Package com.luciad.gui
Class TLcdUserDialog
java.lang.Object
com.luciad.gui.TLcdUserDialog
TLcdUserDialog
is an implementation of user dialogs.
User dialogs are implemented for:
- confirmation of a question (Yes/No, Yes/No/Cancel, OK/Cancel)
- choose an
Object
from a finite number of Objects - input a string
- choose a file
- choose a URL
TLcdUserDialogs
are only shown if an ILcdDialogManager
is attached.
In this implementation there is always an ILcdDialogManager
attached.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
choose
(Vector aVector, ILcdFormatter aFormatter, String aMessage, Object aSource, Component aComponent) Pops up a window with a menu to choose from.static File
chooseFile
(String aDirectoryPath, int aMode, Object aSource, Component aComponent) Pops up a file chooser.static int
Pops up a window to ask for confirmation.static boolean
Tells whether a DialogManager has been specified for the static methods in this class.static String
Pops up a window to ask for an input string.static String
static URL
Pops up a window to input a URL.static void
Pops up a window with an informational message.static void
setDialogManager
(ILcdDialogManager aDialogManager) Sets the DialogManager for the static methods in this class.
-
Constructor Details
-
TLcdUserDialog
public TLcdUserDialog()
-
-
Method Details
-
hasManager
public static boolean hasManager()Tells whether a DialogManager has been specified for the static methods in this class. -
setDialogManager
Sets the DialogManager for the static methods in this class. Note that all dialogs are modal. -
confirm
public static int confirm(String aQuestion, int aOption, int aMessageType, Object aSource, Component aComponent) Pops up a window to ask for confirmation.- Parameters:
aQuestion
- the question displayed in the window.aOption
- the confirmation option that determines the buttons: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION (defined inILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.- Returns:
- an int indicating the user's answer: YES_OPTION, NO_OPTION,
CANCEL_OPTION, or OK_OPTION (defined in
ILcdDialogManager
).
-
message
Pops up a window with an informational message.- Parameters:
aMessage
- the message to be displayed.aMessageType
- the message type that determines the icon: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE (defined inILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.
-
choose
public static Object choose(Vector aVector, ILcdFormatter aFormatter, String aMessage, Object aSource, Component aComponent) Pops up a window with a menu to choose from.- Parameters:
aVector
- the vector with objects for the menu.aFormatter
- the formatter that can convert the objects to strings.aMessage
- the message displayed in the window.aSource
- the class that calls the method.aComponent
- the parent component for the dialog.- Returns:
- the selected object, or
null
if no object has been selected.
-
input
Pops up a window to ask for an input string.- Parameters:
aMessage
- the message displayed in the window.aSource
- the class that calls the method.aComponent
- the parent component for the dialog.- Returns:
- the string that the user has entered.
-
input
-
chooseFile
public static File chooseFile(String aDirectoryPath, int aMode, Object aSource, Component aComponent) Pops up a file chooser.- Parameters:
aDirectoryPath
- the initial directory path. This can usually be an absolute path or a path relative to the working directory.aMode
- the mode that determines the accept button: LOAD or SAVE (defined inILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.- Returns:
- the file that the user has selected.
-
inputURL
Pops up a window to input a URL.- Parameters:
aMessage
- the message displayed in the window.aSource
- the class that calls the method.aComponent
- the parent component for the dialog.- Returns:
- the URL that the user has selected.
-