Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As a part of the Jira LegacyINSPECTIT-625INSPECTIT-625serverJIRA - NovaTec GmbH ticket, this This page will provide the solution to properly refactor the InputDefinition class and all involved components.

...

  1. Remove the additional options map. The additional properties needed for some sub-views will be tackled by sub-classing the InputDefinition.
  2. Leave the IdDefinition as it is.
  3. Following part of the input definition that is related to the Editor look should be in separated class (for example EditorPropertiesDefinition):
Code Block

/**
 * The name of the view part.
 */
private String partName;

/**
 * The tooltip is shown when hovering over the view part tab.
 */
private String partTooltip;

/**
 * The imageDescriptor descriptor of the view.
 */
private ImageDescriptor imageDescriptor;

/**
 * String used by the {@link Form} currently to display the text on it.
 */
private String headerText;

/**
 * String used by the {@link Form} currently to display the message on it.
 */
private String headerDescription;

...

The place where we would get a lot of from generics would be the InputControllers. The method:

Code Block

setInputDefinition(InputDefinition)

...

This means that the complete model is changed. And plus somewhere we need to "cheat" the generics, because the AbstractRootEditor is using IEditorInput eclipse class to get the input, and the sub-view factory to get the sub views. Thus, two places:

Code Block

(1)
	/**
	 * Returns the input definition for this view.
	 *
	 * @return The input definition.
	 */
	public E getInputDefinition() {
		E inputDefinition = (E) getEditorInput().getAdapter(InputDefinition.class);
		Assert.isNotNull(inputDefinition);
		return inputDefinition;
	}
...
(2)	
	SubView<E> subView;

	this.subView = SubViewFactory.createSubView(getInputDefinition().getId());

...