no.uio.edd.utils.datautils
Class MessageViewer

java.lang.Object
  extended by no.uio.edd.utils.datautils.MessageViewer

public class MessageViewer
extends java.lang.Object

Used to display popup messages. Contains static methods for error and info messages as well as non-static methods for table selector popup windows.

Author:
holmen

Constructor Summary
MessageViewer(javax.swing.JFrame thisFrame)
           
 
Method Summary
static void errMessage(javax.swing.JFrame thisFrame, java.lang.String message)
          Show an error message.
static java.lang.String getInput(javax.swing.JFrame thisFrame, java.lang.String message)
          Show a message and get a reply to it from the user.
static java.lang.String getInput(javax.swing.JFrame thisFrame, java.lang.String message, java.lang.String initialValue)
          Show a message and get a reply to it from the user.
static void infoMessage(javax.swing.JFrame thisFrame, java.lang.String message)
          Show an info message.
 void killTableMessage()
          Kill this table popup window.
static void longMessage(javax.swing.JFrame thisFrame, java.lang.String message)
          Show a long message in a large window, with disable button on the bottom.
static void longMessage(javax.swing.JFrame thisFrame, java.lang.String message, java.lang.String title)
          Show a long message in a large window, with disable button on the bottom.
static void longMessage(javax.swing.JFrame thisFrame, java.lang.String message, java.lang.String title, java.lang.String contentType, int xLoc, int yLoc, int xSize, int ySize)
           
static int question(javax.swing.JFrame thisFrame, java.lang.String message)
          Asks a yes/no-question.
static int questionPreselectedNo(javax.swing.JFrame thisFrame, java.lang.String message)
          Asks a yes/no-question.
 void tableMessage(TableDialog messTable)
          Show a table in a popup window with default size and title located on a default place on screen.
 void tableMessage(TableDialog messTable, java.lang.String windowTitle)
          Show a table in a popup window with default size located on a default place on screen.
 void tableMessage(TableDialog messTable, java.lang.String windowTitle, int xLoc, int yLoc, int xSize, int ySize)
          Show a table in a popup window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageViewer

public MessageViewer(javax.swing.JFrame thisFrame)
Parameters:
thisFrame - the frame to connect the message viewer object (that is, the windows created by it) to.
Method Detail

errMessage

public static void errMessage(javax.swing.JFrame thisFrame,
                              java.lang.String message)
Show an error message.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.

infoMessage

public static void infoMessage(javax.swing.JFrame thisFrame,
                               java.lang.String message)
Show an info message.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.

longMessage

public static void longMessage(javax.swing.JFrame thisFrame,
                               java.lang.String message,
                               java.lang.String title,
                               java.lang.String contentType,
                               int xLoc,
                               int yLoc,
                               int xSize,
                               int ySize)
Parameters:
thisFrame -
message -
title -
contentType -
xLoc -
yLoc -
xSize -
ySize -

longMessage

public static void longMessage(javax.swing.JFrame thisFrame,
                               java.lang.String message,
                               java.lang.String title)
Show a long message in a large window, with disable button on the bottom.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.
title - the title of the message window.

longMessage

public static void longMessage(javax.swing.JFrame thisFrame,
                               java.lang.String message)
Show a long message in a large window, with disable button on the bottom.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.

getInput

public static java.lang.String getInput(javax.swing.JFrame thisFrame,
                                        java.lang.String message)
Show a message and get a reply to it from the user.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.
Returns:
The reply from the user.

getInput

public static java.lang.String getInput(javax.swing.JFrame thisFrame,
                                        java.lang.String message,
                                        java.lang.String initialValue)
Show a message and get a reply to it from the user.

Parameters:
thisFrame - the frame to connect to.
message - the message to display.
initialValue - the initial value for the reply.
Returns:
The reply from the user.

question

public static int question(javax.swing.JFrame thisFrame,
                           java.lang.String message)
Asks a yes/no-question. The preselected answer is yes.

Parameters:
thisFrame - the frame to connect to.
message - the question to display.
Returns:
Yes: 0. No: 1. Cancel: 2

questionPreselectedNo

public static int questionPreselectedNo(javax.swing.JFrame thisFrame,
                                        java.lang.String message)
Asks a yes/no-question. The preselected answer is no.

Parameters:
thisFrame - the frame to connect to.
message - the question to display.
Returns:
Yes: 0. No: 1. Cancel: 2

tableMessage

public void tableMessage(TableDialog messTable)
Show a table in a popup window with default size and title located on a default place on screen. Use the method killTableMessage to remove the popup window.

Parameters:
messTable - the table to be displayed. Any event listener on the table is active.

tableMessage

public void tableMessage(TableDialog messTable,
                         java.lang.String windowTitle)
Show a table in a popup window with default size located on a default place on screen. Use the method killTableMessage to remove the popup window.

Parameters:
messTable - the table to be displayed. Any event listener on the table is active.
windowTitle - the title for the popup window.

tableMessage

public void tableMessage(TableDialog messTable,
                         java.lang.String windowTitle,
                         int xLoc,
                         int yLoc,
                         int xSize,
                         int ySize)
Show a table in a popup window. Use the method killTableMessage to remove the popup window.

Parameters:
messTable - the table to be displayed. Any event listener on the table is active.
windowTitle - the title for the popup window.
xLoc - location on screen.
yLoc - location on screen.
xSize - size of window.
ySize - size of window.

killTableMessage

public void killTableMessage()
Kill this table popup window. If it does not exist, nothing is done.