talx x1.0.5

talx.controller.simple
Class BusyComposerHandler

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

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

Used when the composer is open.

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 BusyComposerHandler getInstance()
          Returns the only object of this type.
 ActionHandler handleAction(java.awt.event.ActionEvent ev, Controller c)
          Handles an action event and transitions to a new action handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BusyComposerHandler 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
Description copied from interface: ActionHandler
Handles an action event and transitions to a new action handler. If there is no need to switch action handlers, this method should return "this". If the handler determines that it cannot handle the event, it should fire an Illegal button click event and then throw an action veto exception.

If the GUIState changes as a result of the action, this method should call the controller's fireControllerChange method after setting the new state. Although a normal return from this method will trigger a controller change finished event, visual components are not required to listen for changes that were not introduced via controller change events.

It is also customary for handlers to "initialize" themselves and/or the controller when ev == null. The interpretation of initialization is left to the handler writer; however, handler classes that are used as initial handlers will be called with ev == null at system start-up. Classes that cannot be used as initialHandlers should throw a NullPointerException when called with a null event.

Specified by:
handleAction in interface ActionHandler
Throws:
ActionVetoException - to suppress a controller change finished event upon termination.

talx x1.0.5

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