JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.swing
Class JCAction

java.lang.Object
  |
  +--com.klg.jclass.util.swing.JCAction
All Implemented Interfaces:
Action, ActionListener, EventListener, Serializable
Direct Known Subclasses:
BaseWizardPage.CancelAction, BaseWizardPage.HelpAction, BaseWizardPage.NextAction, BaseWizardPage.PreviousAction, JCMDIPane.ArrangeAction, JCMDIPane.CascadeAction, JCMDIPane.MaxMinAction, JCMDIPane.TileHAction, JCMDIPane.TileVAction

public abstract class JCAction
extends Object
implements Action, Serializable

Abstract implementation of Action interface, but also adds i18n/l10n functionality.

Key enhancements are implementations of Accelerator and Mnemonic support. Does not implement actionPerformed().

See Also:
Serialized Form

Nested Class Summary
protected  class JCAction.ActionButton
           
protected  class JCAction.ActionMenu
           
protected  class JCAction.ActionMenuItem
           
protected  class JCAction.Value
          Inner class to store key - value pairs in a list.
 
Field Summary
static String ACCELERATOR
           
static String DEFAULT
           
protected  boolean enabled
           
static String LONG_DESCRIPTION
           
static String MNEMONIC
           
protected  String name
           
static String NAME
           
protected  PropertyChangeSupport property
           
static String SHORT_DESCRIPTION
           
static String SMALL_ICON
           
protected  Vector values
           
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, MNEMONIC_KEY
 
Constructor Summary
JCAction(String name)
           
JCAction(String label, Integer mnemonic, KeyStroke accelerator)
          Creates an action.
JCAction(String label, int mnemonic, KeyStroke accelerator)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 JButton createButton()
           
 JButton createButton(boolean use_mnemonic)
           
 JMenu createMenu()
           
 JMenuItem createMenuItem()
           
 Object getValue(String key)
           
 boolean isEnabled()
           
 void putValue(String key, Object v)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void setEnabled(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

DEFAULT

public static final String DEFAULT
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

SHORT_DESCRIPTION

public static final String SHORT_DESCRIPTION
See Also:
Constant Field Values

LONG_DESCRIPTION

public static final String LONG_DESCRIPTION
See Also:
Constant Field Values

SMALL_ICON

public static final String SMALL_ICON
See Also:
Constant Field Values

ACCELERATOR

public static final String ACCELERATOR
See Also:
Constant Field Values

MNEMONIC

public static final String MNEMONIC
See Also:
Constant Field Values

values

protected Vector values

enabled

protected boolean enabled

property

protected PropertyChangeSupport property

name

protected String name
Constructor Detail

JCAction

public JCAction(String name)

JCAction

public JCAction(String label,
                Integer mnemonic,
                KeyStroke accelerator)
Creates an action.

Parameters:
label - Label of the action used when creating buttons. On request of the NAME, this value will be used as a key into the JCLocaleManager's default implementation. If the key is not found therein, it will be returned directly.
mnemonic - mnemonic key to use when constructing a menu item
accelerator - accelerator key to use when constructing a menu item or button
See Also:
JCMenu, JCLocaleManager

JCAction

public JCAction(String label,
                int mnemonic,
                KeyStroke accelerator)
Method Detail

getValue

public Object getValue(String key)
Specified by:
getValue in interface Action

putValue

public void putValue(String key,
                     Object v)
Specified by:
putValue in interface Action

setEnabled

public void setEnabled(boolean b)
Specified by:
setEnabled in interface Action

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Action

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface Action

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface Action

createButton

public JButton createButton(boolean use_mnemonic)

createButton

public JButton createButton()

createMenu

public JMenu createMenu()

createMenuItem

public JMenuItem createMenuItem()

Copyright © 2004 Quest Software Inc..
All rights reserved.