org.eclipse.emf.ecoretools.tabbedproperties.sections
Class AbstractChooserPropertySection

java.lang.Object
  extended by org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
      extended by org.eclipse.emf.ecoretools.tabbedproperties.sections.AbstractTabbedPropertySection
          extended by org.eclipse.emf.ecoretools.tabbedproperties.sections.AbstractChooserPropertySection
All Implemented Interfaces:
org.eclipse.ui.views.properties.tabbed.ISection

public abstract class AbstractChooserPropertySection
extends AbstractTabbedPropertySection

An abstract implementation of a section with a field using a CSingleObjectChooser composite (CCombo with a Button). Creation 5 apr. 2006 Updated 7 aug. 2006


Field Summary
 
Fields inherited from class org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
STANDARD_LABEL_WIDTH
 
Constructor Summary
AbstractChooserPropertySection()
           
 
Method Summary
 void createControls(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage aTabbedPropertySheetPage)
           
protected  void createWidgets(org.eclipse.swt.widgets.Composite composite)
          Section widgets should be created inside this method.
protected  java.lang.Object[] getChoices(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EClassifier type)
          Returns an array of all reachable objects of a given type from the current selection.
protected abstract  java.lang.Object[] getComboFeatureValues()
          Get the enumeration values of the feature for the combo field for the section.
protected  CSingleObjectChooser getCSingleObjectChooser()
           
protected abstract  java.lang.Object getFeatureValue()
          Get the current feature value of the selected model object.
protected  java.lang.String getItemLabelText(org.eclipse.emf.ecore.EObject object)
          Returns the label text for the given item
protected  org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
          Get the LabelProvider to use to display the Object
protected  void handleComboModified()
          Handle the combo modified event.
protected  void hookListeners()
          Adds the listeners on the widgets
protected  boolean isRefreshing()
           
 void refresh()
           
protected  void setSectionData(org.eclipse.swt.widgets.Composite composite)
          This method should be implemented to set layout data to the widgets created at AbstractTabbedPropertySection.createWidgets(Composite).
 
Methods inherited from class org.eclipse.emf.ecoretools.tabbedproperties.sections.AbstractTabbedPropertySection
aboutToBeHidden, aboutToBeShown, addListener, clearDecorators, createCommand, getActivePage, getEditingDomain, getEObject, getEObjectList, getFeature, getLabelText, getMainComposite, getMessageManager, getModelListener, getSectionComposite, getStandardLabelWidth, getStatusLineManager, handleModelChanged, isReadOnly, makeContributions, removeListener, setDecorator, setErrorDecorator, setErrorMessage, setInfoDecorator, setInput, setMessage, setWarningDecorator
 
Methods inherited from class org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
dispose, getMinimumHeight, getPart, getSelection, getWidgetFactory, shouldUseExtraSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChooserPropertySection

public AbstractChooserPropertySection()
Method Detail

createControls

public void createControls(org.eclipse.swt.widgets.Composite parent,
                           org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage aTabbedPropertySheetPage)
Specified by:
createControls in interface org.eclipse.ui.views.properties.tabbed.ISection
Overrides:
createControls in class AbstractTabbedPropertySection
See Also:
ISection.createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)

createWidgets

protected void createWidgets(org.eclipse.swt.widgets.Composite composite)
Description copied from class: AbstractTabbedPropertySection
Section widgets should be created inside this method. To set the layout data please implement the AbstractTabbedPropertySection.setSectionData(Composite) If widgets has listeners implement the AbstractTabbedPropertySection.hookListeners().

Overrides:
createWidgets in class AbstractTabbedPropertySection
Parameters:
composite - the parent Composite
See Also:
AbstractTabbedPropertySection.createWidgets(org.eclipse.swt.widgets.Composite)

setSectionData

protected void setSectionData(org.eclipse.swt.widgets.Composite composite)
Description copied from class: AbstractTabbedPropertySection
This method should be implemented to set layout data to the widgets created at AbstractTabbedPropertySection.createWidgets(Composite). This improves visibility

Overrides:
setSectionData in class AbstractTabbedPropertySection
Parameters:
composite - Sometimes widgets will be set formDatas and position will depend on parent composite.
See Also:
AbstractTabbedPropertySection.setSectionData(org.eclipse.swt.widgets.Composite)

hookListeners

protected void hookListeners()
Adds the listeners on the widgets

Overrides:
hookListeners in class AbstractTabbedPropertySection

handleComboModified

protected void handleComboModified()
Handle the combo modified event.


refresh

public void refresh()
Specified by:
refresh in interface org.eclipse.ui.views.properties.tabbed.ISection
Overrides:
refresh in class org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
See Also:
ISection.refresh()

getCSingleObjectChooser

protected CSingleObjectChooser getCSingleObjectChooser()
Returns:
the cSingleObjectChooser

isRefreshing

protected boolean isRefreshing()
Returns:
the isRefreshing

getChoices

protected java.lang.Object[] getChoices(org.eclipse.emf.ecore.EObject object,
                                        org.eclipse.emf.ecore.EClassifier type)
Returns an array of all reachable objects of a given type from the current selection.

Parameters:
object - current EObject selection
type - Reachable object which have this type
Returns:
An array of objects of the given type

getItemLabelText

protected java.lang.String getItemLabelText(org.eclipse.emf.ecore.EObject object)
Returns the label text for the given item

Parameters:
object - the item to find the name
Returns:
The found name of the given item

getLabelProvider

protected org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
Get the LabelProvider to use to display the Object

Returns:
ILabelProvider

getFeatureValue

protected abstract java.lang.Object getFeatureValue()
Get the current feature value of the selected model object.

Returns:
the feature value to select in the ccombo.

getComboFeatureValues

protected abstract java.lang.Object[] getComboFeatureValues()
Get the enumeration values of the feature for the combo field for the section.

Returns:
the list of values of the feature as text.

Copyright 2007 Anyware Technologies.
All Rights Reserved.