|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.japisoft.xmlpad.action.ActionModel
ActionModel
Here a model managing available action for the XMLContainer
.
This class manage actions and actionGroup. An ActionGroup is a set of Action.
As example, inside the XMLContainer component a group is delimited by a
separator inside the main toolbar.
This ActionModel is initialized using the 'xmlpad.properties' file. This properties are managed by the XMLPadProperties class, thus with it user can avoid the file usage working directly in memory to build its own action model.
Field Summary | |
static java.lang.String |
EDIT_GROUP
Edit group |
static java.lang.String |
FILE_GROUP
File group |
static java.lang.String |
OTHER_GROUP
Other group |
static java.lang.String |
SEARCH_GROUP
Search group |
static java.lang.String |
TOOLKIT_GROUP
Toolkit group |
static java.lang.String |
TREE_GROUP
Tree group |
static java.lang.String |
XML_GROUP
XML group |
Fields inherited from interface com.japisoft.xmlpad.action.ActionSet |
COMMENT_ACTION, COPY_ACTION, CUT_ACTION, FAST_COMMENT_ACTION, FORMAT_ACTION, INSERT_ACTION, LOAD_ACTION, NEW_ACTION, PARSE_ACTION, PASTE_ACTION, REDO_ACTION, SAVE_ACTION, SAVEAS_ACTION, SEARCH_ACTION, SPLIT_ACTION, SPLIT_ACTION_HOR, TREE_ADDHISTORY_ACTION, TREE_CLEANHISTORY_ACTION, TREE_COMMENTNODE_ACTION, TREE_COPYNODE_ACTION, TREE_CUTNODE_ACTION, TREE_EDITNODE_ACTION, TREE_NEXT_ACTION, TREE_PREVIOUS_ACTION, TREE_SELECTNODE_ACTION, UNDO_ACTION |
Constructor Summary | |
ActionModel()
|
Method Summary | |
static boolean |
activeActionByName(java.lang.String name)
Active an action by its name |
static boolean |
activeActionByName(java.lang.String name,
XMLContainer container,
XMLEditor editor)
Active an action changing the current container and editor this these ones. |
static void |
activeActionForSelection(boolean selection)
Enabled/Disabled all action implementing the ActicateOnSelection interface |
static void |
addActionForGroup(java.lang.String groupName,
java.lang.String actionClass)
Add a new action for this groupName. |
static void |
addActionForGroup(java.lang.String groupName,
XMLAction a)
Add this action 'a' for the followed groupName. |
static void |
addGroup(ActionGroup group)
Insert a new group of actions |
static void |
buildPopupMenu(javax.swing.JPopupMenu popupMenu)
Build the toolBar by adding all available action (in a toolbarable state) |
static void |
buildToolBar(javax.swing.JToolBar toolBar)
Build the toolBar by adding all available action (in a toolbarable state) |
static javax.swing.Action |
getActionByName(java.lang.String name)
|
static ActionGroup |
getGroupByName(java.lang.String groupName)
|
static java.util.Enumeration |
getGroups()
|
static java.lang.Object |
getParam(java.lang.String actionName)
|
static java.lang.Object |
getProperty(java.lang.String actionName,
java.lang.String propertyName,
java.lang.Object defaultValue)
|
static boolean |
hasFeature(java.lang.String actionName,
java.lang.String featureName)
Check a feature for this action name |
static boolean |
hasGroup(java.lang.String name)
|
static boolean |
isEnabledAction(java.lang.String name)
|
static void |
removeActionByName(java.lang.String name)
Remove an action by its name |
static void |
removeActionForGroup(java.lang.String groupName,
XMLAction a)
Remove this action 'a' from the following groupName. |
static void |
removeGroup(ActionGroup group)
Remove a group of action |
static void |
replaceActionByName(java.lang.String name,
javax.swing.Action newAction)
Replace an action matching the name by the newAction |
static void |
resetActionState(XMLContainer container)
Reset the current Action state for this editor and this container |
static void |
resetActionState(XMLEditor editor,
XMLContainer container)
Deprecated. Use only the version with the XMLContainer as parameter Reset the current Action state for this editor and this container, thus action will work on the good editor. |
static void |
setEnabledAction(java.lang.String name,
boolean enabled)
Enabled/Disabled an action by its name |
static void |
setEnabledAutoResetActionState(boolean enabled)
Decide or not to reset the action model with the last XMLContainer getting the focus. |
static void |
setFeature(java.lang.String actionName,
java.lang.String featureName,
boolean enabled)
Set a feature for this action name |
static void |
setIcon(java.lang.String actionName,
javax.swing.Icon newIcon)
Reset the default icon for this actionName by this one |
static void |
setIconForAction(java.lang.String name,
javax.swing.Icon icon)
Replace an action icon by this one |
static void |
setParam(java.lang.String actionName,
java.lang.Object param)
Set this param for the action related to the actionName |
static void |
setProperty(java.lang.String actionName,
java.lang.String propertyName,
java.lang.Object value)
Reset a property value by calling setProperty on the action known by actionName. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String FILE_GROUP
public static java.lang.String EDIT_GROUP
public static java.lang.String SEARCH_GROUP
public static java.lang.String XML_GROUP
public static java.lang.String OTHER_GROUP
public static java.lang.String TREE_GROUP
public static java.lang.String TOOLKIT_GROUP
Constructor Detail |
public ActionModel()
Method Detail |
public static void buildToolBar(javax.swing.JToolBar toolBar)
public static void buildPopupMenu(javax.swing.JPopupMenu popupMenu)
public static void setEnabledAutoResetActionState(boolean enabled)
true
public static void setIconForAction(java.lang.String name, javax.swing.Icon icon)
public static void resetActionState(XMLEditor editor, XMLContainer container)
editor
- container
- public static void resetActionState(XMLContainer container)
container
- public static void addGroup(ActionGroup group)
public static boolean hasGroup(java.lang.String name)
true
if this group name is knownpublic static void removeGroup(ActionGroup group)
public static ActionGroup getGroupByName(java.lang.String groupName)
null
is returned for
unknown grouppublic static void addActionForGroup(java.lang.String groupName, XMLAction a)
groupName
- existing group namea
- XML actionpublic static void addActionForGroup(java.lang.String groupName, java.lang.String actionClass) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static void removeActionForGroup(java.lang.String groupName, XMLAction a)
groupName
- a
- public static void removeActionByName(java.lang.String name)
public static javax.swing.Action getActionByName(java.lang.String name)
public static void replaceActionByName(java.lang.String name, javax.swing.Action newAction)
public static void setEnabledAction(java.lang.String name, boolean enabled)
public static boolean isEnabledAction(java.lang.String name)
public static boolean activeActionByName(java.lang.String name)
true
is the action is possible else false if
something is wrongpublic static boolean activeActionByName(java.lang.String name, XMLContainer container, XMLEditor editor)
true
is the action is possible else false if
something is wrongpublic static void activeActionForSelection(boolean selection)
public static java.util.Enumeration getGroups()
public static void setFeature(java.lang.String actionName, java.lang.String featureName, boolean enabled)
public static boolean hasFeature(java.lang.String actionName, java.lang.String featureName)
public static void setParam(java.lang.String actionName, java.lang.Object param)
public static java.lang.Object getParam(java.lang.String actionName)
null
public static void setProperty(java.lang.String actionName, java.lang.String propertyName, java.lang.Object value)
actionName
- XMLAction namepropertyName
- Property namevalue
- Property valuepublic static java.lang.Object getProperty(java.lang.String actionName, java.lang.String propertyName, java.lang.Object defaultValue)
null
value will be returnedpublic static void setIcon(java.lang.String actionName, javax.swing.Icon newIcon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |