EGF Engine
Release 0.1.0

org.eclipse.egf.common.ui.field
Class ValidatingStringButtonFieldEditor

java.lang.Object
  extended by StringButtonFieldEditor
      extended by org.eclipse.egf.common.ui.toolkit.adapters.StringButtonFieldEditorAdapter
          extended by org.eclipse.egf.common.ui.toolkit.fields.StringBrowserFieldEditor
              extended by org.eclipse.egf.common.ui.field.ValidatingStringButtonFieldEditor
All Implemented Interfaces:
org.eclipse.egf.common.ui.toolkit.fields.IFieldEditor
Direct Known Subclasses:
JavaClassFieldEditor, JavaScopeClassFieldEditor, ModelElementButtonFieldEditor

public class ValidatingStringButtonFieldEditor
extends org.eclipse.egf.common.ui.toolkit.fields.StringBrowserFieldEditor

Implement a string button field editor that delegated its validation to an IValidator object if provided.


Field Summary
 
Fields inherited from class org.eclipse.egf.common.ui.toolkit.adapters.StringButtonFieldEditorAdapter
_labelStyle, _valueStyle
 
Constructor Summary
ValidatingStringButtonFieldEditor(Composite parent_p, String label_p, SelectionDialog dialogToOpen_p)
          Constructor.
 
Method Summary
protected  String changePressed()
           
protected  SelectionDialog createDialog()
          Create a specific dialog.
protected  SelectionDialog getDialogToOpen()
          Return the provided dialog to open when 'Browse' button is pressed.
protected  String handleSelection(Object selectedObject_p)
          Offers a way to convert the end-user object selection into a string representation displayed in the text field editor.
 boolean isValid(boolean force_p)
          Checks whether the class text field contains a valid value or not.
protected  void setDialogToOpen(SelectionDialog dialogToOpen_p)
          Set the dialog to open.
 
Methods inherited from class org.eclipse.egf.common.ui.toolkit.fields.StringBrowserFieldEditor
getChangeControl, getCurrentSelection, setCurrentSelection
 
Methods inherited from class org.eclipse.egf.common.ui.toolkit.adapters.StringButtonFieldEditorAdapter
checkState, checkValueStyle, createControl, defaultLayout, doCheckState, doFillIntoGrid, getFieldName, getFieldPage, getHelperControl, getLabel, getValidator, getValueControl, init, isFocused, isHelperEnabled, isValueEnabled, layout, setFieldPage, setFocus, setHelperEnabled, setValidator, setValueEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.egf.common.ui.toolkit.fields.IFieldEditor
getErrorMessage, isValid
 

Constructor Detail

ValidatingStringButtonFieldEditor

public ValidatingStringButtonFieldEditor(Composite parent_p,
                                         String label_p,
                                         SelectionDialog dialogToOpen_p)
Constructor.

Parameters:
parent_p -
label_p -
dialogToOpen_p -
Method Detail

isValid

public boolean isValid(boolean force_p)
Checks whether the class text field contains a valid value or not.

Parameters:
force_p - true means force to compute the valid state again.
Returns:
true if the field value is valid, and false if invalid.

changePressed

protected String changePressed()
Overrides:
changePressed in class org.eclipse.egf.common.ui.toolkit.fields.StringBrowserFieldEditor
See Also:
org.eclipse.egf.common.ui.toolkit.fields.CStringButtonFieldEditor#changePressed()

createDialog

protected SelectionDialog createDialog()
Create a specific dialog.
Default implementation does nothing.

Returns:
null if not implemented.

handleSelection

protected String handleSelection(Object selectedObject_p)
Offers a way to convert the end-user object selection into a string representation displayed in the text field editor.
This method is called when the end-user pressed "ok" to finish its selection.
Default behavior is to cast into a String given object selection.

Parameters:
selectedObject_p -
Returns:
a not null String.

setDialogToOpen

protected void setDialogToOpen(SelectionDialog dialogToOpen_p)
Set the dialog to open.

Parameters:
dialogToOpen_p -

getDialogToOpen

protected SelectionDialog getDialogToOpen()
Return the provided dialog to open when 'Browse' button is pressed.

Returns:
null if not set.

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.