Extension SDK 10.1.2

oracle.ide.controls
Class ToggleAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byoracle.ide.controls.ToggleAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable
Direct Known Subclasses:
IdeAction, SingleRowTabbedPaneUI.ScrollMenuAction

public abstract class ToggleAction
extends javax.swing.AbstractAction
implements java.awt.event.ItemListener

See Also:
Serialized Form

Field Summary
static java.lang.String ACCELERATOR
           
static java.lang.String ACTION
          Deprecated.  
static java.lang.String BUTTON_GROUP_NAME
           
static java.lang.String CATEGORY
          The category is used in the shortcuts configuration panel to subdivide the list of actions.
static java.lang.String CONTEXT_INDEPENDENT_NAME
          The CONTEXT_INDEPENDENT_NAME should be used when the NAME property is context dependent as "Build Project1.jpr".
static java.lang.String DISABLED_ICON
           
static java.lang.String HIDDEN
           
static java.lang.String MENU_WEIGHT
           
static float MENU_WEIGHT_UNASSIGNED
           
static java.lang.String MNEMONIC
           
static java.lang.String RADIO
           
static java.lang.String STATE
           
static java.lang.String TOGGLES
           
static java.lang.String USER_DATA
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
  ToggleAction(java.lang.String name, ArrayResourceBundle bundle, int key)
          Construct a ToggleAction with the specified description String whose Icon can be lazily fetched from the specified ResourceBundle using the specified key.
  ToggleAction(java.lang.String name, javax.swing.Icon icon)
          Construct a ToggleAction with the specified description and Icon.
  ToggleAction(java.lang.String name, java.util.ResourceBundle bundle, java.lang.String key)
          Construct a ToggleAction with the specified description String whose Icon can be lazily fetched when needed from the specified ResourceBundle using the specified key.
protected ToggleAction(ToggleAction action)
           
 
Method Summary
protected  boolean getBooleanValue(java.lang.String key)
           
 float getMenuWeight()
          Returns the menu weight for this action.
 boolean getState()
           
 java.lang.Object getValue(java.lang.String key)
           
 boolean isRadio()
           
 boolean isToggle()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
protected  void setBooleanValue(java.lang.String key, boolean newValue)
           
 void setMenuWeight(float weight)
          Sets the menu weight for this action.
 void setState(boolean b)
           
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

ACTION

public static final java.lang.String ACTION
Deprecated.  

See Also:
Constant Field Values

MNEMONIC

public static final java.lang.String MNEMONIC
See Also:
Constant Field Values

ACCELERATOR

public static final java.lang.String ACCELERATOR
See Also:
Constant Field Values

USER_DATA

public static final java.lang.String USER_DATA
See Also:
Constant Field Values

DISABLED_ICON

public static final java.lang.String DISABLED_ICON
See Also:
Constant Field Values

TOGGLES

public static final java.lang.String TOGGLES
See Also:
Constant Field Values

RADIO

public static final java.lang.String RADIO
See Also:
Constant Field Values

STATE

public static final java.lang.String STATE
See Also:
Constant Field Values

HIDDEN

public static final java.lang.String HIDDEN
See Also:
Constant Field Values

BUTTON_GROUP_NAME

public static final java.lang.String BUTTON_GROUP_NAME
See Also:
Constant Field Values

MENU_WEIGHT

public static final java.lang.String MENU_WEIGHT
See Also:
Constant Field Values

MENU_WEIGHT_UNASSIGNED

public static final float MENU_WEIGHT_UNASSIGNED
See Also:
Constant Field Values

CATEGORY

public static final java.lang.String CATEGORY
The category is used in the shortcuts configuration panel to subdivide the list of actions.

See Also:
Constant Field Values

CONTEXT_INDEPENDENT_NAME

public static final java.lang.String CONTEXT_INDEPENDENT_NAME
The CONTEXT_INDEPENDENT_NAME should be used when the NAME property is context dependent as "Build Project1.jpr". The NAME property is used in the menus and tooltips but the Tools|Preferences|Accelerators panel tries CONTEXT_INDEPENDENT_NAME first then uses the NAME property. This is currently the only place where this property is used.

See Also:
Constant Field Values
Constructor Detail

ToggleAction

public ToggleAction(java.lang.String name,
                    javax.swing.Icon icon)
Construct a ToggleAction with the specified description and Icon. If the ToggleAction is to be constructed during performance sensitive operations, such as from an Addin during product intitialization and startup, consider using one of the constructors taking a ResourceBundle instead.

Parameters:
name -
icon -

ToggleAction

public ToggleAction(java.lang.String name,
                    java.util.ResourceBundle bundle,
                    java.lang.String key)
Construct a ToggleAction with the specified description String whose Icon can be lazily fetched when needed from the specified ResourceBundle using the specified key.

Parameters:
name -
bundle -
key -

ToggleAction

public ToggleAction(java.lang.String name,
                    ArrayResourceBundle bundle,
                    int key)
Construct a ToggleAction with the specified description String whose Icon can be lazily fetched from the specified ResourceBundle using the specified key.

Parameters:
name -
bundle -
key -

ToggleAction

protected ToggleAction(ToggleAction action)
Method Detail

getState

public boolean getState()

setState

public void setState(boolean b)

isToggle

public boolean isToggle()

isRadio

public boolean isRadio()

setMenuWeight

public void setMenuWeight(float weight)
Sets the menu weight for this action. Menu weights are used to sort menu items in a menu in ascending order from the top to the bottom of the menu.

Parameters:
weight - the new menu weight
See Also:
getMenuWeight(), MenuManager.createMenuItem(ToggleAction), MenuManager.createMenuItem(ToggleAction, float)

getMenuWeight

public float getMenuWeight()
Returns the menu weight for this action. If no weight has been set for this action, the default menu weight is returned.

Returns:
the weight for this action
See Also:
setMenuWeight(float)

getBooleanValue

protected boolean getBooleanValue(java.lang.String key)

setBooleanValue

protected void setBooleanValue(java.lang.String key,
                               boolean newValue)

getValue

public java.lang.Object getValue(java.lang.String key)
Specified by:
getValue in interface javax.swing.Action

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.