Overview

 
Package  Use  Tree  Deprecated  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.emf.mapping.provider
Class MappingItemProvider

java.lang.Object
  extended byorg.eclipse.emf.common.notify.impl.AdapterImpl
      extended byorg.eclipse.emf.edit.provider.ItemProviderAdapter
          extended byorg.eclipse.emf.mapping.provider.MappingItemProviderAdapter
              extended byorg.eclipse.emf.mapping.provider.MappingItemProvider

All Implemented Interfaces:
Adapter, CreateChildCommand.Helper, IChangeNotifier, IDisposable, IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider, ResourceLocator

Direct Known Subclasses:
MappingRootItemProvider


public class MappingItemProvider
extends MappingItemProviderAdapter
implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource

This is the item provider adpater for a Mapping object.


Nested Class Summary
static class MappingItemProvider.TypeMappingHelperWrapper
           
 
Nested classes inherited from class org.eclipse.emf.edit.provider.ItemProviderAdapter
ItemProviderAdapter.ChildrenStore, ItemProviderAdapter.ModifiableSingletonEList, ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand, ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommandActionDelegate
 
Field Summary
protected static String DIVIDER
           
protected  ArrayList mappedObjectItemProviderList
           
protected static String SEPARATOR
           
 
Fields inherited from class org.eclipse.emf.edit.provider.ItemProviderAdapter
adapterFactory, changeNotifier, childrenFeatures, childrenReferences, childrenStoreMap, itemPropertyDescriptors, targets, wrappers, wrappingNeeded
 
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
 
Constructor Summary
MappingItemProvider(AdapterFactory adapterFactory)
          This constructs an instance from a factory and a notifier.
 
Method Summary
protected  Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index)
          This creates a primitive AddCommand.
 Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter)
          This does the same thing as EditingDomain.createCommand, i.e., it creates commands for a domain's model objects.
protected  Command createMoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, int index)
          This creates a primitive MoveCommand.
protected  Command createNameMatchMappingCommand(MappingDomain domain, Mapping mapping)
          This creates a primitive NameMatchMappingCommand.
protected  Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection)
          This creates a primitive RemoveCommand.
protected  Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value)
          This creates a primitive SetCommand.
protected  Command createTypeMatchMappingCommand(MappingDomain domain, Mapping mapping)
          This creates a primitive TypeMatchMappingCommand.
static Iterator createValueIterator(Object object)
           
 void dispose()
          This will remove this adapter from all its the targets and dispose any remainging children wrappers in the children store.
protected  Command factorAddCommand(EditingDomain domain, CommandParameter commandParameter)
          This method factors an AddCommand for a collection of objects into one or more primitive add command, i.e., one per unique feature.
protected  EStructuralFeature getChildFeature(Object object, Object child)
          This returns the most appropriate feature of the object into which the given child could be added.
 Collection getChildren(Object object)
          This does the same thing as EditingDomain.getChildren, i.e., it imposes a hierarchical relation on a domain's model objects.
 Collection getChildrenFeatures(Object object)
          This specifies how to implement getChildren(java.lang.Object) and is used to deduce an appropriate feature for an AddCommand, RemoveCommand or MoveCommand in createCommand(java.lang.Object, org.eclipse.emf.edit.domain.EditingDomain, java.lang.Class, org.eclipse.emf.edit.command.CommandParameter).
static Object getImage(MappingRoot mappingRoot, String prefix, Collection collection)
           
static Object getImage(MappingRoot mappingRoot, String prefix, Collection collection, boolean supportNone)
           
 Object getImage(Object object)
          This returns Mapping.gif.
static Object getImage(String prefix, Collection tops, Collection bottoms)
           
static Object getImage(String prefix, Collection tops, Collection bottoms, boolean supportNone)
           
static Object getImage(String prefix, int topsSize, int bottomsSize, boolean supportNone)
           
protected  MappedObjectItemProvider getMappedObjectItemProvider(Mapping mapping, Object mappedObject)
           
 Object getParent(Object object)
          This returns the nestedIn of the Mapping.
 List getPropertyDescriptors(Object object)
          This returns the property descriptors for the adapted class.
 void getPropertyDescriptorsForHelper(Mapping mapping)
           
 ResourceLocator getResourceLocator()
          Return the resource locator for this item provider's resources
 EStructuralFeature getSetFeature(Object object, Object value)
          This returns the most appropriate feature of the object into which the value be set.
static String getText(MappingRoot mappingRoot, AdapterFactory adapterFactory, Collection collection)
           
static String getText(MappingRoot mappingRoot, AdapterFactory adapterFactory, Collection inputs, Collection outputs)
           
static String getText(MappingRoot mappingRoot, AdapterFactory adapterFactory, Collection inputs, Collection outputs, String objectSeparator, String divider)
           
static String getText(MappingRoot mappingRoot, AdapterFactory adapterFactory, Collection collection, String pathSeparator)
           
static String getText(MappingRoot mappingRoot, AdapterFactory adapterFactory, Collection collection, String pathSeparator, String objectSeparator, String divider)
           
 String getText(Object object)
          This does the same thing as ILabelProvider.getlText, it fetches the label text specific to this object instance.
 boolean hasChildren(Object object)
          This does the same thing as ITreeContentProvider.hasChildren.
 void notifyChanged(Notification msg)
          This handles notification by delegating to fireNotifyChanged.
protected  Object substituteMappedObject(Mapping mapping, Object object)
           
protected  Object substituteMappedObjectItemProvider(Mapping mapping, Object object)
           
 
Methods inherited from class org.eclipse.emf.edit.provider.ItemProviderAdapter
addListener, adjustWrapperIndex, adjustWrapperIndices, adjustWrapperIndices, collectNewChildDescriptors, createAddCommand, createChildParameter, createChildrenStore, createCopyCommand, createCreateChildCommand, createCreateChildCommand, createCreateCopyCommand, createDragAndDropCommand, createInitializeCopyCommand, createMoveCommand, createMoveCommand, createRemoveCommand, createReplaceCommand, createReplaceCommand, createSetCommand, createWrapper, disposeWrapper, disposeWrappers, factorMoveCommand, factorRemoveCommand, fireNotifyChanged, getAdapterFactory, getBaseURL, getChildReference, getChildrenReferences, getChildrenStore, getCreateChildDescription, getCreateChildImage, getCreateChildResult, getCreateChildText, getCreateChildToolTipText, getEditableValue, getElements, getFeatureText, getFeatureValue, getImage, getNewChildDescriptors, getPropertyDescriptor, getPropertyValue, getReferenceValue, getResourceLocator, getRootAdapterFactory, getSetFeatures, getString, getString, getString, getString, getTypeText, getUpdateableText, getWrappedValues, isAdapterForType, isEquivalentValue, isPropertySet, isWrappingNeeded, removeListener, resetPropertyValue, setPropertyValue, setTarget, unwrap, unwrapCommandValues, updateChildren, wrap, wrapCommand
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget
 
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.IEditingDomainItemProvider
getNewChildDescriptors
 
Methods inherited from interface org.eclipse.emf.edit.provider.IStructuredItemContentProvider
getElements
 
Methods inherited from interface org.eclipse.emf.edit.provider.IItemPropertySource
getEditableValue, getPropertyDescriptor
 

 

Field Detail

 

 

mappedObjectItemProviderList

protected ArrayList mappedObjectItemProviderList


 

 

DIVIDER

protected static final String DIVIDER


 

 

SEPARATOR

protected static final String SEPARATOR

Constructor Detail

 

 

MappingItemProvider

public MappingItemProvider(AdapterFactory adapterFactory)

This constructs an instance from a factory and a notifier.

Method Detail

 

 

getPropertyDescriptorsForHelper

public void getPropertyDescriptorsForHelper(Mapping mapping)


 

 

getPropertyDescriptors

public List getPropertyDescriptors(Object object)

This returns the property descriptors for the adapted class.

Specified by:
getPropertyDescriptors in interface IItemPropertySource
Overrides:
getPropertyDescriptors in class ItemProviderAdapter


 

 

getChildrenFeatures

public Collection getChildrenFeatures(Object object)

This specifies how to implement getChildren(java.lang.Object) and is used to deduce an appropriate feature for an AddCommand, RemoveCommand or MoveCommand in createCommand(java.lang.Object, org.eclipse.emf.edit.domain.EditingDomain, java.lang.Class, org.eclipse.emf.edit.command.CommandParameter).

Overrides:
getChildrenFeatures in class ItemProviderAdapter


 

 

getChildFeature

protected EStructuralFeature getChildFeature(Object object,
                                             Object child)

Description copied from class: ItemProviderAdapter
This returns the most appropriate feature of the object into which the given child could be added. This default implementation first calls the deprecated getChildReference, for backwards compatibility. If that does not yield a non-null result, it returns the first feature returned by getChildrenFeatures that has a type compatible with the child. You can override this to return a better result or to compute it more efficiently.

Overrides:
getChildFeature in class ItemProviderAdapter


 

 

getSetFeature

public EStructuralFeature getSetFeature(Object object,
                                        Object value)

Description copied from class: ItemProviderAdapter
This returns the most appropriate feature of the object into which the value be set. This default implementation returns the first feature returned by getSetFeatures that has a type compatible with the value. You can override this to return a better result or to compute it more efficiently.

Overrides:
getSetFeature in class ItemProviderAdapter


 

 

getMappedObjectItemProvider

protected MappedObjectItemProvider getMappedObjectItemProvider(Mapping mapping,
                                                               Object mappedObject)


 

 

substituteMappedObjectItemProvider

protected Object substituteMappedObjectItemProvider(Mapping mapping,
                                                    Object object)


 

 

substituteMappedObject

protected Object substituteMappedObject(Mapping mapping,
                                        Object object)


 

 

createValueIterator

public static Iterator createValueIterator(Object object)


 

 

getChildren

public Collection getChildren(Object object)

Description copied from interface: IEditingDomainItemProvider
This does the same thing as EditingDomain.getChildren, i.e., it imposes a hierarchical relation on a domain's model objects.

Specified by:
getChildren in interface IEditingDomainItemProvider
Overrides:
getChildren in class ItemProviderAdapter


 

 

hasChildren

public boolean hasChildren(Object object)

Description copied from interface: ITreeItemContentProvider
This does the same thing as ITreeContentProvider.hasChildren.

Specified by:
hasChildren in interface ITreeItemContentProvider
Overrides:
hasChildren in class ItemProviderAdapter


 

 

getParent

public Object getParent(Object object)

This returns the nestedIn of the Mapping.

Specified by:
getParent in interface IEditingDomainItemProvider
Overrides:
getParent in class ItemProviderAdapter


 

 

getImage

public static Object getImage(MappingRoot mappingRoot,
                              String prefix,
                              Collection collection)


 

 

getImage

public static Object getImage(MappingRoot mappingRoot,
                              String prefix,
                              Collection collection,
                              boolean supportNone)


 

 

getImage

public static Object getImage(String prefix,
                              Collection tops,
                              Collection bottoms)


 

 

getImage

public static Object getImage(String prefix,
                              Collection tops,
                              Collection bottoms,
                              boolean supportNone)


 

 

getImage

public static Object getImage(String prefix,
                              int topsSize,
                              int bottomsSize,
                              boolean supportNone)


 

 

getImage

public Object getImage(Object object)

This returns Mapping.gif.

Specified by:
getImage in interface IItemLabelProvider
Overrides:
getImage in class ItemProviderAdapter


 

 

getText

public static String getText(MappingRoot mappingRoot,
                             AdapterFactory adapterFactory,
                             Collection collection)


 

 

getText

public static String getText(MappingRoot mappingRoot,
                             AdapterFactory adapterFactory,
                             Collection collection,
                             String pathSeparator)


 

 

getText

public static String getText(MappingRoot mappingRoot,
                             AdapterFactory adapterFactory,
                             Collection collection,
                             String pathSeparator,
                             String objectSeparator,
                             String divider)


 

 

getText

public static String getText(MappingRoot mappingRoot,
                             AdapterFactory adapterFactory,
                             Collection inputs,
                             Collection outputs)


 

 

getText

public static String getText(MappingRoot mappingRoot,
                             AdapterFactory adapterFactory,
                             Collection inputs,
                             Collection outputs,
                             String objectSeparator,
                             String divider)


 

 

getText

public String getText(Object object)

Description copied from interface: IItemLabelProvider
This does the same thing as ILabelProvider.getlText, it fetches the label text specific to this object instance.

Specified by:
getText in interface IItemLabelProvider
Overrides:
getText in class ItemProviderAdapter


 

 

notifyChanged

public void notifyChanged(Notification msg)

This handles notification by delegating to fireNotifyChanged.

Specified by:
notifyChanged in interface Adapter
Overrides:
notifyChanged in class AdapterImpl


 

 

createCommand

public Command createCommand(Object object,
                             EditingDomain editingDomain,
                             Class commandClass,
                             CommandParameter commandParameter)

Description copied from interface: IEditingDomainItemProvider
This does the same thing as EditingDomain.createCommand, i.e., it creates commands for a domain's model objects.

Specified by:
createCommand in interface IEditingDomainItemProvider
Overrides:
createCommand in class ItemProviderAdapter


 

 

createNameMatchMappingCommand

protected Command createNameMatchMappingCommand(MappingDomain domain,
                                                Mapping mapping)

This creates a primitive NameMatchMappingCommand.


 

 

createTypeMatchMappingCommand

protected Command createTypeMatchMappingCommand(MappingDomain domain,
                                                Mapping mapping)

This creates a primitive TypeMatchMappingCommand.


 

 

createRemoveCommand

protected Command createRemoveCommand(EditingDomain domain,
                                      EObject owner,
                                      EStructuralFeature feature,
                                      Collection collection)

Description copied from class: ItemProviderAdapter
This creates a primitive RemoveCommand.

Overrides:
createRemoveCommand in class ItemProviderAdapter


 

 

factorAddCommand

protected Command factorAddCommand(EditingDomain domain,
                                   CommandParameter commandParameter)

Description copied from class: ItemProviderAdapter
This method factors an AddCommand for a collection of objects into one or more primitive add command, i.e., one per unique feature.

Overrides:
factorAddCommand in class ItemProviderAdapter


 

 

createAddCommand

protected Command createAddCommand(EditingDomain domain,
                                   EObject owner,
                                   EStructuralFeature feature,
                                   Collection collection,
                                   int index)

Description copied from class: ItemProviderAdapter
This creates a primitive AddCommand.

Overrides:
createAddCommand in class ItemProviderAdapter


 

 

createMoveCommand

protected Command createMoveCommand(EditingDomain domain,
                                    EObject owner,
                                    EStructuralFeature feature,
                                    EObject value,
                                    int index)

This creates a primitive MoveCommand.


 

 

createSetCommand

protected Command createSetCommand(EditingDomain domain,
                                   EObject owner,
                                   EStructuralFeature feature,
                                   Object value)

This creates a primitive SetCommand.

Overrides:
createSetCommand in class ItemProviderAdapter


 

 

dispose

public void dispose()

Description copied from class: ItemProviderAdapter
This will remove this adapter from all its the targets and dispose any remainging children wrappers in the children store.

Specified by:
dispose in interface IDisposable
Overrides:
dispose in class ItemProviderAdapter


 

 

getResourceLocator

public ResourceLocator getResourceLocator()

Return the resource locator for this item provider's resources.

Overrides:
getResourceLocator in class ItemProviderAdapter


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
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