| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.edit.command.DragAndDropCommand
The drag and drop command logically acts upon an owner object onto which a collection of things is being dragged. The static create method delegates command creation to EditingDomain.createCommand, which may or may not result in the actual creation of an instance of this class.
The implementation of this class is high-level and generic; it ultimately delegates all behaviour to other types of command, and is typically undoable as a result.
Nested Class Summary | |
static class | DragAndDropCommand.Detail
This class is used to encode the drag and drop arguments into an object that will be passed as the feature of a CommandParameter. |
Nested classes inherited from class org.eclipse.emf.common.command.AbstractCommand |
AbstractCommand.NonDirtying |
Field Summary | |
protected Collection | collection
This keeps track of the collection of dragged sources. |
protected static String | DESCRIPTION
This caches the description. |
protected EditingDomain | domain
This keeps track of the domain in which this command is created. |
protected Command | dragCommand
This keeps track of the command that implements the drag side of the operation. |
protected Command | dropCommand
This keeps track of the command that implements the drop side of the operation. |
protected int | feedback
This keeps track of the feedback that will be returned by getFeedback(). |
protected boolean | isDragCommandExecuted
This keeps track of whether execute has been called on the dragCommand. |
protected static String | LABEL
This caches the label. |
protected float | location
This keeps track of the location of the drag and drop. |
protected float | lowerLocationBound
This keeps track of the lower range of locations in which the effect of this command remains unchanged. |
protected int | operation
This keeps track of the current operation that will be returned by getOperation(). |
protected int | operations
This keeps track of the permitted operations. |
protected boolean | optimize
This controls whether or not to optimize the prepare(). |
protected Object | optimizedDropCommandOwner
This is to remember which owner to use for the drop command in the optimized mode. |
protected Object | owner
This keeps track of the owner that is the target of the drag and drop. |
protected float | upperLocationBound
This keeps track of the upper range of locations in which the effect of this command remains unchanged. |
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand |
description, isExecutable, isPrepared, label |
Fields inherited from interface org.eclipse.emf.edit.command.DragAndDropFeedback |
DROP_COPY, DROP_LINK, DROP_MOVE, DROP_NONE, FEEDBACK_INSERT_AFTER, FEEDBACK_INSERT_BEFORE, FEEDBACK_NONE, FEEDBACK_SELECT |
Constructor Summary | |
DragAndDropCommand(EditingDomain domain,
Object owner,
float location,
int operations,
int operation,
Collection collection)
This creates and instance in the given domain and for the given information. | |
DragAndDropCommand(EditingDomain domain,
Object owner,
float location,
int operations,
int operation,
Collection collection,
boolean optimize)
|
Method Summary | |
protected boolean | analyzeForNonContainment(Command command)
|
static Command | create(EditingDomain domain,
Object owner,
float location,
int operations,
int operation,
Collection collection)
This creates a command to perform a drag and drop operation upon the owner. |
void | dispose()
Called to indicate that the command will never be used again. |
void | execute()
Performs the command activity required for the effect. |
Collection | getAffectedObjects()
Returns an empty list. |
protected Collection | getChildren(Object object)
This can be overriden to determine the children of an object; this implementation uses EditingDomain.getChildren(java.lang.Object). |
Collection | getCollection()
|
int | getFeedback()
This returns one of the FEEDBACK_* values. |
float | getLocation()
|
int | getOperation()
This returns one of the DROP_* values. |
int | getOperations()
|
Object | getOwner()
|
protected Object | getParent(Object object)
This can be overriden to determine the parent of an object; this implementation uses EditingDomain.getParent(java.lang.Object). |
Collection | getResult()
Returns an empty list. |
protected boolean | isCrossDomain()
|
protected boolean | isNonContainment(EStructuralFeature feature)
|
protected boolean | optimizedCanExecute()
|
protected boolean | prepare()
This implementation of prepare is called again to implement validate. |
protected boolean | prepareDropCopyInsert(Object parent,
Collection children,
int index)
This attempts to prepare a drop copy insert operation. |
protected boolean | prepareDropCopyOn()
This attempts to prepare a drop copy on operation. |
protected boolean | prepareDropInsert()
This attempts to prepare a drop insert operation. |
protected boolean | prepareDropLinkInsert(Object parent,
Collection children,
int index)
This attempts to prepare a drop link insert operation. |
protected boolean | prepareDropLinkOn()
This attempts to prepare a drop link on operation. |
protected boolean | prepareDropMoveInsert(Object parent,
Collection children,
int index)
This attempts to prepare a drop move insert operation. |
protected boolean | prepareDropMoveOn()
This attempts to prepare a drop move on operation. |
protected boolean | prepareDropOn()
This attempts to prepare a drop on operation. |
void | redo()
Performs the command activity required to redo the effect after undoing the effect. |
protected void | reset()
This restores the command to its default initialized state, disposing an command that may have been contained. |
String | toString()
This gives an abbreviated name using this object's own class' name, without package qualification, followed by a space separated list of field:value pairs. |
void | undo()
Throws a runtime exception. |
boolean | validate(Object owner,
float location,
int operations,
int operation,
Collection collection)
This is called by EditingDomainViewerDropAdapter to determine if the drag and drop operation is still enabled. |
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand |
canExecute, canUndo, chain, getDescription, getLabel, setDescription, setLabel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final String LABEL
protected static final String DESCRIPTION
protected EditingDomain domain
protected Object owner
protected float location
protected float lowerLocationBound
protected float upperLocationBound
protected int operations
protected int operation
protected int feedback
protected Collection collection
protected Command dragCommand
protected boolean isDragCommandExecuted
protected Command dropCommand
protected boolean optimize
protected Object optimizedDropCommandOwner
Constructor Detail |
public DragAndDropCommand(EditingDomain domain, Object owner, float location, int operations, int operation, Collection collection)
public DragAndDropCommand(EditingDomain domain, Object owner, float location, int operations, int operation, Collection collection, boolean optimize)
Method Detail |
public static Command create(EditingDomain domain, Object owner, float location, int operations, int operation, Collection collection)
protected boolean analyzeForNonContainment(Command command)
protected boolean isNonContainment(EStructuralFeature feature)
public Object getOwner()
public float getLocation()
public int getOperations()
public Collection getCollection()
protected boolean prepare()
protected Object getParent(Object object)
protected Collection getChildren(Object object)
protected boolean prepareDropInsert()
protected boolean prepareDropMoveInsert(Object parent, Collection children, int index)
protected boolean isCrossDomain()
protected boolean prepareDropCopyInsert(Object parent, Collection children, int index)
protected boolean prepareDropLinkInsert(Object parent, Collection children, int index)
protected boolean prepareDropOn()
protected boolean prepareDropMoveOn()
protected boolean prepareDropCopyOn()
protected boolean prepareDropLinkOn()
protected boolean optimizedCanExecute()
protected void reset()
public boolean validate(Object owner, float location, int operations, int operation, Collection collection)
public int getFeedback()
public int getOperation()
public void execute()
public void undo()
public void redo()
public void dispose()
public Collection getResult()
public Collection getAffectedObjects()
public String toString()
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |