Class TLcdUserDialog

java.lang.Object
com.luciad.gui.TLcdUserDialog

public class TLcdUserDialog extends Object
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 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

      public static void setDialogManager(ILcdDialogManager aDialogManager)
      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 in ILcdDialogManager).
      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

      public static void message(String aMessage, int aMessageType, Object aSource, Component aComponent)
      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 in ILcdDialogManager).
      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

      public static String input(String aMessage, Object aSource, Component aComponent)
      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

      public static String input(String aMessage, String aInitialResponse, Object aSource, Component aComponent)
    • 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 in ILcdDialogManager).
      aSource - the class that calls the method.
      aComponent - the parent component for the dialog.
      Returns:
      the file that the user has selected.
    • inputURL

      public static URL inputURL(String aMessage, Object aSource, Component aComponent)
      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.