public class AbstractTransformGUI
extends java.lang.Object
The derived GUI class for a transformation must be identified in the transformation descriptor in the XML file using the "transformGUI" attribute. When a configuration for that transformation is created, this GUI class will be loaded and the transformation author can supply his own tabs that allow the user to configure his transformation. The author can also control what items are displayed in the default tab for selecting the target container.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAIN_TAB_ID
The id of the Main tab in the transformation configuration editor.
|
Constructor and Description |
---|
AbstractTransformGUI()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateTargetContainer(java.lang.Object suggestedParent)
Indicate whether or not a transform can create a target container.
|
boolean |
canUseWorkspaceAsSource()
Determines if the workspace can be used as the source for the
transformation.
|
boolean |
canUseWorkspaceAsTarget()
Determines if the workspace can be used as the target for the
transformation.
|
static AbstractTransformConfigTab |
createDefaultPropertyTab(ITransformationDescriptor descriptor)
Create the default property tab for the transformation configuration.
|
static AbstractTransformConfigTab |
createExtensionsTab(ITransformationDescriptor descriptor)
Create the extensions tab for the transformation configuration.
|
java.lang.Object |
createTargetContainer(java.lang.Object suggestedParent)
Create and return a new target container.
|
static AbstractTransformConfigTab |
createTransformCommonTab(ITransformationDescriptor descriptor)
Create the default transformation common tab for the transformation configuration.
|
static AbstractTransformConfigTab |
createUML2TargetContainerTab(ITransformationDescriptor descriptor)
Create the default UML2 target container tab for the transformation configuration.
|
static AbstractTransformConfigTab |
createUML2TargetContainerTab(ITransformationDescriptor descriptor,
boolean canUseWorkspaceAsSource,
boolean canUseWorkspaceAsTarget)
Create the default UML2 target container tab for the transformation configuration.
|
AbstractTransformConfigTab[] |
getConfigurationTabs(ITransformationDescriptor descriptor)
Return the custom list of tabs to be displayed for the given
transformation's configurations.
|
AbstractTransformConfigTab[] |
getNewTransformationConfigurationWizardPages(ITransformationDescriptor descriptor)
Returns the pages that will appear in the new transformation
configuration wizard.
|
void |
handleEditorSave(ITransformConfig config)
This method is called after a transformation configuration has been saved
using the transformation configuration editor.
|
boolean |
showInSourceTree(ITransformationDescriptor transformationDescriptor,
java.lang.Object suggestedSource)
Determine if the suggested object should be shown in the 'Select Source' dialog's tree.
|
boolean |
showInTargetContainerTree(ITransformationDescriptor transformationDescriptor,
java.lang.Object suggestedTargetContainer)
Determine if the suggested object should be shown in the 'Target' tab's tree.
|
public static final java.lang.String MAIN_TAB_ID
public static final AbstractTransformConfigTab createDefaultPropertyTab(ITransformationDescriptor descriptor)
descriptor
- the corresponding transformation descriptorpublic static final AbstractTransformConfigTab createUML2TargetContainerTab(ITransformationDescriptor descriptor)
descriptor
- The corresponding transformation descriptor.public static final AbstractTransformConfigTab createUML2TargetContainerTab(ITransformationDescriptor descriptor, boolean canUseWorkspaceAsSource, boolean canUseWorkspaceAsTarget)
descriptor
- The corresponding transformation descriptor.canUseWorkspaceAsSource
- True if the transformation can use the
workspace as the source. False otherwise.canUseWorkspaceAsTarget
- True if the transformation can use the
workspace as the target. False otherwise.public static final AbstractTransformConfigTab createTransformCommonTab(ITransformationDescriptor descriptor)
descriptor
- the corresponding transformation descriptorpublic static final AbstractTransformConfigTab createExtensionsTab(ITransformationDescriptor descriptor)
descriptor
- the corresponding transformation descriptorpublic AbstractTransformConfigTab[] getConfigurationTabs(ITransformationDescriptor descriptor)
The default implementation adds a set of tabs that allow the user to change properties, define a target container and do some 'common' operations such as enabling the logging of the transform execution.
If a transformation author overrides this method, the defaults tabs can still be created using the appropriate createXxxTab() method. This allows the author to selectively override or exclude the default tabs if they are not applicable to the transformation.
descriptor
- the corresponding transformation descriptorpublic boolean canCreateTargetContainer(java.lang.Object suggestedParent)
The transformation author would override this method if he wants to enable the "Create new target" button on the target container tab. If this method returns true, the method createTargetContainer() must be implemented too.
suggestedParent
- - the current selection in the 'target container' tree.
This might be used as the parent of the new target container if, for example,
you were creating a new 'folder' within a particular project.public java.lang.Object createTargetContainer(java.lang.Object suggestedParent)
This method is called to create a new entry in the target container tree when the default target container tab is used. The author should create the target container using an appropriate wizard. The UI will automatically detect a new entry being added and will update the target container tree. The new target container should also be selected.
suggestedParent
- - the current selection in the 'target container' tree.
This might be used as the parent of the new target container if, for example,
you were creating a new 'folder' within a particular project.public boolean showInTargetContainerTree(ITransformationDescriptor transformationDescriptor, java.lang.Object suggestedTargetContainer)
This method should return 'true' if the suggested target container is valid for the corresponding transformation or could contain one, otherwise return 'false'. The result is used to 'prune' the tree of possible target container candidates from the default target tab's tree.
The default implementation simply returns 'true'.
transformationDescriptor
- The ITransformationDescriptor identifying the transformation
that is being queried.suggestedTargetContainer
- The current 'suggestion' as to what the target
container is.public boolean showInSourceTree(ITransformationDescriptor transformationDescriptor, java.lang.Object suggestedSource)
This method should return 'true' if the suggested element is valid as a source for the corresponding transformation or could contain one, otherwise return 'false'. The result is used to 'prune' the tree of invalid source candidates from the select source dialog's tree.
The default implementation simply returns 'true'.
transformationDescriptor
- The ITransformationDescriptor identifying the transformation
that is being queried.suggestedSource
- The current 'suggestion' as to the element to show.public void handleEditorSave(ITransformConfig config)
config
- The configuration that was saved.public AbstractTransformConfigTab[] getNewTransformationConfigurationWizardPages(ITransformationDescriptor descriptor)
The default implementation returns null which means the transformation wants to use the same tabs for both the wizard and editor.
descriptor
- The corresponding transformation descriptor.public boolean canUseWorkspaceAsSource()
public boolean canUseWorkspaceAsTarget()