com.japisoft.framework.application.descriptor
Class ActionModel

java.lang.Object
  extended bycom.japisoft.framework.application.descriptor.ActionModel

public class ActionModel
extends java.lang.Object

Store all actions from the interface builder

Version:
1.0
Author:
(c) 2003 JAPISoft / Alexandre Brillant

Field Summary
static java.lang.String CLOSE_ALL
          Default name for the close all action
static boolean LAST_ACTION_STATE
           
static java.lang.String OPEN
          Default name for the open action
static java.lang.String SAVE
          Default name for saving a file
static java.lang.String SAVE_ALL
          Default name for saving all the file
static java.lang.String SAVE_PROJECT
          Default name for saving a project
static java.lang.String SAVEAS
          Default name for saving a file in a directory
static java.lang.String SAVEAS_PROJECT
          Default name for saving a project in a directory
 
Constructor Summary
ActionModel()
           
 
Method Summary
static void activeActionById(java.lang.String id, java.awt.event.ActionEvent e)
          Run an action with the following name and event
static void activeActionById(java.lang.String id, java.awt.event.ActionEvent e, java.lang.String param)
          Run an action with the following name and event and a param available from the "param" key (getValue)
static void activeActionById(java.lang.String id, java.awt.event.ActionEvent e, java.lang.String param1, java.lang.String param2)
          Run an action with the following name and event and two params available from the "param" and "param2" keys (getValue)
static boolean hasAction(java.lang.String id)
          Check if this action name is known
static boolean isEnabled(java.lang.String id)
          Check the Enabled/Disabled state for the following action by its name (id)
static javax.swing.Action restoreAction(java.lang.String id)
          Restore an action from its name (id)
static void setEnabled(java.lang.String id, boolean state)
          Enabled/Disabled the following action by its name (id)
static void storeAction(java.lang.String id, javax.swing.Action a)
          Store an action in the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN

public static final java.lang.String OPEN
Default name for the open action

See Also:
Constant Field Values

CLOSE_ALL

public static final java.lang.String CLOSE_ALL
Default name for the close all action

See Also:
Constant Field Values

SAVE_PROJECT

public static final java.lang.String SAVE_PROJECT
Default name for saving a project

See Also:
Constant Field Values

SAVEAS_PROJECT

public static final java.lang.String SAVEAS_PROJECT
Default name for saving a project in a directory

See Also:
Constant Field Values

SAVEAS

public static final java.lang.String SAVEAS
Default name for saving a file in a directory

See Also:
Constant Field Values

SAVE

public static final java.lang.String SAVE
Default name for saving a file

See Also:
Constant Field Values

SAVE_ALL

public static final java.lang.String SAVE_ALL
Default name for saving all the file

See Also:
Constant Field Values

LAST_ACTION_STATE

public static boolean LAST_ACTION_STATE
Constructor Detail

ActionModel

public ActionModel()
Method Detail

storeAction

public static void storeAction(java.lang.String id,
                               javax.swing.Action a)
Store an action in the model. The id is the name of the action


restoreAction

public static javax.swing.Action restoreAction(java.lang.String id)
Restore an action from its name (id)


hasAction

public static boolean hasAction(java.lang.String id)
Check if this action name is known


setEnabled

public static void setEnabled(java.lang.String id,
                              boolean state)
Enabled/Disabled the following action by its name (id)


isEnabled

public static boolean isEnabled(java.lang.String id)
Check the Enabled/Disabled state for the following action by its name (id)


activeActionById

public static void activeActionById(java.lang.String id,
                                    java.awt.event.ActionEvent e)
Run an action with the following name and event


activeActionById

public static void activeActionById(java.lang.String id,
                                    java.awt.event.ActionEvent e,
                                    java.lang.String param)
Run an action with the following name and event and a param available from the "param" key (getValue)


activeActionById

public static void activeActionById(java.lang.String id,
                                    java.awt.event.ActionEvent e,
                                    java.lang.String param1,
                                    java.lang.String param2)
Run an action with the following name and event and two params available from the "param" and "param2" keys (getValue)