|
|
|
|
org.eclipse.rse.ui.propertypages
Class SystemStringFieldEditor
java.lang.Object
org.eclipse.jface.preference.FieldEditor
org.eclipse.rse.ui.propertypages.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.
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! |
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 org.eclipse.jface.preference.
FieldEditor
|
applyFont,
checkParent,
clearErrorMessage,
clearMessage,
convertHorizontalDLUsToPixels,
convertVerticalDLUsToPixels,
createControl,
dispose,
fillIntoGrid,
fireStateChanged,
fireValueChanged,
getFieldEditorFontName,
getLabelControl,
getLabelControl,
getLabelText,
getPage,
getPreferenceName,
getPreferencePage,
getPreferenceStore,
init,
load,
loadDefault,
presentsDefaultValue,
setButtonLayoutData,
setEnabled,
setLabelText,
setPage,
setPreferenceName,
setPreferencePage,
setPreferenceStore,
setPresentsDefaultValue,
setPropertyChangeListener,
showErrorMessage,
showMessage,
store
|
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
SystemStringFieldEditor
public SystemStringFieldEditor(
String name,
ResourceBundle rb,
String rbKey,
Composite parent)
- Constructor for SystemStringFieldEditor
-
Parameters:
-
name - - the unique ID for this editor. Used as index in preference store -
rb - - the resource bundle from which to retrieve the mri -
rbKey - - the key into the resource bundle, to get the label (_LABEL and tooltip text (_TOOLTIP -
parent - - the parent composite to host this editor
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.
-
-
Specified by:
-
getNumberOfControls
in class
FieldEditor
-
-
See Also:
-
FieldEditor.getNumberOfControls()
doStore
protected void doStore()
- Save the user-entered value to the preference store.
-
-
Specified by:
-
doStore
in class
FieldEditor
-
-
See Also:
-
FieldEditor.doStore()
doLoadDefault
protected void doLoadDefault()
- Load the entry field contents from the preference store default value
-
-
Specified by:
-
doLoadDefault
in class
FieldEditor
-
-
See Also:
-
FieldEditor.doLoadDefault()
doLoad
protected void doLoad()
- Load the entry field contents from the preference store current value
-
-
Specified by:
-
doLoad
in class
FieldEditor
-
-
See Also:
-
FieldEditor.doLoad()
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.
-
-
Specified by:
-
doFillIntoGrid
in class
FieldEditor
-
-
See Also:
-
FieldEditor.doFillIntoGrid(Composite, int)
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.
-
-
Specified by:
-
adjustForNumColumns
in class
FieldEditor
-
-
See Also:
-
FieldEditor.adjustForNumColumns(int)
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
-
-
Overrides:
-
isValid
in class
FieldEditor
-
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.
-
-
Overrides:
-
refreshValidState
in class
FieldEditor
-
setFocus
public void setFocus()
- Set focus
-
-
Overrides:
-
setFocus
in class
FieldEditor
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|