Class PBASAction

java.lang.Object
javax.swing.AbstractAction
com.portal.bas.PBASAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
PAboutAction, PARAdjustAction, PARBillNowAction, PARChargeCCAction, PARRefundAction, PARWriteOffAction, PBackAction, PBASToggleAction, PChangePasswordAction, PCopyAction, PCutAction, PDefaultContextHelpAction, PDefaultHelpAction, PDefaultHelpIDAction, PEventBrowserAction, PExitAction, PGoToBalanceAction, PGoToHierarchyAction, PGoToPaymentAction, PGoToProductAction, PGoToServiceAction, PGoToSponsorshipAction, PGoToSummaryAction, PHomePageAction, PNewAccountAction, PNotesAction, PPasteAction, PPermissionAction, PPrefsAction, PPrintAction, PPrintSetupAction, PPurchaseOfferingAction, PRefreshAction, PSaveAction, PSearchAction, PVoucherAction

public abstract class PBASAction extends AbstractAction
PBASAction is the BAS Action command base. Given a resource tag, the action's name, icon, tooltext, and other information are retrieved from the resource file provided by PViewComponent.
Version:
6
Author:
Larry Lynch-Freshner
See Also:
  • Field Details

    • ACCEL

      public static final String ACCEL
      Constant used to store accelerator property information in the action class.
      See Also:
    • MNEM

      public static final String MNEM
      Constant used to store mnemonic property information in the action class.
      See Also:
    • TOOL_TITLE

      public static final String TOOL_TITLE
      Constant used to store icon property information in the action class.
      See Also:
    • ICON_DISABLED

      public static final String ICON_DISABLED
      Constant used to store property information in action class
      See Also:
    • ICON_DISABLED_SELECTED

      public static final String ICON_DISABLED_SELECTED
      Constant used to store icon property information in the action class.
      See Also:
    • ICON_SELECTED

      public static final String ICON_SELECTED
      Constant used to store icon property information in the action class.
      See Also:
    • ICON_ROLLOVER

      public static final String ICON_ROLLOVER
      Constant used to store icon property information in the action class.
      See Also:
    • ICON_ROLLOVER_SELECTED

      public static final String ICON_ROLLOVER_SELECTED
      Constant used to store icon property information in the action class.
      See Also:
    • ICON_PRESSED

      public static final String ICON_PRESSED
      Constant used to store icon property information in the action class.
      See Also:
    • TOOLBAR_LABEL

      public static final String TOOLBAR_LABEL
      Constant used to indicate the label that should appear for a toolbar button. When using PToolBar, Action.NAME will be ignored and this used instead. Menu items will still refer to Action.NAME - this allows you to use one action in both widgets and not have a label appear in the toolbar unless you explicitely want it to.
      See Also:
  • Constructor Details

    • PBASAction

      public PBASAction(String tag)
      Creates a new PBASAction from a supplied component and resource tag.
      Parameters:
      tag - a String that contains the resource tag from which to look up the information

      The icon is expected at: <component resource base>.tag.icon

      The name is expected at: <component resource base>.tag.name

      The description is expected at: <component resource base>.tag.desc

    • PBASAction

      public PBASAction(PClientComponent comp, String tag)
      Creates a new PBASAction from a supplied component and resource tag.
      Parameters:
      comp - the target component of this action
      tag - a String that contains the resource tag used to look up the information

      The icon is expected at: <component resource base>.tag.icon

      The name is expected at: <component resource base>.tag.name

      The description is expected at: <component resource base>.tag.desc

    • PBASAction

      public PBASAction(PClientComponent comp, String tag, String helpID)
      Creates a new PBASAction from a supplied component, resource tag, and helpID.
      Parameters:
      comp - the component this action will act upon
      tag - a String that contains the resource tag used to look up the information

      The name is expected at: <component resource base>.tag.name

      The description is expected at: <component resource base>.tag.desc

      The accelerator is expected at: <component resource base>.tag.accel

      The mnemonic is expected at: <component resource base>.tag.mnemonic

      The preferred menu is expected at: <component resource base>.tag.menu

      The icon is expected at: <component resource base>.tag.icon

      The disabled icon is expected at: <component resource base>.tag.icon.disabled

      The selected icon is expected at: <component resource base>.tag.icon.selected

      The pressed icon is expected at: <component resource base>.tag.icon.pressed

      The rollover icon is expected at: <component resource base>.tag.icon.rollover

      The disabled selected icon is expected at: <component resource base>.tag.icon.disabled.selected

      The rollover selected icon is expected at: <component resource base>.tag.icon.rollover.selected

      Accelerator format is: <mod>-<key>

      where <mod> is any combination of A, S, or C for Alt, Shift, or Control and <key> is A-z, F1-F12, and so on.

      helpID - the help ID for this action
  • Method Details

    • setPreferredMenu

      public void setPreferredMenu(String menuStr)
      Sets the name of the menu this action should be added to if and when it is displayed in a menu bar. The default value is null, which causes the action to not be added to any menu. Submenus must be separated by periods (.), for example, "file.import".
      Parameters:
      menuStr - the name of the menu to add to. This is the name of the menu before localization.
    • getPreferredMenu

      public String getPreferredMenu()
      Gets the name of the menu to which this action should be added.
      Returns:
      A String name for the menu.
    • getTag

      public String getTag()
      Gets the property tag used to load action resources.
      Returns:
      A String tag.
    • getHelpID

      public String getHelpID()
      Gets the help ID associated with this action.
      Returns:
      A String help identifier.
    • setActionHelpOn

      public void setActionHelpOn(Component comp)
      Sets up help. Can only be called after the action is set on a component.
      Parameters:
      comp - the Action trigger component
    • getComponent

      public PClientComponent getComponent()
      Gets the Action target.
      Returns:
      A GUIComponent.
    • handleError

      public boolean handleError(Throwable e)
      Handles errors that occur during actionPerformed.
      Parameters:
      e - the exception that occured
      Returns:
      True if the error is handled; false otherwise.
    • equals

      public boolean equals(Object other)
      Tests whether a supplied object is equal to this PBASAction.
      Overrides:
      equals in class Object
      Parameters:
      other - the other object with which to test equality
      Returns:
      True if objects are equal; false otherwise.