public abstract class StringButtonFieldEditor extends StringFieldEditor
changePressed()
gets called
to compute a new string.oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE
HORIZONTAL_GAP, IS_VALID, VALUE
Modifier | Constructor and Description |
---|---|
protected |
StringButtonFieldEditor()
Creates a new string button field editor
|
protected |
StringButtonFieldEditor(String name,
String labelText,
Composite parent)
Creates a string button field editor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
adjustForNumColumns(int numColumns)
Adjusts the horizontal span of this field editor's basic controls.
|
protected abstract String |
changePressed()
Notifies that this field editor's change button has been pressed.
|
protected void |
doFillIntoGrid(Composite parent,
int numColumns)
Fills this field editor's basic controls into the given parent.
|
protected Button |
getChangeControl(Composite parent)
Get the change control.
|
int |
getNumberOfControls()
Returns the number of basic controls this field editor consists of.
|
protected Shell |
getShell()
Returns this field editor's shell.
|
void |
setChangeButtonText(String text)
Sets the text of the change button.
|
void |
setEnabled(boolean enabled,
Composite parent)
Set whether or not the controls in the field editor
are enabled.
|
checkState, doCheckState, doLoad, doLoadDefault, doStore, getErrorMessage, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChanged
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, load, loadDefault, presentsDefaultValue, setButtonLayoutData, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
protected StringButtonFieldEditor()
protected StringButtonFieldEditor(String name, String labelText, Composite parent)
name
- the name of the preference this field editor works onlabelText
- the label text of the field editorparent
- the parent of the field editor's controlprotected void adjustForNumColumns(int numColumns)
FieldEditor
Subclasses must implement this method to adjust the horizontal span of controls so they appear correct in the given number of columns.
The number of columns will always be equal to or greater than the
value returned by this editor's getNumberOfControls
method.
adjustForNumColumns
in class StringFieldEditor
numColumns
- the number of columnsprotected abstract String changePressed()
Subclasses must implement this method to provide a corresponding
new string for the text field. If the returned value is null
,
the currently displayed value remains.
null
to leave the
old string showingprotected void doFillIntoGrid(Composite parent, int numColumns)
StringFieldEditor
The string field implementation of this FieldEditor
framework method contributes the text field. Subclasses may override
but must call super.doFillIntoGrid
.
doFillIntoGrid
in class StringFieldEditor
parent
- the composite used as a parent for the basic controls;
the parent's layout must be a GridLayout
numColumns
- the number of columnsprotected Button getChangeControl(Composite parent)
parent
- public int getNumberOfControls()
FieldEditor
getNumberOfControls
in class StringFieldEditor
protected Shell getShell()
public void setChangeButtonText(String text)
text
- the new textpublic void setEnabled(boolean enabled, Composite parent)
FieldEditor
setEnabled
in class StringFieldEditor
enabled
- The enabled state.parent
- The parent of the controls in the group.
Used to create the controls if required.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.