com.jgoodies.uif.util
Class ComponentUtils

java.lang.Object
  extended by com.jgoodies.uif.util.ComponentUtils

public final class ComponentUtils
extends Object

Consists only of static convenience methods around components.

Since:
1.4
Version:
$Revision: 1.4 $
Author:
Karsten Lentzsch

Method Summary
static void addAction(JComponent component, Action action, KeyStroke keyStroke)
          Adds the given action to the input map of the given component for the given key stroke.
static void addAction(JComponent component, Action action, KeyStroke keyStroke, int condition)
          Adds the given action to the input map of the given component for the given key stroke.
static void addEnterAction(JComponent component, Action action)
          Adds the given action to the input map of the given component as a action on pressing the ENTER key.
static void removeAction(JComponent component, Action action, KeyStroke keyStroke, int condition)
          Removes the given action from the input map of the given component for the given key stroke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addAction

public static void addAction(JComponent component,
                             Action action,
                             KeyStroke keyStroke)
Adds the given action to the input map of the given component for the given key stroke. The key used to register the action is the Action object itself.

Parameters:
component - the component that shall hold the action
action - the action to add
keyStroke - the key stroke that initiates the action

addAction

public static void addAction(JComponent component,
                             Action action,
                             KeyStroke keyStroke,
                             int condition)
Adds the given action to the input map of the given component for the given key stroke. The key used to register the action is the Action object itself.

Parameters:
component - the component that shall hold the action
action - the action to add
keyStroke - the key stroke that initiates the action
condition - one of JComponent.WHEN_IN_FOCUSED_WINDOW, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT

addEnterAction

public static void addEnterAction(JComponent component,
                                  Action action)
Adds the given action to the input map of the given component as a action on pressing the ENTER key.

Parameters:
component - the component that shall hold the action
action - the action to add

removeAction

public static void removeAction(JComponent component,
                                Action action,
                                KeyStroke keyStroke,
                                int condition)
Removes the given action from the input map of the given component for the given key stroke. The key used to register the action is the Action object itself.

Parameters:
component - the component that shall hold the action
action - the action to add
keyStroke - the key stroke that initiates the action
condition - one of JComponent.WHEN_IN_FOCUSED_WINDOW, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.