IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.ui
Class AbstractTransformGUI

java.lang.Object
  extended bycom.ibm.xtools.transform.ui.AbstractTransformGUI

public class AbstractTransformGUI
extends Object

The Abstract Transform GUI class is the base class for transformation authors to supply custom GUI that is integrated into the Transformation Configuration Manager.

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.


Constructor Summary
AbstractTransformGUI()
          Default Constructor
 
Method Summary
 boolean canCreateTargetContainer(Object suggestedParent)
          Indicate whether or not a transform can create a target container.
static AbstractTransformConfigTab createDefaultPropertyTab(ITransformationDescriptor descriptor)
          Create the default property tab for the transformation configuration.
 Object createTargetContainer(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.
 AbstractTransformConfigTab[] getConfigurationTabs(ITransformationDescriptor descriptor)
          Return the custom list of tabs to be displayed for the given transformation's configurations.
 boolean showInTargetContainerTree(ITransformationDescriptor transformationDescriptor, Object suggestedTargetContainer)
          Determine if the suggested object should be shown in the 'Target' tab's tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTransformGUI

public AbstractTransformGUI()
Default Constructor

Method Detail

createDefaultPropertyTab

public static final AbstractTransformConfigTab createDefaultPropertyTab(ITransformationDescriptor descriptor)
Create the default property tab for the transformation configuration.

Parameters:
descriptor - the corresponding transformation descriptor
Returns:
AbstractTransformConfigTab - the default property tab instance

createUML2TargetContainerTab

public static final AbstractTransformConfigTab createUML2TargetContainerTab(ITransformationDescriptor descriptor)
Create the default UML2 target container tab for the transformation configuration.

Parameters:
descriptor - the corresponding transformation descriptor
Returns:
AbstractTransformConfigTab - the default target tab instance

createTransformCommonTab

public static final AbstractTransformConfigTab createTransformCommonTab(ITransformationDescriptor descriptor)
Create the default transformation common tab for the transformation configuration.

Parameters:
descriptor - the corresponding transformation descriptor
Returns:
AbstractTransformConfigTab - the default common tab instance

getConfigurationTabs

public AbstractTransformConfigTab[] getConfigurationTabs(ITransformationDescriptor descriptor)
Return the custom list of tabs to be displayed for the given transformation's configurations.

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.

Parameters:
descriptor - the corresponding transformation descriptor
Returns:
AbstractTransformConfigTab[] - the ordered list of GUI tabs

canCreateTargetContainer

public boolean canCreateTargetContainer(Object suggestedParent)
Indicate whether or not a transform can create a target container.

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.

Parameters:
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.
Returns:
'true' if the transform supports target container creation, 'false' otherwise.

createTargetContainer

public Object createTargetContainer(Object suggestedParent)
Create and return a new target container.

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.

Parameters:
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.
Returns:
The newly created target if there is one or 'null' if the User cancels the creation.

showInTargetContainerTree

public boolean showInTargetContainerTree(ITransformationDescriptor transformationDescriptor,
                                         Object suggestedTargetContainer)
Determine if the suggested object should be shown in the 'Target' tab's tree.

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'.

Parameters:
transformationDescriptor - The ITransformationDescriptor identifying the transformation that is being queried.
suggestedTargetContainer - The current 'suggestion' as to what the target container is.
Returns:
'true' if the suggested container is valid or might contain a valid target container, otherwise return 'false'.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.