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

java.lang.Object
  extended by com.ibm.commons.swt.data.editors.api.PropertyEditor
      extended by com.ibm.commons.swt.data.editors.api.AbstractTextEditor
All Implemented Interfaces:
IPropertyEditor
Direct Known Subclasses:
DoubleEditor, IntegerEditor, MultilineTextEditor, PasswordEditor, StringEditor

public abstract class AbstractTextEditor
extends PropertyEditor

An editor that uses a text control.


Constructor Summary
AbstractTextEditor()
          Constructs a new instance of this class.
AbstractTextEditor(IValidator validator)
          Constructs a new instance of this class with the given validator.
 
Method Summary
 org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
          This method is called by the PropertyEditor during initialization.
 int getCols()
          Return the number of columns this text should span.
 int getRows()
          Return the number of rows this text should span.
protected  int getTextStyle()
           
 void initControlValue(CompositeEditor parent, java.lang.String value)
          Set the given value into the control created for this property editor.
 boolean isImmediateUpdate()
           
 void setCols(int cols)
          Sets the number of columns this text should span.
 void setId(java.lang.String id)
          Allows the implementor to associate an ID attribute with this control.
 void setRows(int rows)
          Sets the number of rows this text should span.
 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

AbstractTextEditor

public AbstractTextEditor()
Constructs a new instance of this class.


AbstractTextEditor

public AbstractTextEditor(IValidator validator)
Constructs a new instance of this class with the given validator.

See Also:
IValidator
Method Detail

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

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.

isImmediateUpdate

public boolean isImmediateUpdate()

getTextStyle

protected int getTextStyle()

getCols

public int getCols()
Return the number of columns this text should span. A column is the average width of a character.

Returns:
int

getRows

public int getRows()
Return the number of rows this text should span. A row is the average height of a character.

Returns:
int

setCols

public void setCols(int cols)
Sets the number of columns this text should span. A column is the average width of a character.


setRows

public void setRows(int rows)
Sets the number of rows this text should span. A row is the average height of a character.