org.jminor.common.ui.control
Class ControlSet

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jminor.common.ui.control.Control
          extended by org.jminor.common.ui.control.ControlSet
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class ControlSet
extends Control

A set of Actions/Controls, includes separators.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ControlSet()
          Constructs a new ControlSet.
ControlSet(Control... controls)
          Constructs a new ControlSet
ControlSet(String name)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic, Control... controls)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic, ImageIcon icon)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic, ImageIcon icon, StateObserver enabledState)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic, State enabledState, Control... controls)
          Constructs a new ControlSet
ControlSet(String name, char mnemonic, State enabledState, ImageIcon icon, Control... controls)
          Constructs a new ControlSet
ControlSet(String name, Control... controls)
          Constructs a new ControlSet
 
Method Summary
 void add(Action action)
          Adds the given action to this ControlSet, adding a null action has the same effect as addSeparator()
 void add(ControlSet controlSet)
           
 void addAll(ControlSet controlSet)
          Adds all action found in controlSet to this control set
 void addAt(Action action, int index)
          Adds the given action to this ControlSet at the specified index, adding a null action has the same effect as addSeparator()
 void addAt(ControlSet controlSet, int index)
           
 void addSeparator()
          Adds a separator to this control set
 void addSeparatorAt(int index)
          Adds a separator at the given index
 Action get(int index)
           
 List<Action> getActions()
           
 List<ControlSet> getControlSets()
           
 boolean hasIcon()
           
 boolean hasName()
           
 boolean remove(Action action)
           
 boolean remove(ControlSet controlSet)
           
 void removeAll()
          Removes all actions from this control set
 int size()
           
 
Methods inherited from class org.jminor.common.ui.control.Control
actionPerformed, getDescription, getEnabledState, getIcon, getMnemonic, getName, isEnabled, setDescription, setEnabled, setIcon, setKeyStroke, setMnemonic, setName
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlSet

public ControlSet()
Constructs a new ControlSet.


ControlSet

public ControlSet(String name)
Constructs a new ControlSet

Parameters:
name - the control set name

ControlSet

public ControlSet(String name,
                  char mnemonic)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set

ControlSet

public ControlSet(String name,
                  char mnemonic,
                  ImageIcon icon)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set
icon - the icon

ControlSet

public ControlSet(String name,
                  char mnemonic,
                  ImageIcon icon,
                  StateObserver enabledState)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set
icon - the icon
enabledState - the state observer dictating the enable state of this control

ControlSet

public ControlSet(Control... controls)
Constructs a new ControlSet

Parameters:
controls - the controls to add to this set

ControlSet

public ControlSet(String name,
                  Control... controls)
Constructs a new ControlSet

Parameters:
name - the control set name
controls - the controls to add to this set

ControlSet

public ControlSet(String name,
                  char mnemonic,
                  Control... controls)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set
controls - the controls to add to this set

ControlSet

public ControlSet(String name,
                  char mnemonic,
                  State enabledState,
                  Control... controls)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set
enabledState - the state observer dictating the enable state of this control
controls - the controls to add to this set

ControlSet

public ControlSet(String name,
                  char mnemonic,
                  State enabledState,
                  ImageIcon icon,
                  Control... controls)
Constructs a new ControlSet

Parameters:
name - the control set name
mnemonic - the mnemonic to assign to this control set
enabledState - the state observer dictating the enable state of this control
icon - the icon
controls - the controls to add to this set
Method Detail

getControlSets

public List<ControlSet> getControlSets()
Returns:
a list containing all ControlSets this ControlSet contains

getActions

public List<Action> getActions()
Returns:
the actions in this set

add

public void add(Action action)
Adds the given action to this ControlSet, adding a null action has the same effect as addSeparator()

Parameters:
action - the action to add

addAt

public void addAt(Action action,
                  int index)
Adds the given action to this ControlSet at the specified index, adding a null action has the same effect as addSeparator()

Parameters:
action - the action to add at the specified index
index - the index

remove

public boolean remove(Action action)
Parameters:
action - the action to remove
Returns:
true if the action was removed

remove

public boolean remove(ControlSet controlSet)
Parameters:
controlSet - the control set to remove
Returns:
true if the set was removed

removeAll

public void removeAll()
Removes all actions from this control set


size

public int size()
Returns:
the size of this control set

get

public Action get(int index)
Parameters:
index - the index
Returns:
the action at the given index

add

public void add(ControlSet controlSet)
Parameters:
controlSet - the control set to add

addAt

public void addAt(ControlSet controlSet,
                  int index)
Parameters:
controlSet - the control set to add at the specified index
index - the index

addSeparator

public void addSeparator()
Adds a separator to this control set


addSeparatorAt

public void addSeparatorAt(int index)
Adds a separator at the given index

Parameters:
index - the index

hasName

public boolean hasName()
Returns:
true if this control set has a name

hasIcon

public boolean hasIcon()
Returns:
true if this control set has an icon

addAll

public void addAll(ControlSet controlSet)
Adds all action found in controlSet to this control set

Parameters:
controlSet - the source set