public class TransientItemProvider extends ExtendedItemProviderAdapter implements org.eclipse.emf.edit.provider.IEditingDomainItemProvider, org.eclipse.emf.edit.provider.IStructuredItemContentProvider, org.eclipse.emf.edit.provider.ITreeItemContentProvider, ITreeItemAncestorProvider, org.eclipse.emf.edit.provider.IItemLabelProvider, org.eclipse.emf.edit.provider.IItemPropertySource
adapter
s that can be used to insert non-model view objects
between an object and its children.
Transient item providers must be instantiated statefully wrt their target object, i.e., the same transient item provider instance must not be used for multiple target objects.
Modifier and Type | Class and Description |
---|---|
static class |
TransientItemProvider.AdapterFactoryHelper |
org.eclipse.emf.edit.provider.ItemProviderAdapter.ChildrenStore, org.eclipse.emf.edit.provider.ItemProviderAdapter.ModifiableSingletonEList<E>, org.eclipse.emf.edit.provider.ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand, org.eclipse.emf.edit.provider.ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommandActionDelegate
Constructor and Description |
---|
TransientItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
Standard constructor for creation of transient item provider instances through an
adapter
factory . |
TransientItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory,
org.eclipse.emf.common.notify.Notifier target)
Deprecated.
Use
TransientItemProvider(AdapterFactory) instead. |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.emf.common.command.Command |
createAddCommand(org.eclipse.emf.edit.domain.EditingDomain domain,
org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.util.Collection<?> collection,
int index)
This creates a primitive
AddCommand . |
protected org.eclipse.emf.edit.provider.ItemProviderAdapter.ChildrenStore |
createChildrenStore(java.lang.Object object) |
org.eclipse.emf.common.command.Command |
createCommand(java.lang.Object object,
org.eclipse.emf.edit.domain.EditingDomain domain,
java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass,
org.eclipse.emf.edit.command.CommandParameter commandParameter)
This implements delegated command creation for the given transient item provider and sets its owner to
target . |
protected org.eclipse.emf.common.command.Command |
createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain domain,
org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.util.Collection<?> collection)
This creates a primitive
RemoveCommand . |
protected org.eclipse.emf.common.command.Command |
createWrappedCommand(org.eclipse.emf.common.command.Command command,
org.eclipse.emf.ecore.EObject owner)
This allows creating a command and overriding the
org.eclipse.emf.common.command.CommandWrapper.getAffectedObjects()#getAffectedObjects() method to return the
appropriate transient item provider whenever the real affected object is the owner. |
protected java.lang.Object |
createWrapper(java.lang.Object object,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value,
int index)
Creates and returns a wrapper for the given value, at the given index in the given feature of the given object if
such a wrapper is needed; otherwise, returns the original value.
|
java.util.Collection<?> |
getChildren(java.lang.Object object) |
java.lang.Object |
getImage(java.lang.Object object)
Returns a folder kind of icon as default image for non-model view objects between an object and its children.
|
java.util.Collection<?> |
getNewChildDescriptors(java.lang.Object object,
org.eclipse.emf.edit.domain.EditingDomain editingDomain,
java.lang.Object sibling)
This implements
IEditingDomainItemProvider.getNewChildDescriptors , returning descriptors for all the possible children that can
be added to the specified target . |
java.lang.Object |
getParent(java.lang.Object object)
This sets the parent of the transient item provider to
target value. |
boolean |
isAdapterForType(java.lang.Object type) |
void |
notifyChanged(org.eclipse.emf.common.notify.Notification notification)
Handles model change notifications by calling
ItemProviderAdapter.updateChildren(org.eclipse.emf.common.notify.Notification) to update any cached children and by
creating a viewer notification, which it passes to ItemProviderAdapter.fireNotifyChanged(org.eclipse.emf.common.notify.Notification) to trigger a full or partial
refresh of the underlying viewer. |
void |
setTarget(org.eclipse.emf.common.notify.Notifier target) |
protected java.lang.Object |
wrap(java.lang.Object object,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value,
int index)
Wraps a value, if needed, and keeps the wrapper for disposal along with the item provider.
|
createCreateChildCommand, createItemPropertyDescriptor, createSetCommand, createTreeItemContentProviderHelper, createWrapper, factorAddCommand, factorRemoveCommand, findAncestor, getAncestorPath, getAncestorPath, getChoiceOfValues, getCreateChildImage, getCreateChildText, getCreateChildText, getTraversalHelper, getTreeItemContentProviderHelper, isWrappingNeeded, overlayImage
addListener, adjustWrapperIndex, adjustWrapperIndices, adjustWrapperIndices, collectNewChildDescriptors, createAddCommand, createChildParameter, createCopyCommand, createCreateChildCommand, createCreateCopyCommand, createDragAndDropCommand, createDragAndDropCommand, createInitializeCopyCommand, createItemPropertyDescriptor, createMoveCommand, createMoveCommand, createRemoveCommand, createReplaceCommand, createReplaceCommand, createReplaceCommand, createSetCommand, crop, dispose, disposeWrapper, disposeWrappers, factorMoveCommand, fireNotifyChanged, getAdapterFactory, getBackground, getBackground, getBaseURL, getChildFeature, getChildReference, getChildrenFeatures, getChildrenReferences, getChildrenStore, getColumnImage, getColumnText, getCreateChildDescription, getCreateChildResult, getCreateChildToolTipText, getEditableValue, getElements, getFeatureText, getFeatureValue, getFont, getFont, getForeground, getForeground, getImage, getPropertyDescriptor, getPropertyDescriptors, getPropertyValue, getReferenceValue, getResourceLocator, getResourceLocator, getRootAdapterFactory, getSetFeature, getSetFeatures, getString, getString, getString, getString, getString, getString, getString, getString, getStyledText, getText, getTypeText, getTypeText, getUpdateableText, getValue, getWrappedValues, hasChildren, hasChildren, isEquivalentValue, isPropertySet, isResolveProxies, isValidValue, removeListener, resetPropertyValue, setPropertyValue, shouldComposeCreationImage, shouldTranslate, unsetTarget, unwrap, unwrapCommandValues, updateChildren, wrap, wrapCommand
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElements
findAncestor, getAncestorPath, getAncestorPath
public TransientItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
adapter
factory
.adapterFactory
- The adapter factory which created this transient item provider instance.@Deprecated public TransientItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory, org.eclipse.emf.common.notify.Notifier target)
TransientItemProvider(AdapterFactory)
instead.org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adapt(Notifier, Object))
. Explicitly adds the
freshly created transient item provider to the adapters
of specified
target
object.adapterFactory
- The adapter factory for the target object of the transient item provider to be created.target
- The target object
of the transient item provider to be created.public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
ItemProviderAdapter.updateChildren(org.eclipse.emf.common.notify.Notification)
to update any cached children and by
creating a viewer notification, which it passes to ItemProviderAdapter.fireNotifyChanged(org.eclipse.emf.common.notify.Notification)
to trigger a full or partial
refresh of the underlying viewer.notifyChanged
in interface org.eclipse.emf.common.notify.Adapter
notifyChanged
in class org.eclipse.emf.common.notify.impl.AdapterImpl
public java.util.Collection<?> getChildren(java.lang.Object object)
getChildren
in interface org.eclipse.emf.edit.provider.IEditingDomainItemProvider
getChildren
in interface org.eclipse.emf.edit.provider.ITreeItemContentProvider
getChildren
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
protected org.eclipse.emf.edit.provider.ItemProviderAdapter.ChildrenStore createChildrenStore(java.lang.Object object)
createChildrenStore
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
protected java.lang.Object wrap(java.lang.Object object, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value, int index)
createWrapper
to determine if the given value, at the given index in the given
feature of the given object, should be wrapped and to obtain the wrapper. If a wrapper is obtained, it is
recorded and returned. Otherwise, the original value is returned. Subclasses may override createWrapper
to specify when and with what to wrap values.
This method is very similar to ItemProviderAdapter.wrap(EObject, EStructuralFeature, Object, int)
but accepts and handles
Object
rather than just EObject
object
arguments.
protected java.lang.Object createWrapper(java.lang.Object object, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value, int index)
This method is very similar to ExtendedItemProviderAdapter.createWrapper(EObject, EStructuralFeature, Object, int)
but accepts and
handles Object
rather than just EObject
object
arguments and uses
ExtendedDelegatingWrapperItemProvider
instead of DelegatingWrapperItemProvider
to wrap cross
references.
public java.lang.Object getParent(java.lang.Object object)
target
value. The target instance variable
comes from the adapter base class AdapterImpl
.getParent
in interface org.eclipse.emf.edit.provider.IEditingDomainItemProvider
getParent
in interface org.eclipse.emf.edit.provider.ITreeItemContentProvider
getParent
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
protected org.eclipse.emf.common.command.Command createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, java.util.Collection<?> collection)
RemoveCommand
.createRemoveCommand
in class ExtendedItemProviderAdapter
protected org.eclipse.emf.common.command.Command createAddCommand(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, java.util.Collection<?> collection, int index)
AddCommand
.createAddCommand
in class ExtendedItemProviderAdapter
protected org.eclipse.emf.common.command.Command createWrappedCommand(org.eclipse.emf.common.command.Command command, org.eclipse.emf.ecore.EObject owner)
org.eclipse.emf.common.command.CommandWrapper.getAffectedObjects()#getAffectedObjects()
method to return the
appropriate transient item provider whenever the real affected object is the owner.command
- an command.owner
- the owner of the object.CommandWrapper
public java.util.Collection<?> getNewChildDescriptors(java.lang.Object object, org.eclipse.emf.edit.domain.EditingDomain editingDomain, java.lang.Object sibling)
IEditingDomainItemProvider.getNewChildDescriptors
, returning descriptors for all the possible children that can
be added to the specified target
. The target instance variable comes from the adapter base class
AdapterImpl
.getNewChildDescriptors
in interface org.eclipse.emf.edit.provider.IEditingDomainItemProvider
getNewChildDescriptors
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
public org.eclipse.emf.common.command.Command createCommand(java.lang.Object object, org.eclipse.emf.edit.domain.EditingDomain domain, java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass, org.eclipse.emf.edit.command.CommandParameter commandParameter)
target
.createCommand
in interface org.eclipse.emf.edit.provider.IEditingDomainItemProvider
createCommand
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
public java.lang.Object getImage(java.lang.Object object)
getImage
in interface org.eclipse.emf.edit.provider.IItemLabelProvider
getImage
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
public void setTarget(org.eclipse.emf.common.notify.Notifier target)
setTarget
in interface org.eclipse.emf.common.notify.Adapter
setTarget
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
public boolean isAdapterForType(java.lang.Object type)
isAdapterForType
in interface org.eclipse.emf.common.notify.Adapter
isAdapterForType
in class org.eclipse.emf.edit.provider.ItemProviderAdapter