talx x1.0.5

talx.controller.mixed
Class ReaderHandler

java.lang.Object
  extended bytalx.controller.mixed.ReaderHandler
All Implemented Interfaces:
ActionHandler, GUIStateConstants, java.io.Serializable

public final class ReaderHandler
extends java.lang.Object
implements ActionHandler, GUIStateConstants

Used when the reader contains a message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface talx.model.GUIStateConstants
ACTIVE_COMMANDS, ARCHIVE_MESSAGE, CHOICE_DIALOG, COMPOSE_FOCUS, COMPOSE_WINDOW, COMPOSER_CAPTION, COMPOSER_DIRTY, CONFIRM_DIALOG, CURRENT_PEOPLE, CURRENT_PLAYER, DEFAULT_MESSAGE, DIALOG_FOCUS, DIALOG_TEXT, INBOX_FOCUS, INBOX_MAIL_COUNTS, INBOX_MAIL_COUNTS_ANSWERED, INBOX_MAIL_COUNTS_NEW, INBOX_PANEL, INBOX_PLAYER_CAPTIONS, NO_CHANGE, NO_MESSAGE, NO_PEOPLE, NO_PERSON, NO_PLAYER, READER_CAPTION, READER_FOCUS, READER_HEADERS, READER_WINDOW, STATE_ABBR, STATE_CONST, STATE_DESC
 
Method Summary
 boolean canRun(GUIState state, Controller c)
          This method tells the controller whether the given handler will function in the given GUIState.
static ReaderHandler getInstance()
          Returns the only object of this type.
 ActionHandler handleAction(java.awt.event.ActionEvent ev, Controller c)
          Handles reader controls.
 ActionHandler handleReply(Controller c)
           
 GUIState setComposeCaption(GUIState s, Settings settings)
          Returns a state with an appropriate composer caption.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ReaderHandler getInstance()
Returns the only object of this type.


canRun

public boolean canRun(GUIState state,
                      Controller c)
Description copied from interface: ActionHandler
This method tells the controller whether the given handler will function in the given GUIState. For example, if a given handler only responds to Inbox actions, then this method should test the given GUIState to make sure the inbox flag is set.

Specified by:
canRun in interface ActionHandler
Parameters:
state - the current visual state of the system
Returns:
true if the given visual state will support this behavioral state. False if using this handler would lock up the system.

handleAction

public ActionHandler handleAction(java.awt.event.ActionEvent ev,
                                  Controller c)
                           throws ActionVetoException
Handles reader controls. This method handles delete button presses by deleting the message and resetting the interface, reply button presses by setting up the composer to get a reply, and other reader controls by clearing the interface (ie calling the initial handler with a null event). If the control is not a reader control, this method delegates to the initial handler class's handleAction method.
Note: Calling this method from the initial handler class without knowing that the control is a reader control will result in an infinite loop.

Specified by:
handleAction in interface ActionHandler
Throws:
java.lang.NullPointerException - if ev is null. This class cannot be used as an initial handler class because that would result in an infinite loop on controls that are not reader controls.
ActionVetoException - to suppress a controller change finished event upon termination.

handleReply

public ActionHandler handleReply(Controller c)

setComposeCaption

public GUIState setComposeCaption(GUIState s,
                                  Settings settings)
Returns a state with an appropriate composer caption.

Parameters:
s - the state containing the appropriate list of people.
settings - the settings containing the base initiate and response captions.
Returns:
s modified to contain a composer caption appropriate to its list of people and the base captions found in settings.

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.