Java Doc for AbstractAction.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.AbstractAction

All known Subclasses:   javax.swing.text.TextAction,
AbstractAction
abstract public class AbstractAction implements Action,Cloneable,Serializable(Code)
This class provides default implementations for the JFC Action interface. Standard behaviors like the get and set methods for Action object properties (icon, text, and enabled) are defined here. The developer need only subclass this abstract class and define the actionPerformed method.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .
version:
   1.61 05/05/07
author:
   Georges Saab
See Also:   Action



Field Summary
protected  SwingPropertyChangeSupportchangeSupport
     If any PropertyChangeListeners have been registered, the changeSupport field describes them.
protected  booleanenabled
     Specifies whether action is enabled; the default is true.

Constructor Summary
public  AbstractAction()
     Creates an Action .
public  AbstractAction(String name)
     Creates an Action with the specified name.
public  AbstractAction(String name, Icon icon)
     Creates an Action with the specified name and small icon.

Method Summary
public synchronized  voidaddPropertyChangeListener(PropertyChangeListener listener)
     Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired in response to setting a bound property, e.g.

protected  Objectclone()
     Clones the abstract action.
protected  voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)
     Supports reporting bound property changes.
public  Object[]getKeys()
     Returns an array of Objects which are keys for which values have been set for this AbstractAction, or null if no keys have values set.
public synchronized  PropertyChangeListener[]getPropertyChangeListeners()
     Returns an array of all the PropertyChangeListeners added to this AbstractAction with addPropertyChangeListener().
public  ObjectgetValue(String key)
     Gets the Object associated with the specified key.
static  booleanhasSelectedKey(Action a)
    
public  booleanisEnabled()
     Returns true if the action is enabled.
static  booleanisSelected(Action a)
    
public  voidputValue(String key, Object newValue)
     Sets the Value associated with the specified key.
public synchronized  voidremovePropertyChangeListener(PropertyChangeListener listener)
     Removes a PropertyChangeListener from the listener list.
public  voidsetEnabled(boolean newValue)
     Sets whether the Action is enabled.
static  voidsetEnabledFromAction(JComponent c, Action a)
     Sets the enabled state of a component from an Action.
static  voidsetToolTipTextFromAction(JComponent c, Action a)
     Sets the tooltip text of a component from an Action.
static  booleanshouldReconfigure(PropertyChangeEvent e)
     Whether or not to reconfigure all action properties from the specified event.

Field Detail
changeSupport
protected SwingPropertyChangeSupport changeSupport(Code)
If any PropertyChangeListeners have been registered, the changeSupport field describes them.



enabled
protected boolean enabled(Code)
Specifies whether action is enabled; the default is true.




Constructor Detail
AbstractAction
public AbstractAction()(Code)
Creates an Action .



AbstractAction
public AbstractAction(String name)(Code)
Creates an Action with the specified name.
Parameters:
  name - the name ( Action.NAME ) for the action; avalue of null is ignored



AbstractAction
public AbstractAction(String name, Icon icon)(Code)
Creates an Action with the specified name and small icon.
Parameters:
  name - the name ( Action.NAME ) for the action; avalue of null is ignored
Parameters:
  icon - the small icon ( Action.SMALL_ICON ) for the action; avalue of null is ignored




Method Detail
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)(Code)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired in response to setting a bound property, e.g. setFont, setBackground, or setForeground. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property.
Parameters:
  listener - The PropertyChangeListener to be added
See Also:   Action.addPropertyChangeListener
See Also:   




clone
protected Object clone() throws CloneNotSupportedException(Code)
Clones the abstract action. This gives the clone its own copy of the key/value list, which is not handled for you by Object.clone().



firePropertyChange
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code)
Supports reporting bound property changes. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.



getKeys
public Object[] getKeys()(Code)
Returns an array of Objects which are keys for which values have been set for this AbstractAction, or null if no keys have values set. an array of key objects, or null if nokeys have values set
since:
   1.3



getPropertyChangeListeners
public synchronized PropertyChangeListener[] getPropertyChangeListeners()(Code)
Returns an array of all the PropertyChangeListeners added to this AbstractAction with addPropertyChangeListener(). all of the PropertyChangeListeners added or an emptyarray if no listeners have been added
since:
   1.4



getValue
public Object getValue(String key)(Code)
Gets the Object associated with the specified key.
Parameters:
  key - a string containing the specified key the binding Object stored with this key; if thereare no keys, it will return null
See Also:   Action.getValue



hasSelectedKey
static boolean hasSelectedKey(Action a)(Code)



isEnabled
public boolean isEnabled()(Code)
Returns true if the action is enabled. true if the action is enabled, false otherwise
See Also:   Action.isEnabled



isSelected
static boolean isSelected(Action a)(Code)



putValue
public void putValue(String key, Object newValue)(Code)
Sets the Value associated with the specified key.
Parameters:
  key - the String that identifies the stored object
Parameters:
  newValue - the Object to store using this key
See Also:   Action.putValue
See Also:   



removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)(Code)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
Parameters:
  listener - the PropertyChangeListener to be removed
See Also:   Action.removePropertyChangeListener
See Also:   



setEnabled
public void setEnabled(boolean newValue)(Code)
Sets whether the Action is enabled. The default is true .
Parameters:
  newValue - true to enable the action, false todisable it
See Also:   Action.setEnabled



setEnabledFromAction
static void setEnabledFromAction(JComponent c, Action a)(Code)
Sets the enabled state of a component from an Action.
Parameters:
  c - the Component to set the enabled state on
Parameters:
  a - the Action to set the enabled state from, may be null



setToolTipTextFromAction
static void setToolTipTextFromAction(JComponent c, Action a)(Code)
Sets the tooltip text of a component from an Action.
Parameters:
  c - the Component to set the tooltip text on
Parameters:
  a - the Action to set the tooltip text from, may be null



shouldReconfigure
static boolean shouldReconfigure(PropertyChangeEvent e)(Code)
Whether or not to reconfigure all action properties from the specified event.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.