|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jface.preference.FieldEditor net.sf.commonclipse.preferences.AddRemoveListFieldEditor
public class AddRemoveListFieldEditor
A field editor for displaying and storing a list of strings. Buttons are provided for adding items to the list and removing items from the list. Implementation from http://www.eclipse.org/articles/Article-Field-Editors/field_editors.html
Field Summary | |
---|---|
(package private) org.eclipse.swt.widgets.List |
list
The list of items. |
Fields inherited from class org.eclipse.jface.preference.FieldEditor |
---|
HORIZONTAL_GAP, IS_VALID, VALUE |
Constructor Summary | |
---|---|
AddRemoveListFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
Creates a string field editor of unlimited width. |
|
AddRemoveListFieldEditor(java.lang.String name,
java.lang.String labelText,
java.lang.String addButtonText,
java.lang.String removeButtonText,
org.eclipse.swt.widgets.Composite parent)
Creates a string field editor of unlimited width. |
Method Summary | |
---|---|
(package private) void |
add()
Adds the string in the text field to the list. |
protected void |
adjustForNumColumns(int numColumns)
|
static boolean |
containsOnlyValidChars(java.lang.String str)
Checks the the given String doesn't contains invalid chars. |
protected void |
doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int numColumns)
|
protected void |
doLoad()
|
protected void |
doLoadDefault()
|
protected void |
doStore()
|
int |
getNumberOfControls()
|
(package private) void |
selectionChanged()
Sets the enablement of the remove button depending on the selection in the list. |
void |
setAddButtonText(java.lang.String text)
Sets the label for the button that adds the contents of the text field to the list. |
void |
setRemoveButtonText(java.lang.String text)
Sets the label for the button that removes the selected item from the list. |
void |
setSeparator(java.lang.String listSeparator)
Sets the string that separates items in the list when the list is stored as a single String in the preference store. |
Methods inherited from class org.eclipse.jface.preference.FieldEditor |
---|
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, 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 |
---|
org.eclipse.swt.widgets.List list
Constructor Detail |
---|
public AddRemoveListFieldEditor(java.lang.String name, java.lang.String labelText, org.eclipse.swt.widgets.Composite parent)
setTextLimit
to limit the text.
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 controlpublic AddRemoveListFieldEditor(java.lang.String name, java.lang.String labelText, java.lang.String addButtonText, java.lang.String removeButtonText, org.eclipse.swt.widgets.Composite parent)
setTextLimit
to limit the text.
name
- the name of the preference this field editor works onlabelText
- the label text of the field editoraddButtonText
- text for the "add" buttonremoveButtonText
- text for the "remove" buttomparent
- the parent of the field editor's controlMethod Detail |
---|
protected void adjustForNumColumns(int numColumns)
adjustForNumColumns
in class org.eclipse.jface.preference.FieldEditor
FieldEditor.adjustForNumColumns(int)
protected void doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int numColumns)
doFillIntoGrid
in class org.eclipse.jface.preference.FieldEditor
(Composite, int)
protected void doLoad()
doLoad
in class org.eclipse.jface.preference.FieldEditor
FieldEditor.doLoad()
protected void doLoadDefault()
doLoadDefault
in class org.eclipse.jface.preference.FieldEditor
FieldEditor.doLoadDefault()
protected void doStore()
doStore
in class org.eclipse.jface.preference.FieldEditor
FieldEditor.doStore()
public int getNumberOfControls()
getNumberOfControls
in class org.eclipse.jface.preference.FieldEditor
FieldEditor.getNumberOfControls()
void add()
public static boolean containsOnlyValidChars(java.lang.String str)
str
- input String
true
if the string doesn't contains invalid chars.public void setAddButtonText(java.lang.String text)
text
- "add" button textpublic void setRemoveButtonText(java.lang.String text)
text
- "remove" button textpublic void setSeparator(java.lang.String listSeparator)
listSeparator
- token used as a delimiter when converting the array in a single stringvoid selectionChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |