com.ibm.commons.swt.data.editors.api
Class AbstractTableEditor

java.lang.Object
  extended by com.ibm.commons.swt.data.editors.api.PropertyEditor
      extended by com.ibm.commons.swt.data.editors.api.AbstractTableEditor
All Implemented Interfaces:
IPropertyEditor

public abstract class AbstractTableEditor
extends PropertyEditor

A table editor used to edit a particular property.

See Also:
ITableEditorValuePopulator

Constructor Summary
AbstractTableEditor(int style, ITableEditorValuePopulator populator)
          Constructs a new instance of the class given the style flags which are used to set the look/behavior of the control, and a populator which is used to determine the contents of the table.
AbstractTableEditor(IValidator validator)
          Constructs a new instance of the class given a particular validator.
 
Method Summary
 org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
          This method is called by the PropertyEditor during initialization.
 void fillTable(org.eclipse.swt.widgets.Table table, java.lang.String value)
          Fills the contents of the table based on the value of the associated property.
 com.ibm.commons.iloader.node.lookups.TableLookup getLookup()
           
 int getStyle()
          Returns the style bits for the control in question.
 void initControlValue(CompositeEditor parent, java.lang.String value)
          Set the given value into the control created for this property editor.
 void setId(java.lang.String id)
          Allows the implementor to associate an ID attribute with this control.
 void setLookup(com.ibm.commons.iloader.node.lookups.TableLookup lookup, org.eclipse.swt.widgets.Table table)
          Sets a lookup for the table.
 void setTableEditorValuePopulator(ITableEditorValuePopulator populator)
          Sets the table populator for the current table.
 boolean stopEdit(CompositeEditor parent)
          Called to tell the current editor to stop editing the associated attribute.
 
Methods inherited from class com.ibm.commons.swt.data.editors.api.PropertyEditor
addPropertyEditorUpdateListener, addValidator, callDialog, getContextAttribute, getContextObject, getDefaultEditor, getDialogButtonAltText, getDialogButtonImage, getDialogButtonText, getEditor, getRenderedValue, getScriptMode, getTextValidator, getValidator, getWorkBenchPart, hasDialogButton, isScriptModeFixed, postModelUpdate, preModelUpdate, removePropertyEditorUpdateListener, setContextAttribute, setContextObject, setScriptMode, setValidator, setWorkBenchPart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTableEditor

public AbstractTableEditor(int style,
                           ITableEditorValuePopulator populator)
Constructs a new instance of the class given the style flags which are used to set the look/behavior of the control, and a populator which is used to determine the contents of the table.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. Style bits are also inherited from superclasses.

Parameters:
style - - the style of control to construct
populator - - the populator to fill the contents of the table
See Also:
ITableEditorValuePopulator

AbstractTableEditor

public AbstractTableEditor(IValidator validator)
Constructs a new instance of the class given a particular validator. Only input matching the input pattern of the validator will be accepted as input for the editor.

Parameters:
validator -
See Also:
IValidator
Method Detail

getStyle

public final int getStyle()
Returns the style bits for the control in question.

Returns:

createControl

public org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
Description copied from class: PropertyEditor
This method is called by the PropertyEditor during initialization. This method creates the control that is used by the PropertyEditor to edit the associated property.

Specified by:
createControl in class PropertyEditor
Parameters:
parent - - The parent of the control
Returns:
Control - The 'control' used to edit this property (control is used liberally here as a composite of controls could be returned).

setId

public void setId(java.lang.String id)
Description copied from class: PropertyEditor
Allows the implementor to associate an ID attribute with this control. This may be of use later when trying to identify the control.

Specified by:
setId in class PropertyEditor

fillTable

public void fillTable(org.eclipse.swt.widgets.Table table,
                      java.lang.String value)
Fills the contents of the table based on the value of the associated property. The value is parsed using the associated populator.

Parameters:
table -
value -
See Also:
ITableEditorValuePopulator

initControlValue

public void initControlValue(CompositeEditor parent,
                             java.lang.String value)
Description copied from class: PropertyEditor
Set the given value into the control created for this property editor.

Specified by:
initControlValue in class PropertyEditor
See Also:
CompositeEditor

stopEdit

public boolean stopEdit(CompositeEditor parent)
Description copied from class: PropertyEditor
Called to tell the current editor to stop editing the associated attribute. Typically this will be called when the current CompositeEditor has lost focus.

Specified by:
stopEdit in class PropertyEditor
Parameters:
parent - - CompositeEditor
Returns:
boolean - returns true if the operation succeeded, otherwise returns false.

setLookup

public void setLookup(com.ibm.commons.iloader.node.lookups.TableLookup lookup,
                      org.eclipse.swt.widgets.Table table)
Sets a lookup for the table.

Parameters:
lookup -
table -
See Also:
TableLookup

getLookup

public com.ibm.commons.iloader.node.lookups.TableLookup getLookup()

setTableEditorValuePopulator

public void setTableEditorValuePopulator(ITableEditorValuePopulator populator)
Sets the table populator for the current table.

Parameters:
populator -
See Also:
ITableEditorValuePopulator