org.fosstrak.llrp.commander.preferences.pref
Class GroupedStringFieldEditor

java.lang.Object
  extended by org.eclipse.jface.preference.FieldEditor
      extended by org.fosstrak.llrp.commander.preferences.pref.GroupedStringFieldEditor

public class GroupedStringFieldEditor
extends org.eclipse.jface.preference.FieldEditor

An extension of the FieldEditor supporting the grouping of several preferences into a nice group box.

Author:
sawielan

Field Summary
static int INDEX_LABEL
          index of the text label in the preferencesLabelsAndNames array.
static int INDEX_PREF_NAME
          index of the preference name in the preferencesLabelsAndNames array.
 
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
 
Constructor Summary
GroupedStringFieldEditor(java.lang.String labelText, java.lang.String[][] preferencesLabelsAndNames, org.eclipse.swt.widgets.Composite parent)
          A FieldEditor supporting the grouping of several preferences into a nice group box.
 
Method Summary
protected  void adjustForNumColumns(int numColumns)
           
protected  void createControl(org.eclipse.swt.widgets.Composite parent)
           
protected  void doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int numColumns)
           
protected  void doLoad()
           
protected  void doLoadDefault()
           
protected  void doStore()
           
 org.eclipse.swt.widgets.Composite getDBFieldControl(org.eclipse.swt.widgets.Composite parent)
          create the group providing the entries.
 int getNumberOfControls()
           
 
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, isValid, load, loadDefault, presentsDefaultValue, refreshValidState, setButtonLayoutData, setEnabled, setFocus, 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
 

Field Detail

INDEX_LABEL

public static final int INDEX_LABEL
index of the text label in the preferencesLabelsAndNames array.

See Also:
Constant Field Values

INDEX_PREF_NAME

public static final int INDEX_PREF_NAME
index of the preference name in the preferencesLabelsAndNames array.

See Also:
Constant Field Values
Constructor Detail

GroupedStringFieldEditor

public GroupedStringFieldEditor(java.lang.String labelText,
                                java.lang.String[][] preferencesLabelsAndNames,
                                org.eclipse.swt.widgets.Composite parent)
A FieldEditor supporting the grouping of several preferences into a nice group box.

Parameters:
labelText - the text of the group box (example the title).
preferencesLabelsAndNames - a 2D array providing the labels for the preferences in the first column, and the preferences names in the second column.

Example

new String[][] {
  {"Implementor", PreferenceConstants.P_EXT_DB_IMPLEMENTOR },
  {"JDBC String", PreferenceConstants.P_EXT_DB_JDBC}
}
parent - the parent widget of this editor.
Method Detail

getDBFieldControl

public org.eclipse.swt.widgets.Composite getDBFieldControl(org.eclipse.swt.widgets.Composite parent)
create the group providing the entries.

Parameters:
parent - the parent of this widget.
Returns:
a composite widget holding all the graphical elements.

createControl

protected void createControl(org.eclipse.swt.widgets.Composite parent)
Overrides:
createControl in class org.eclipse.jface.preference.FieldEditor

adjustForNumColumns

protected void adjustForNumColumns(int numColumns)
Specified by:
adjustForNumColumns in class org.eclipse.jface.preference.FieldEditor

doFillIntoGrid

protected void doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
                              int numColumns)
Specified by:
doFillIntoGrid in class org.eclipse.jface.preference.FieldEditor

doLoad

protected void doLoad()
Specified by:
doLoad in class org.eclipse.jface.preference.FieldEditor

doLoadDefault

protected void doLoadDefault()
Specified by:
doLoadDefault in class org.eclipse.jface.preference.FieldEditor

doStore

protected void doStore()
Specified by:
doStore in class org.eclipse.jface.preference.FieldEditor

getNumberOfControls

public int getNumberOfControls()
Specified by:
getNumberOfControls in class org.eclipse.jface.preference.FieldEditor


Copyright © 2009. All Rights Reserved.