com.isti.util
Interface IstiDialogInterface

All Superinterfaces:
javax.swing.WindowConstants
All Known Implementing Classes:
IstiDialogPopup, IstiPasswordDialog, ProgressDialog

public interface IstiDialogInterface
extends javax.swing.WindowConstants

Interface IstiDialogInterface defines the methods used to operate a 'IstiDialogPopup' object. Other objects may use this interface to optionally operate a dialog popup without having to reference the 'IstiDialogPopup' class.


Field Summary
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Method Summary
 void close()
          Closes the popup dialog window.
 void close(java.lang.Object obj)
          Closes the popup dialog window.
 void closeWithWait(int maxWaitTimeMs)
          Waits (if necessary) for the popup dialog window to be visible and then closes it.
 void closeWithWait(java.lang.Object obj, int maxWaitTimeMs)
          Waits (if necessary) for the popup dialog window to be visible and then closes it.
 void dispose()
          Disposes the popup dialog window.
 java.lang.Object getInputValue()
          Returns the value the user has input.
 java.lang.Object getMessageObj()
          Returns the message object displayed by this dialog.
 java.lang.String getMessageStr()
          Returns the message string displayed by this dialog.
 java.lang.String getTitleStr()
          Returns the title displayed by this dialog.
 java.lang.String getUserMessageString()
          Returns the user-defined message string set via the 'setMessageString()' method.
 java.lang.Object getValue()
          Returns the value the user has selected.
 void hide()
          Hides the popup dialog window.
 void invalidate()
          Invalidates the popup dialog window.
 boolean isModal()
          Returns the modal status of the dialog.
 boolean isShowing()
          Returns true if the popup dialog window is showing.
 boolean isVisible()
          Determines whether the popup dialog should be visible when its parent is visible.
 void pack()
          Causes this dialog to be sized to fit the preferred size and layouts of its subcomponents.
 void repaint()
          Repaints the popup dialog window.
 void requestFocus()
          Requests that the dialog get the input focus, and that the dialog's top-level ancestor become the focused Window.
 void setDefaultCloseOperation(int selVal)
          Sets the operation which will happen by default when the user initiates a "close" on this dialog.
 void setInitialFocus()
          Requests that the current "initial" component have focus.
 void setLocation(int x, int y)
          Moves the dialog to a new location.
 void setMessageObj(java.lang.Object obj)
          Sets the message object displayed by this dialog.
 void setMessageStr(java.lang.String str)
          Sets the message object displayed by this dialog to the given string.
 void setModal(boolean modalFlag)
          Specifies whether this dialog should be modal.
 void setResizable(boolean resizableFlag)
          Sets whether the dialog is resizable by the user.
 void setSize(int width, int height)
          Sets the size of the dialog.
 void setTitleStr(java.lang.String str)
          Sets the title displayed by this dialog.
 void setUserMessageString(java.lang.String str)
          Sets a user-defined message string that may be fetched via the 'getMessageString()' method.
 void setVisible(boolean flgVal)
          Sets the visibility of the dialog window.
 void setVisibleViaInvokeLater(boolean flgVal)
          Sets the visibility of the dialog window, using the event-dispatch thread via a call to 'SwingUtilities.invokeLater()'.
 java.lang.Object show()
          Displays the popup dialog window.
 java.lang.Object showAndWait()
          Displays the popup dialog window.
 void validate()
          Validates the popup dialog window.
 boolean waitForDialogVisible(int maxWaitTimeMs)
          Waits for the popup dialog window to be visible, up to the given maximum time value.
 

Method Detail

show

java.lang.Object show()
Displays the popup dialog window. If the dialog is modal then this method blocks until the dialog is dismissed by the user or the 'close()' method is called.

Returns:
The Object chosen by the user (UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice) or the value entered via the 'close()' method.

showAndWait

java.lang.Object showAndWait()
Displays the popup dialog window. The method blocks until the dialog is dismissed by the user or the 'close()' method is called (even if the window is non-modal).

Returns:
The Object chosen by the user (UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice) or the value entered via the 'close()' method.

setVisible

void setVisible(boolean flgVal)
Sets the visibility of the dialog window. If the dialog is non-modal then the call is redirected to the dialog object's 'show()' or 'hide()' method (depending on the state of the given flag parameter).

Parameters:
flgVal - true for visible, false for hidden.

setVisibleViaInvokeLater

void setVisibleViaInvokeLater(boolean flgVal)
Sets the visibility of the dialog window, using the event-dispatch thread via a call to 'SwingUtilities.invokeLater()'. This allows a modal dialog to be shown without blocking the invoking thread.

Parameters:
flgVal - true for visible, false for hidden.

isVisible

boolean isVisible()
Determines whether the popup dialog should be visible when its parent is visible.

Returns:
true if the popup dialog is visible; false otherwise.

isShowing

boolean isShowing()
Returns true if the popup dialog window is showing.

Returns:
true if the popup dialog window is showing, false if not.

waitForDialogVisible

boolean waitForDialogVisible(int maxWaitTimeMs)
Waits for the popup dialog window to be visible, up to the given maximum time value.

Parameters:
maxWaitTimeMs - the maximum time to wait, in milliseconds.
Returns:
true if the dialog is visible, false if the maximum time was reached without the dialog being visible.

close

void close(java.lang.Object obj)
Closes the popup dialog window.

Parameters:
obj - the value to be returned via the 'show()' or 'showAndWait()' method.

close

void close()
Closes the popup dialog window. (Same as 'hide()').


closeWithWait

void closeWithWait(java.lang.Object obj,
                   int maxWaitTimeMs)
Waits (if necessary) for the popup dialog window to be visible and then closes it.

Parameters:
obj - the value to be returned via the 'show()' or 'showAndWait()' method.
maxWaitTimeMs - the maximum time to wait for the popup dialog window to be visible, in milliseconds.

closeWithWait

void closeWithWait(int maxWaitTimeMs)
Waits (if necessary) for the popup dialog window to be visible and then closes it.

Parameters:
maxWaitTimeMs - the maximum time to wait for the popup dialog window to be visible, in milliseconds.

hide

void hide()
Hides the popup dialog window. (Same as 'close()').


dispose

void dispose()
Disposes the popup dialog window.


repaint

void repaint()
Repaints the popup dialog window.


validate

void validate()
Validates the popup dialog window.


invalidate

void invalidate()
Invalidates the popup dialog window.


pack

void pack()
Causes this dialog to be sized to fit the preferred size and layouts of its subcomponents. If the dialog and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The Window will be validated after the preferredSize is calculated.


setSize

void setSize(int width,
             int height)
Sets the size of the dialog.

Parameters:
width - the width to use.
height - the height to use.

setResizable

void setResizable(boolean resizableFlag)
Sets whether the dialog is resizable by the user.

Parameters:
resizableFlag - true if the user can resize this dialog; false otherwise.

setLocation

void setLocation(int x,
                 int y)
Moves the dialog to a new location. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this component's parent.

Parameters:
x - The x-coordinate of the new location's top-left corner in the parent's coordinate space.
y - The y-coordinate of the new location's top-left corner in the parent's coordinate space.

requestFocus

void requestFocus()
Requests that the dialog get the input focus, and that the dialog's top-level ancestor become the focused Window.


setModal

void setModal(boolean modalFlag)
Specifies whether this dialog should be modal.

Parameters:
modalFlag - true for modal, false for modeless (allows other windows to run).

isModal

boolean isModal()
Returns the modal status of the dialog.

Returns:
true if modal, false if modeless (allows other windows to run).

setDefaultCloseOperation

void setDefaultCloseOperation(int selVal)
Sets the operation which will happen by default when the user initiates a "close" on this dialog. The possible choices are: DO_NOTHING_ON_CLOSE - do not do anything - require the program to handle the operation in the windowClosing method of a registered WindowListener object; HIDE_ON_CLOSE - automatically hide the dialog after invoking any registered WindowListener objects; DISPOSE_ON_CLOSE - automatically hide and dispose the dialog after invoking any registered WindowListener objects. The value is set to HIDE_ON_CLOSE by default.

Parameters:
selVal - one of the following constants: DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, or HIDE_ON_CLOSE.

setMessageObj

void setMessageObj(java.lang.Object obj)
Sets the message object displayed by this dialog.

Parameters:
obj - the message obj.

getMessageObj

java.lang.Object getMessageObj()
Returns the message object displayed by this dialog.

Returns:
The message obj.

setMessageStr

void setMessageStr(java.lang.String str)
Sets the message object displayed by this dialog to the given string.

Parameters:
str - the message string.

getMessageStr

java.lang.String getMessageStr()
Returns the message string displayed by this dialog.

Returns:
The message String object, or null if a String object could not be retrieved.

setTitleStr

void setTitleStr(java.lang.String str)
Sets the title displayed by this dialog.

Parameters:
str - the title string to display.

getTitleStr

java.lang.String getTitleStr()
Returns the title displayed by this dialog.

Returns:
The title string.

getInputValue

java.lang.Object getInputValue()
Returns the value the user has input.

Returns:
The Object the user specified.

getValue

java.lang.Object getValue()
Returns the value the user has selected. UNINITIALIZED_VALUE implies the user has not yet made a choice, null means the user closed the window with out choosing anything. Otherwise the returned value will be one of the options defined in this object.

Returns:
The Object chosen by the user, UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice.

setUserMessageString

void setUserMessageString(java.lang.String str)
Sets a user-defined message string that may be fetched via the 'getMessageString()' method.

Parameters:
str - the message text.

getUserMessageString

java.lang.String getUserMessageString()
Returns the user-defined message string set via the 'setMessageString()' method.

Returns:
The message text, or null if none has been set.

setInitialFocus

void setInitialFocus()
Requests that the current "initial" component have focus.