Class OKCancelDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, HelpPageProvider
Direct Known Subclasses:
OKCancelDialog, SATableSplitCustomizerDialog

@API(type=EXTENDABLE, src=PUBLIC) public class OKCancelDialog extends JDialog implements HelpPageProvider
Dialog with OK and Cancel buttons.
See Also:
  • Field Details

    • RESULT_CANCEL

      public static final int RESULT_CANCEL
      Dialog was canceled.
      See Also:
    • RESULT_OK

      public static final int RESULT_OK
      'Ok' button was pressed.
      See Also:
    • messages

      protected static final ro.sync.i18n.MessageBundle messages
      The messages resource bundle.
  • Constructor Details

    • OKCancelDialog

      public OKCancelDialog(JFrame parentFrame, String title, boolean modal)
      Constructor.
      Parameters:
      parentFrame - The parent frame. Can be null in which case it will be auto detected.
      title - The dialog title.
      modal - true if modal.
    • OKCancelDialog

      public OKCancelDialog(Frame parentFrame, String title, boolean modal)
      Constructor.
      Parameters:
      parentFrame - The parent frame. Can be null in which case it will be auto detected.
      title - The dialog title.
      modal - true if modal.
  • Method Details

    • detectParentFrame

      public static Window detectParentFrame(Window parentFrame)
      Try to detect the parent frame if null or not showing.
      Parameters:
      parentFrame - The parent frame.
      Returns:
      the parent frame.
      Since:
      24
    • doOK

      protected void doOK()
      OK pressed.
    • enterKeyPressed

      protected void enterKeyPressed()
      Enter key pressed. If ok button is enabled call doOk method.

      Subclasses can overwrite this method to make default action.

    • doCancel

      protected void doCancel()
      Cancel pressed.
    • getResult

      public int getResult()
      Gets the result of the the dialog. Used after show.
      Returns:
      The result value.
    • setOkButtonText

      public void setOkButtonText(String text)
      Sets the text on the ok button.
      Parameters:
      text - The text value.
    • setCancelButtonText

      public void setCancelButtonText(String text)
      Sets the text on the cancel button.
      Parameters:
      text - The text value.
    • getContentPane

      public Container getContentPane()
      Specified by:
      getContentPane in interface RootPaneContainer
      Overrides:
      getContentPane in class JDialog
      See Also:
    • getOkButton

      public JButton getOkButton()
      Returns:
      Returns the okButton.
    • getCancelButton

      public JButton getCancelButton()
      Returns:
      Returns the cancelButton.
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class Dialog
      See Also:
    • setDialogLocation

      protected void setDialogLocation()
      Set dialog location. By default it is relative to the owner window.
    • getHiDPIAwareDimension

      @Deprecated protected Dimension getHiDPIAwareDimension(Dimension initialDimension)
      Deprecated.
      Kept for backwards compatibility, no longer necessary with java 9+
      Kept for backwards compatibility, no longer necessary with java 9+ Get the high DPI aware dimension.
      Parameters:
      initialDimension - The initial dimension.
      Returns:
      The computed dimension if we have a high DPI screen with no implicit support form the OS (e.g. Windows), or the initial dimension otherwise.
    • getHelpPageID

      public String getHelpPageID()
      Get the help page ID. If an implementation returns a help page ID, the dialog will contain an extra "Help" button in the bottom left. If the returned help page ID is an URL, a web browser will be opened pointing to that URL when the user presses F1 in the dialog or when using the Help button. If the returned help page ID is an identifier, when help is invoked, the application will open the Oxygen User's Manual and locate this identifier inside it.
      Specified by:
      getHelpPageID in interface HelpPageProvider
      Returns:
      the help page id for this provider. If not needed please return NO_HELP_PAGE_ID
      Since:
      18
      See Also: