EGF Engine
Release 0.1.0

org.eclipse.egf.core.ui.workbench.action.navigator
Class AbstractNavigatorAction

java.lang.Object
  extended by Action
      extended by org.eclipse.egf.core.ui.workbench.action.navigator.AbstractNavigatorAction
Direct Known Subclasses:
AbstractModelElementAction

public abstract class AbstractNavigatorAction
extends Action

Base class to implement action located in the context menu of a tree viewer based on the CommonNavigator.


Constructor Summary
protected AbstractNavigatorAction(ISelectionProvider selectionProvider_p)
          Constructor..
protected AbstractNavigatorAction(Shell shell_p, ISelectionProvider selectionProvider_p)
          Constructor.
 
Method Summary
protected abstract  Class<?> getModelElementClass()
          Get the model element class for which this action is enabled for.
protected  Object getSelection(Class<?> objectType_p)
          Get the current selected object
protected  ISelectionProvider getSelectionProvider()
          Get the selection provider.
protected  ISharedImages getSharedImages()
          Get the shared images.
protected  Shell getShell()
          Get the shell
 boolean isSelectionCompatible()
          Returns whether this action is compatible with current selection.
protected abstract  void setSelectedElement(Object object_p)
          Set given object as the selected object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNavigatorAction

protected AbstractNavigatorAction(ISelectionProvider selectionProvider_p)
Constructor..

Parameters:
selectionProvider_p -

AbstractNavigatorAction

protected AbstractNavigatorAction(Shell shell_p,
                                  ISelectionProvider selectionProvider_p)
Constructor.

Parameters:
shell_p -
selectionProvider_p -
Method Detail

getSelection

protected Object getSelection(Class<?> objectType_p)
Get the current selected object

Parameters:
objectType_p - the object type that the selection must be an instance of

getShell

protected Shell getShell()
Get the shell

Returns:
the shell or null if not set with the constructor.

isSelectionCompatible

public boolean isSelectionCompatible()
Returns whether this action is compatible with current selection.

Returns:

getModelElementClass

protected abstract Class<?> getModelElementClass()
Get the model element class for which this action is enabled for.

Returns:

setSelectedElement

protected abstract void setSelectedElement(Object object_p)
Set given object as the selected object.

Parameters:
object_p -

getSharedImages

protected ISharedImages getSharedImages()
Get the shared images.

Returns:

getSelectionProvider

protected ISelectionProvider getSelectionProvider()
Get the selection provider.

Returns:
the provider

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.