org.fopps.ui.actions
Class ItemAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.fopps.ui.actions.BaseAction
              |
              +--org.fopps.ui.actions.ItemAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable
Direct Known Subclasses:
CompileAction, DeleteAction

public abstract class ItemAction
extends BaseAction

ItemAction is the base class for all item action (actions operating on AbstractItem's)

Author:
Oliver Wieland
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.fopps.ui.actions.BaseAction
GROUP, selectedItems
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ItemAction(ActionHandler pListener)
           
ItemAction(java.lang.String name, ActionHandler pListener)
           
ItemAction(java.lang.String name, javax.swing.Icon icon, ActionHandler pListener)
           
 
Method Summary
 boolean acceptSelection()
          Indicates, if an action is able to work with the selected items.
 int itemsNeeded()
          Returns the number of items needed to perform this action.
 
Methods inherited from class org.fopps.ui.actions.BaseAction
actionPerformed, addToMenu, addToPopup, addToToolBar, clearSelection, compareTo, getAccelerator, getActionHandler, getApplication, getContainer, getGroup, getIcon, getLocaleName, getLongDescription, getMnemonic, getName, getSelectedItems, getSelectionSize, getShortDescription, isStringPropertySet, isTogglable, itemInSelection, itemStateChanged, setAccelerator, setAccelerator, setAcceleratorWithAlt, setAcceleratorWithCtrl, setAcceleratorWithShift, setGroup, setLocaleName, setLongDescription, setMnemonic, setMnemonic, setShortDescription, toString, updateState
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemAction

public ItemAction(ActionHandler pListener)

ItemAction

public ItemAction(java.lang.String name,
                  ActionHandler pListener)

ItemAction

public ItemAction(java.lang.String name,
                  javax.swing.Icon icon,
                  ActionHandler pListener)
Method Detail

acceptSelection

public boolean acceptSelection()
Indicates, if an action is able to work with the selected items. If acceptSelection returns false, the action will be disabled. This method is called after every selection change. ItemAction's accept selection which contain only intsances of AbstractItem

Overrides:
acceptSelection in class BaseAction
Returns:
true, if action is able to operate on current selection

itemsNeeded

public int itemsNeeded()
Returns the number of items needed to perform this action. Default is 1



Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.