Class BaseDialog

  • Direct Known Subclasses:
    BaseMessageDialog, FieldSelectionDialog

    public abstract class BaseDialog
    extends org.eclipse.swt.widgets.Dialog
    A base dialog class containing a body and a configurable button panel.
    • Constructor Detail

      • BaseDialog

        public BaseDialog​(org.eclipse.swt.widgets.Shell shell)
      • BaseDialog

        public BaseDialog​(org.eclipse.swt.widgets.Shell shell,
                          String title,
                          int width)
    • Method Detail

      • presentFileDialog

        public static final String presentFileDialog​(org.eclipse.swt.widgets.Shell shell,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(boolean save,
                                                     org.eclipse.swt.widgets.Shell shell,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     org.apache.commons.vfs2.FileObject fileObject,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(boolean save,
                                                     org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     org.apache.commons.vfs2.FileObject fileObject,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     IVariables variables,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(boolean save,
                                                     org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     IVariables variables,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     IVariables variables,
                                                     org.apache.commons.vfs2.FileObject fileObject,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentFileDialog

        public static final String presentFileDialog​(boolean save,
                                                     org.eclipse.swt.widgets.Shell shell,
                                                     TextVar textVar,
                                                     IVariables variables,
                                                     org.apache.commons.vfs2.FileObject fileObject,
                                                     String[] filterExtensions,
                                                     String[] filterNames,
                                                     boolean folderAndFile)
      • presentDirectoryDialog

        public static String presentDirectoryDialog​(org.eclipse.swt.widgets.Shell shell,
                                                    IVariables variables)
      • presentDirectoryDialog

        public static String presentDirectoryDialog​(org.eclipse.swt.widgets.Shell shell,
                                                    TextVar textVar,
                                                    IVariables variables)
      • presentDirectoryDialog

        public static String presentDirectoryDialog​(org.eclipse.swt.widgets.Shell shell,
                                                    TextVar textVar,
                                                    String message,
                                                    IVariables variables)
      • buildBody

        protected abstract org.eclipse.swt.widgets.Control buildBody()
        Returns the last element in the body - the one to which the buttons should be attached.
        Returns:
      • open

        public int open()
      • buildFooter

        protected void buildFooter​(org.eclipse.swt.widgets.Control anchorElement)
      • setFooterTopPadding

        public void setFooterTopPadding​(int footerTopPadding)
      • dispose

        public void dispose()
      • setButtons

        public void setButtons​(Map<String,​org.eclipse.swt.widgets.Listener> buttons)
      • defaultShellHandling

        public static void defaultShellHandling​(org.eclipse.swt.widgets.Shell shell,
                                                Consumer<Void> okConsumer,
                                                Consumer<Void> cancelConsumer)
        Handle the shell specified until the OK (button) is consumed. Set a default icon on the shell, add default selection handlers on fields. Set the appropriate size for the shell. If you have widgets on which you don't want to have this default selection handler to okConsumer, do:

        widget.setData(NO_DEFAULT_HANDLER, true)

        Parameters:
        shell - The shell to handle.
        okConsumer - What to do when the dialog information needs to be retained after closing.
        cancelConsumer - What to do when the dialog is cancelled.
      • setDefaultIconsOnTabs

        public static void setDefaultIconsOnTabs​(org.eclipse.swt.widgets.Composite composite)
      • addDefaultListeners

        public static void addDefaultListeners​(org.eclipse.swt.widgets.Composite composite,
                                               Consumer<Void> okConsumer)
      • openMessageBox

        public static final int openMessageBox​(org.eclipse.swt.widgets.Shell parent,
                                               String title,
                                               String message,
                                               int flags)