|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandler
org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
public class DiagramGlobalActionHandler
Class that implements the IGlobalActionHandler
interface.
Contains behaviour common to GMF diagrams.
Constructor Summary | |
---|---|
DiagramGlobalActionHandler()
Constructor for DiagramGlobalActionHandler. |
Method Summary | |
---|---|
protected boolean |
canCopy(IGlobalActionContext cntxt)
Checks if the selected IViews can be copied to the clipboard |
protected boolean |
canCut(IGlobalActionContext cntxt)
Checks if the selected IViews can be cut |
boolean |
canHandle(IGlobalActionContext cntxt)
Return true if the handler can handle the context |
protected boolean |
canPaste(IGlobalActionContext cntxt)
Checks if the paste can occur |
protected boolean |
canSave(IGlobalActionContext cntxt)
Checks if the selected IElements will allow a save. |
protected PasteViewRequest |
createPasteViewRequest()
Creates and returns the appropriate PasteViewRequest that
is to be used to get the appropriate paste Command from
the EditPart . |
ICommand |
getCommand(IGlobalActionContext cntxt)
Return the ICommand for the context |
protected ICommand |
getCopyCommand(IGlobalActionContext cntxt,
IDiagramWorkbenchPart diagramPart,
boolean isUndoable)
Returns a command to copy the context's selection to the clipboard. |
protected ICommand |
getCutCommand(IGlobalActionContext cntxt,
IDiagramWorkbenchPart diagramPart)
Returns a command to copy the context's selection to the clipboard and to delete it. |
protected IMapMode |
getMapMode(IGlobalActionContext cntxt)
Retrieve the IMapMode object from the
DiagramRootEditPart |
protected java.util.List |
getSelectedViews(ISelection sel)
Returns the selected View objects, only if the selection
is an IStructuredSelection . and only the
View object of an INodeEditPart or a
ShapeEditPart |
protected void |
selectAddedObject(EditPartViewer viewer,
java.util.Collection objects)
Select the newly added shape view by default. |
Methods inherited from class org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandler |
---|
getLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiagramGlobalActionHandler()
Method Detail |
---|
public ICommand getCommand(IGlobalActionContext cntxt)
IGlobalActionHandler
cntxt
- The context
protected ICommand getCopyCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart, boolean isUndoable)
cntxt
- the IGlobalActionContext
from which the label
and selection are retrieved.diagramPart
- the IDiagramWorkbenchPart
from which the
diagram is retrieved.isUndoable
- true if this command should be undoable/redoable; false
otherwise
protected ICommand getCutCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart)
cntxt
- the IGlobalActionContext
from which the label
and selection are retrieved.diagramPart
- the IDiagramWorkbenchPart
from which the
diagram is retrieved.
protected PasteViewRequest createPasteViewRequest()
PasteViewRequest
that
is to be used to get the appropriate paste Command
from
the EditPart
. The returned PasteViewRequest
contains data from the clipboard
protected java.util.List getSelectedViews(ISelection sel)
View
objects, only if the selection
is an IStructuredSelection
. and only the
View
object of an INodeEditPart
or a
ShapeEditPart
sel
- the selection from which to extract the View objects
IStructuredSelection
protected boolean canCopy(IGlobalActionContext cntxt)
cntxt
- the IGlobalActionContext
holding the necessary
information needed by this action handler
protected boolean canCut(IGlobalActionContext cntxt)
cntxt
- the IGlobalActionContext
holding the necessary
information needed by this action handler
protected boolean canPaste(IGlobalActionContext cntxt)
cntxt
- the IGlobalActionContext
holding the necessary
information needed by this action handler
protected boolean canSave(IGlobalActionContext cntxt)
cntxt
- the IGlobalActionContext
holding the necessary
information needed by this action handler
public boolean canHandle(IGlobalActionContext cntxt)
IGlobalActionHandler
cntxt
- The context
protected void selectAddedObject(EditPartViewer viewer, java.util.Collection objects)
viewer
- the viewer owning the edit parts to be selectedobjects
- the collection of object from which to extract the
EditPart
to selectprotected IMapMode getMapMode(IGlobalActionContext cntxt)
IMapMode
object from the
DiagramRootEditPart
cntxt
- the IGlobalActionContext
holding the necessary
information needed by this action handler
IMapMode
object that performs coordinate mapping
from device to logical. Returns null if the context isn't valid.
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.