Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.controls
Class ToggleAction

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

public abstract class ToggleAction
extends javax.swing.AbstractAction

See Also:
Serialized Form

Field Summary
static java.lang.String ACCELERATOR
           
static java.lang.String ACTION
          Deprecated.  
static java.lang.String ACTION_MENU_ACTIONS
           
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
          Deprecated. use Action.MNEMONIC_KEY.
protected static boolean PERFORM_ACTION_LATER
          Deprecated. since 11.1.1 with no replacement.
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, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, 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
 void addPropertyResolver(PropertyResolver resolver)
          Add a resolver for properties on this action.
protected static void freezeKeyboard(boolean freeze)
           
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 isActionMenu()
           
 boolean isRadio()
           
 boolean isToggle()
           
 void listenForItemEvent(javax.swing.AbstractButton button)
           
 void removePropertyResolver(PropertyResolver resolver)
          Remove a resolver previously added to this action via addPropertyResolver( PropertyResolver ).
protected  void setBooleanValue(java.lang.String key, boolean newValue)
           
 void setMenuWeight(float weight)
          Sets the menu weight for this action.
 void setName(java.lang.String name)
          Sets the menu name (Action.NAME) strips out and sets the mnemonic key if any mnemonics are defined in the name.
 void setState(boolean b)
           
 java.lang.String toString()
           
 
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, 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
Deprecated. use Action.MNEMONIC_KEY.
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

ACTION_MENU_ACTIONS

public static final java.lang.String ACTION_MENU_ACTIONS
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

PERFORM_ACTION_LATER

protected static final boolean PERFORM_ACTION_LATER
Deprecated. since 11.1.1 with no replacement.
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

addPropertyResolver

public final void addPropertyResolver(PropertyResolver resolver)
Add a resolver for properties on this action. When an attempt is made to retrieve a property from this action via the getValue(String) method and the value is null, all property resolvers will be given the opportunity to resolve the value of the property, starting with the last resolver that was added. If a non-null value is returned by any resolver, then the resolved value is added to the property set for this action an no further resolvers are queried.

PropertyResolvers provide a mechanism whereby properties on an action can be resolved lazily.

Parameters:
resolver - a resolver to add.
Since:
10.1.3

removePropertyResolver

public final void removePropertyResolver(PropertyResolver resolver)
Remove a resolver previously added to this action via addPropertyResolver( PropertyResolver ).

Parameters:
resolver - a resolver to remove.
Since:
10.1.3

getState

public boolean getState()

setState

public void setState(boolean b)

isToggle

public boolean isToggle()

isRadio

public boolean isRadio()

isActionMenu

public boolean isActionMenu()

setName

public void setName(java.lang.String name)
Sets the menu name (Action.NAME) strips out and sets the mnemonic key if any mnemonics are defined in the name. If no mnemonics are defined, the original (if any) is left untouched.

Parameters:
name -

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(), oracle.ide.MenuManager#createMenuItem(ToggleAction), oracle.ide.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)

listenForItemEvent

public void listenForItemEvent(javax.swing.AbstractButton button)

getValue

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

freezeKeyboard

protected static final void freezeKeyboard(boolean freeze)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

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