Class OutputField
The OutputField
extends StringFieldEditor
but overrides its behavior
to prevent storing, loading, or modifying values through the preference store. The field
is displayed as a read-only text field with a fixed width.
-
Field Summary
Fields inherited from class org.eclipse.jface.preference.StringFieldEditor
oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
-
Constructor Summary
ConstructorsConstructorDescriptionOutputField
(String labelText, String value, org.eclipse.swt.widgets.Composite parent) Constructs anOutputField
with the specified label and initial value. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createControl
(org.eclipse.swt.widgets.Composite parent) Creates the UI control for the output field and sets it to read-only.protected void
doLoad()
Overrides the load behavior to prevent loading a value from preferences.protected void
Overrides the default load behavior to prevent resetting the value.protected void
doStore()
Overrides the store behavior to prevent saving the value.Retrieves the current value displayed in the output field.void
setStringValue
(String value) Sets the displayed value of the output field.Methods inherited from class org.eclipse.jface.preference.StringFieldEditor
adjustForNumColumns, checkState, createTextWidget, doCheckState, doFillIntoGrid, getErrorMessage, getNumberOfControls, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setEnabled, setErrorMessage, setFocus, setTextLimit, setValidateStrategy, showErrorMessage, valueChanged
Methods inherited from class org.eclipse.jface.preference.FieldEditor
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, 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
-
OutputField
Constructs anOutputField
with the specified label and initial value.The field is initialized with the given value and displayed in the specified parent composite.
- Parameters:
labelText
- the label text displayed next to the field.value
- the initial value to display in the field.parent
- the parentComposite
in which this field is created.
-
-
Method Details
-
doLoadDefault
protected void doLoadDefault()Overrides the default load behavior to prevent resetting the value.This method is intentionally left empty to ensure that the field does not load any default values from the preference store.
- Overrides:
doLoadDefault
in classorg.eclipse.jface.preference.StringFieldEditor
-
createControl
protected void createControl(org.eclipse.swt.widgets.Composite parent) Creates the UI control for the output field and sets it to read-only.This method ensures that the text field cannot be edited by the user.
- Overrides:
createControl
in classorg.eclipse.jface.preference.FieldEditor
- Parameters:
parent
- the parentComposite
in which this field is created.
-
doStore
protected void doStore()Overrides the store behavior to prevent saving the value.This method is intentionally left empty to ensure that the field does not store any values in the preference store.
- Overrides:
doStore
in classorg.eclipse.jface.preference.StringFieldEditor
-
doLoad
protected void doLoad()Overrides the load behavior to prevent loading a value from preferences.This method is intentionally left empty to ensure that the field does not retrieve any stored values from the preference store.
- Overrides:
doLoad
in classorg.eclipse.jface.preference.StringFieldEditor
-
setStringValue
Sets the displayed value of the output field.This value is stored locally and not persisted to the preference store.
- Overrides:
setStringValue
in classorg.eclipse.jface.preference.StringFieldEditor
- Parameters:
value
- the new value to display in the field.
-
getStringValue
Retrieves the current value displayed in the output field.This method returns the locally stored value instead of fetching from preferences.
- Overrides:
getStringValue
in classorg.eclipse.jface.preference.StringFieldEditor
- Returns:
- the current value of the field as a
String
.
-