java.lang.Object java.util.Observable com.ibm.etools.mft.api.AbstractPropertyEditor
public abstract class AbstractPropertyEditor
implements IPropertyEditor
extends Observable
Provides basic support to write a custom Property Editor.
It implements the IPropertyEditor interface.
Inherits from Observable so that it can notify the Property Editor Framework when the contents of the Property Editor have changed (for validation purposes).
Subclass must provide a public constructor with no arguments.
Field | Description |
---|---|
copyright | |
EMPTY_STRING |
Constructor | Description |
---|---|
AbstractPropertyEditor() | An instance of this class is created using the public constructor with no arguments. |
Method | Description |
---|---|
String getDisplayName() | Returns the display name of the property as it was set by the setDisplayName method. |
IEditorInput getEditorInput() | Returns the editor input which contains the flow to which the property that this editor is matched with belongs. |
String getGroup() | Returns the name of the group to which this property belongs. |
Object getProperty() | Returns the property associated with this Editor. |
ResourceBundle getResourceBundle() | Returns the resource bundle associated with this Editor. |
void notifyChanged(IPropertyEditor) | Is called by the framework to alert the property editors it is managing that another editor has changed; indicates which one. |
void setDefaultValue(Object) | Sets the Property Editor default value for the property. |
void setDisplayName(String) | Sets the property display name. |
void setEditorInput(IEditorInput) | Sets the editor input which contains the flow to which the property that this editor is matched with belongs. |
void setEnabled(boolean) | Sets whether the Property Editor is enabled or disabled. |
void setEnumChoices(String[]) | Sets the Property Editor user choices for the property. |
void setGroup(String) | Sets the group name of this property. |
void setProperty(Object) | Associates the Property to the Editor. |
void setReadOnly(boolean) | Sets the readOnly state for the Property Editor |
void setRequired(boolean) | Sets the "required" state for the Property Editor |
void setResourceBundle(ResourceBundle) | Sets the resource bundle for the Property Editor |
public static final java.lang.String copyright
public static final java.lang.String EMPTY_STRING
public AbstractPropertyEditor()An instance of this class is created using the public constructor with no arguments.
public String getDisplayName()Returns the display name of the property as it was set by the setDisplayName method.
The default implementation returns the display name stored by the setDisplayName method *
- Returns
- java.lang.String
public IEditorInput getEditorInput()Returns the editor input which contains the flow to which the property that this editor is matched with belongs.
The default implementation returns the IEditorInput stored by the setEditorInput method
- Returns
- The editor input
public String getGroup()Returns the name of the group to which this property belongs.
This method is called by the Property Editor Framework when ordering the properties.
The default implementation returns the group name stored by the setGroupName method
- Returns
- The group name
public Object getProperty()Returns the property associated with this Editor.
This method is called by the Property Editor Framework when it needs to locate the property matching this editor.
The default implementation returns the property stored by the setProperty method.
- Returns
- the property being edited.
public ResourceBundle getResourceBundle()Returns the resource bundle associated with this Editor.
This method is called by the Property Editor Framework when it needs to locate the resource bundle matching this editor.
The default implementation returns the resource bundle stored by the setResourceBundle method.
- Returns
- the resource bundle for this property's node
public void notifyChanged(IPropertyEditor otherEditor)Is called by the framework to alert the property editors it is managing that another editor has changed; indicates which one.
This provides one Property Editor with the ability to respond to a change that is made in another Property Editor.
In addition to being called every time a Property Editor is changed, this method is also called on each editor once for every other editor being managed by the framework after the framework has finished creating editors. This initialization round of calls performed before an editor's controls are created is performed so that editors whose display depends on some aspect of another editor can be initialized correctly.
Note: This method will always be called just prior to the
isValid
method. It is conceivable that a change made in another editor could invalidate the contents of the current one.Default implementation does nothing. Should be overridden by subclasses that wish to be notified when other editors change.
- Parameters
- otherEditor - the
IPropertyEditor
that has changed.
public void setDefaultValue(Object value)Sets the Property Editor default value for the property.
This method is called by the Property Editor Framework when the editor is created (before controls are created) The subclass may use this value to restore defaults.
The concrete parameter class passed in will be either a String or a java.lang class that wraps a primitive type such a Boolean or Integer.
The valueOf method should be used to convert the wrapper class value to a string for display.This method is not called is the property has no default value.
The default implementation stores the value of the parameter in a field
- Parameters
- value - the default property value
public void setDisplayName(String name)Sets the property display name.
This method is called by the Property Editor Framework when the editor is created (before controls are created)
The subclass may used this property name but should not change it.
The default implementation stores the value of the parameter in a field
- Parameters
- name - the property name
public void setEditorInput(IEditorInput input)Sets the editor input which contains the flow to which the property that this editor is matched with belongs.
This method is called by the Property Editor Framework when the editor is created (before controls are created)
The subclass may used this property but should not change it.
The default implementation stores the value of the parameter in a field
- Parameters
- The - editor input
public void setEnabled(boolean enabled)Sets whether the Property Editor is enabled or disabled.
This method is called by the Property Editor Framework when the subject property has enabled/disabled status. This method is called before the controls are created
The editor may chose to ignore this information if it is known that it will never happen. Otherwise the editor may disable the control to prevent user from changing the value.
- Parameters
- enabled - true if the property is enabled
public void setEnumChoices(String[] choices)Sets the Property Editor user choices for the property.
This method is called by the Property Editor Framework when the editor is created (before controls are created) The subclass should display user choices in the UI
The concrete parameter class passed in will be either a String or a java.lang class that wraps a primitive type such a Boolean or Integer.
The valueOf method should be used to convert the wrapper class value to a string for display.
The default implementation does nothing. The subclass should store the user choices in a field if the property is an enumerated type.
- Parameters
- choices - the user choices for the UI
public void setGroup(String name)Sets the group name of this property.
This method is called by the Property Editor Framework when the editor is created (before controls are created)
When properties are grouped by category, this name indicates to which category this property belongs. Categories are used to display properties on different pages. The categories are set by the Node author at design time.
The default implementation stores the value of the parameter in a field
- Parameters
- name - the property name
public void setProperty(Object property)Associates the Property to the Editor.
This method is called by the Property Editor Framework when the editor is created (before controls are created) The subclass must provide a field to store it.
The concrete parameter class passed in is of a type that is not accessible to the Editor. The Editor Framework provides the function of changing the value of the property.
The default implementation stores the value of the parameter in a field
- Parameters
- property - the property being edited
public void setReadOnly(boolean readOnly)Sets the readOnly state for the Property Editor
This method is called by the Property Editor Framework when the subject property has readOnly status. This method is called before the controls are created
The editor may chose to ignore this information if it is known that it will never happen. Otherwise the editor may disable the control to prevent user from changing the value.
The default implementation stores the value of the parameter in a field
- Parameters
- readOnly - true if the property is read only
public void setRequired(boolean required)Sets the "required" state for the Property Editor
This method is called by the Property Editor Framework when the subject property must have a value set. This method is called before the controls are created
The editor may chose to ignore this information if it is known that it will never happen. Otherwise the editor may change some aspect of the UI to indicate to the user that a value is required.
The Framework will disable the OK button until all required properties are set.
The default implementation stores the value of the parameter in a field
- Parameters
- required - true if a property value is required
public void setResourceBundle(ResourceBundle nodeBundle)Sets the resource bundle for the Property Editor
This method is called by the Property Editor Framework when the editor is created (before controls are created) The subclass must provide a field to store it.
The concrete parameter class passed in is of a type that is not accessible to the Editor. The Editor Framework provides the function of changing the value of the property.
The default implementation stores the value of the parameter in a field
- Parameters
- nodeBundle -