VLab Common 1.2

pl.psnc.vlab.util.gui.action.helper
Class ActionHelper

java.lang.Object
  extended by pl.psnc.vlab.util.gui.action.helper.ActionHelper

public final class ActionHelper
extends java.lang.Object

ActionHelper class - contains a set of utility methods for the Swing components

Author:
Dominik Stoklosa (~osa~)
Email address
osa@man.poznan.pl

Constructor Summary
ActionHelper()
           
 
Method Summary
static void addObserver(ActionType observable, ActionType observer)
          Add action observer to the given observable object
static void addObserver(ActionType observable, java.util.Observer observer)
          Add action observer to the given observable object
static void setAction(javax.swing.AbstractButton component, AbstractActionDefault action, boolean enabled)
          Set action for the given component.
static void setAction(javax.swing.AbstractButton component, ActionType actionType, boolean enabled)
          Set action for the given component.
static void setAction(javax.swing.AbstractButton component, ActionType actionType, boolean enabled, boolean associate)
          Set action for the given component.
static void setSelected(ActionDecorator aDecorator, boolean selected)
          Change selection of all AbstractButton components associated with this action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionHelper

public ActionHelper()
Method Detail

setAction

public static void setAction(javax.swing.AbstractButton component,
                             AbstractActionDefault action,
                             boolean enabled)
Set action for the given component. The tooltip, icons and text are copied from the given action. If the given component is of type JButton the empty text will be set

Parameters:
component - swing component, instance of AbstractButton
action - instance of action AbstractActionDefault
enabled - specifies whether action is enabled

setAction

public static void setAction(javax.swing.AbstractButton component,
                             ActionType actionType,
                             boolean enabled)
Set action for the given component. The tooltip, icons and text are copied from the given action. If the given component is of type JButton the empty text will be set. By default action component button is associated with action.

Parameters:
component - swing component, instance of AbstractButton
actionType - action type, instance ActionType
enabled - specifies whether action is enabled

setAction

public static void setAction(javax.swing.AbstractButton component,
                             ActionType actionType,
                             boolean enabled,
                             boolean associate)
Set action for the given component. The tooltip, icons and text are copied from the given action. If the given component is of type JButton the empty text will be set

Parameters:
component - swing component, instance of AbstractButton
actionType - action type, instance ActionType
enabled - specifies whether action is enabled
associate - specifies whether source components should be associated with this action

setSelected

public static void setSelected(ActionDecorator aDecorator,
                               boolean selected)
Change selection of all AbstractButton components associated with this action.

Parameters:
aDecorator - instance of ActionDecorator
selected - specifies whether AbstractButton should be selected or not

addObserver

public static void addObserver(ActionType observable,
                               ActionType observer)
Add action observer to the given observable object

Parameters:
observable - observable instance Observable
observer - observer instance Observer

addObserver

public static void addObserver(ActionType observable,
                               java.util.Observer observer)
Add action observer to the given observable object

Parameters:
observable - observable instance Observable
observer - observer instance Observer

VLab Common 1.2

Copyright 2004 by VLAB Dominik Stoklosa.