org.mockcentral.editor.nodes.expectation.part.wizard
Class AbstractFieldEditor

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.mockcentral.editor.nodes.expectation.part.wizard.AbstractFieldEditor
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
CollectionFieldEditor, ConstantFieldEditor, InstanceFieldEditor, NullFieldEditor, ReferrableFieldEditor, SimpleValueFieldEditor

public class AbstractFieldEditor
extends org.eclipse.swt.widgets.Composite

Base class for the Composite classes used to edit SignaturePartBean data for specific value types.

Author:
David Hutchinson

Field Summary
protected  org.mockcentral.server.SignaturePartBean bean
          The SignaturePartBean modeling the data being edited.
protected  SelectSignaturePartTypePage page
          The SelectSignatureParTypetPage for the wizard.
protected  org.eclipse.swt.widgets.Composite valueClassNameEditor
          The Composite used to edit the value class name, if applicable.
protected  java.util.List<java.lang.String> valueClassNameOptions
          the list of options for selecting a value class name from a Combo, if applicable.
protected  org.eclipse.swt.widgets.Label valueClassNamePromptLabel
          The Label for prompting editing the value class name, if applicable.
protected  org.eclipse.swt.widgets.Composite valueEditor
          The Composite used to edit the value, if applicable.
protected  java.util.List<java.lang.String> valueOptions
          the list of options for selecting a value from a Combo, if applicable.
protected  org.eclipse.swt.widgets.Label valuePromptLabel
          The Label for prompting editing the value, if applicable.
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
AbstractFieldEditor(SelectSignaturePartTypePage page, org.mockcentral.server.SignaturePartBean bean, org.eclipse.swt.widgets.Composite parent)
          Creates a new instance.
 
Method Summary
protected  void createEditorContent(org.eclipse.swt.widgets.Composite parent)
          Creates the editor contents.
protected  void createValueClassNameEditor(java.lang.Integer... args)
          Creates the Composite used to edit the value class name of the SignaturePartBean.
protected  void createValueEditor(java.lang.Integer... args)
          Creates the Composite used to edit the value of the SignaturePartBean.
 EditSignaturePartWizardDialog getDialog()
          Returns the EditSignaturePartWizardDialog.
protected  void setBean(org.mockcentral.server.SignaturePartBean bean)
          Sets the SignaturePartBean being edited.
protected  void setDefaultValue()
          Sets the value field for the SignaturePartBean to the appropriate default.
protected  void setFocusOn(org.eclipse.swt.widgets.Control control)
          Focuses on the supplied Control inside the UI Thread.
protected  void setModelFieldValue(java.lang.String fieldName, java.lang.String value, boolean validate, java.lang.Object o)
          Assigns the supplied value to the appropriate field in the current SignaturePartBean.
protected  void setModelFieldValue(java.lang.String fieldName, java.lang.String value, org.mockcentral.server.SignaturePartBean toValidate, java.lang.Object o)
          Assigns the supplied value to the appropriate field in the current SignaturePartBean.
protected  void setNoMatchingElementErrorMessage()
          Notification from an ElementListSelector that there was no matching element based on the user's input.
protected  void updateControls()
          Notification that the various controls within the editor(s) should be updated with new bean data.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

page

protected SelectSignaturePartTypePage page
The SelectSignatureParTypetPage for the wizard.


bean

protected org.mockcentral.server.SignaturePartBean bean
The SignaturePartBean modeling the data being edited.


valueClassNameEditor

protected org.eclipse.swt.widgets.Composite valueClassNameEditor
The Composite used to edit the value class name, if applicable.


valueClassNamePromptLabel

protected org.eclipse.swt.widgets.Label valueClassNamePromptLabel
The Label for prompting editing the value class name, if applicable.


valueClassNameOptions

protected java.util.List<java.lang.String> valueClassNameOptions
the list of options for selecting a value class name from a Combo, if applicable.


valueEditor

protected org.eclipse.swt.widgets.Composite valueEditor
The Composite used to edit the value, if applicable.


valuePromptLabel

protected org.eclipse.swt.widgets.Label valuePromptLabel
The Label for prompting editing the value, if applicable.


valueOptions

protected java.util.List<java.lang.String> valueOptions
the list of options for selecting a value from a Combo, if applicable.

Constructor Detail

AbstractFieldEditor

public AbstractFieldEditor(SelectSignaturePartTypePage page,
                           org.mockcentral.server.SignaturePartBean bean,
                           org.eclipse.swt.widgets.Composite parent)
Creates a new instance.

Parameters:
page - the SelectSignaturePartTypePage.
bean - the SignaturePartBean being edited.
parent - the parent Composite within the page.
Method Detail

createEditorContent

protected void createEditorContent(org.eclipse.swt.widgets.Composite parent)
Creates the editor contents.

Parameters:
parent - the parent Composite belonging to the wizard page.

createValueClassNameEditor

protected void createValueClassNameEditor(java.lang.Integer... args)
Creates the Composite used to edit the value class name of the SignaturePartBean. Not all subclasses will require this method.

Parameters:
args - the number of columns for the layout for the Composite. If not supplied the value will be 1.

createValueEditor

protected void createValueEditor(java.lang.Integer... args)
Creates the Composite used to edit the value of the SignaturePartBean. Not all subclasses will require this method.

Parameters:
args - the number of columns for the layout for the Composite. If not supplied the value will be 1.

setBean

protected void setBean(org.mockcentral.server.SignaturePartBean bean)
Sets the SignaturePartBean being edited.

Parameters:
bean - the SignaturePartBean being edited.

updateControls

protected void updateControls()
Notification that the various controls within the editor(s) should be updated with new bean data. This method updates the label(s) prompting for user input for the bean's value class name and/or value(as appropriate), accessing the SignaturePartUtil class to get the prompts. Subclasses will implement additional any necessary initialization of their editor controls.


setNoMatchingElementErrorMessage

protected void setNoMatchingElementErrorMessage()
Notification from an ElementListSelector that there was no matching element based on the user's input. This default implementation does nothing. Subclasses may override to set an error message on the page.


setDefaultValue

protected void setDefaultValue()
Sets the value field for the SignaturePartBean to the appropriate default.


getDialog

public EditSignaturePartWizardDialog getDialog()
Returns the EditSignaturePartWizardDialog.

Returns:
the EditSignaturePartWizardDialog.

setModelFieldValue

protected void setModelFieldValue(java.lang.String fieldName,
                                  java.lang.String value,
                                  boolean validate,
                                  java.lang.Object o)
Assigns the supplied value to the appropriate field in the current SignaturePartBean. If the validate flag is set, validation will be performed.

Parameters:
fieldName - the name of the edited field ("valueClassName" or "value").
value - the new value for the edited field.
validate - whether to validate the new value.

setModelFieldValue

protected void setModelFieldValue(java.lang.String fieldName,
                                  java.lang.String value,
                                  org.mockcentral.server.SignaturePartBean toValidate,
                                  java.lang.Object o)
Assigns the supplied value to the appropriate field in the current SignaturePartBean. Validation will be performed on the supplied SignaturePartBean.

Parameters:
fieldName - the name of the edited field.
value - the new value for the edited field.
toValidate - the SignaturePartBean to test for validity.

setFocusOn

protected void setFocusOn(org.eclipse.swt.widgets.Control control)
Focuses on the supplied Control inside the UI Thread.

Parameters:
control - the Control on which to set focus.