|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.util.UserMessage
UserMessage
is class, which will accept messages that need to
be directed to the applet/application User. It is the responsibility of
the application to determine how to handle the messages. The default behavior
is to pass the message along to System.out.println().
This class was created with the idea that it would be enhanced to handle messages in various ways. Printing to an output stream is just the first, and most basic, mechanism.
UserMessage provides a means of sending messages to the console, when the application has use LogFile to re-direct debugging messages, sent to System.out, to a log file.
The following is an example of how UserMessage
message would be
directed to System.out:
// initialize UserMessage to System.out UserMessage.init( System.out );// initialize log file, which will redirect System.out to the log file LogFile.init(LOG_FILE, false, false);
UserMessage.send( "You do not have the access necessary to perform this action." );
LogFile
,
PrintStream
,
System.out
Field Summary | |
private static PrintStream |
stdOut
|
Constructor Summary | |
UserMessage()
|
Method Summary | |
static void |
init(PrintStream newOut)
Initialize with a PrintStream , which messages will be streamed to. |
static void |
send(String message)
Send a message to the user. |
static void |
sendWithoutLineBreak(String message)
Send a message to the user without a line break after the output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static PrintStream stdOut
Constructor Detail |
public UserMessage()
Method Detail |
public static void init(PrintStream newOut)
PrintStream
, which messages will be streamed to.
newOut
- the ouput stream, where messages will be sent.public static void send(String message)
message
- the message that needs to be delivered to the user.public static void sendWithoutLineBreak(String message)
message
- the message that needs to be delivered to the user.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |