|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
eTextReader.actions.BaseAction
eTextReader.actions.CurrentAnnotationAction
public abstract class CurrentAnnotationAction
An Action object that tracks the currently selected annotation. Sub-classes can retrieve the current annotation by calling the method getCurrentNotation. Sub-classes can perform custom actions based on the current annotation by overriding the notationEntered, notationSelected and notationExited methods.
The method configureActionOnEnter can be used to alter the way the action presents itself in menus, buttons, etc. These properties are set to reasonable values by this class, making custom configuration unnecessary in most cases.
An implementation can specify whether not it can handle annotations of a specific type using the isEnabledForType method, which by default includes all types of annotations.
Nested Class Summary | |
---|---|
(package private) class |
CurrentAnnotationAction.NotationHandler
Listens for NotationEvents to be generated by the content pane associated with this CurrentAnnotationAction |
Nested classes/interfaces inherited from class eTextReader.actions.BaseAction |
---|
BaseAction.Key |
Field Summary | |
---|---|
protected CurrentAnnotationAction.NotationHandler |
notationHandler
|
Fields inherited from class eTextReader.actions.BaseAction |
---|
instances |
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 | |
---|---|
protected |
CurrentAnnotationAction(ContentContainer contentPane)
Constructs a new CurrentAnnotationAction associated with the specified content pane. |
protected |
CurrentAnnotationAction(ContentContainer contentPane,
java.lang.String filename)
Constructs a new CurrentAnnotationAction associated with the specified content pane and using the specified icon |
Method Summary | |
---|---|
protected void |
configureActionOnEnter()
Configures the name and short description (tool-tip text) properties of this action when the notation is entered. |
abstract java.lang.String |
getActionText()
Returns the verb that should be used to describe the action taken by this Action. |
protected Notation |
getCurrentNotation()
Retrieves the current notation being worked with in the content pane associated with this CurrentAnnotationAction |
protected boolean |
isEnabledForType(Notation.AnnotationType type)
Determines whether this action is enabled for the given type of annotation. |
protected void |
notationEntered(NotationEvent ne)
Called when a notation is entered. |
protected void |
notationExited(NotationEvent ne)
Called when a notation is exited. |
protected void |
notationSelected(NotationEvent ne)
Called when a notation is selected. |
Methods inherited from class eTextReader.actions.BaseAction |
---|
getAcceleratorKeyStrokeFromPreferences, getInstance, propertyChange |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, 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 |
---|
protected CurrentAnnotationAction.NotationHandler notationHandler
Constructor Detail |
---|
protected CurrentAnnotationAction(ContentContainer contentPane)
contentPane
- the content pane whose NotationEvents should
be listened toprotected CurrentAnnotationAction(ContentContainer contentPane, java.lang.String filename)
contentPane
- the content pane whose NotationEvents should
be listened tofilename
- the filename of the icon used to represent the actionMethod Detail |
---|
protected Notation getCurrentNotation()
public abstract java.lang.String getActionText()
protected void configureActionOnEnter()
Configures the name and short description (tool-tip text) properties of this action when the notation is entered.
The default implementation sets the NAME property of the action to getActionText(), a space, and the type of the annotation. The SHORT_DESCRIPTION property is set to getActionText(), " this ", and the type of the annotation. Sub-classes can override this method to change these default values
protected void notationEntered(NotationEvent ne)
ne
- the NotationEvent representing the entering of the notationconfigureActionOnEnter()
protected void notationSelected(NotationEvent ne)
ne
- the NotationEvent representing the selection of the notationconfigureActionOnEnter()
protected void notationExited(NotationEvent ne)
ne
- the NotationEvent representing the exiting of the notationprotected boolean isEnabledForType(Notation.AnnotationType type)
type
- the type of annotation in question
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |