Understanding Action Management

Actions are needed for the independent implementation of specific operations. UI components that are possible users can then, for example, request actions at runtime in connection with a context menu.

Therefore, an intermediary instance is required that informs the surrounding Eclipse framework of the available actions. This is where action providers become involved. They know all existing actions and provide the available actions for any selection context (action context).

With selection context we mean the set of selected elements. Although actions are generally executed on individual elements, not all these actions must be passed to the surrounding framework. The action provider decides which actions for a defined set of elements are passed to the Eclipse framework.

 

Relevant Action Provider Classes/Interfaces

 

 

Package  com.tssap.selena.model.extension.action

 

IElementActionProvider

 

This interface is used to make all existing actions for a selection context available to the Eclipse environment.

 

Methods:

public IElementSingleAction[] getSingleActions(Element element,

Element[] context)

Returns the set of all assigned single actions for an element and a specific selection context.

 

public IElementMultiAction[] getMultiActions(Element[] context)

Returns the set of all assigned multi-element actions for a specific selection context.

 

ElementActionProvider

 

ElementActionProvider is defined as an abstract class and serves as a superclass for all provider classes, whose actions are connected with Selena elements.

This class implements the interfaces ObjectPropertyProvider and IElementActionProvider. The methods getSingleActions and getMultiActions are declared as abstract in ElementActionProvider.

Whenever you write your own action providers for Selena elements, you must implement these two methods.

 

 

 

Package  com.tssap.util.action

 

ObjectActionProvider

 

ObjectActionProvider is defined as an abstract class and serves as a superclass for all provider classes, whose actions are to be associated with any SWT/JFace objects.

The methods getSingleActions and getMultiActions are declared as abstract. Whenever you write your own action providers for SWT/JFace objects, you must implement these two methods.

 

 

 

 

Relationship Between Relevant Classes and Interfaces

All action provider classes that are linked with Selena elements inherit from the abstract class ElementActionProvider. The action classes themselves always implement either the interface IElementSingleAction or IElementSingleAction. The following class diagram lists all the relevant framework classes and interfaces that are involved in the implementation of actions.