Class MessageBoxShell

    • Field Detail

      • STATUS_TEXT_CLOSE

        public static final java.lang.String STATUS_TEXT_CLOSE
        See Also:
        Constant Field Values
      • numOpen

        private static int numOpen
      • parent

        private org.eclipse.swt.widgets.Shell parent
      • min_size_x

        private int min_size_x
      • min_size_y

        private int min_size_y
      • max_size_x

        private int max_size_x
      • title

        private final java.lang.String title
      • text

        private final java.lang.String text
      • buttons

        private java.lang.String[] buttons
      • buttonVals

        private java.lang.Integer[] buttonVals
      • defaultButtonPos

        private int defaultButtonPos
      • rememberID

        private java.lang.String rememberID
      • rememberText

        private java.lang.String rememberText
      • rememberByDefault

        private boolean rememberByDefault
      • rememberOnlyIfButtonPos

        private int rememberOnlyIfButtonPos
      • autoCloseInMS

        private int autoCloseInMS
      • html

        private java.lang.String html
      • url

        private java.lang.String url
      • squish

        private boolean squish
      • autoClosed

        private boolean autoClosed
      • relatedObjects

        private java.lang.Object[] relatedObjects
      • imgLeft

        private org.eclipse.swt.graphics.Image imgLeft
      • urlColor

        protected org.eclipse.swt.graphics.Color urlColor
      • handleHTML

        private boolean handleHTML
      • iconImage

        private org.eclipse.swt.graphics.Image iconImage
      • browser_follow_links

        private boolean browser_follow_links
      • isRemembered

        protected boolean isRemembered
      • supportsApplyToAll

        private boolean supportsApplyToAll
      • applyToAll

        private boolean applyToAll
      • iconImageID

        private java.lang.String iconImageID
      • result

        private int result
      • filterListener

        private org.eclipse.swt.widgets.Listener filterListener
      • shell

        private org.eclipse.swt.widgets.Shell shell
      • opened

        private boolean opened
      • useTextBox

        private boolean useTextBox
      • cbMessageID

        private java.lang.String cbMessageID
      • cbMinUserMode

        private int cbMinUserMode
      • cbEnabled

        private boolean cbEnabled
      • instanceID

        private java.lang.String instanceID
      • modal

        private boolean modal
      • mapInstances

        private static java.util.Map<java.lang.String,​MessageBoxShell> mapInstances
    • Constructor Detail

      • MessageBoxShell

        public MessageBoxShell​(java.lang.String title,
                               java.lang.String text,
                               java.lang.String[] buttons,
                               int defaultOption)
        Parameters:
        shellForChildren -
        string -
        string2 -
        strings -
      • MessageBoxShell

        @Deprecated
        public MessageBoxShell​(org.eclipse.swt.widgets.Shell parent,
                               java.lang.String title,
                               java.lang.String text,
                               java.lang.String[] buttons,
                               int defaultOption)
        Deprecated.
        ONLY FOR OLD EMP. DO NOT USE
      • MessageBoxShell

        public MessageBoxShell​(java.lang.String title,
                               java.lang.String text)
      • MessageBoxShell

        public MessageBoxShell​(int style,
                               java.lang.String keyPrefix,
                               java.lang.String[] textParams)
        Open a messagebox using resource keys for title/text
        Parameters:
        parent - Parent shell for messagebox
        style - SWT styles for messagebox
        keyPrefix - message bundle key prefix used to get title and text. Title will be keyPrefix + ".title", and text will be set to keyPrefix + ".text"
        textParams - any parameters for text
      • MessageBoxShell

        public MessageBoxShell​(int style,
                               java.lang.String title,
                               java.lang.String text)
        Open a messagebox with actual title and text
        Parameters:
        parent -
        style -
        title -
        text -
    • Method Detail

      • open

        public static void open​(org.eclipse.swt.widgets.Shell parent,
                                java.lang.String title,
                                java.lang.String text,
                                java.lang.String[] buttons,
                                int defaultOption,
                                java.lang.String rememberID,
                                java.lang.String rememberText,
                                boolean bRememberByDefault,
                                int autoCloseInMS,
                                UserPrompterResultListener l)
      • isOpen

        public static boolean isOpen()
      • setDefaultButtonUsingStyle

        public void setDefaultButtonUsingStyle​(int defaultStyle)
      • triggerResultListener

        private void triggerResultListener​(int returnVal)
      • getButtonVal

        private int getButtonVal​(int buttonPos)
      • getButtonPos

        private int getButtonPos​(int buttonVal)
      • open

        private void open​(boolean useCustomShell)
      • _open

        private void _open()
      • createTextBox

        private org.eclipse.swt.widgets.Control createTextBox​(org.eclipse.swt.widgets.Composite textComposite,
                                                              java.lang.String text2)
        Parameters:
        textComposite -
        text2 -
        Returns:
      • createLinkLabel

        private org.eclipse.swt.widgets.Canvas createLinkLabel​(org.eclipse.swt.widgets.Composite shell,
                                                               java.lang.String text)
      • getHtml

        public java.lang.String getHtml()
        Description copied from interface: UIFunctionsUserPrompter
        Returns the HTML that will be displayed along with the prompt

        TODO: Create a boolean canHandleHTML()

        Specified by:
        getHtml in interface UIFunctionsUserPrompter
        Returns:
      • setSize

        public void setSize​(int width,
                            int height)
      • setRemember

        public void setRemember​(java.lang.String rememberID,
                                boolean rememberByDefault,
                                java.lang.String rememberText)
        Specified by:
        setRemember in interface UIFunctionsUserPrompter
        Parameters:
        rememberID -
        rememberByDefault -
        rememberText - null if you want the default
      • setRememberText

        public void setRememberText​(java.lang.String rememberText)
        Specified by:
        setRememberText in interface UIFunctionsUserPrompter
        Parameters:
        rememberText - the rememberText to set
      • getAutoCloseInMS

        public int getAutoCloseInMS()
        Description copied from interface: UIFunctionsUserPrompter
        Returns the number milliseconds the prompt will wait around until it auto closes. Timer starts after the user is prompted (when #open() is called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)
        Specified by:
        getAutoCloseInMS in interface UIFunctionsUserPrompter
        Returns:
        the autoCloseInMS
      • setAutoCloseInMS

        public void setAutoCloseInMS​(int autoCloseInMS)
        Description copied from interface: UIFunctionsUserPrompter
        Sets the # of milliseconds before auto closing. Timer starts after the user is prompted (when #open() is called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)
        Specified by:
        setAutoCloseInMS in interface UIFunctionsUserPrompter
        Parameters:
        autoCloseInMS - the autoCloseInMS to set
      • setSquish

        public void setSquish​(boolean b)
      • isAutoClosed

        public boolean isAutoClosed()
        Description copied from interface: UIFunctionsUserPrompter
        Determines if the prompt was auto closed after #open() was called, or if the user chose an option.
        Specified by:
        isAutoClosed in interface UIFunctionsUserPrompter
        Returns:
        the autoClosed
      • setModal

        public void setModal​(boolean m)
        Only use this if you REALLY know what you're doing as in general it is a bad thing - check comments in this class
        Parameters:
        m -
      • getRelatedObjects

        public java.lang.Object[] getRelatedObjects()
      • getLeftImage

        public java.lang.Object getLeftImage()
        Returns:
        Since:
        4.0.0.1
      • setLeftImage

        public void setLeftImage​(org.eclipse.swt.graphics.Image imgLeft)
      • setLeftImage

        public void setLeftImage​(int icon)
        Replaces Image on left with icon
        Parameters:
        icon - SWT.ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING, ICON_WORKING
        Since:
        3.0.1.7
      • setIconResource

        public void setIconResource​(java.lang.String resource)
        Specified by:
        setIconResource in interface UIFunctionsUserPrompter
        Parameters:
        resource - image repository resource name (e.g. "error", "warning", "info")
      • main

        public static void main​(java.lang.String[] args)
      • getRememberOnlyIfButton

        public int getRememberOnlyIfButton()
      • getUrlColor

        public org.eclipse.swt.graphics.Color getUrlColor()
      • setBrowserFollowLinks

        public void setBrowserFollowLinks​(boolean follow)
      • setUrlColor

        public void setUrlColor​(org.eclipse.swt.graphics.Color colorURL)
      • setHandleHTML

        public void setHandleHTML​(boolean handleHTML)
        Parameters:
        b -
        Since:
        3.0.5.3
      • isRemembered

        public boolean isRemembered()
      • getResult

        public int getResult()
      • swtButtonStylesToText

        private static java.lang.Object[] swtButtonStylesToText​(int style)
      • getButtons

        public java.lang.String[] getButtons()
      • setButtons

        public void setButtons​(java.lang.String[] buttons)
      • setButtons

        public void setButtons​(int defaltButtonPos,
                               java.lang.String[] buttons,
                               java.lang.Integer[] buttonVals)
      • addCheckBox

        public void addCheckBox​(java.lang.String cbMessageID,
                                int cbMinUserMode,
                                boolean defaultOn)
        Adds a checkbox to the message box. Currently only one checkbox can be made via this method.
      • getCheckBoxEnabled

        public boolean getCheckBoxEnabled()
      • setApplyToAllEnabled

        public void setApplyToAllEnabled()
      • getApplyToAll

        public boolean getApplyToAll()
      • getParent

        public org.eclipse.swt.widgets.Shell getParent()
      • setParent

        public void setParent​(org.eclipse.swt.widgets.Shell parent)
      • close

        public void close()
      • setUseTextBox

        public void setUseTextBox​(boolean useTextBox)
        Parameters:
        useTextBox - The useTextBox to set.
      • useTextBox

        public boolean useTextBox()
        Returns:
        Returns the useTextBox.
      • setLeftImage

        public void setLeftImage​(java.lang.String id)