talx x1.0.5

talx.controller.base
Class CCInterceptor

java.lang.Object
  extended bytalx.controller.base.CCInterceptor
All Implemented Interfaces:
ControllerListener, java.util.EventListener, GUIStateConstants, Interceptor, TALFeature

public class CCInterceptor
extends java.lang.Object
implements Interceptor, ControllerListener, GUIStateConstants

Interceptor to allow additional recipients to a composition. When the composer is open and the user clicks on a mailbox, this interceptor will allow the person associated with the mailbox to be added as a recipient of the message under composition.


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
 
Constructor Summary
CCInterceptor(java.lang.String param)
           
 
Method Summary
 boolean claim(java.awt.event.ActionEvent ev, Controller c)
          Determines whether this feature is responsible for the action.
 void controllerChange(ControllerChangeEvent ev)
          Sent when the controller wants the GUI to change state.
 void controllerChangeFinished(ChangeFinishedEvent ev)
          Makes sure the inbox is showing when the composer has focus.
 void controllerChangeVetoed(ActionVetoException ex)
          Sent when the system has decided not to transition on a user action.
 void initialize(Controller c)
          Allows the interceptor to change the gui state.
 void release()
          Releases all system resources held by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCInterceptor

public CCInterceptor(java.lang.String param)
Parameters:
param - the text to display in the dialog boxes. This string should consist of at most two key=value pairs. If the key "add" appears, then when a mailbox is newly selected, a dialog with the value for "add" will appear to allow the user to add the person as a recipient. If the key "remove" appears, then when a selected mailbox is clicked, a dialog with the value for "remove" will appear to allow the user to remove the person as a recipient. If either add or remove or both do not appear as keys, then those actions will happen automatically without a confirmation dialog box.
Method Detail

controllerChange

public void controllerChange(ControllerChangeEvent ev)
Description copied from interface: ControllerListener
Sent when the controller wants the GUI to change state.

Specified by:
controllerChange in interface ControllerListener

controllerChangeVetoed

public void controllerChangeVetoed(ActionVetoException ex)
Description copied from interface: ControllerListener
Sent when the system has decided not to transition on a user action.

Specified by:
controllerChangeVetoed in interface ControllerListener

controllerChangeFinished

public void controllerChangeFinished(ChangeFinishedEvent ev)
Makes sure the inbox is showing when the composer has focus.

Specified by:
controllerChangeFinished in interface ControllerListener

claim

public boolean claim(java.awt.event.ActionEvent ev,
                     Controller c)
              throws ActionVetoException
Description copied from interface: Interceptor
Determines whether this feature is responsible for the action. In response to this method, the feature can: Each feature can manage its own state in any way, including updating its state in response to unclaimed or vetoed actions. However, a feature may not update the volatile state without claiming the action. This is because the controller will not fire a changeFinishedEvent if the action is vetoed. Since, by not claiming the state, a feature leaves open the possibilty that another feature will veto it, it is only safe to update the state on actions that it claims. Once an action is claimed, the controller fires a changeFinishedEvent and stops propagating the action through the chain of responsibility.

Interceptors that wish to make some minor change to the gui state but not stop other effects from an action must make their change, refire the action via the controller's doAction() method, and then claim the action. Obviously, such interceptors must remember the action event to prevent them from reacting to it the next time.

Unlike ActionHandlers, which are stateless, Interceptors must manage their own state.

Specified by:
claim in interface Interceptor
Returns:
true to claim the action, false otherwise.
Throws:
ActionVetoException - to veto the action.

initialize

public void initialize(Controller c)
Description copied from interface: Interceptor
Allows the interceptor to change the gui state. This method is called in the controller init method just after the controller restores the state but before it fires the first controller change event.

Specified by:
initialize in interface Interceptor

release

public void release()
Description copied from interface: TALFeature
Releases all system resources held by this object. The general contract of pluggable features is that once their release method is called, they should be elligible for garbage collection. The exceptions to this are references to this object held in the ActionDispatcher and in the Transport model. Both of those objects are cleared by the system. However, in all other cases, if this object subscribed to a listener interface, it must unsubscribe in this method. This method should block until all object clean-up has been accomplished. This includes closing all open files, etc. Once the object has returned from the release method, the system may go down without further warning.

Specified by:
release in interface TALFeature

talx x1.0.5

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