java.lang.Object
org.eclipse.jface.preference.FieldEditor
org.eclipse.jface.preference.StringFieldEditor
com.developer.nefarious.zjoule.plugin.core.preferences.OutputField

public class OutputField extends org.eclipse.jface.preference.StringFieldEditor
Represents a read-only output field for displaying values in an Eclipse preference page.

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

    Constructors
    Constructor
    Description
    OutputField(String labelText, String value, org.eclipse.swt.widgets.Composite parent)
    Constructs an OutputField with the specified label and initial value.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    createControl(org.eclipse.swt.widgets.Composite parent)
    Creates the UI control for the output field and sets it to read-only.
    protected void
    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
    Overrides the store behavior to prevent saving the value.
    Retrieves the current value displayed in the output field.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OutputField

      public OutputField(String labelText, String value, org.eclipse.swt.widgets.Composite parent)
      Constructs an OutputField 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 parent Composite 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 class org.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 class org.eclipse.jface.preference.FieldEditor
      Parameters:
      parent - the parent Composite 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 class org.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 class org.eclipse.jface.preference.StringFieldEditor
    • setStringValue

      public void setStringValue(String value)
      Sets the displayed value of the output field.

      This value is stored locally and not persisted to the preference store.

      Overrides:
      setStringValue in class org.eclipse.jface.preference.StringFieldEditor
      Parameters:
      value - the new value to display in the field.
    • getStringValue

      public String 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 class org.eclipse.jface.preference.StringFieldEditor
      Returns:
      the current value of the field as a String.