## org.eclipse.emf.edit.domain
Interface EditingDomain

All Known Subinterfaces:
  MappingDomain

All Known Implementing Classes:
  AdapterFactoryEditingDomain, AdapterFactoryMappingDomain, Ecore2EcoreEditor.Ecore2EcoreMappingDomain, PluginAdapterFactoryMappingDomain

    public interface EditingDomain

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(java.lang.Class<? extends Command> 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(java.lang.String fileNameURI)` This creates the specified resource in this editing domain's resource set.
`java.util.Collection<?>` `getChildren(java.lang.Object object)` This returns the children of the object.
`java.util.Collection<java.lang.Object>` `getClipboard()` This returns the clipboard of the editing domain.
`CommandStack` `getCommandStack()` This returns a command queue for executing commands.
`java.util.Collection<?>` `getNewChildDescriptors(java.lang.Object object, java.lang.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.
`java.lang.Object` `getParent(java.lang.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.
`java.lang.Object` `getRoot(java.lang.Object object)` This returns the root of the object, i.e., .
`java.util.List<?>` `getTreePath(java.lang.Object object)` This returns a path from the root object to the given object in the tree.
`boolean` `isControllable(java.lang.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(java.lang.String fileNameURI)` This loads the specified resource into this editing domain's resource set.
`void` `setClipboard(java.util.Collection<java.lang.Object> clipboard)` This sets the clipboard of the editing domain.
`TreeIterator<?>` `treeIterator(java.lang.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

    Resource createResource(java.lang.String fileNameURI)

  This creates the specified resource in this editing domain's resource set.

### loadResource

    Resource loadResource(java.lang.String fileNameURI)

  This loads the specified resource into this editing domain's resource set.

### getResourceSet

    ResourceSet getResourceSet()

  This returns the resource set within which all the created and loaded resources reside.

### createCommand

    Command createCommand(java.lang.Class<? extends Command> 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

    Command createOverrideCommand(OverrideableCommand command)

  This creates an override for the given command.

### getCommandStack

    CommandStack getCommandStack()

  This returns a command queue for executing commands.

### getChildren

    java.util.Collection<?> getChildren(java.lang.Object object)

  This returns the children of the object.

### getParent

    java.lang.Object getParent(java.lang.Object object)

  This returns the parent of the object.

### getRoot

    java.lang.Object getRoot(java.lang.Object object)

  This returns the root of the object, i.e., .

### getNewChildDescriptors

    java.util.Collection<?> getNewChildDescriptors(java.lang.Object object,
                                                   java.lang.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

    TreeIterator<?> treeIterator(java.lang.Object object)

  This returns a tree iterator that will yield the object, the children of the object, their children, and so on.

### getTreePath

    java.util.List<?> getTreePath(java.lang.Object object)

  This returns a path from the root object to the given object in the tree.

### getClipboard

    java.util.Collection<java.lang.Object> getClipboard()

  This returns the clipboard of the editing domain.

### setClipboard

    void setClipboard(java.util.Collection<java.lang.Object> clipboard)

  This sets the clipboard of the editing domain.

### getOptimizeCopy

    boolean getOptimizeCopy()

  This returns whether or not copy command optimizations are safe in this domain.

### isReadOnly

    boolean isReadOnly(Resource resource)

  This returns whether the resource is read only in editing domain.

### isControllable

    boolean isControllable(java.lang.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.