org.brains2b.swingext.action
Class ExtActionMap

java.lang.Object
  extended by javax.swing.ActionMap
      extended by org.brains2b.swingext.action.ExtActionMap
All Implemented Interfaces:
java.io.Serializable

public class ExtActionMap
extends javax.swing.ActionMap

An Abstract ActionMap with an easy way to add actions

This actionMap takes an ActionListener that handles all actions in this Map.

This actionmap is based on SortedMap to allow for keys returned in the order where they where added in.

Version:
0.32 [06-07-2007]
Author:
dennis@brains2b.nl
See Also:
SortedMap, DefaultAction, ActionMap, Serialized Form

Constructor Summary
ExtActionMap(java.awt.event.ActionListener parent)
          Create an FwActionMap.
 
Method Summary
 void addAction(java.lang.Object actionCommand, java.lang.String label, java.lang.String description, java.lang.String icon, java.lang.String accelerator, char mnemomic)
          adds an Action to the Map
 java.lang.Object[] allKeys()
          
 void clear()
          
 javax.swing.Action get(java.lang.Object key)
          
 java.awt.event.ActionListener getListener()
          get the ActionListener belonging to this map
 org.brains2b.collection.SortedMap getMap()
          get the SortedMap this ActionMap is based on
 java.lang.Object[] keys()
          
 void put(java.lang.Object key, javax.swing.Action action)
          
 void remove(java.lang.Object key)
          
static void setDefaultSystemActions(ExtActionMap map)
          sets Default system actions.
 int size()
          
 
Methods inherited from class javax.swing.ActionMap
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtActionMap

public ExtActionMap(java.awt.event.ActionListener parent)
Create an FwActionMap.

Parameters:
parent - ActionHandler, the ActionHandler handling fired actions.
Method Detail

setDefaultSystemActions

public static final void setDefaultSystemActions(ExtActionMap map)
sets Default system actions.


addAction

public void addAction(java.lang.Object actionCommand,
                      java.lang.String label,
                      java.lang.String description,
                      java.lang.String icon,
                      java.lang.String accelerator,
                      char mnemomic)
adds an Action to the Map

Parameters:
actionCommand - String, the actionCommand to perform, also the key with which to find the action in the map
label - String, the name that will show up as label
description - String, the description displayed as tooltip.
icon - javax.swing.Icon, an optional image to display with this action
accelerator - String , accelarator key as String, refer to KeyStroke for a description of KeyStrokes as text.
mnemomic - char, the mnemonic or shortcut key used.

getListener

public java.awt.event.ActionListener getListener()
get the ActionListener belonging to this map

Returns:
ActionListener, returns the handler belonging to this map

allKeys

public java.lang.Object[] allKeys()

Overrides:
allKeys in class javax.swing.ActionMap

clear

public void clear()

Overrides:
clear in class javax.swing.ActionMap

get

public javax.swing.Action get(java.lang.Object key)

Overrides:
get in class javax.swing.ActionMap

keys

public java.lang.Object[] keys()

Overrides:
keys in class javax.swing.ActionMap

put

public void put(java.lang.Object key,
                javax.swing.Action action)

Overrides:
put in class javax.swing.ActionMap

remove

public void remove(java.lang.Object key)

Overrides:
remove in class javax.swing.ActionMap

size

public int size()

Overrides:
size in class javax.swing.ActionMap

getMap

public org.brains2b.collection.SortedMap getMap()
get the SortedMap this ActionMap is based on

Returns:
SortedMap