org.eclipse.emf.edit.domain
Interface EditingDomain

All Known Subinterfaces:
MappingDomain
All Known Implementing Classes:
AdapterFactoryEditingDomain, AdapterFactoryMappingDomain

public interface EditingDomain

An editing domain manages a self-contained set of interrelated EMF models and the Commands 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

createResource

public Resource createResource(String fileNameURI)
This creates the specified resource in this editing domain's resource set.


loadResource

public Resource loadResource(String fileNameURI)
This loads the specified resource into this editing domain's resource set.


getResourceSet

public ResourceSet getResourceSet()
This returns the resource set within which all the created and loaded resources reside.


createCommand

public 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.


createOverrideCommand

public Command createOverrideCommand(OverrideableCommand command)
This creates an override for the given command.


getCommandStack

public CommandStack getCommandStack()
This returns a command queue for executing commands.


getChildren

public Collection getChildren(Object object)
This returns the children of the object.


getParent

public Object getParent(Object object)
This returns the parent of the object.


getRoot

public Object getRoot(Object object)
This returns the root of the object, i.e., .


getNewChildDescriptors

public Collection getNewChildDescriptors(Object object,
                                         Object sibling)
This returns a collection of objects describing the different children that can be added under the specified object. If a sibling is specified (non-null), the children should be as close to immediately following that sibling as possible.


treeIterator

public TreeIterator treeIterator(Object object)
This returns a tree iterator that will yield the object, the children of the object, their children, and so on.


getTreePath

public List getTreePath(Object object)
This returns a path from the root object to the given object in the tree.


getClipboard

public Collection getClipboard()
This returns the clipboard of the editing domain.


setClipboard

public void setClipboard(Collection clipboard)
This sets the clipboard of the editing domain.


getOptimizeCopy

public boolean getOptimizeCopy()
This returns whether or not copy command optimizations are safe in this domain.


isReadOnly

public boolean isReadOnly(Resource resource)
This returns whether the resource is read only in editing domain.


isControllable

public 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.


Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.