Package org.eclipse.jface.preference
Class StringButtonFieldEditor
java.lang.Object
org.eclipse.jface.preference.FieldEditor
org.eclipse.jface.preference.StringFieldEditor
org.eclipse.jface.preference.StringButtonFieldEditor
- Direct Known Subclasses:
- DirectoryFieldEditor,- FileFieldEditor
An abstract field editor for a string type preference that presents
 a string input field with a change button to its right to edit the
 input field's content. When the user presses the change button, the
 abstract framework method 
changePressed() gets called
 to compute a new string.- 
Field SummaryFields inherited from class org.eclipse.jface.preference.StringFieldEditoroldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKEFields inherited from class org.eclipse.jface.preference.FieldEditorHORIZONTAL_GAP, IS_VALID, VALUE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a new string button field editorprotectedStringButtonFieldEditor(String name, String labelText, Composite parent) Creates a string button field editor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidadjustForNumColumns(int numColumns) Adjusts the horizontal span of this field editor's basic controls.protected abstract StringNotifies that this field editor's change button has been pressed.protected voiddoFillIntoGrid(Composite parent, int numColumns) Fills this field editor's basic controls into the given parent.protected ButtongetChangeControl(Composite parent) Get the change control.intReturns the number of basic controls this field editor consists of.protected ShellgetShell()Returns this field editor's shell.voidsetChangeButtonText(String text) Sets the text of the change button.voidsetEnabled(boolean enabled, Composite parent) Set whether or not the controls in the field editor are enabled.Methods inherited from class org.eclipse.jface.preference.StringFieldEditorcheckState, createTextWidget, doCheckState, doLoad, doLoadDefault, doStore, getErrorMessage, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChangedMethods inherited from class org.eclipse.jface.preference.FieldEditorapplyFont, 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
- 
Constructor Details- 
StringButtonFieldEditorprotected StringButtonFieldEditor()Creates a new string button field editor
- 
StringButtonFieldEditorCreates a string button field editor.- Parameters:
- name- the name of the preference this field editor works on
- labelText- the label text of the field editor
- parent- the parent of the field editor's control
 
 
- 
- 
Method Details- 
adjustForNumColumnsprotected void adjustForNumColumns(int numColumns) Description copied from class:FieldEditorAdjusts the horizontal span of this field editor's basic controls.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 getNumberOfControlsmethod.- Overrides:
- adjustForNumColumnsin class- StringFieldEditor
- Parameters:
- numColumns- the number of columns
 
- 
changePressedNotifies that this field editor's change button has been pressed.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.- Returns:
- the new string to display, or nullto leave the old string showing
 
- 
doFillIntoGridDescription copied from class:StringFieldEditorFills this field editor's basic controls into the given parent.The string field implementation of this FieldEditorframework method contributes the text field. Subclasses may override but must callsuper.doFillIntoGrid.- Overrides:
- doFillIntoGridin class- StringFieldEditor
- Parameters:
- parent- the composite used as a parent for the basic controls; the parent's layout must be a- GridLayout
- numColumns- the number of columns
 
- 
getChangeControlGet the change control. Create it in parent if required.- Parameters:
- parent- the parent composite
- Returns:
- Button
 
- 
getNumberOfControlspublic int getNumberOfControls()Description copied from class:FieldEditorReturns the number of basic controls this field editor consists of.- Overrides:
- getNumberOfControlsin class- StringFieldEditor
- Returns:
- the number of controls
 
- 
getShellReturns this field editor's shell.- Returns:
- the shell
 
- 
setChangeButtonTextSets the text of the change button.- Parameters:
- text- the new text
 
- 
setEnabledDescription copied from class:FieldEditorSet whether or not the controls in the field editor are enabled.- Overrides:
- setEnabledin class- StringFieldEditor
- Parameters:
- enabled- The enabled state.
- parent- The parent of the controls in the group. Used to create the controls if required.
 
 
-