| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.edit.provider.WrapperItemProvider
org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider
org.eclipse.emf.edit.provider.FeatureMapEntryWrapperItemProvider
A wrapper for FeatureMap.Entrys. Feature map entry values can be either simple attribute values or model objects, so this wrapper provides behaviours appropriate for both, depending on the type of the entry feature. If it is a reference with a non-null value, an item provider will be obtained for that value, and most methods will delegate to that item provider. Otherwise, simple attribute-value-like implementations generally suffice. This wrapper's text and image values reflect the primary use of feature maps: to represent XML mixed content and choice model groups.
Nested Class Summary |
Nested classes inherited from class org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider |
DelegatingWrapperItemProvider.AffectedObjectsWrappingCommand, DelegatingWrapperItemProvider.AffectedObjectsWrappingCommandActionDelegate |
Nested classes inherited from class org.eclipse.emf.edit.provider.WrapperItemProvider |
WrapperItemProvider.SimpleCopyCommand, WrapperItemProvider.WrappingCopyCommand |
Field Summary | |
protected EAttribute | attribute
The attribute through which the feature map entry can be set and retreived. |
protected int | index
The index within the attribute at which the feature map entry is located. |
Fields inherited from class org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider |
changeNotifier, childrenMap, delegateChildren, delegateItemProvider, propertyDescriptors |
Fields inherited from class org.eclipse.emf.edit.provider.WrapperItemProvider |
adapterFactory, COPY_COMMAND_DESCRIPTION, COPY_COMMAND_LABEL, owner, value |
Constructor Summary | |
FeatureMapEntryWrapperItemProvider(FeatureMap.Entry entry,
EObject owner,
EAttribute attribute,
int index,
AdapterFactory adapterFactory)
Creates an instance for the feature map entry. |
Method Summary | |
protected String | addEntryFeature(String text)
Prepends the entry feature name to the given text and returns the result. |
Command | createCommand(Object object,
EditingDomain domain,
Class commandClass,
CommandParameter commandParameter)
Uses the delegate item provider or the base wrapper implementation to create a command. |
protected Command | createCopyCommand(EditingDomain domain,
Object owner,
CopyCommand.Helper helper)
This is only called for null or attribute values; it returns a WrapperItemProvider.SimpleCopyCommand that copies the wrapper. |
protected String | encode(String s)
Encodes the given string by replacing any occurences of non-printable characters by the corresponding Java escape sequence. |
protected Object | getDelegateValue()
If the entry's feature is a reference, returns its value as the value from which to obtain and which to pass to a delegate item provider. |
Object | getEditableValue(Object object)
Uses the delegate item provider for a reference value or returns the attribute value itself. |
protected EStructuralFeature | getEntryFeature()
Returns the feature of the wrapped feature map entry. |
protected Object | getEntryValue()
Returns the value of the wrapped feature map entry. |
Object | getImage(Object object)
Returns the appropriate image for the entry value: the text property icon for text, CDATA, or comment; the generic property icon for an attribute value; the generic item icon for a null reference value; or the icon returned by the delegate item provider for a non-null reference value. |
int | getIndex()
Returns the index within the attribute at which the feature map entry is located. |
List | getPropertyDescriptors(Object object)
Uses the delegate item provider for a reference value or creates a single property descriptor for an attribute value, calling out to getPropertyName, getPropertyDescription, isPropertySettable, and getPropertyImage. |
protected Object | getPropertyImage()
Calls getPropertyImage to obtain the property image for the entry attribute's type. |
String | getText(Object object)
Returns the appropriate text for the entry value. |
protected boolean | isEntryAttribute()
Returns whether the feature of the wrapped feature map entry is an attribute. |
protected boolean | isPropertySettable()
Returns false, since the property descriptor decorator cannot properly set the feature map entry value. |
void | setIndex(int index)
Sets the index. |
protected Command | wrapCommand(Command command,
Class commandClass)
For a copy command, creates a WrapperItemProvider.WrappingCopyCommand, which copies the feature map entry and wrapper along with the entry value; for other commands, the wrapper-substituting command wrapper supplied by the base implementation is used. |
Methods inherited from class org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider |
addListener, createWrapper, dispose, fireNotifyChanged, getChildren, getElements, getNewChildDescriptors, getRefreshElement, hasChildren, notifyChanged, removeListener, updateChildren, wrapNotification |
Methods inherited from class org.eclipse.emf.edit.provider.WrapperItemProvider |
baseCreateCommand, createDragAndDropCommand, getParent, getPropertyDescription, getPropertyDescriptor, getPropertyImage, getPropertyName, getRootAdapterFactory, getUpdateableText, getValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.edit.provider.ITreeItemContentProvider |
getParent |
Methods inherited from interface org.eclipse.emf.edit.provider.IItemPropertySource |
getPropertyDescriptor |
Methods inherited from interface org.eclipse.emf.edit.provider.IEditingDomainItemProvider |
getParent |
Field Detail |
protected EAttribute attribute
protected int index
Constructor Detail |
public FeatureMapEntryWrapperItemProvider(FeatureMap.Entry entry, EObject owner, EAttribute attribute, int index, AdapterFactory adapterFactory)
Method Detail |
protected Object getEntryValue()
protected EStructuralFeature getEntryFeature()
protected boolean isEntryAttribute()
protected Object getDelegateValue()
public int getIndex()
public void setIndex(int index)
public String getText(Object object)
protected String addEntryFeature(String text)
public Object getImage(Object object)
protected String encode(String s)
public List getPropertyDescriptors(Object object)
public Object getEditableValue(Object object)
protected boolean isPropertySettable()
protected Object getPropertyImage()
public Command createCommand(Object object, EditingDomain domain, Class commandClass, CommandParameter commandParameter)
protected Command wrapCommand(Command command, Class commandClass)
protected Command createCopyCommand(EditingDomain domain, Object owner, CopyCommand.Helper helper)
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |