eTextReader.actions
Class NotationListingAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by eTextReader.actions.BaseAction
          extended by eTextReader.actions.NotationListingAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
AnnotationTypeAction, AuthorListingAction, CurrentPageNotationAction, CurrentUserAnnotationAction, HighlightTypeNotationAction, TextbookAction

public abstract class NotationListingAction
extends BaseAction

Provides the functionality allowing us to display an AnnotationListing. The actionPerformed method of this class constructs a NotationListing object to show the desired annotations. By default, all pages containing any type of annotation are shown. The methods getNotationProvider() and getNotationFilter() are used to construct the NotationListing object when the action is invoked, and allow sub-classes to specify an arbitrary set of pages to be included in the search for annotations, as well as a means to filter out which annotations on those pages are included. Notation providers or filters that require specialized configuration (such as interaction with the user or querying of a database) are supported through the configureProvider and configureFilter methods.

The action is configured using the results of the abstract getName() and getTooltipText methods, which are used for the Action.NAME and Action.SHORT_DESCRIPTION properties.

Since it descends from BaseAction, there is a single instance of these actions associated with a given ContentContainer.

Author:
mcfall
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class eTextReader.actions.BaseAction
BaseAction.Key
 
Field Summary
protected  ContentContainer container
           
protected  NotationFilter filter
           
protected  NotationProvider provider
           
 
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 NotationListingAction(ContentContainer container)
          Constructs a NotationListingAction without an icon representation
protected NotationListingAction(ContentContainer container, java.lang.String fileName)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  void configureFilter()
           Allows an action to interact with the user to configure the NotationFilter in some way.
protected  void configureProvider()
           Allows an action to interact with the user to configure the NotationProvider in some way.
protected abstract  java.lang.String getName()
          Returns the name associated with this action, displayed in menus, buttons, etc.
protected  NotationFilter getNotationFilter()
          Returns the NotationFilter used to filter the set of annotations that are displayed by the NotationListing interface.
protected  NotationProvider getNotationProvider()
          Returns the NotationProvider used to provide a set of pages to the NotationListing interface.
protected abstract  java.lang.String getTooltipText()
          Returns the tooltip text associated with this action
 
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
 

Field Detail

container

protected ContentContainer container

provider

protected NotationProvider provider

filter

protected NotationFilter filter
Constructor Detail

NotationListingAction

protected NotationListingAction(ContentContainer container)
Constructs a NotationListingAction without an icon representation


NotationListingAction

protected NotationListingAction(ContentContainer container,
                                java.lang.String fileName)
Parameters:
fileName -
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

configureProvider

protected void configureProvider()

Allows an action to interact with the user to configure the NotationProvider in some way. For example, it might allow the user to select a set of book chapters to be included.

configureProvider is called by actionPerformed before the NotationListing object is constructed. The default implementation does nothing.


configureFilter

protected void configureFilter()

Allows an action to interact with the user to configure the NotationFilter in some way. For example, it might allow the user to specify a date range or select a subset of annotation types to be displayed

configureFilter is called by actionPerformed before the NotationListing object is constructed. The default implementation does nothing.


getNotationProvider

protected NotationProvider getNotationProvider()
Returns the NotationProvider used to provide a set of pages to the NotationListing interface. The default implementation returns an instance of AllPagesProvider

Returns:
the NotationProvider associated with this action

getNotationFilter

protected NotationFilter getNotationFilter()
Returns the NotationFilter used to filter the set of annotations that are displayed by the NotationListing interface. The default implementation returns an instance of IncludeAllFilter

Returns:
the NotationFilter associated with this action

getName

protected abstract java.lang.String getName()
Returns the name associated with this action, displayed in menus, buttons, etc.

Returns:
the String used to represent this action

getTooltipText

protected abstract java.lang.String getTooltipText()
Returns the tooltip text associated with this action

Returns:
the String used as the tooltip text