EGF Engine
Release 0.1.0

org.eclipse.egf.core.ui.internal.field
Class ModelElementButtonFieldEditor

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
                  extended by org.eclipse.egf.core.ui.internal.field.ModelElementButtonFieldEditor
All Implemented Interfaces:
org.eclipse.egf.common.ui.toolkit.fields.IFieldEditor

public class ModelElementButtonFieldEditor
extends ValidatingStringButtonFieldEditor

Implement a string button field editor for NamedModelElementWithId objects.
When the "Browse" button is pressed, the end-user can select a NamedModelElementWithId in the open dialog.
The text field editor is displayed the result of NamedModelElementWithId.getName() method call.


Field Summary
 
Fields inherited from class org.eclipse.egf.common.ui.toolkit.adapters.StringButtonFieldEditorAdapter
_labelStyle, _valueStyle
 
Constructor Summary
ModelElementButtonFieldEditor(Composite parent_p, String label_p, ElementListSelectionDialog dialogToOpen_p)
          Constructor.
 
Method Summary
protected  void addListeners()
          Add listeners on widgets contained by this field editor.
static ModelElementButtonFieldEditor createModelElementButtonFieldEditor(Composite parent_p, DialogPage page_p, String fieldEditorLabel_p, String fieldEditorTooltip_p, ElementListSelectionDialog dialogToOpen_p, org.eclipse.egf.common.ui.toolkit.validators.IValidator fieldEditorValidator_p, boolean readOnly_p)
          Create a string button field editor to select a NamedModelElementWithId object.
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.
 
Methods inherited from class org.eclipse.egf.common.ui.field.ValidatingStringButtonFieldEditor
changePressed, createDialog, getDialogToOpen, isValid, setDialogToOpen
 
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

ModelElementButtonFieldEditor

public ModelElementButtonFieldEditor(Composite parent_p,
                                     String label_p,
                                     ElementListSelectionDialog dialogToOpen_p)
Constructor.

Parameters:
parent_p -
label_p -
dialogToOpen_p -
Method Detail

handleSelection

protected String handleSelection(Object selectedObject_p)
Description copied from class: ValidatingStringButtonFieldEditor
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.

Overrides:
handleSelection in class ValidatingStringButtonFieldEditor
Returns:
a not null String.
See Also:
ValidatingStringButtonFieldEditor.handleSelection(java.lang.Object)

createModelElementButtonFieldEditor

public static ModelElementButtonFieldEditor createModelElementButtonFieldEditor(Composite parent_p,
                                                                                DialogPage page_p,
                                                                                String fieldEditorLabel_p,
                                                                                String fieldEditorTooltip_p,
                                                                                ElementListSelectionDialog dialogToOpen_p,
                                                                                org.eclipse.egf.common.ui.toolkit.validators.IValidator fieldEditorValidator_p,
                                                                                boolean readOnly_p)
Create a string button field editor to select a NamedModelElementWithId object.

Parameters:
parent_p -
page_p - the page where the created field editor is displayed.
fieldEditorLabel_p -
dialogToOpen_p - dialog open when the button is pressed.
fieldEditorValidator_p -
Returns:

addListeners

protected void addListeners()
Add listeners on widgets contained by this field editor.


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.