org.w3c.jwput.tui
Class JWTUI

java.lang.Object
  |
  +--org.w3c.jwput.tui.JWTUI
All Implemented Interfaces:
JWUI

public class JWTUI
extends java.lang.Object
implements JWUI

Winie's Textual User Interface


Field Summary
protected  java.io.LineNumberReader in
           
 
Fields inherited from interface org.w3c.jwput.JWUI
ABORT_OPTION, APPROVE_OPTION, CANCEL_OPTION, ERROR_OPTION
 
Constructor Summary
JWTUI()
           
 
Method Summary
 int ask(java.lang.String[] message, java.lang.String[] question)
          Ask a question to the user.
 boolean askQuestion(java.lang.String question)
          Ask a question to the user.
 boolean askQuestion(java.lang.String[] message, java.lang.String question)
          Ask a question to the user.
 boolean askQuestion(java.lang.String[] message, java.lang.String[] question)
          Ask a question to the user.
 boolean askQuestion(java.lang.String message, java.lang.String question)
          Ask a question to the user.
 void displayError(java.lang.String msg)
          Display an error message
 void displayError(java.lang.String[] msg, java.lang.String title)
          Display a error message (on several lines)
 void displayError(java.lang.String msg, java.lang.String title)
          Display an error message
 void displayMessage(java.lang.String msg)
          Display a message
 void displayMessage(java.lang.String[] msg, java.lang.String title)
          Display a message (on several lines)
 void displayMessage(java.lang.String msg, java.lang.String title)
          Display a message
 void errlog(java.lang.String msg)
          Log an error
 java.lang.String[] getAuthentication(java.lang.String realm, java.lang.String message, boolean firstime)
          [0] username [1] password
 java.io.OutputStream getErrlogStream()
          Get a Stream on the errlog.
 java.lang.String getFile(java.lang.String title, java.lang.String message)
          Get a File from the user.
 java.lang.String getFile(java.lang.String title, java.lang.String[] message)
          Get a File from the user.
 java.io.OutputStream getLogStream()
          Get a Stream on the log.
 java.io.InputStream getMonitoredInputStream(java.io.InputStream in, java.lang.String message, int length)
          Get a monitored inputstream
 java.lang.String getString(java.lang.String message)
          Get a String from the user.
 java.lang.String getString(java.lang.String[] message)
          Get a String from the user.
 void hidelogs()
          Hide the log to the User (and still write in the log stream)
 void hidePopups()
          No message popup
 void log(java.lang.String msg)
          Log a string
protected  java.lang.String readLine()
           
 void setStatus(java.lang.String stat)
           
 void showlogs()
          Show the log to the User (and still write in the log stream)
 void showPopups()
          Display message popups
 void sync()
          Flush the logs (log and errlog)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected java.io.LineNumberReader in
Constructor Detail

JWTUI

public JWTUI()
Method Detail

readLine

protected java.lang.String readLine()
                             throws java.io.IOException

displayError

public void displayError(java.lang.String msg)
Display an error message
Specified by:
displayError in interface JWUI
Parameters:
msg - the error message

displayError

public void displayError(java.lang.String msg,
                         java.lang.String title)
Display an error message
Specified by:
displayError in interface JWUI
Parameters:
msg - the error message
title - the title

displayError

public void displayError(java.lang.String[] msg,
                         java.lang.String title)
Display a error message (on several lines)
Specified by:
displayError in interface JWUI
Parameters:
msg - the message
title - the title

displayMessage

public void displayMessage(java.lang.String msg)
Display a message
Specified by:
displayMessage in interface JWUI
Parameters:
msg - the message
title - the title

displayMessage

public void displayMessage(java.lang.String msg,
                           java.lang.String title)
Display a message
Specified by:
displayMessage in interface JWUI
Parameters:
msg - the message
title - the dialog title

displayMessage

public void displayMessage(java.lang.String[] msg,
                           java.lang.String title)
Display a message (on several lines)
Specified by:
displayMessage in interface JWUI
Parameters:
msg - the message
title - the dialog title

log

public void log(java.lang.String msg)
Log a string
Specified by:
log in interface JWUI
Parameters:
the - String to log

errlog

public void errlog(java.lang.String msg)
Log an error
Specified by:
errlog in interface JWUI
Parameters:
the - String to log

setStatus

public void setStatus(java.lang.String stat)
Specified by:
setStatus in interface JWUI

getFile

public java.lang.String getFile(java.lang.String title,
                                java.lang.String message)
Get a File from the user.
Specified by:
getFile in interface JWUI
Parameters:
message - the message to display
Returns:
a String instance

getFile

public java.lang.String getFile(java.lang.String title,
                                java.lang.String[] message)
Get a File from the user.
Specified by:
getFile in interface JWUI
Parameters:
message - the message to display
Returns:
a String instance

getString

public java.lang.String getString(java.lang.String message)
Get a String from the user.
Specified by:
getString in interface JWUI
Parameters:
message - the message to display
Returns:
a String instance

getString

public java.lang.String getString(java.lang.String[] message)
Get a String from the user.
Specified by:
getString in interface JWUI
Parameters:
message - the message to display
Returns:
a String instance

askQuestion

public boolean askQuestion(java.lang.String question)
Ask a question to the user.
Specified by:
askQuestion in interface JWUI
Parameters:
question - the Question return a boolean (true = yes, false = no)

askQuestion

public boolean askQuestion(java.lang.String message,
                           java.lang.String question)
Ask a question to the user.
Specified by:
askQuestion in interface JWUI
Parameters:
message - a message to display before the question
question - the Question return a boolean (true = yes, false = no)

askQuestion

public boolean askQuestion(java.lang.String[] message,
                           java.lang.String question)
Ask a question to the user.
Parameters:
question - the Question
message - a message to display before the question (several lines) return a boolean (true = yes, false = no)

askQuestion

public boolean askQuestion(java.lang.String[] message,
                           java.lang.String[] question)
Ask a question to the user.
Specified by:
askQuestion in interface JWUI
Parameters:
question - the Question (several lines)
message - a message to display before the question (several lines) return a boolean (true = yes, false = no)

ask

public int ask(java.lang.String[] message,
               java.lang.String[] question)
Ask a question to the user.
Specified by:
ask in interface JWUI
Parameters:
question - the Question (several lines)
message - a message to display before the question (several lines)
Returns:
APPROVE_OPTION, CANCEL_OPTION, ABORT_OPTION

getLogStream

public java.io.OutputStream getLogStream()
Get a Stream on the log.
Specified by:
getLogStream in interface JWUI
Returns:
an OutputStream

getErrlogStream

public java.io.OutputStream getErrlogStream()
Get a Stream on the errlog.
Specified by:
getErrlogStream in interface JWUI
Returns:
an OutputStream

getMonitoredInputStream

public java.io.InputStream getMonitoredInputStream(java.io.InputStream in,
                                                   java.lang.String message,
                                                   int length)
Get a monitored inputstream
Specified by:
getMonitoredInputStream in interface JWUI
Parameters:
the - inputstream to monitor
Returns:
the monitored inputstream

sync

public void sync()
Description copied from interface: JWUI
Flush the logs (log and errlog)
Specified by:
sync in interface JWUI

getAuthentication

public java.lang.String[] getAuthentication(java.lang.String realm,
                                            java.lang.String message,
                                            boolean firstime)
[0] username [1] password
Specified by:
getAuthentication in interface JWUI
Following copied from interface: org.w3c.jwput.JWUI
Parameters:
firstime - is is the first time we ask for a password?
Returns:
a String array containing { user, password }

showlogs

public void showlogs()
Show the log to the User (and still write in the log stream)
Specified by:
showlogs in interface JWUI

hidelogs

public void hidelogs()
Hide the log to the User (and still write in the log stream)
Specified by:
hidelogs in interface JWUI

hidePopups

public void hidePopups()
No message popup
Specified by:
hidePopups in interface JWUI

showPopups

public void showPopups()
Display message popups
Specified by:
showPopups in interface JWUI