org.eclipse.emf.edit.provider
Class ItemPropertyDescriptor

java.lang.Object
  extended by org.eclipse.emf.edit.provider.ItemPropertyDescriptor
All Implemented Interfaces:
IItemPropertyDescriptor, IItemPropertyDescriptor.OverrideableCommandOwner
Direct Known Subclasses:
EModelElementItemProvider.ItemPropertyDescriptorWithUniqueChoiceOfValueLabels, GenBaseItemProvider.GenItemPropertyDescriptor, WrapperItemProvider.WrapperItemPropertyDescriptor

public class ItemPropertyDescriptor
extends java.lang.Object
implements IItemPropertyDescriptor, IItemPropertyDescriptor.OverrideableCommandOwner

This implementation of an item property descriptor supports delegating of the IItemPropertySource interface to the IItemPropertyDescriptor interface.


Nested Class Summary
protected  class ItemPropertyDescriptor.ItemDelegator
          This class uses a static image
static class ItemPropertyDescriptor.PropertyValueWrapper
           
 
Nested classes/interfaces inherited from interface org.eclipse.emf.edit.provider.IItemPropertyDescriptor
IItemPropertyDescriptor.OverrideableCommandOwner
 
Field Summary
protected  AdapterFactory adapterFactory
          For now we need to keep track of the adapter factory, because we need it to provide a correct label provider.
static java.lang.Object BOOLEAN_VALUE_IMAGE
           
protected  java.lang.String category
          This represents the group of properties into which this one should be placed.
protected  java.lang.Object commandOwner
          If non-null, this object will be the owner of commands created to set the property's value.
protected  java.lang.String description
          This is the description shown in the property sheet when this property is selected.
protected  java.lang.String displayName
          This is the name that is displayed in the property sheet.
protected static EcorePackage ecorePackage
           
protected  EStructuralFeature feature
          This is the structural feature that provides the values for this property.
protected  java.lang.String[] filterFlags
          These are the flags used as filters in the property sheet.
static java.lang.Object GENERIC_VALUE_IMAGE
           
static java.lang.Object INTEGRAL_VALUE_IMAGE
           
protected  boolean isSettable
          This is returned by canSetProperty(java.lang.Object).
protected  AdapterFactoryItemDelegator itemDelegator
          This is a convenient wrapper of the adapterFactory.
protected  boolean multiLine
          Whether the value of this property consists of multi-line text.
protected  EReference[] parentReferences
          This is the set of single-valued references that act as a parent, only one can have a non null value at a time.
static java.lang.Object REAL_VALUE_IMAGE
           
protected  ResourceLocator resourceLocator
          This is used to locate resources for translated values like enumeration literals.
protected  boolean sortChoices
          Whether the choices for this property should be sorted for display.
protected  java.lang.Object staticImage
          This is the image that will be used with the value no matter what type of object it is.
static java.lang.Object TEXT_VALUE_IMAGE
           
 
Constructor Summary
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EReference[] parentReferences)
          This creates an instance that uses a resource locator and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable)
          This creates an instance that uses a resource locator and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable, java.lang.String category)
          This creates an instance that uses a resource locator, specifies a category, and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that uses a resource locator, specifies a category and filter flags, and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature)
          This creates an instance that uses a resource locator and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable)
          This creates an instance that uses a resource locator and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, boolean multiLine, boolean sortChoices, java.lang.Object staticImage, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that uses a resource locator; indicates whether to be multi-line and to sort choices; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage)
          This creates an instance that uses a resource locator, specifies a static image, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage, java.lang.String category)
          This creates an instance that uses a resource locator, specifies a static image and category, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that uses a resource locator; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.String category)
          This creates an instance that uses a resource locator, specifies a category, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that uses a resource locator, specifies a category and filter flags, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EReference[] parentReferences)
          This creates an instance that does not use a resource locator and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable)
          This creates an instance that does not use a resource locator and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable, java.lang.String category)
          This creates an instance that does not use a resource locator, specifies a category, and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EReference[] parentReferences, boolean isSettable, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that does not use a resource locator, specifies a category and filter flags, and determines the cell editor from the parent references.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature)
          This creates an instance that does not use a resource locator and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable)
          This creates an instance that does not use a resource locator and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage)
          This creates an instance that does not use a resource locator, specifies a static image, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage, java.lang.String category)
          This creates an instance that does not use a resource locator, specifies a static image and category, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.Object staticImage, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that does not use a resource locator; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.String category)
          This creates an instance that does not use a resource locator, specifies a category, and determines the cell editor from the type of the structural feature.
ItemPropertyDescriptor(AdapterFactory adapterFactory, java.lang.String displayName, java.lang.String description, EStructuralFeature feature, boolean isSettable, java.lang.String category, java.lang.String[] filterFlags)
          This creates an instance that does not use a resource locator, specifies a category and filter flags, and determines the cell editor from the type of the structural feature.
 
Method Summary
 boolean canSetProperty(java.lang.Object object)
          This determines whether this descriptor's property for the object supports set (and reset).
static void collectReachableObjectsOfType(java.util.Collection<EObject> visited, java.util.Collection<EObject> result, EObject object, EClassifier type)
          This will visit all reachable references from object except those in visited; it updates visited and adds to result any object with a meta object that indicates that it is a subtype of type.
protected  java.lang.Object createPropertyValueWrapper(java.lang.Object object, java.lang.Object propertyValue)
           
 java.lang.String getCategory(java.lang.Object object)
          This returns the group of properties into which this one should be placed.
 java.util.Collection<?> getChoiceOfValues(java.lang.Object object)
          Returns the choices of all the values that this property may take one.
protected  java.util.Collection<?> getComboBoxObjects(java.lang.Object object)
          This will be called to populate a list of choices.
 java.lang.Object getCommandOwner()
          Returns the override command owner set via setCommandOwner.
protected  java.lang.Object getCommandOwner(java.lang.Object fallback)
          Returns either the override command owner set via setCommandOwner or, if that is null, the fall-back object provided.
static java.lang.String getDefaultId(EStructuralFeature eStructuralFeature)
          Returns the feature's default identifier.
static java.lang.Object getDefaultValue(EClassifier eType)
           
 java.lang.String getDescription(java.lang.Object object)
          This returns the description to be displayed in the property sheet when this property is selected.
 java.lang.String getDisplayName(java.lang.Object object)
          This returns the name of the property to be displayed in the property sheet.
 EditingDomain getEditingDomain(java.lang.Object object)
           
 java.lang.Object getFeature(java.lang.Object object)
          Returns the feature.
 java.lang.String[] getFilterFlags(java.lang.Object object)
          This returns the flags used as filters in the property sheet.
 java.lang.Object getHelpContextIds(java.lang.Object object)
           
 java.lang.String getId(java.lang.Object object)
          This returns the default identifier of the feature if it's present, or dash-separated concatenation of the default identifier of each parent reference.
 IItemLabelProvider getLabelProvider(java.lang.Object object)
          This returns the label provider that will be used to render the value of this property.
 java.lang.Object getPropertyValue(java.lang.Object object)
          This does the delegated job of getting the property value from the given object; and it sets object, which is necessary if getComboBoxObjects is called.
static java.util.Collection<EObject> getReachableObjectsOfType(EObject object, EClassifier type)
          This yields all reachable references from object with a meta object which indicates that it is a subtype of type.
protected  java.lang.Object getValue(EObject object, EStructuralFeature feature)
          This is called by getPropertyValue to reflectively obtain the value of a feature from an object.
 boolean isCompatibleWith(java.lang.Object object, java.lang.Object anotherObject, IItemPropertyDescriptor anotherItemPropertyDescriptor)
          This indicates whether these two property descriptors are equal.
 boolean isMany(java.lang.Object object)
          Returns whether this property represents multiple values.
 boolean isMultiLine(java.lang.Object object)
          Returns whether this property's value will consist of multi-line text.
 boolean isPropertySet(java.lang.Object object)
          This does the delegated job of determine whether the property value from the given object is set.
 boolean isSortChoices(java.lang.Object object)
          Returns whether the choices for this property should be sorted for display.
 void resetPropertyValue(java.lang.Object object)
          This does the delegated job of resetting property value back to it's default value.
 void setCommandOwner(java.lang.Object commandOwner)
          Sets the object to use as the owner of commands created to set the property's value.
 void setPropertyValue(java.lang.Object object, java.lang.Object value)
          This does the delegated job of setting the property to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_VALUE_IMAGE

public static final java.lang.Object BOOLEAN_VALUE_IMAGE

GENERIC_VALUE_IMAGE

public static final java.lang.Object GENERIC_VALUE_IMAGE

INTEGRAL_VALUE_IMAGE

public static final java.lang.Object INTEGRAL_VALUE_IMAGE

REAL_VALUE_IMAGE

public static final java.lang.Object REAL_VALUE_IMAGE

TEXT_VALUE_IMAGE

public static final java.lang.Object TEXT_VALUE_IMAGE

adapterFactory

protected AdapterFactory adapterFactory
For now we need to keep track of the adapter factory, because we need it to provide a correct label provider.


resourceLocator

protected ResourceLocator resourceLocator
This is used to locate resources for translated values like enumeration literals.


itemDelegator

protected AdapterFactoryItemDelegator itemDelegator
This is a convenient wrapper of the adapterFactory.


isSettable

protected boolean isSettable
This is returned by canSetProperty(java.lang.Object).


displayName

protected java.lang.String displayName
This is the name that is displayed in the property sheet.


description

protected java.lang.String description
This is the description shown in the property sheet when this property is selected.


feature

protected EStructuralFeature feature
This is the structural feature that provides the values for this property. This is mutually exclusive with parentReferences.


parentReferences

protected EReference[] parentReferences
This is the set of single-valued references that act as a parent, only one can have a non null value at a time. This is mutually exclusive with feature.


multiLine

protected boolean multiLine
Whether the value of this property consists of multi-line text.

Since:
2.2.0

sortChoices

protected boolean sortChoices
Whether the choices for this property should be sorted for display.

Since:
2.2.0

category

protected java.lang.String category
This represents the group of properties into which this one should be placed.


filterFlags

protected java.lang.String[] filterFlags
These are the flags used as filters in the property sheet.


staticImage

protected java.lang.Object staticImage
This is the image that will be used with the value no matter what type of object it is.


commandOwner

protected java.lang.Object commandOwner
If non-null, this object will be the owner of commands created to set the property's value.


ecorePackage

protected static final EcorePackage ecorePackage
Constructor Detail

ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature)
This creates an instance that does not use a resource locator and determines the cell editor from the type of the structural feature. It assumed that the feature should be settable from this property.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature)
This creates an instance that uses a resource locator and determines the cell editor from the type of the structural feature. It assumed that the feature should be settable from this property.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable)
This creates an instance that does not use a resource locator and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable)
This creates an instance that uses a resource locator and determines the cell editor from the type of the structural feature.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage)
This creates an instance that does not use a resource locator, specifies a static image, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage)
This creates an instance that uses a resource locator, specifies a static image, and determines the cell editor from the type of the structural feature.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.String category)
This creates an instance that does not use a resource locator, specifies a category, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.String category)
This creates an instance that uses a resource locator, specifies a category, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage,
                              java.lang.String category)
This creates an instance that does not use a resource locator, specifies a static image and category, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage,
                              java.lang.String category)
This creates an instance that uses a resource locator, specifies a static image and category, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that does not use a resource locator, specifies a category and filter flags, and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that uses a resource locator, specifies a category and filter flags, and determines the cell editor from the type of the structural feature.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that does not use a resource locator; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              java.lang.Object staticImage,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that uses a resource locator; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EStructuralFeature feature,
                              boolean isSettable,
                              boolean multiLine,
                              boolean sortChoices,
                              java.lang.Object staticImage,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that uses a resource locator; indicates whether to be multi-line and to sort choices; specifies a static image, a category, and filter flags; and determines the cell editor from the type of the structural feature.

Since:
2.2.0

ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences)
This creates an instance that does not use a resource locator and determines the cell editor from the parent references. It assumed that the feature should be settable from this property.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences)
This creates an instance that uses a resource locator and determines the cell editor from the parent references. It assumed that the feature should be settable from this property.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable)
This creates an instance that does not use a resource locator and determines the cell editor from the parent references.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable)
This creates an instance that uses a resource locator and determines the cell editor from the parent references.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable,
                              java.lang.String category)
This creates an instance that does not use a resource locator, specifies a category, and determines the cell editor from the parent references.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable,
                              java.lang.String category)
This creates an instance that uses a resource locator, specifies a category, and determines the cell editor from the parent references.

To reduce the number of constructors for this class, this one will soon be deprecated. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that does not use a resource locator, specifies a category and filter flags, and determines the cell editor from the parent references.

To reduce the number of constructors for this class, this one may be deprecated in the future. For new code, please use this form, instead.


ItemPropertyDescriptor

public ItemPropertyDescriptor(AdapterFactory adapterFactory,
                              ResourceLocator resourceLocator,
                              java.lang.String displayName,
                              java.lang.String description,
                              EReference[] parentReferences,
                              boolean isSettable,
                              java.lang.String category,
                              java.lang.String[] filterFlags)
This creates an instance that uses a resource locator, specifies a category and filter flags, and determines the cell editor from the parent references.

Method Detail

getDefaultId

public static java.lang.String getDefaultId(EStructuralFeature eStructuralFeature)
Returns the feature's default identifier.

Parameters:
eStructuralFeature - the feature to lookup.
Returns:
the feature's default identifier.

getCategory

public java.lang.String getCategory(java.lang.Object object)
This returns the group of properties into which this one should be placed.

Specified by:
getCategory in interface IItemPropertyDescriptor

getDescription

public java.lang.String getDescription(java.lang.Object object)
This returns the description to be displayed in the property sheet when this property is selected.

Specified by:
getDescription in interface IItemPropertyDescriptor

getDisplayName

public java.lang.String getDisplayName(java.lang.Object object)
This returns the name of the property to be displayed in the property sheet.

Specified by:
getDisplayName in interface IItemPropertyDescriptor

getFilterFlags

public java.lang.String[] getFilterFlags(java.lang.Object object)
This returns the flags used as filters in the property sheet.

Specified by:
getFilterFlags in interface IItemPropertyDescriptor

getId

public java.lang.String getId(java.lang.Object object)
This returns the default identifier of the feature if it's present, or dash-separated concatenation of the default identifier of each parent reference. This key that must uniquely identify this descriptor among the other descriptors from the same property source.

Specified by:
getId in interface IItemPropertyDescriptor

getHelpContextIds

public java.lang.Object getHelpContextIds(java.lang.Object object)
Specified by:
getHelpContextIds in interface IItemPropertyDescriptor

getComboBoxObjects

protected java.util.Collection<?> getComboBoxObjects(java.lang.Object object)
This will be called to populate a list of choices. The label provider will be used to determine the labels for the objects this returns. This default implementation uses getReachableObjectsOfType.


getReachableObjectsOfType

public static java.util.Collection<EObject> getReachableObjectsOfType(EObject object,
                                                                      EClassifier type)
This yields all reachable references from object with a meta object which indicates that it is a subtype of type.


collectReachableObjectsOfType

public static void collectReachableObjectsOfType(java.util.Collection<EObject> visited,
                                                 java.util.Collection<EObject> result,
                                                 EObject object,
                                                 EClassifier type)
This will visit all reachable references from object except those in visited; it updates visited and adds to result any object with a meta object that indicates that it is a subtype of type.


getLabelProvider

public IItemLabelProvider getLabelProvider(java.lang.Object object)
This returns the label provider that will be used to render the value of this property. The implementation here just creates an AdapterFactoryItemDelegator.

Specified by:
getLabelProvider in interface IItemPropertyDescriptor

isCompatibleWith

public boolean isCompatibleWith(java.lang.Object object,
                                java.lang.Object anotherObject,
                                IItemPropertyDescriptor anotherItemPropertyDescriptor)
This indicates whether these two property descriptors are equal. It's not really clear to me how this is meant to be used, but it's a little bit like an equals test.

Specified by:
isCompatibleWith in interface IItemPropertyDescriptor

createPropertyValueWrapper

protected java.lang.Object createPropertyValueWrapper(java.lang.Object object,
                                                      java.lang.Object propertyValue)

getDefaultValue

public static java.lang.Object getDefaultValue(EClassifier eType)

getValue

protected java.lang.Object getValue(EObject object,
                                    EStructuralFeature feature)
This is called by getPropertyValue to reflectively obtain the value of a feature from an object. It can be overridden by a subclass to provide additional processing of the value.


getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object object)
This does the delegated job of getting the property value from the given object; and it sets object, which is necessary if getComboBoxObjects is called. It is implemented in a generic way using the structural feature or parent references.

Specified by:
getPropertyValue in interface IItemPropertyDescriptor

isPropertySet

public boolean isPropertySet(java.lang.Object object)
This does the delegated job of determine whether the property value from the given object is set. It is implemented in a generic way using the structural feature.

Specified by:
isPropertySet in interface IItemPropertyDescriptor

canSetProperty

public boolean canSetProperty(java.lang.Object object)
This determines whether this descriptor's property for the object supports set (and reset).

Specified by:
canSetProperty in interface IItemPropertyDescriptor

setCommandOwner

public void setCommandOwner(java.lang.Object commandOwner)
Sets the object to use as the owner of commands created to set the property's value.

Specified by:
setCommandOwner in interface IItemPropertyDescriptor.OverrideableCommandOwner

getCommandOwner

public java.lang.Object getCommandOwner()
Returns the override command owner set via setCommandOwner.

Specified by:
getCommandOwner in interface IItemPropertyDescriptor.OverrideableCommandOwner

getCommandOwner

protected java.lang.Object getCommandOwner(java.lang.Object fallback)
Returns either the override command owner set via setCommandOwner or, if that is null, the fall-back object provided.


resetPropertyValue

public void resetPropertyValue(java.lang.Object object)
This does the delegated job of resetting property value back to it's default value.

Specified by:
resetPropertyValue in interface IItemPropertyDescriptor

getEditingDomain

public EditingDomain getEditingDomain(java.lang.Object object)

setPropertyValue

public void setPropertyValue(java.lang.Object object,
                             java.lang.Object value)
This does the delegated job of setting the property to the given value. It is implemented in a generic way using the structural feature.

Specified by:
setPropertyValue in interface IItemPropertyDescriptor

getFeature

public java.lang.Object getFeature(java.lang.Object object)
Description copied from interface: IItemPropertyDescriptor
Returns the feature.

Specified by:
getFeature in interface IItemPropertyDescriptor

isMany

public boolean isMany(java.lang.Object object)
Returns whether this property represents multiple values. This is true only if we're using a structural feature to provide the values for this property, and if that feature is multi-valued.

Specified by:
isMany in interface IItemPropertyDescriptor

getChoiceOfValues

public java.util.Collection<?> getChoiceOfValues(java.lang.Object object)
Description copied from interface: IItemPropertyDescriptor
Returns the choices of all the values that this property may take one.

Specified by:
getChoiceOfValues in interface IItemPropertyDescriptor

isMultiLine

public boolean isMultiLine(java.lang.Object object)
Description copied from interface: IItemPropertyDescriptor
Returns whether this property's value will consist of multi-line text.

Specified by:
isMultiLine in interface IItemPropertyDescriptor

isSortChoices

public boolean isSortChoices(java.lang.Object object)
Description copied from interface: IItemPropertyDescriptor
Returns whether the choices for this property should be sorted for display.

Specified by:
isSortChoices in interface IItemPropertyDescriptor

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.