org.w3c.jwput
Interface JWUI

All Known Implementing Classes:
JWGUI, JWTUI

public interface JWUI

The JWUI interface is a generic User Interface


Field Summary
static int ABORT_OPTION
          Return value if abort is chosen.
static int APPROVE_OPTION
          Return value if approve (yes, ok) is chosen.
static int CANCEL_OPTION
          Return value if cancel is chosen.
static int ERROR_OPTION
          Return value if an error occured.
 
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.
 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 log)
          Log an error
 java.lang.String[] getAuthentication(java.lang.String realm, java.lang.String message, boolean firstime)
          Get a username and a 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 log)
          Log a string
 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)
 

Field Detail

CANCEL_OPTION

public static final int CANCEL_OPTION
Return value if cancel is chosen.

APPROVE_OPTION

public static final int APPROVE_OPTION
Return value if approve (yes, ok) is chosen.

ABORT_OPTION

public static final int ABORT_OPTION
Return value if abort is chosen.

ERROR_OPTION

public static final int ERROR_OPTION
Return value if an error occured.
Method Detail

getAuthentication

public java.lang.String[] getAuthentication(java.lang.String realm,
                                            java.lang.String message,
                                            boolean firstime)
Get a username and a password
Parameters:
firstime - is is the first time we ask for a password?
Returns:
a String array containing { user, password }

getFile

public java.lang.String getFile(java.lang.String title,
                                java.lang.String message)
Get a File from the user.
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.
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.
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.
Parameters:
message - the message to display
Returns:
a String instance

askQuestion

public boolean askQuestion(java.lang.String question)
Ask a question to the user.
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.
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 (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.
Parameters:
question - the Question (several lines)
message - a message to display before the question (several lines)
Returns:
APPROVE_OPTION, CANCEL_OPTION, ABORT_OPTION

displayError

public void displayError(java.lang.String msg)
Display an error message
Parameters:
msg - the error message

displayError

public void displayError(java.lang.String msg,
                         java.lang.String title)
Display an error message
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)
Parameters:
msg - the message
title - the title

displayMessage

public void displayMessage(java.lang.String msg)
Display a message
Parameters:
msg - the message

displayMessage

public void displayMessage(java.lang.String msg,
                           java.lang.String title)
Display a message
Parameters:
msg - the message
title - the title

displayMessage

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

setStatus

public void setStatus(java.lang.String stat)

log

public void log(java.lang.String log)
Log a string
Parameters:
the - String to log

errlog

public void errlog(java.lang.String log)
Log an error
Parameters:
the - String to log

sync

public void sync()
Flush the logs (log and errlog)

getLogStream

public java.io.OutputStream getLogStream()
Get a Stream on the log.
Returns:
an OutputStream

getErrlogStream

public java.io.OutputStream getErrlogStream()
Get a Stream on the errlog.
Returns:
an OutputStream

getMonitoredInputStream

public java.io.InputStream getMonitoredInputStream(java.io.InputStream in,
                                                   java.lang.String message,
                                                   int length)
Get a monitored inputstream
Parameters:
in - the inputstream to monitor
message - the message to display during monitoring
length - the number of byte to be read
Returns:
the monitored inputstream

showlogs

public void showlogs()
Show the log to the User (and still write in the log stream)

hidelogs

public void hidelogs()
Hide the log to the User (and still write in the log stream)

hidePopups

public void hidePopups()
No message popup

showPopups

public void showPopups()
Display message popups