Runtime

org.eclipse.gmf.runtime.diagram.ui.actions
Class AbstractDiagramGlobalActionProxy

java.lang.Object
  extended byorg.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandler
      extended byorg.eclipse.gmf.runtime.diagram.ui.actions.AbstractDiagramGlobalActionProxy
All Implemented Interfaces:
IGlobalActionHandler

public abstract class AbstractDiagramGlobalActionProxy
extends AbstractGlobalActionHandler

Proxy that instantiates the diagram action when necessary and destroys it after use.


Constructor Summary
AbstractDiagramGlobalActionProxy()
           
 
Method Summary
 boolean canHandle(IGlobalActionContext cntxt)
          Return true if the handler can handle the context
 ICommand getCommand(IGlobalActionContext cntxt)
          Return the ICommand for the context
protected abstract  DiagramAction instantiateAction(IGlobalActionContext context)
          Instantiate the DiagramAction.
 
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

AbstractDiagramGlobalActionProxy

public AbstractDiagramGlobalActionProxy()
Method Detail

instantiateAction

protected abstract DiagramAction instantiateAction(IGlobalActionContext context)
Instantiate the DiagramAction. You should call dispose() on the action when done with it. This is particularly important when the action is a selection listener. Subclasses should return an instance of the DiagramAction

Parameters:
context - the IGlobalActionContext holding nevessary context information for the action
Returns:
DiagramAction the newly instantiated action

getCommand

public ICommand getCommand(IGlobalActionContext cntxt)
Description copied from interface: IGlobalActionHandler
Return the ICommand for the context

Parameters:
cntxt - The context
Returns:
ICommand

canHandle

public boolean canHandle(IGlobalActionContext cntxt)
Description copied from interface: IGlobalActionHandler
Return true if the handler can handle the context

Parameters:
cntxt - The context
Returns:
boolean

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.