Global Action Handler Providers Extension Point

org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders

This extension point is used to configure providers for the global action handler service (org.eclipse.gmf.runtime.common.ui.services.action.global.GlobalActionHandlerService).

This service provides an extensible way to handle commonly used (global) actions in different views and editors. These global actions may appear in a view part context menu or may be predefined retargetable actions. The service allows different handlers to be used depending on the nature of the element(s) selected in the workbench part. Each global action handler provider registers itself for actions against a specific element type within a view part.

<!ELEMENT extension (GlobalActionHandlerProvider)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT GlobalActionHandlerProvider (Priority , Policy? , ViewId+)>

<!ATTLIST GlobalActionHandlerProvider

id    CDATA #REQUIRED

class CDATA #REQUIRED>

This element is used to describe a global action handler provider that will contribute handlers to a given view or views for one or more retargetable actions.



<!ELEMENT Priority EMPTY>

<!ATTLIST Priority

name (Lowest|Low|Medium|High|Highest) >

This element is used to specify the priority that this provider has relative to other global action handler providers that are registered to handle the same global action for the kind of element in the same view. When such a conflict occurs, the provider with the highest priority will be selected to provide the global action handler.



<!ELEMENT ViewId (ElementType+)>

<!ATTLIST ViewId

id CDATA #REQUIRED>

This element is used to specify a group of global actions that this provider handles for the specified view and element types.



<!ELEMENT ElementType (GlobalActionId+)>

<!ATTLIST ElementType

class CDATA #IMPLIED>

This element is used to define the set of global actions that are handled by this provider when objects of the specified type are selected.



<!ELEMENT GlobalActionId EMPTY>

<!ATTLIST GlobalActionId

actionId CDATA #REQUIRED>

This element is used to describe a global action that will be handled by this provider.



<!ELEMENT Policy EMPTY>

<!ATTLIST Policy

class CDATA #REQUIRED>

This element is used to optionally specify a policy to use to further determine if this provider should be considered to provide a handler for a global action, given that the view, element type and action ID all match the specified criteria. To delay plugin loading, the recommended strategy for policies is to define them in a separate package and add the package to the Eclipse-LazyStart in the Manifest.MF so that loading the policy class does not load the plug-in.



The following is an example of the global action handler provider extension:
   

<extension id=

"globalActionHandlerProviders"

name=

"%ext.globalActionHandlerProviders"

point=

"org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders"

>

<GlobalActionHandlerProvider class=

"org.eclipse.test.common.ui.views.internal.providers.GlobalActionHandlerProvider"

id=

"ContainerResourceGlobalActionHandlerProvider"

>

<Priority name=

"Lowest"

>

</Priority>

<ViewId id=

"org.eclipse.test.common.ui.views.DiagramNavigator"

>

<ElementType class=

"org.eclipse.test.common.ui.views.internal.providers.ContainerViewerElement"

>

<GlobalActionId actionId=

"open"

>

</GlobalActionId>

<GlobalActionId actionId=

"openProject"

>

</GlobalActionId>

<GlobalActionId actionId=

"rename"

>

</GlobalActionId>

<GlobalActionId actionId=

"delete"

>

</GlobalActionId>

<GlobalActionId actionId=

"move"

>

</GlobalActionId>

<GlobalActionId actionId=

"closeProject"

>

</GlobalActionId>

<GlobalActionId actionId=

"copy"

>

</GlobalActionId>

<GlobalActionId actionId=

"paste"

>

</GlobalActionId>

<GlobalActionId actionId=

"properties"

>

</GlobalActionId>

</ElementType>

</ViewId>

</GlobalActionHandlerProvider>

</extension>

The value of the global action handler provider class attribute must be a fully qualified name of a Java class that implements both the org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandlerProvider and org.eclipse.gmf.runtime.common.core.service.IProvider interfaces. For convenience, this can be a subclass of org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandlerProvider.