Static Public Member Functions

cern.gp.actions.support.ActionUtils Class Reference

List of all members.

Static Public Member Functions

static JButton createJButton (Class actionClass)
static JButton createJButton (TopComponent tc, Class actionClass)
static JButton createJButton (SystemAction act)
static JButton createJButton (Action act)
static JPanel createJButtonPanel (Class[] actionClasses)
static JPanel createJButtonPanel (TopComponent tc, Class[] actionClasses)
static JComponent addJButtons (JComponent comp, Class[] actionClasses)
static ImageIcon getBlankIcon ()
static Action actionForComp (TopComponent tc, Class action)

Detailed Description

A few utility methods for Actions. This is partly an extension to the functionality in openide.awt.Actions.

Author:
Vito Baggiolini
Version:
Revision:
1.2
Date:
2006/09/25 08:52:36

Member Function Documentation

static Action cern.gp.actions.support.ActionUtils.actionForComp ( TopComponent  tc,
Class  action 
) [static]

helper method, creates an action that is "connected" to the nodes inside a TopComponent. This makes it possible to create Action Buttons that listen to nodes in an Explorer but are located outside the Explorer's TopComponent

Parameters:
tc the TopComponent (e.g. Explorer) to connect to
action the action class
Returns:
the Context aware Action instance
Since:
2.0.5

References org.openide.windows.TopComponent.getLookup().

Referenced by cern.gp.actions.support.ActionUtils.createJButton().

static JComponent cern.gp.actions.support.ActionUtils.addJButtons ( JComponent  comp,
Class[]  actionClasses 
) [static]

Utility method, adds JButtons corresponding to the actionClasses to a JComponent

Returns:
the JComponent passed as first paraameter, with the buttons added
Deprecated:
-- tell us (proj-gp-dev@cern.ch) if you really need it!

References cern.gp.actions.support.ActionUtils.createJButton().

Referenced by cern.gp.actions.support.ActionUtils.createJButtonPanel().

static JButton cern.gp.actions.support.ActionUtils.createJButton ( Action  act  )  [static]

creates a JButton for the Action itself. You should not need to use this method, rather use createJButton(Class) If you find you need to use this action, please do not create actions yourself, use the or #actionForComp(TopComponent, Class) instead.

See also:
createJButton(Class) for more explanations
Returns:
a JButton
Since:
2.0.5
static JButton cern.gp.actions.support.ActionUtils.createJButton ( SystemAction  act  )  [static]

creates a JButton for the SystemAction itself. You should not need to use this method, rather use createJButton(Class) If you find you need to use this action, please do not create actions yourself, use the or #actionForComp(TopComponent, Class) instead.

See also:
createJButton(Class) for more explanations
Returns:
a JButton
Deprecated:
-- use createJButton(Action)
static JButton cern.gp.actions.support.ActionUtils.createJButton ( TopComponent  tc,
Class  actionClass 
) [static]

creates a JButton for the action class that listens to Nodes in the specified TopComponent. This is useful, e.g. when you want to place the JButton in a separate TopComponent (i.e. not in the Explorer TopComponent itself)

Parameters:
tc the TopComponent that contains the nodes (typically this is an Explorer)
actionClass an action supported by one or more of the nodes in the TopComponent
Returns:
a JButton
Since:
2.0.5

References cern.gp.actions.support.ActionUtils.actionForComp(), and cern.gp.actions.support.ActionUtils.createJButton().

static JButton cern.gp.actions.support.ActionUtils.createJButton ( Class  actionClass  )  [static]

creates a JButton for the action class. This button takes its icon, description, shortcut etc from the action class. It is enabled whenever the action is enabled.

Returns:
a JButton

Referenced by cern.gp.actions.support.ActionUtils.addJButtons(), cern.gp.actions.support.ActionUtils.createJButton(), and cern.gp.actions.support.ActionUtils.createJButtonPanel().

static JPanel cern.gp.actions.support.ActionUtils.createJButtonPanel ( TopComponent  tc,
Class[]  actionClasses 
) [static]

creates a JPanel with JButtons for action classes that listen to Nodes in the specified TopComponent. This is useful, e.g.when you want to place the Buttons in a separate TopComponent (i.e. not in the Explorer TopComponent itself).

Parameters:
tc the TopComponent that contains the nodes (typically this is an Explorer)
actionClasses actions supported by one or more of the nodes in the TopComponent
Returns:
a JButton
Since:
2.0.5

References cern.gp.actions.support.ActionUtils.createJButton(), and cern.gp.actions.support.ActionUtils.createJButtonPanel().

static JPanel cern.gp.actions.support.ActionUtils.createJButtonPanel ( Class[]  actionClasses  )  [static]

creates a JPanel with JButtons for the actions specified. The JPanel uses a FlowLayout. If you don't like the JPanel, you can create the JPanel (or other component) yourself and use addJButtons

Returns:
JPanel the panel containing the buttons

References cern.gp.actions.support.ActionUtils.addJButtons().

Referenced by cern.gp.actions.support.ActionUtils.createJButtonPanel().

static ImageIcon cern.gp.actions.support.ActionUtils.getBlankIcon (  )  [static]

utility method, returns a blank icon, can be used if an existing icon shall be "hidden"


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties