Class BaseXDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, BaseXWindow
Direct Known Subclasses:
DialogAbout, DialogBindings, DialogColors, DialogEdit, DialogExport, DialogFonts, DialogInsert, DialogLine, DialogManage, DialogMem, DialogMessage, DialogNew, DialogPackages, DialogPass, DialogPrefs, DialogProgress, DialogProps, DialogSort

public abstract class BaseXDialog extends JDialog implements BaseXWindow
This superclass in inherited by all dialog windows.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
See Also:
  • Field Details

    • gui

      public GUI gui
      Reference to the main window.
    • ok

      protected boolean ok
      Remembers if the window was correctly closed.
    • panel

      protected BaseXBack panel
      Reference to the root panel.
    • keys

      public final KeyListener keys
      Key listener, triggering an action with each click.
  • Constructor Details

    • BaseXDialog

      protected BaseXDialog(BaseXDialog dialog, String title)
      Constructor, called from a dialog window.
      Parameters:
      dialog - calling dialog
      title - dialog title
    • BaseXDialog

      protected BaseXDialog(GUI gui, String title)
      Constructor, called from the main window.
      Parameters:
      gui - reference to the main window
      title - dialog title
    • BaseXDialog

      protected BaseXDialog(GUI gui, String title, boolean modal)
      Constructor, called from the main window.
      Parameters:
      gui - reference to the main window
      title - dialog title
      modal - modal flag
  • Method Details

    • set

      protected final void set(Component comp, String pos)
      Sets a component at the specified BorderLayout position.
      Parameters:
      comp - component to be added
      pos - layout position
    • finish

      protected final void finish()
      Finalizes the dialog layout and sets it visible.
    • action

      public void action(Object source)
      Reacts on user input; can be overwritten.
      Parameters:
      source - source
    • cancel

      public void cancel()
      Cancels the dialog; can be overwritten.
    • close

      public void close()
      Closes the dialog and stores the location of the dialog window; can be overwritten.
    • dispose

      public void dispose()
      Overrides:
      dispose in class Window
    • modal

      public final boolean modal()
      Indicates if this is a modal dialog.
      Returns:
      result of check
    • ok

      public final boolean ok()
      States if the dialog window was confirmed or canceled.
      Returns:
      true when dialog was confirmed
    • okCancel

      protected final BaseXBack okCancel()
      Creates a OK and CANCEL button.
      Returns:
      button list
    • newButtons

      public final BaseXBack newButtons(Object... buttons)
      Creates a new button list.
      Parameters:
      buttons - button names or objects
      Returns:
      button list
    • enableOK

      protected static void enableOK(JComponent panel, String label, boolean enabled)
      Enables/disables a button in the specified panel.
      Parameters:
      panel - button panel
      label - button label
      enabled - enabled/disabled
    • yesNoCancel

      public static String yesNoCancel(GUI gui, String text, String... buttons)
      Static yes/no/cancel dialog. Returns null if the dialog was canceled.
      Parameters:
      gui - parent reference
      text - text
      buttons - additional buttons
      Returns:
      chosen action (Text.B_YES, Text.B_NO, Text.B_CANCEL)
    • confirm

      public static boolean confirm(GUI gui, String text)
      Static yes/no dialog.
      Parameters:
      gui - parent reference
      text - text
      Returns:
      true if dialog was confirmed
    • error

      public static void error(GUI gui, String text)
      Static error dialog.
      Parameters:
      gui - parent reference
      text - text
    • browse

      public static void browse(GUI gui, String url)
      Browses the specified url.
      Parameters:
      gui - parent reference
      url - url to be browsed
    • gui

      public GUI gui()
      Description copied from interface: BaseXWindow
      Returns the GUI.
      Specified by:
      gui in interface BaseXWindow
      Returns:
      GUI
    • dialog

      public BaseXDialog dialog()
      Description copied from interface: BaseXWindow
      Returns the dialog.
      Specified by:
      dialog in interface BaseXWindow
      Returns:
      dialog (can be null)
    • component

      public BaseXDialog component()
      Description copied from interface: BaseXWindow
      Returns the window reference.
      Specified by:
      component in interface BaseXWindow
      Returns:
      window