public abstract class AbstractTransformConfigTab
extends com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
The transformation UI also requires the tab's data to be persisted and the save/restore mechanism uses a string to save the data. The format of that persisted data string is up to the tab itself but is usually a list of name/value pairs.
Constructor and Description |
---|
AbstractTransformConfigTab(ITransformationDescriptor transDesc,
java.lang.String tabId,
java.lang.String label)
Constructor for a transform configuration tab
|
Modifier and Type | Method and Description |
---|---|
abstract org.eclipse.swt.widgets.Control |
createContents(org.eclipse.swt.widgets.Composite parent)
Create the contents (controls) for the tab.
|
AbstractTransformConfigFormPage |
createFormPage()
Creates and returns the form page to use in the transformation
configuration editor.
|
void |
dispose()
This method is called when the tab is being displosed.
|
static java.lang.String |
getChangedPropertyId(ITransformContext context)
This method should be called in the populateContext method.
|
ITransformContext |
getCurrentTransformContext()
Construct a transform context from the information currently displayed
in the GUI.
|
java.lang.String |
getHostTabId()
Transformation authors may want the contents of a tab to appear in the
first page of the transformation configuration editor instead of a
separate editor page.
|
java.lang.String |
getTabData()
Deprecated.
|
java.lang.String |
getTabId()
Returns the id of this tab.
|
protected org.eclipse.jface.viewers.IStructuredSelection |
getWorkbenchSelection()
This is intended to be used when the tab is displayed in the new
transformation configuration wizard.
|
void |
populateContext(ITransformContext context)
Populate the transformation context based on the current state of the
tab's controls.
|
void |
populateContext(ITransformContext context,
java.lang.String info)
Deprecated.
Use
populateContext(ITransformContext) instead. |
void |
populateTab(ITransformContext context)
Populate the controls on the tab based on the given transformation
context.
|
protected void |
setDirty()
Indicate that the contents of the tab is dirty and requires an apply.
|
protected void |
setDirty(java.lang.String propId)
Indicates that the value for the property with the specified id has
changed.
|
protected void |
setErrorMessage(java.lang.String message)
Set an error message in the dialog's UI.
|
protected void |
setMessage(java.lang.String message)
Set a message (the title) in the dialog's UI.
|
void |
setTabData(java.lang.String newInfo)
Deprecated.
Use
populateTab(ITransformContext) instead. |
boolean |
showTab(ITransformContext context)
Determines if this tab should be visible in the user interface.
|
public AbstractTransformConfigTab(ITransformationDescriptor transDesc, java.lang.String tabId, java.lang.String label)
transDesc
- the ITransformationDescriptor the tab is fortabId
- a unique identifier for this tablabel
- the localized label to be displayed on the tabpublic abstract org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
This UI will be seen in the new transformation configuration wizard. It will also been seen in the transformation configuration editor if the createFormPage method is not overridden.
parent
- The Composite into which to create the tab's controlspublic void setTabData(java.lang.String newInfo)
populateTab(ITransformContext)
instead.newInfo
- The string containing the new information to displaypublic java.lang.String getTabData()
public void populateContext(ITransformContext context, java.lang.String info)
populateContext(ITransformContext)
instead.context
- The transformation execute context to populateinfo
- The string containing the formatted data for the tabpublic void dispose()
protected final void setDirty()
setDirty
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
protected final void setDirty(java.lang.String propId)
setDirty
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
propId
- The id of the property that has changed.protected final void setMessage(java.lang.String message)
setMessage
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
message
- - the message that describes the tab's purposeprotected final void setErrorMessage(java.lang.String message)
setErrorMessage
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
message
- - the message that describes the errorpublic final ITransformContext getCurrentTransformContext()
This method is meant to be used ONLY when the new transformation configuration wizard or transformation configuration editor is displayed and must not be called inside the 'populateContext' method (which will cause a recursion).
public void populateContext(ITransformContext context)
The default implementation of this method delegates to the deprecated API to maintain backwards compatibility. It should always be overridden to not refer to the deprecated API.
For backwards compatibility, this method should first check for a property in the context that has an id equal to the id of this tab. If the property exists, the value is tab data from the deprecated tab API. This method should populate the context in the old manner using the tab data string instead of using the information from the user interface. Also, once the context has been populated, the tab data property should be removed.
context
- The transformation context to populate.public void populateTab(ITransformContext context)
The default implementation of this method delegates to the deprecated API to maintain backwards compatibility. It should always be overridden to not refer to the deprecated API.
This method has no responsibilities associated with maintaining
backwards compatiblity with the deprecated tab API. Only the
populateContext
method is impacted.
context
- The transformation context to retrieve information from.public final java.lang.String getTabId()
getTabId
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
protected org.eclipse.jface.viewers.IStructuredSelection getWorkbenchSelection()
getWorkbenchSelection
in class com.ibm.xtools.transform.ui.internal.dialogs.BaseTransformConfigTab
public boolean showTab(ITransformContext context)
This method does not have the final say. The default conditions enforced by the transform UI still apply. If the tab is associated with the reverse transformation, the reverse transformation must be enabled. If the tab is associated with a transformation extension, the extension must be enabled in the associated transformation configuration. If and only if these conditions are met will this method's result be considered.
context
- The transformation context that contains the properties
used to determine if the tab should be visible.public static final java.lang.String getChangedPropertyId(ITransformContext context)
context
- The transformation context that contains all the property
values.public AbstractTransformConfigFormPage createFormPage()
This method by default simply returns null to indicate form specific content is not needed.
public java.lang.String getHostTabId()
To do this, subclasses should override this method to return the id of
the Main tab of the editor, which is defined in
AbstractTransformGUI.MAIN_TAB_ID
. In that scenario, the UI
for this tab will appear in either the forward or reverse transformation
section on the Main tab, depending on which transformation the tab is
associated with
This method returns a tab id instead of a boolean because even though the Main tab is currently the only tab that can host another tab's UI, eventually it would be nice to expand this to any tab. Having this method return the id of the host tab will make that easier to do in a future release.
If this method is overridden, the createContents method should be implemented and the createFormPage method should not be implemented.