com.microfocus.awm.core

## Class ApplicationAction

- java.lang.Object
- - com.microfocus.awm.core.ApplicationAction

-     public class ApplicationAction
      extends java.lang.Object

  Combines a `RApplicationAction` and `CGlobalActions` with an `Action`.

  All ApplicationActions of a active application are stored in static lists and can be obtained using the `getApplicationActions(EApplicationActionExecutionType)` method. Global actions are treated as a application action of type `EApplicationActionExecutionType.MANUAL`.

  Important note: This is considered to be internal API. This class might get changed or moved in the future. Clients should not use it.

  Author:
    Christelle Biahmou

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationAction(ITaurusApplication pAppl, GlobalAction pGlobalAction)` Creates a new Application action from a `GlobalAction`.
    `ApplicationAction(ITaurusApplication pAppl, RApplicationAction pRApplAct)` Creates a new Application action from a `RApplicationAction`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<ApplicationAction>` | `getApplicationActions(EApplicationActionExecutionType pExecutionType)` Gets a sorted list of all modelled `RApplicationAction` of the given execution type.
    `static ApplicationAction` | `getApplicationDefaultAction()` Returns the default action for the given Element Type.
    `GlobalAction` | `getGlobalAction()`
    `RApplicationAction` | `getRApplicationAction()` Gets the `RApplicationAction` relationship of the action if the application action was created from a `RApplicationAction`.
    `ITaurusApplication` | `getTaurusApplication()`
    `boolean` | `isGlobalApplicationAction()`
    `void` | `run()` Runs the application action.
    `static void` | `runApplicationActions(EApplicationActionExecutionType pType)` Run application actions from the given type.
    `boolean` | `seperatorAfter()` Gets whether a separator should be inserted in (context) menus after this application action.
    `static void` | `unregisterApplicationActions()` Unregisters all actions that have been registered in the active application.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ApplicationAction

          public ApplicationAction(ITaurusApplication pAppl,
                                   RApplicationAction pRApplAct)

      Creates a new Application action from a `RApplicationAction`.
      Parameters:
        `pAppl` - the active application in which the action will be execute
        `pRApplAct` - the modeled relationship.

    - #### ApplicationAction

          public ApplicationAction(ITaurusApplication pAppl,
                                   GlobalAction pGlobalAction)

      Creates a new Application action from a `GlobalAction`.
      Parameters:
        `pAppl` - the active application in which the action will be execute
        `pGlobalAction` - the modeled global action.

  - ### Method Detail

    - #### getApplicationActions

          public static java.util.List<ApplicationAction> getApplicationActions(EApplicationActionExecutionType pExecutionType)

      Gets a sorted list of all modelled `RApplicationAction` of the given execution type. If the types `EApplicationActionExecutionType.ON_FIRST_LOAD` oder `EApplicationActionExecutionType.ON_LOAD` are given, all application actions of both types will be returned.
      Parameters:
        `pExecutionType` - the application execution type
      Returns:
        a list of `RApplicationAction`, sorted by the sequence number

    - #### getApplicationDefaultAction

          public static ApplicationAction getApplicationDefaultAction()

      Returns the default action for the given Element Type.
      Returns:
        the last default application action, set in the configuration by the "Default_Action" attribute in one of `RApplicationAction`

    - #### getRApplicationAction

          public RApplicationAction getRApplicationAction()

      Gets the `RApplicationAction` relationship of the action if the application action was created from a `RApplicationAction`.
      Returns:
        the application action relationship or `null` for global actions.

    - #### getGlobalAction

          public GlobalAction getGlobalAction()

      Returns:
        the `GlobalAction` if the application action was created from a `GlobalAction`. `null` otherwise.

    - #### isGlobalApplicationAction

          public boolean isGlobalApplicationAction()

      Returns:
        `true` if the application action was created from a `GlobalAction`. `false` otherwise.

    - #### getTaurusApplication

          public ITaurusApplication getTaurusApplication()

      Returns:
        the active application with what the application action was created.

    - #### unregisterApplicationActions

          public static void unregisterApplicationActions()

      Unregisters all actions that have been registered in the active application. Must be called if an application is unloaded.

    - #### seperatorAfter

          public boolean seperatorAfter()

      Gets whether a separator should be inserted in (context) menus after this application action.
      Returns:
        whether a separator should be inserted in (context) menus after the action.
      See Also:
        `and {@link GlobalAction#isSeparatorAfter()}`

    - #### runApplicationActions

          public static void runApplicationActions(EApplicationActionExecutionType pType)
                                            throws TaurusCoreException

      Run application actions from the given type. If the types `EApplicationActionExecutionType.ON_FIRST_LOAD` oder `EApplicationActionExecutionType.ON_LOAD` are given, all application actions of both types will be run.
      Parameters:
        `pType` - execution type of actions to be run
      Throws:
        `TaurusCoreException` - if at least one application action was not successfully executed

    - #### run

          public void run()
                   throws TaurusException

      Runs the application action.
      Throws:
        `TaurusException` - if any exception occurs during the execution

Copyright © 2015 Micro Focus GmbH. All rights reserved.