|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.preference.FieldEditor
net.sf.commonclipse.preferences.ComboFieldEditor
public class ComboFieldEditor
Implementation identical to StringFieldEditor but using a combo instead of a Text field.
| Field Summary | |
|---|---|
(package private) org.eclipse.swt.widgets.Combo |
textField
The text field, or null if none. |
static int |
UNLIMITED
Text limit constant (value -1) indicating unlimited text limit and width. |
| Fields inherited from class org.eclipse.jface.preference.FieldEditor |
|---|
HORIZONTAL_GAP, IS_VALID, VALUE |
| Constructor Summary | |
|---|---|
protected |
ComboFieldEditor()
Creates a new string field editor. |
|
ComboFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
Creates a string field editor of unlimited width. |
|
ComboFieldEditor(java.lang.String name,
java.lang.String labelText,
int width,
org.eclipse.swt.widgets.Composite parent)
Creates a string field editor. |
| Method Summary | |
|---|---|
protected void |
adjustForNumColumns(int numColumns)
|
protected boolean |
checkState()
Checks whether the text input field contains a valid value or not. |
protected void |
clearErrorMessage()
|
protected boolean |
doCheckState()
Hook for subclasses to do specific state checks. |
protected void |
doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int numColumns)
|
protected void |
doLoad()
|
protected void |
doLoadDefault()
|
protected void |
doStore()
|
java.lang.String |
getErrorMessage()
Returns the error message that will be displayed when and if an error occurs. |
int |
getNumberOfControls()
|
java.lang.String |
getStringValue()
Returns the field editor's value. |
protected org.eclipse.swt.widgets.Combo |
getTextControl()
Returns this field editor's text control. |
org.eclipse.swt.widgets.Combo |
getTextControl(org.eclipse.swt.widgets.Composite parent)
Returns this field editor's text control. |
boolean |
isEmptyStringAllowed()
Returns whether an empty string is a valid value. |
boolean |
isValid()
|
protected void |
refreshValidState()
|
void |
setEmptyStringAllowed(boolean b)
Sets whether the empty string is a valid value or not. |
void |
setEnabled(boolean enabled,
org.eclipse.swt.widgets.Composite parent)
|
void |
setErrorMessage(java.lang.String message)
Sets the error message that will be displayed when and if an error occurs. |
void |
setFocus()
|
void |
setPredefinedValues(java.lang.String[] strings)
Sets a list of predefined values that must be shown in the combo. |
void |
setStringValue(java.lang.String value)
Sets this field editor's value. |
void |
setTextLimit(int limit)
Sets this text field's text limit. |
void |
showErrorMessage()
Shows the error message set via setErrorMessage. |
protected void |
valueChanged()
Informs this field editor's listener, if it has one, about a change to the value ( VALUE property)
provided that the old and new values are different. |
| Methods inherited from class org.eclipse.jface.preference.FieldEditor |
|---|
applyFont, checkParent, 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNLIMITED
-1) indicating unlimited text limit and width.
org.eclipse.swt.widgets.Combo textField
null if none.
| Constructor Detail |
|---|
protected ComboFieldEditor()
public ComboFieldEditor(java.lang.String name,
java.lang.String labelText,
int width,
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 editorwidth - the width of the text input field in characters, or UNLIMITED for no limitparent - the parent of the field editor's control
public ComboFieldEditor(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 control| Method Detail |
|---|
protected boolean checkState()
true if the field value is valid, and false if invalidprotected void doLoad()
doLoad in class org.eclipse.jface.preference.FieldEditorFieldEditor.doLoad()protected void doLoadDefault()
doLoadDefault in class org.eclipse.jface.preference.FieldEditorFieldEditor.doLoadDefault()protected void doStore()
doStore in class org.eclipse.jface.preference.FieldEditorFieldEditor.doStore()public java.lang.String getErrorMessage()
null if nonepublic int getNumberOfControls()
getNumberOfControls in class org.eclipse.jface.preference.FieldEditorFieldEditor.getNumberOfControls()public java.lang.String getStringValue()
protected org.eclipse.swt.widgets.Combo getTextControl()
null if no text field is created yetpublic org.eclipse.swt.widgets.Combo getTextControl(org.eclipse.swt.widgets.Composite parent)
The control is created if it does not yet exist
parent - the parent
public boolean isEmptyStringAllowed()
true if an empty string is a valid value, and false if an empty string is
invalidsetEmptyStringAllowed(boolean)public boolean isValid()
isValid in class org.eclipse.jface.preference.FieldEditor# isValid()protected void refreshValidState()
refreshValidState in class org.eclipse.jface.preference.FieldEditorFieldEditor.refreshValidState()public void setEmptyStringAllowed(boolean b)
b - true if the empty string is allowed, and false if it is considered invalidpublic void setErrorMessage(java.lang.String message)
message - the error messagepublic void setFocus()
setFocus in class org.eclipse.jface.preference.FieldEditorFieldEditor.setFocus()public void setStringValue(java.lang.String value)
value - the new value, or null meaning the empty stringpublic void setTextLimit(int limit)
limit - the limit on the number of character in the text input field, or UNLIMITED for no
limitpublic void showErrorMessage()
setErrorMessage.
protected void valueChanged()
VALUE property)
provided that the old and new values are different.
This hook is not called when the text is initialized (or reset to the default value) from the preference store.
public void setEnabled(boolean enabled,
org.eclipse.swt.widgets.Composite parent)
setEnabled in class org.eclipse.jface.preference.FieldEditorFieldEditor.setEnabled(boolean,Composite).protected boolean doCheckState()
The default implementation of this framework method does nothing and returns true. Subclasses
should override this method to specific state checks.
true if the field value is valid, and false if invalidprotected void adjustForNumColumns(int numColumns)
adjustForNumColumns in class org.eclipse.jface.preference.FieldEditorFieldEditor.adjustForNumColumns(int)
protected void doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int numColumns)
doFillIntoGrid in class org.eclipse.jface.preference.FieldEditorFieldEditor.doFillIntoGrid(Composite, int)public void setPredefinedValues(java.lang.String[] strings)
strings - array of Strings added to the comboprotected void clearErrorMessage()
clearErrorMessage in class org.eclipse.jface.preference.FieldEditorFieldEditor.clearErrorMessage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||