talx x1.0.5

talx.controller.base
Class DialogInterceptor.DialogTree

java.lang.Object
  extended bytalx.controller.base.DialogInterceptor.DialogTree
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
DialogInterceptor

protected class DialogInterceptor.DialogTree
extends java.lang.Object
implements java.io.Serializable

class to manage sequences of dialogs to be shown.

Note: this class implements serializable, but it does not check if the Runnables supplied in the constructor are Serializable. Attempting to serialize objects of this type that contain non-serializable runnables will result in an error.

See Also:
Serialized Form

Constructor Summary
DialogInterceptor.DialogTree(java.lang.String message, DialogInterceptor.DialogRunner whenYes, DialogInterceptor.DialogRunner whenNo, boolean confirm, DialogInterceptor.DialogTree onYes, DialogInterceptor.DialogTree onNo, DialogInterceptor.DialogActivator da, boolean defaultToYes)
          Creates a new entry in a dialog stack.
 
Method Summary
 DialogInterceptor.DialogTree doDefault(Controller c)
          Runs the default action.
 DialogInterceptor.DialogTree doNo(Controller c)
          Runs the action appropriate for a no response from the user.
 DialogInterceptor.DialogTree doYes(Controller c)
          Runs the action appropriate for a yes response from the user.
 java.lang.String getMessage()
           
 boolean isChoice()
          Returns true if this dialog represents a choice for the user.
 boolean isConfirm()
          Returns true if this dialog represents a confirmation of the user's action.
 boolean shouldShow(Controller c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogInterceptor.DialogTree

public DialogInterceptor.DialogTree(java.lang.String message,
                                    DialogInterceptor.DialogRunner whenYes,
                                    DialogInterceptor.DialogRunner whenNo,
                                    boolean confirm,
                                    DialogInterceptor.DialogTree onYes,
                                    DialogInterceptor.DialogTree onNo,
                                    DialogInterceptor.DialogActivator da,
                                    boolean defaultToYes)
Creates a new entry in a dialog stack.

Parameters:
message - the text to show in the dialog box.
whenYes - the action to perform when the user clicks "yes". If null, doYes does nothing.
whenNo - the action to perform when the user clicks "no". If null, doNo does nothing.
onYes - the link in the list to return from the doYes method.
onNo - the link in the list to return from the doNo method.
confirm - if yes, this describes a confirmation action. Otherwise, this represents a choice for the user.
da - determines whether the dialog should be shown or not.
defaultToYes - indicates whether the default action (ie the action taken when the activator returns false) should be the yes action or not.
Method Detail

doYes

public DialogInterceptor.DialogTree doYes(Controller c)
Runs the action appropriate for a yes response from the user.


doNo

public DialogInterceptor.DialogTree doNo(Controller c)
Runs the action appropriate for a no response from the user.


doDefault

public DialogInterceptor.DialogTree doDefault(Controller c)
Runs the default action.


getMessage

public java.lang.String getMessage()

isConfirm

public boolean isConfirm()
Returns true if this dialog represents a confirmation of the user's action. In general, the system recognizes a no response to a confirmation dialog as a mistake by the user (ie. the action that summoned the dialog was a mistake.)


isChoice

public boolean isChoice()
Returns true if this dialog represents a choice for the user. In general, the system does not take a no response to a choice dialog to be significant in terms of the user's understanding of the system. Both the yes and no options are considered equal as far as determining whether the user is facile with the interface.


shouldShow

public boolean shouldShow(Controller c)

talx x1.0.5

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