|
JHotDraw 7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractAction
org.jhotdraw.app.action.AbstractViewAction
public abstract class AbstractViewAction
An Action that acts on on the current View of an
Application.
If the current View object is disabled or is null, the
AbstractViewAction is disabled as well.
A property name can be specified. When the specified property changes or when the current view changes, method updateView is invoked.
View,
Application,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
ENABLED_PROPERTY
|
static java.lang.String |
VIEW_PROPERTY
|
| 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 | |
|---|---|
AbstractViewAction(Application app)
Creates a new instance. |
|
| Method Summary | |
|---|---|
View |
getActiveView()
|
Application |
getApplication()
|
protected java.lang.String |
getPropertyName()
Gets the property name. |
protected void |
installViewListeners(View p)
Installs listeners on the view object. |
boolean |
isEnabled()
Returns true if the action is enabled. |
void |
setEnabled(boolean newValue)
Enables or disables the action. |
protected void |
setPropertyName(java.lang.String name)
Sets the property name. |
protected void |
uninstallViewListeners(View p)
Uninstalls listeners on the view object. |
protected void |
updateEnabled(boolean oldValue,
boolean newValue)
Updates the enabled state of this action depending on the new enabled state of the view. |
protected void |
updateView()
This method is invoked, when the property changed and when the view changed. |
protected void |
updateView(View oldValue,
View newValue)
Updates the listeners of this action depending on the current view of the application. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener |
| 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 |
|---|
public static final java.lang.String VIEW_PROPERTY
public static final java.lang.String ENABLED_PROPERTY
| Constructor Detail |
|---|
public AbstractViewAction(Application app)
| Method Detail |
|---|
protected void updateView(View oldValue,
View newValue)
protected void setPropertyName(java.lang.String name)
protected java.lang.String getPropertyName()
protected void updateView()
protected void installViewListeners(View p)
protected void uninstallViewListeners(View p)
protected void updateEnabled(boolean oldValue,
boolean newValue)
public Application getApplication()
public View getActiveView()
public boolean isEnabled()
isEnabled in interface javax.swing.ActionisEnabled in class javax.swing.AbstractActionAction.isEnabled()public void setEnabled(boolean newValue)
setEnabled in interface javax.swing.ActionsetEnabled in class javax.swing.AbstractActionnewValue - true to enable the action, false to
disable itAction.setEnabled(boolean)
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||