|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.edit.domain.AdapterFactoryEditingDomain
org.eclipse.emf.mapping.domain.AdapterFactoryMappingDomain
This class implements MappingDomain
interface using two strategies.
The primary strategy is to delegate to an adapter that is produced by a AdapterFactoryMappingDomain.LabelUpdatePropagatingComposedAdapterFactory
that comprises
an adapter factory for the mapping model,
an adapter factory for the top domain,
and an adapter factory for the bottom domain (which may be the same as the one for the top domain).
The secondary strategy is to use table lookup,
which provides an easy way to supply the input/ouput type correspondence information from a plugin configuration file,
when the top and bottom domains are of different type.
Nested Class Summary | |
static class |
AdapterFactoryMappingDomain.EditingDomainProvidingComposedAdapterFactory
|
protected class |
AdapterFactoryMappingDomain.LabelUpdatePropagatingComposedAdapterFactory
|
Nested classes inherited from class org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain |
AdapterFactoryEditingDomain.AdapterFactoryEditingDomainResourceSet, AdapterFactoryEditingDomain.DomainTreeIterator, AdapterFactoryEditingDomain.EditingDomainProvider |
Field Summary | |
protected int |
bottomLabelCase
|
protected List |
bottomLabelLongForms
|
protected char |
bottomLabelSeparator
|
protected List |
bottomLabelShortForms
|
protected HashMap |
bottomToTopTypeTable
|
protected boolean |
isSameEditingDomainAdapterFactory
|
static int |
LABEL_LOWER
|
static int |
LABEL_MIXED
|
static char |
LABEL_NO_SEPARATOR
|
static int |
LABEL_UPPER
|
protected int |
mappingEnablementFlags
|
protected MappingRoot |
mappingRoot
|
protected char |
packageTypeSeparator
|
protected PersistentCommandStack |
persistentCommandStack
|
protected int |
topLabelCase
|
protected List |
topLabelLongForms
|
protected char |
topLabelSeparator
|
protected List |
topLabelShortForms
|
protected HashMap |
topToBottomTypeTable
|
Fields inherited from class org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain |
adapterFactory, clipboard, commandStack, optimizeCopy, resourceSet, resourceToReadOnlyMap |
Fields inherited from interface org.eclipse.emf.mapping.domain.MappingDomain |
ENABLE_ALL, ENABLE_EMPTY_INPUTS, ENABLE_EMPTY_OUTPUTS, ENABLE_INCOMPATIBLE_METAOBJECTS, ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS, ENABLE_MULTIPLE_INPUT_MAPPINGS, ENABLE_MULTIPLE_INPUTS, ENABLE_MULTIPLE_OUTPUT_MAPPINGS, ENABLE_MULTIPLE_OUTPUTS, ENABLE_UNMAPPED_PARENTS |
Constructor Summary | |
AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory,
AdapterFactory topDomainAdapterFactory,
AdapterFactory bottomDomainAdapterFactory,
CommandStack commandStack)
|
|
AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory,
AdapterFactory topDomainAdapterFactory,
AdapterFactory bottomDomainAdapterFactory,
CommandStack commandStack,
ResourceSet resourceSet)
|
|
AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory,
AdapterFactory editingDomainAdapterFactory,
CommandStack commandStack)
|
|
AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory,
AdapterFactory editingDomainAdapterFactory,
CommandStack commandStack,
ResourceSet resourceSet)
|
Method Summary | |
protected String |
change(String in,
String oldPat,
String newPat)
|
protected String |
convertCase(String sourceName,
int sourceCase,
int targetCase,
char sourceSeparator)
|
protected String |
convertName(String sourceName,
char sourceSeparator,
int sourceCase,
List sourceShortForms,
List sourceLongForms,
char targetSeparator,
int targetCase,
List targetShortForms,
List targetLongForms)
|
protected String |
convertNameForm(String name,
List fromStrings,
List toStrings)
|
protected String |
convertSeparator(String sourceName,
char sourceSeparator,
char targetSeparator,
int sourceCase)
|
protected Command |
createAddOverrideCommand(AddCommand addCommand)
|
Command |
createCommand(Class commandClass,
CommandParameter commandParameter)
This creates a command of the type of the specified by the command class and acting upon the information specified in the given command parameter. |
protected ComposedAdapterFactory |
createComposedAdapterFactory(AdapterFactory[] adapterFactories)
|
protected ComposedAdapterFactory |
createComposedAdapterFactory(AdapterFactory mappingDomainAdapterFactory,
AdapterFactory topDomainAdapterFactory,
AdapterFactory bottomDomainAdapterFactory)
|
protected Command |
createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand)
|
protected Command |
createCreateCopyOverrideCommand(CreateCopyCommand createCopyCommand)
|
protected Command |
createDragAndDropOverrideCommand(DragAndDropCommand dragAndDropCommand)
|
protected Command |
createInitializeCopyOverrideCommand(InitializeCopyCommand initializeCopyCommand)
|
protected Command |
createMoveOverrideCommand(MoveCommand moveCommand)
|
Command |
createOverrideCommand(OverrideableCommand command)
This creates an override for the given command. |
protected Command |
createPasteFromClipboardOverrideCommand(PasteFromClipboardCommand pasteFromClipboardCommand)
|
protected Command |
createRemoveOverrideCommand(RemoveCommand removeCommand)
|
protected Command |
createReplaceOverrideCommand(ReplaceCommand replaceCommand)
|
protected Command |
createSetOverrideCommand(SetCommand setCommand)
|
protected EObject |
getCorrespondingType(EObject sourceType,
HashMap typeTable)
|
int |
getMappingEnablementFlags()
This returns a set of flags that control enablement of mapping creation and removal commands for this domain. |
MappingRoot |
getMappingRoot()
This returns the mapping root for this domain. |
String |
getName(Object object)
This returns the name of the object. |
EObject |
getOutputMetaObject(EObject inputMetaObject)
This returns the output meta object corresponding to the given input meta object. |
String |
getOutputName(String inputName)
This returns the corresponding output name for the given input name. |
Object |
getOutputTypeClassifier(Object inputType)
This returns the corresponding type classifier for the given input type classifier. |
Object |
getTypeClassifier(Object mappedObject)
This default implementation returns null or the ETypedElement if the object is an ETypedElement . |
void |
handleCreateCommand(Class commandClass,
CommandParameter commandParameter,
Command command)
This is called for every command created by the domain. |
List |
parseInputName(String inputName)
This returns the list of words (substrings) in the specified input name. |
protected List |
parseName(String sourceName,
char sourceSeparator)
|
List |
parseOutputName(String outputName)
This returns the list of words (substrings) in the specified output name. |
void |
setMappingEnablementFlags(int mappingEnablementFlags)
|
void |
setMappingRoot(MappingRoot mappingRoot)
This sets the mapping root for this domain to use. |
void |
setName(Object object,
String name)
This sets the name of the object. |
void |
setTypeClassifier(Object mappedObject,
Object typeClassifier)
This default implementation sets the ETypedElement if the object is an ETypedElement . |
Methods inherited from class org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain |
createResource, getAdapterFactory, getChildren, getClipboard, getCommandStack, getEditingDomainFor, getEditingDomainFor, getEditingDomainItemProviderFor, getNewChildDescriptors, getOptimizeCopy, getParent, getResourceSet, getResourceToReadOnlyMap, getRoot, getTreePath, getWrapper, isControllable, isControlled, isReadOnly, isReadOnlyURI, loadResource, setAdapterFactory, setClipboard, setOptimizeCopy, setResourceToReadOnlyMap, treeIterator, unwrap |
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.domain.EditingDomain |
createResource, getChildren, getClipboard, getCommandStack, getNewChildDescriptors, getOptimizeCopy, getParent, getResourceSet, getRoot, getTreePath, isControllable, isReadOnly, loadResource, setClipboard, treeIterator |
Field Detail |
public static final int LABEL_UPPER
public static final int LABEL_LOWER
public static final int LABEL_MIXED
public static final char LABEL_NO_SEPARATOR
protected HashMap topToBottomTypeTable
protected HashMap bottomToTopTypeTable
protected char topLabelSeparator
protected char bottomLabelSeparator
protected int topLabelCase
protected int bottomLabelCase
protected List topLabelLongForms
protected List bottomLabelLongForms
protected List topLabelShortForms
protected List bottomLabelShortForms
protected char packageTypeSeparator
protected MappingRoot mappingRoot
protected boolean isSameEditingDomainAdapterFactory
protected PersistentCommandStack persistentCommandStack
protected int mappingEnablementFlags
Constructor Detail |
public AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory, AdapterFactory editingDomainAdapterFactory, CommandStack commandStack)
public AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory, AdapterFactory editingDomainAdapterFactory, CommandStack commandStack, ResourceSet resourceSet)
public AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory, AdapterFactory topDomainAdapterFactory, AdapterFactory bottomDomainAdapterFactory, CommandStack commandStack)
public AdapterFactoryMappingDomain(AdapterFactory mappingDomainAdapterFactory, AdapterFactory topDomainAdapterFactory, AdapterFactory bottomDomainAdapterFactory, CommandStack commandStack, ResourceSet resourceSet)
Method Detail |
protected ComposedAdapterFactory createComposedAdapterFactory(AdapterFactory mappingDomainAdapterFactory, AdapterFactory topDomainAdapterFactory, AdapterFactory bottomDomainAdapterFactory)
protected ComposedAdapterFactory createComposedAdapterFactory(AdapterFactory[] adapterFactories)
public String getOutputName(String inputName)
MappingDomain
getOutputName
in interface MappingDomain
public List parseOutputName(String outputName)
MappingDomain
parseOutputName
in interface MappingDomain
public List parseInputName(String inputName)
MappingDomain
parseInputName
in interface MappingDomain
public String getName(Object object)
MappingDomain
getName
in interface MappingDomain
public void setName(Object object, String name)
MappingDomain
setName
in interface MappingDomain
public EObject getOutputMetaObject(EObject inputMetaObject)
MappingDomain
getOutputMetaObject
in interface MappingDomain
public MappingRoot getMappingRoot()
MappingDomain
getMappingRoot
in interface MappingDomain
public void setMappingRoot(MappingRoot mappingRoot)
MappingDomain
setMappingRoot
in interface MappingDomain
public Object getTypeClassifier(Object mappedObject)
ETypedElement
if the object is an ETypedElement
.
getTypeClassifier
in interface MappingDomain
public void setTypeClassifier(Object mappedObject, Object typeClassifier)
ETypedElement
if the object is an ETypedElement
.
setTypeClassifier
in interface MappingDomain
public Object getOutputTypeClassifier(Object inputType)
MappingDomain
getOutputTypeClassifier
in interface MappingDomain
public int getMappingEnablementFlags()
MappingDomain
getMappingEnablementFlags
in interface MappingDomain
public void setMappingEnablementFlags(int mappingEnablementFlags)
public void handleCreateCommand(Class commandClass, CommandParameter commandParameter, Command command)
public Command createCommand(Class commandClass, CommandParameter commandParameter)
EditingDomain
createCommand
in interface EditingDomain
createCommand
in class AdapterFactoryEditingDomain
public Command createOverrideCommand(OverrideableCommand command)
EditingDomain
createOverrideCommand
in interface EditingDomain
createOverrideCommand
in class AdapterFactoryEditingDomain
protected Command createAddOverrideCommand(AddCommand addCommand)
protected Command createRemoveOverrideCommand(RemoveCommand removeCommand)
protected Command createSetOverrideCommand(SetCommand setCommand)
protected Command createMoveOverrideCommand(MoveCommand moveCommand)
protected Command createReplaceOverrideCommand(ReplaceCommand replaceCommand)
protected Command createCreateCopyOverrideCommand(CreateCopyCommand createCopyCommand)
protected Command createInitializeCopyOverrideCommand(InitializeCopyCommand initializeCopyCommand)
protected Command createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand)
protected Command createPasteFromClipboardOverrideCommand(PasteFromClipboardCommand pasteFromClipboardCommand)
protected Command createDragAndDropOverrideCommand(DragAndDropCommand dragAndDropCommand)
protected EObject getCorrespondingType(EObject sourceType, HashMap typeTable)
protected List parseName(String sourceName, char sourceSeparator)
protected String convertName(String sourceName, char sourceSeparator, int sourceCase, List sourceShortForms, List sourceLongForms, char targetSeparator, int targetCase, List targetShortForms, List targetLongForms)
protected String convertCase(String sourceName, int sourceCase, int targetCase, char sourceSeparator)
protected String convertSeparator(String sourceName, char sourceSeparator, char targetSeparator, int sourceCase)
protected String convertNameForm(String name, List fromStrings, List toStrings)
protected String change(String in, String oldPat, String newPat)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |