com.ibm.commons.swt.data.editors
Class TreeComboEditor

java.lang.Object
  extended by com.ibm.commons.swt.data.editors.api.PropertyEditor
      extended by com.ibm.commons.swt.data.editors.TreeComboEditor
All Implemented Interfaces:
IPropertyEditor

public class TreeComboEditor
extends PropertyEditor

An editor that represents a selectable user interface object that combines a text field and a tree and issues notification when an item is selected from the tree.

Note that although this class is a subclass of Composite, it does not make sense to add children to it, or set a layout on it.

Styles:
BORDER, FLAT
Events:
Selection


Constructor Summary
TreeComboEditor(org.eclipse.jface.viewers.ITreeContentProvider provider, CTreeCombo.IPathSerializer serializer)
          Creates a new instance of this class with the given content provider and path serializer.
TreeComboEditor(IValidator validator, org.eclipse.jface.viewers.ITreeContentProvider provider, CTreeCombo.IPathSerializer serializer)
          Creates a new instance of this class with the given validator, content provider and path serializer.
 
Method Summary
 org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
          This method is called by the PropertyEditor during initialization.
 void initControlValue(CompositeEditor parent, java.lang.String value)
          Set the given value into the control created for this property editor.
 boolean isImmediateUpdate()
           
 void setId(java.lang.String id)
          Allows the implementor to associate an ID attribute with this control.
 boolean stopEdit(CompositeEditor parent)
          Called to tell the current editor to stop editing the associated attribute.
 
Methods inherited from class com.ibm.commons.swt.data.editors.api.PropertyEditor
addPropertyEditorUpdateListener, addValidator, callDialog, getContextAttribute, getContextObject, getDefaultEditor, getDialogButtonAltText, getDialogButtonImage, getDialogButtonText, getEditor, getRenderedValue, getScriptMode, getTextValidator, getValidator, getWorkBenchPart, hasDialogButton, isScriptModeFixed, postModelUpdate, preModelUpdate, removePropertyEditorUpdateListener, setContextAttribute, setContextObject, setScriptMode, setValidator, setWorkBenchPart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeComboEditor

public TreeComboEditor(org.eclipse.jface.viewers.ITreeContentProvider provider,
                       CTreeCombo.IPathSerializer serializer)
Creates a new instance of this class with the given content provider and path serializer. The content provider is responsible for populating the contents of the tree while the path serializer is responsible for serializing the location of the node in the tree which has been selected.

Parameters:
provider - a content provider that will populate the tree
serializer - a serializer that can resolve a node in the tree into a path

TreeComboEditor

public TreeComboEditor(IValidator validator,
                       org.eclipse.jface.viewers.ITreeContentProvider provider,
                       CTreeCombo.IPathSerializer serializer)
Creates a new instance of this class with the given validator, content provider and path serializer. The validator will ensure that the text entered by the user is within the desired parameters. The content provider is responsible for populating the contents of the tree while the path serializer is responsible for serializing the location of the node in the tree which has been selected.

Parameters:
validator - a validator that will be used to validate the text entered by the user
provider - a content provider that will populate the tree
serializer - a serializer that can resolve a node in the tree into a path
Method Detail

createControl

public org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
Description copied from class: PropertyEditor
This method is called by the PropertyEditor during initialization. This method creates the control that is used by the PropertyEditor to edit the associated property.

Specified by:
createControl in class PropertyEditor
Parameters:
parent - - The parent of the control
Returns:
Control - The 'control' used to edit this property (control is used liberally here as a composite of controls could be returned).

setId

public void setId(java.lang.String id)
Description copied from class: PropertyEditor
Allows the implementor to associate an ID attribute with this control. This may be of use later when trying to identify the control.

Specified by:
setId in class PropertyEditor

initControlValue

public void initControlValue(CompositeEditor parent,
                             java.lang.String value)
Description copied from class: PropertyEditor
Set the given value into the control created for this property editor.

Specified by:
initControlValue in class PropertyEditor
See Also:
CompositeEditor

stopEdit

public boolean stopEdit(CompositeEditor parent)
Description copied from class: PropertyEditor
Called to tell the current editor to stop editing the associated attribute. Typically this will be called when the current CompositeEditor has lost focus.

Specified by:
stopEdit in class PropertyEditor
Parameters:
parent - - CompositeEditor
Returns:
boolean - returns true if the operation succeeded, otherwise returns false.

isImmediateUpdate

public boolean isImmediateUpdate()