Synergy Home Page

au.edu.swin.synergy.plugin.command.event
Class BStandardOutCE

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--au.edu.swin.synergy.kernel.BCommandEvent
              |
              +--au.edu.swin.synergy.plugin.command.event.BStandardOutCE

public class BStandardOutCE
extends BCommandEvent

This is the event which should be used whenever a general dialog with the user is required. It provides a means of both asking the user for a response to the query provided as well as simply notifying them of something.

The handler of this event may be either the BCommandLine or the BWindowManager, or anything else that registers itself as the listener for BStandardOutCE's.

Author:
Tristan Austin
See Also:
Serialized Form

Field Summary
static int kCancel
          The users response in the "cancelative"
static int kDefaultOption
          Indicates to use the default "ok" option for the user
static int kError
          Indicates that this is an error message
static int kInfo
          Indicates that this is an information message
static int kNo
          The users response in the negative
static int kOK
          The users response in the affirmative, this is the equivalent to kYes but included for ease of use reasons.
static int kOkCancelOption
          Indicates to use the default "ok/cancel" option for the user
static int kQuestion
          Indicates that this is an information message
static int kWarning
          Indicates that this is a warning message
static int kYes
          The users response in the affirmative
static int kYesNoCancelOption
          Indicates to use the default "yes/no/cancel" option for the user
static int kYesNoOption
          Indicates to use the default "yes/no" option for the user
 
Fields inherited from class au.edu.swin.synergy.kernel.BCommandEvent
connectionID, index, kBroadcast, kClient, kClientDone, kLocal, kServer, kServerDone, networkStatus, serialVersionUID
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BStandardOutCE(Object source, String message)
          Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events.
BStandardOutCE(Object source, String message, boolean requiresResponse, BCommandComplete completionObject)
          Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events.
BStandardOutCE(Object source, String message, boolean requiresResponse, int messageType, BCommandComplete completionObject)
          Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events.
 
Method Summary
 String getMessage()
          Gets the message to be displayed to the user.
 int getMessageType()
          Gets the type of message being displayed.
 int getUserResponse()
          When the completion object is called, calling this method will supply the users response to the message.
 int getUserResponseOption()
          Gets the response the user should select if they want to respond in the affirmative.
 boolean isResponseRequired()
          Indicates whether the user should be prompted for a response to the message displayed.
 void setMessageType(int messageType)
          Sets the type of message being displayed.
 void setUserResponse(int userResponse)
          Allows the handling module to set the response the user selected in the event so that the source of the event can receive the response.
 void setUserResponseOption(int userResponseOption)
          This will set the options the user has to response to one of the predefined values provided in this class.
 
Methods inherited from class au.edu.swin.synergy.kernel.BCommandEvent
decrementThreadCount, doComplete, doInit, getAutoComplete, getCompletionObject, getCompletionStatus, getConnectionID, getIndex, getNetworkStatus, getPipe, getUndoable, setAutoComplete, setCompletionObject, setCompletionStatus, setConnectionID, setIndex, setNetworkStatus, setPipe, setThreadCount, setUndoable
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kError

public static final int kError
Indicates that this is an error message

kInfo

public static final int kInfo
Indicates that this is an information message

kQuestion

public static final int kQuestion
Indicates that this is an information message

kWarning

public static final int kWarning
Indicates that this is a warning message

kDefaultOption

public static final int kDefaultOption
Indicates to use the default "ok" option for the user

kYesNoOption

public static final int kYesNoOption
Indicates to use the default "yes/no" option for the user

kYesNoCancelOption

public static final int kYesNoCancelOption
Indicates to use the default "yes/no/cancel" option for the user

kOkCancelOption

public static final int kOkCancelOption
Indicates to use the default "ok/cancel" option for the user

kYes

public static final int kYes
The users response in the affirmative

kNo

public static final int kNo
The users response in the negative

kOK

public static final int kOK
The users response in the affirmative, this is the equivalent to kYes but included for ease of use reasons.

kCancel

public static final int kCancel
The users response in the "cancelative"
Constructor Detail

BStandardOutCE

public BStandardOutCE(Object source,
                      String message)
Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events. This constructor will set the requires response flags to false as the default so it may be used to simply notify the users of a message.
Parameters:
source - The source of the event
message - The message for the user

BStandardOutCE

public BStandardOutCE(Object source,
                      String message,
                      boolean requiresResponse,
                      BCommandComplete completionObject)
Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events.
Parameters:
source - The source of the event
message - The message for the user
requiresResponse - True to get a response back, false otherwise
completionObject - The class to be told when the user responds

BStandardOutCE

public BStandardOutCE(Object source,
                      String message,
                      boolean requiresResponse,
                      int messageType,
                      BCommandComplete completionObject)
Cretaes a new BStandardOutCE to be sent to the plugin responsible for such events.
Parameters:
source - The source of the event
message - The message for the user
requiresResponse - True to get a response back, false otherwise
completionObject - The class to be told when the user responds
Method Detail

getMessage

public String getMessage()
Gets the message to be displayed to the user.
Returns:
The message in a String

isResponseRequired

public boolean isResponseRequired()
Indicates whether the user should be prompted for a response to the message displayed.
Returns:
True if they should, false otherwise

getUserResponseOption

public int getUserResponseOption()
Gets the response the user should select if they want to respond in the affirmative.
Returns:
The label as as a String

setUserResponseOption

public void setUserResponseOption(int userResponseOption)
This will set the options the user has to response to one of the predefined values provided in this class.
Parameters:
userResponseOption - kDefaultOption, kOkCancelOption, kYesNoCancelOption, kYesNoOption

setUserResponse

public void setUserResponse(int userResponse)
Allows the handling module to set the response the user selected in the event so that the source of the event can receive the response.
Parameters:
userResponse - The response from the user kYes, kNo, kCancel

getUserResponse

public int getUserResponse()
When the completion object is called, calling this method will supply the users response to the message.
Returns:
One of kYes, kNo or kCancel Depending ont he users response

setMessageType

public void setMessageType(int messageType)
Sets the type of message being displayed. Depending on the value given here, the message may be represented differently on screen.
Parameters:
messageType - kInfo or kError

getMessageType

public int getMessageType()
Gets the type of message being displayed. Depending on the value given here, the message may be represented differently on screen.
Parameters:
messageType - kInfo or kError

Synergy Home Page