Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.preferences
Class SystemStringFieldEditor

java.lang.Object
  extended by FieldEditor
      extended by com.ibm.etools.iseries.rse.ui.preferences.SystemStringFieldEditor

public class SystemStringFieldEditor
extends FieldEditor

A preference page field editor that prompts for a string. Unlike the eclipse-supplied StringFieldEditor, this one allows use of RSE validators and massagers for error checking and massaging of the user-entered input prior to persisting.


Constructor Summary
SystemStringFieldEditor(String name, String labelText, String tooltipText, Composite parent)
          Constructor for SystemStringFieldEditor
 
Method Summary
protected  void adjustForNumColumns(int numColumns)
          Adjust grid data to support the number of columns, after all field editors have been added to the page.
protected  void createModifyListener()
          Creates a modify text listener used in per-keystroke validation
protected  void doFillIntoGrid(Composite parent, int numColumns)
          This is called by our parent's constructor, which is too soon for us! So, we do nothing here and then call doOurFillIntoGrid later within our own constructor.
protected  void doLoad()
          Load the entry field contents from the preference store current value
protected  void doLoadDefault()
          Load the entry field contents from the preference store default value
protected  void doOurFillIntoGrid()
          Create controls
protected  void doStore()
          Save the user-entered value to the preference store.
 int getNumberOfControls()
          Return number of columns we need.
protected  Text getTextControl()
          Returns this field editor's Text control.
 Text getTextControl(Composite parent)
          Returns this field editor's text control.
 boolean isValid()
          Override of parent to return validity state.
protected  void refreshValidState()
          Override of parent to refresh validity state by checking if the input is valid.
 void setFocus()
          Set focus
 void setMassager(ISystemMassager massager)
          Set the massager that is used to affect the user-entered text before saving it to the preference store.
 void setToolTipText(String tip)
          Allows setting of tooltip text
 void setValidator(ISystemValidator validator)
          Set the validator to use per keystroke.
protected  void validate()
          Validate contents of text field
protected  void valueChanged()
          Informs this field editor's listener, if it has one, about a change to the value (VALUE property) provided that the old and new values are different.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemStringFieldEditor

public SystemStringFieldEditor(String name,
                               String labelText,
                               String tooltipText,
                               Composite parent)
Constructor for SystemStringFieldEditor

Parameters:
name - - the unique ID for this editor. Used as index in preference store
labelText - - the text of the LABEL
tooltipText - - the text of TOOLTIP
parent - - the parent composite to host this editor
Method Detail

setValidator

public void setValidator(ISystemValidator validator)
Set the validator to use per keystroke. If not set, no validation is done


setMassager

public void setMassager(ISystemMassager massager)
Set the massager that is used to affect the user-entered text before saving it to the preference store.


getNumberOfControls

public int getNumberOfControls()
Return number of columns we need. We return 2.

See Also:
FieldEditor

doStore

protected void doStore()
Save the user-entered value to the preference store.

See Also:
FieldEditor

doLoadDefault

protected void doLoadDefault()
Load the entry field contents from the preference store default value

See Also:
FieldEditor

doLoad

protected void doLoad()
Load the entry field contents from the preference store current value

See Also:
FieldEditor

doFillIntoGrid

protected void doFillIntoGrid(Composite parent,
                              int numColumns)
This is called by our parent's constructor, which is too soon for us! So, we do nothing here and then call doOurFillIntoGrid later within our own constructor.

See Also:
FieldEditor

doOurFillIntoGrid

protected void doOurFillIntoGrid()
Create controls


adjustForNumColumns

protected void adjustForNumColumns(int numColumns)
Adjust grid data to support the number of columns, after all field editors have been added to the page.

See Also:
FieldEditor

getTextControl

protected Text getTextControl()
Returns this field editor's Text control.


getTextControl

public Text getTextControl(Composite parent)
Returns this field editor's text control.

The control is created if it does not yet exist

Parameters:
parent - the parent
Returns:
the text control

setToolTipText

public void setToolTipText(String tip)
Allows setting of tooltip text


createModifyListener

protected void createModifyListener()
Creates a modify text listener used in per-keystroke validation


validate

protected void validate()
Validate contents of text field


valueChanged

protected void valueChanged()
Informs this field editor's listener, if it has one, about a change to the value (VALUE property) provided that the old and new values are different.

This hook is not called when the text is initialized (or reset to the default value) from the preference store.


isValid

public boolean isValid()
Override of parent to return validity state. If this readonly, we always return true, else we return result of last validation


refreshValidState

protected void refreshValidState()
Override of parent to refresh validity state by checking if the input is valid. Does nothing unless this is not a readonly combo.


setFocus

public void setFocus()
Set focus


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.