public class TLcdUserDialog extends Object
TLcdUserDialog
is an implementation of user dialogs.
User dialogs are implemented for:
Object
from a finite number of Objects
TLcdUserDialogs
are only shown if an ILcdDialogManager
is attached.
In this implementation there is always an ILcdDialogManager
attached.Constructor and Description |
---|
TLcdUserDialog() |
Modifier and Type | Method and Description |
---|---|
static 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 |
confirm(String aQuestion,
int aOption,
int aMessageType,
Object aSource,
Component aComponent)
Pops up a window to ask for confirmation.
|
static boolean |
hasManager()
Tells whether a DialogManager has been specified for the static methods in
this class.
|
static String |
input(String aMessage,
Object aSource,
Component aComponent)
Pops up a window to ask for an input string.
|
static String |
input(String aMessage,
String aInitialResponse,
Object aSource,
Component aComponent) |
static URL |
inputURL(String aMessage,
Object aSource,
Component aComponent)
Pops up a window to input a URL.
|
static void |
message(String aMessage,
int aMessageType,
Object aSource,
Component aComponent)
Pops up a window with an informational message.
|
static void |
setDialogManager(ILcdDialogManager aDialogManager)
Sets the DialogManager for the static methods in this class.
|
public static boolean hasManager()
public static void setDialogManager(ILcdDialogManager aDialogManager)
public static int confirm(String aQuestion, int aOption, int aMessageType, Object aSource, Component aComponent)
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 in ILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.ILcdDialogManager
).public static void message(String aMessage, int aMessageType, Object aSource, Component aComponent)
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 in
ILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.public static Object choose(Vector aVector, ILcdFormatter aFormatter, String aMessage, Object aSource, Component aComponent)
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.null
if no object has been
selected.public static String input(String aMessage, Object aSource, Component aComponent)
aMessage
- the message displayed in the window.aSource
- the class that calls the method.aComponent
- the parent component for the dialog.public static String input(String aMessage, String aInitialResponse, Object aSource, Component aComponent)
public static File chooseFile(String aDirectoryPath, int aMode, Object aSource, Component aComponent)
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 in ILcdDialogManager
).aSource
- the class that calls the method.aComponent
- the parent component for the dialog.public static URL inputURL(String aMessage, Object aSource, Component aComponent)
aMessage
- the message displayed in the window.aSource
- the class that calls the method.aComponent
- the parent component for the dialog.