|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An editing domain manages a self-contained set of interrelated EMF models and the Command
s that modify them.
The models are maintained in the form of a ResourceSet
.
Commands that modify the model are typically created through the domain and are executed using the CommandStack
.
An optional feature of an editing domain, which is used to implement mapping domains,
is the ability to override primitive commands, see OverrideableCommand
.
The domain imposes a hierarchical structure upon the models
via the results of the getChildren
and getParent
methods.
This is useful for implementing commands such as
RemoveCommand
, which often needs to deduce the parent from which to remove a particular object,
and CopyCommand
, which often needs to deduce all the children to copy recursively.
This also meshes well with user interfaces, which often present a model hierarchically, i.e., as a tree.
Method Summary | |
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. |
Command |
createOverrideCommand(OverrideableCommand command)
This creates an override for the given command. |
Resource |
createResource(String fileNameURI)
This creates the specified resource in this editing domain's resource set. |
Collection |
getChildren(Object object)
This returns the children of the object. |
Collection |
getClipboard()
This returns the clipboard of the editing domain. |
CommandStack |
getCommandStack()
This returns a command queue for executing commands. |
Collection |
getNewChildDescriptors(Object object,
Object sibling)
This returns a collection of objects describing the different children that can be added under the specified object. |
boolean |
getOptimizeCopy()
This returns whether or not copy command optimizations are safe in this domain. |
Object |
getParent(Object object)
This returns the parent of the object. |
ResourceSet |
getResourceSet()
This returns the resource set within which all the created and loaded resources reside. |
Object |
getRoot(Object object)
This returns the root of the object, i.e., . |
List |
getTreePath(Object object)
This returns a path from the root object to the given object in the tree. |
boolean |
isControllable(Object object)
This returns whether or not the domain allows the given object to be moved to a different resource from its container. |
boolean |
isReadOnly(Resource resource)
This returns whether the resource is read only in editing domain. |
Resource |
loadResource(String fileNameURI)
This loads the specified resource into this editing domain's resource set. |
void |
setClipboard(Collection clipboard)
This sets the clipboard of the editing domain. |
TreeIterator |
treeIterator(Object object)
This returns a tree iterator that will yield the object, the children of the object, their children, and so on. |
Method Detail |
public Resource createResource(String fileNameURI)
public Resource loadResource(String fileNameURI)
public ResourceSet getResourceSet()
public Command createCommand(Class commandClass, CommandParameter commandParameter)
public Command createOverrideCommand(OverrideableCommand command)
public CommandStack getCommandStack()
public Collection getChildren(Object object)
public Object getParent(Object object)
public Object getRoot(Object object)
public Collection getNewChildDescriptors(Object object, Object sibling)
public TreeIterator treeIterator(Object object)
public List getTreePath(Object object)
public Collection getClipboard()
public void setClipboard(Collection clipboard)
public boolean getOptimizeCopy()
public boolean isReadOnly(Resource resource)
public boolean isControllable(Object object)
|
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 |