|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.edit.domain.AdapterFactoryEditingDomain
public class AdapterFactoryEditingDomain
This class implements an editing domain by delegating to adapters that implement
IEditingDomainItemProvider
.
Nested Class Summary | |
---|---|
protected class |
AdapterFactoryEditingDomain.AdapterFactoryEditingDomainResourceSet
This is an implementation of a context that knows about this editing domain. |
static class |
AdapterFactoryEditingDomain.DomainTreeIterator<E>
This implements an tree iterator that iterates over an object, it's domain children, their domain children, and so on. |
static class |
AdapterFactoryEditingDomain.EditingDomainProvider
This class is an adapter than implements IEditingDomainProvider . |
Field Summary | |
---|---|
protected AdapterFactory |
adapterFactory
This is the adapter factory used to create the adapter to which calls are delegated. |
protected java.util.Collection<java.lang.Object> |
clipboard
This is the current clipboard. |
protected CommandStack |
commandStack
This is the command stack that was passed into the constructor. |
protected boolean |
optimizeCopy
This controls whether or not copy command optimizations are safe in this domain. |
protected ResourceSet |
resourceSet
This is the resource set used to contain all created and loaded resources. |
protected java.util.Map<Resource,java.lang.Boolean> |
resourceToReadOnlyMap
This controls whether the domain is read only. |
Constructor Summary | |
---|---|
AdapterFactoryEditingDomain(AdapterFactory adapterFactory,
CommandStack commandStack)
Create an instance from the adapter factory, and the specialized command stack. |
|
AdapterFactoryEditingDomain(AdapterFactory adapterFactory,
CommandStack commandStack,
java.util.Map<Resource,java.lang.Boolean> resourceToReadOnlyMap)
Create an instance from the adapter factory, the specialized command stack, and the map used to maintain read only state. |
|
AdapterFactoryEditingDomain(AdapterFactory adapterFactory,
CommandStack commandStack,
ResourceSet resourceSet)
Create an instance from the adapter factory, the specialized command stack, and the specialized resource set. |
Method Summary | |
---|---|
Command |
createCommand(java.lang.Class<? extends Command> commandClass,
CommandParameter commandParameter)
This delegates to IEditingDomainItemProvider.createCommand . |
Command |
createOverrideCommand(OverrideableCommand command)
This just returns null, since this is an optional feature that we don't support here. |
Resource |
createResource(java.lang.String fileNameURI)
This is a convenience method to create a resource, you could use the resource set returned by getResourceSet() directly. |
AdapterFactory |
getAdapterFactory()
This returns the adapter factory used by this domain. |
java.util.Collection<?> |
getChildren(java.lang.Object object)
This delegates to IEditingDomainItemProvider.getChildren . |
java.util.Collection<java.lang.Object> |
getClipboard()
This returns the clipboard of the editing domain. |
CommandStack |
getCommandStack()
This returns the command stack provided in the constructor. |
static EditingDomain |
getEditingDomainFor(EObject object)
This returns the editing domain of the given EMF object, or null, if it can't be determined. |
static EditingDomain |
getEditingDomainFor(java.lang.Object object)
This returns the editing domain for the given arbitrary object, or null, if it can't be determined. |
static IEditingDomainItemProvider |
getEditingDomainItemProviderFor(java.lang.Object object)
This is a convenient way to determine the adapter to which editing domain methods are delegated for a given object, by providing nothing more than the object itself. |
java.util.Collection<?> |
getNewChildDescriptors(java.lang.Object object,
java.lang.Object sibling)
This delegates to IEditingDomainItemProvider.getNewChildDescriptors . |
boolean |
getOptimizeCopy()
This returns whether or not copy command optimizations are safe in this domain. |
java.lang.Object |
getParent(java.lang.Object object)
This delegates to IEditingDomainItemProvider.getParent . |
ResourceSet |
getResourceSet()
This returns the resource set used to contain all created and loaded resources. |
java.util.Map<Resource,java.lang.Boolean> |
getResourceToReadOnlyMap()
Returns the map of resource to a Boolean value indicating whether the resource is read only. |
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 list from the root object to the given object in the tree. |
java.lang.Object |
getWrapper(java.lang.Object object)
|
static java.lang.Object |
getWrapper(java.lang.Object object,
EditingDomain domain)
Determine a wrapper associated with the given object in the given editing domain. |
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. |
static boolean |
isControlled(java.lang.Object object)
This returns whether or not an object has been moved to a different resource from its container. |
boolean |
isReadOnly(Resource resource)
This returns whether the resource is read only. |
protected boolean |
isReadOnlyURI(URI uri)
Deprecated. this method is no longer called by isReadOnly(Resource) |
static boolean |
isStale(java.lang.Object object)
Returns whether the object is, contains, or wraps something that likely represents a stale unloaded object . |
Resource |
loadResource(java.lang.String fileNameURI)
This is a convenience method to load a resource, you could use the resource set returned by getResourceSet() directly. |
java.util.List<?> |
resolve(java.util.Collection<?> objects)
Each isStale(Object) in the list is unwrapped,
resolved ,
and rewrapped before it's added to the result;
Other objects are passed through unchecked. |
void |
setAdapterFactory(AdapterFactory adapterFactory)
This sets the adapter factory after the domain is already created. |
void |
setClipboard(java.util.Collection<java.lang.Object> clipboard)
This sets the clipboard of the editing domain. |
void |
setOptimizeCopy(boolean optimizeCopy)
This sets whether or not copy command optimizations are safe in this domain. |
void |
setResourceToReadOnlyMap(java.util.Map<Resource,java.lang.Boolean> resourceToReadOnlyMap)
Set the map of resource to a Boolean value indicating whether the resource is read only. |
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. |
static java.lang.Object |
unwrap(java.lang.Object object)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AdapterFactory adapterFactory
protected CommandStack commandStack
protected ResourceSet resourceSet
protected java.util.Collection<java.lang.Object> clipboard
protected boolean optimizeCopy
protected java.util.Map<Resource,java.lang.Boolean> resourceToReadOnlyMap
Constructor Detail |
---|
public AdapterFactoryEditingDomain(AdapterFactory adapterFactory, CommandStack commandStack)
public AdapterFactoryEditingDomain(AdapterFactory adapterFactory, CommandStack commandStack, java.util.Map<Resource,java.lang.Boolean> resourceToReadOnlyMap)
public AdapterFactoryEditingDomain(AdapterFactory adapterFactory, CommandStack commandStack, ResourceSet resourceSet)
IEditingDomainProvider
.
Method Detail |
---|
public static boolean isStale(java.lang.Object object)
unloaded
object
.
It's best to stop using unloaded objects entirely because they ought to be garbage collected
and should be replaced by their resolved
result.
public static EditingDomain getEditingDomainFor(EObject object)
ResourceSet
of the object
implements IEditingDomainProvider
and returns that result or null.
Just as for getEditingDomainFor(Object)
,
it is recommended that you always keep an editing domain instance available through some other means.
public static EditingDomain getEditingDomainFor(java.lang.Object object)
IEditingDomainProvider
and returns that result.
Otherwise it checks if it is valid to call
getEditingDomainFor(EObject)
and returns that result or null.
It is recommended that you always keep an editing domain instance available through some other means; this should only be used to implement things such as a global popup action for some object; in such a cases such as that the editing domain returned here may well be one that belongs to some editor you know nothing about, which is what you want.
public static IEditingDomainItemProvider getEditingDomainItemProviderFor(java.lang.Object object)
getEditingDomainFor(Object)
and to return the adapter returned from the domain's adapter factory.
If the object itself is an IEditingDomainItemProvider, it returns the object.
Otherwise, it returns null.
public AdapterFactory getAdapterFactory()
public void setAdapterFactory(AdapterFactory adapterFactory)
public Resource createResource(java.lang.String fileNameURI)
getResourceSet()
directly.
createResource
in interface EditingDomain
public Resource loadResource(java.lang.String fileNameURI)
getResourceSet()
directly.
loadResource
in interface EditingDomain
public ResourceSet getResourceSet()
getResourceSet
in interface EditingDomain
public Command createCommand(java.lang.Class<? extends Command> commandClass, CommandParameter commandParameter)
IEditingDomainItemProvider.createCommand
.
createCommand
in interface EditingDomain
public Command createOverrideCommand(OverrideableCommand command)
createOverrideCommand
in interface EditingDomain
public CommandStack getCommandStack()
getCommandStack
in interface EditingDomain
public java.util.Collection<?> getChildren(java.lang.Object object)
IEditingDomainItemProvider.getChildren
.
getChildren
in interface EditingDomain
public java.lang.Object getParent(java.lang.Object object)
IEditingDomainItemProvider.getParent
.
getParent
in interface EditingDomain
public java.lang.Object getRoot(java.lang.Object object)
EditingDomain
getRoot
in interface EditingDomain
public java.util.List<?> resolve(java.util.Collection<?> objects)
isStale(Object)
in the list is unwrapped,
resolved
,
and rewrapped before it's added to the result;
Other objects are passed through unchecked.
public java.lang.Object getWrapper(java.lang.Object object)
public static java.lang.Object getWrapper(java.lang.Object object, EditingDomain domain)
object
- the object for which to determine a wrapper.domain
- the domain in which to find the wrapper.
public static java.lang.Object unwrap(java.lang.Object object)
public java.util.Collection<?> getNewChildDescriptors(java.lang.Object object, java.lang.Object sibling)
IEditingDomainItemProvider.getNewChildDescriptors
.
getNewChildDescriptors
in interface EditingDomain
public java.util.Collection<java.lang.Object> getClipboard()
getClipboard
in interface EditingDomain
public void setClipboard(java.util.Collection<java.lang.Object> clipboard)
setClipboard
in interface EditingDomain
public boolean getOptimizeCopy()
getOptimizeCopy
in interface EditingDomain
public void setOptimizeCopy(boolean optimizeCopy)
public java.util.Map<Resource,java.lang.Boolean> getResourceToReadOnlyMap()
public void setResourceToReadOnlyMap(java.util.Map<Resource,java.lang.Boolean> resourceToReadOnlyMap)
public boolean isReadOnly(Resource resource)
isReadOnly
in interface EditingDomain
@Deprecated protected boolean isReadOnlyURI(URI uri)
isReadOnly(Resource)
public TreeIterator<?> treeIterator(java.lang.Object object)
treeIterator
in interface EditingDomain
public java.util.List<?> getTreePath(java.lang.Object object)
getTreePath
in interface EditingDomain
public boolean isControllable(java.lang.Object object)
isControllable
in interface EditingDomain
public static boolean isControlled(java.lang.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 |