Class MessageSlideShell


  • public class MessageSlideShell
    extends java.lang.Object
    +=====================================+ | +----+ | | |Icon| Big Bold Title | | +----+ | | Wrapping message text | | with optional URL links | | +-----+ | | |BGImg| XX more slideys.. | | | Icon| Closing in XX secs | | +-----+ [HideAll] [Details] [Hide] | +=====================================+
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean bDelayPaused
      paused state of auto-close delay
      private org.eclipse.swt.widgets.Button btnHideAll
      Button that hides all slideys in the popupList.
      private org.eclipse.swt.widgets.Button btnNext
      Button to move to next message.
      private org.eclipse.swt.graphics.Color colorFG  
      protected org.eclipse.swt.graphics.Color colorURL  
      private org.eclipse.swt.widgets.Composite cShell
      Composite in shell
      private static int currentPopupIndex
      Current popup being displayed
      private static boolean DEBUG  
      private static int DETAILS_HEIGHT
      Height of the details shell
      private static int DETAILS_WIDTH
      Width of the details shell
      private java.util.ArrayList<java.lang.Object> disposeList
      List of SWT objects needing disposal
      private static int EDGE_GAP
      Slide until there's this much gap between shell and edge of screen
      private static int firstUnreadMessage
      Index of first message which the user has not seen (index) - set to -1 if we don't care.
      private static java.util.ArrayList<MessageSlideShell.PopupParams> historyList
      List of all popups ever created
      private int idxHistory
      Position this popup is in the history list
      private org.eclipse.swt.widgets.Label lblCloseIn
      popup could and closing in xx seconds label
      private static AEMonitor monitor
      Synchronization for popupList
      private java.lang.String sDetails
      Text to put into details popup
      private org.eclipse.swt.widgets.Shell shell
      Shell for popup
      private static int SHELL_DEF_WIDTH
      Width used when BG image can't be loaded
      private static int SHELL_MAX_HEIGHT
      Maximimum height of popup.
      private static int SHELL_MIN_HEIGHT
      Standard height of the shell.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        MessageSlideShell​(org.eclipse.swt.widgets.Display display, int iconID, java.lang.String keyPrefix, java.lang.String details, java.lang.String[] textParams, int timeoutSecs)
      Open a popup using resource keys for title/text
        MessageSlideShell​(org.eclipse.swt.widgets.Display display, int iconID, java.lang.String keyPrefix, java.lang.String details, java.lang.String[] textParams, java.lang.Object[] relatedObjects, int timeoutSecs)  
        MessageSlideShell​(org.eclipse.swt.widgets.Display display, int iconID, java.lang.String title, java.lang.String text, java.lang.String details, int timeoutSecs)  
        MessageSlideShell​(org.eclipse.swt.widgets.Display display, int iconID, java.lang.String title, java.lang.String text, java.lang.String details, java.lang.Object[] relatedObjects, int timeoutSecs)
      Open Mr Slidey
      private MessageSlideShell​(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addMouseTrackListener​(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
      Adds mousetracklistener to composite and all it's children
      private static void addToHistory​(MessageSlideShell.PopupParams popupParams)  
      private void create​(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)  
      private void createLinkLabel​(org.eclipse.swt.widgets.Composite shell, MessageSlideShell.PopupParams popupParams)  
      static void displayLastMessage​(org.eclipse.swt.widgets.Display display, boolean last_unread)  
      private void disposeShell​(org.eclipse.swt.widgets.Shell shell)  
      org.eclipse.swt.graphics.Color getColorFG()  
      org.eclipse.swt.graphics.Color getUrlColor()  
      static void main​(java.lang.String[] args)
      Test
      static void recordMessage​(int iconID, java.lang.String title, java.lang.String text, java.lang.String details, java.lang.Object[] relatedTo, int timeoutSecs)
      Adds this message to the slide shell without forcing it to be displayed.
      private void removeMouseTrackListener​(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
      removes mousetracklistener from composite and all it's children
      private void runPopup​(org.eclipse.swt.graphics.Rectangle endBounds, int idx, boolean bSlide, int timeoutSecs)
      Start the slid in, wait specified time while notifying user of impending auto-close, then slide out.
      private void setButtonNextText​(int numAfter)  
      void setColorFG​(org.eclipse.swt.graphics.Color colorFG)  
      void setUrlColor​(org.eclipse.swt.graphics.Color urlColor)  
      private void showPopup​(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams item, boolean bSlide)
      Show the popup with the specified parameters.
      static void test​(org.eclipse.swt.widgets.Display display)  
      static void waitUntilClosed()
      Waits until all slideys are closed before returning to caller.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EDGE_GAP

        private static final int EDGE_GAP
        Slide until there's this much gap between shell and edge of screen
        See Also:
        Constant Field Values
      • SHELL_DEF_WIDTH

        private static final int SHELL_DEF_WIDTH
        Width used when BG image can't be loaded
        See Also:
        Constant Field Values
      • SHELL_MIN_HEIGHT

        private static final int SHELL_MIN_HEIGHT
        Standard height of the shell. Shell may grow depending on text
        See Also:
        Constant Field Values
      • SHELL_MAX_HEIGHT

        private static final int SHELL_MAX_HEIGHT
        Maximimum height of popup. If text is too long, the full text will be put into details.
        See Also:
        Constant Field Values
      • DETAILS_WIDTH

        private static final int DETAILS_WIDTH
        Width of the details shell
        See Also:
        Constant Field Values
      • DETAILS_HEIGHT

        private static final int DETAILS_HEIGHT
        Height of the details shell
        See Also:
        Constant Field Values
      • monitor

        private static final AEMonitor monitor
        Synchronization for popupList
      • currentPopupIndex

        private static int currentPopupIndex
        Current popup being displayed
      • firstUnreadMessage

        private static int firstUnreadMessage
        Index of first message which the user has not seen (index) - set to -1 if we don't care. :)
      • shell

        private org.eclipse.swt.widgets.Shell shell
        Shell for popup
      • cShell

        private org.eclipse.swt.widgets.Composite cShell
        Composite in shell
      • lblCloseIn

        private org.eclipse.swt.widgets.Label lblCloseIn
        popup could and closing in xx seconds label
      • btnHideAll

        private org.eclipse.swt.widgets.Button btnHideAll
        Button that hides all slideys in the popupList. Visible only when there's more than 1 slidey
      • btnNext

        private org.eclipse.swt.widgets.Button btnNext
        Button to move to next message. Text changes from "Hide" to "Next" appropriately.
      • bDelayPaused

        private boolean bDelayPaused
        paused state of auto-close delay
      • disposeList

        private java.util.ArrayList<java.lang.Object> disposeList
        List of SWT objects needing disposal
      • sDetails

        private java.lang.String sDetails
        Text to put into details popup
      • idxHistory

        private int idxHistory
        Position this popup is in the history list
      • colorURL

        protected org.eclipse.swt.graphics.Color colorURL
      • colorFG

        private org.eclipse.swt.graphics.Color colorFG
    • Constructor Detail

      • MessageSlideShell

        public MessageSlideShell​(org.eclipse.swt.widgets.Display display,
                                 int iconID,
                                 java.lang.String keyPrefix,
                                 java.lang.String details,
                                 java.lang.String[] textParams,
                                 int timeoutSecs)
        Open a popup using resource keys for title/text
        Parameters:
        display - Display to create the shell on
        iconID - SWT.ICON_* constant for icon in top left
        keyPrefix - message bundle key prefix used to get title and text. Title will be keyPrefix + ".title", and text will be set to keyPrefix + ".text"
        details - actual text for details (not a key)
        textParams - any parameters for text
      • MessageSlideShell

        public MessageSlideShell​(org.eclipse.swt.widgets.Display display,
                                 int iconID,
                                 java.lang.String keyPrefix,
                                 java.lang.String details,
                                 java.lang.String[] textParams,
                                 java.lang.Object[] relatedObjects,
                                 int timeoutSecs)
        Parameters:
        display -
        iconID -
        keyPrefix -
        details -
        textParams -
        relatedObjects -
        timeoutSecs - = -1 -> use default timeout, 0 -> no timeout, other -> timeout in secs
      • MessageSlideShell

        public MessageSlideShell​(org.eclipse.swt.widgets.Display display,
                                 int iconID,
                                 java.lang.String title,
                                 java.lang.String text,
                                 java.lang.String details,
                                 int timeoutSecs)
      • MessageSlideShell

        public MessageSlideShell​(org.eclipse.swt.widgets.Display display,
                                 int iconID,
                                 java.lang.String title,
                                 java.lang.String text,
                                 java.lang.String details,
                                 java.lang.Object[] relatedObjects,
                                 int timeoutSecs)
        Open Mr Slidey
        Parameters:
        display - Display to create the shell on
        iconID - SWT.ICON_* constant for icon in top left
        title - Text to put in the title
        text - Text to put in the body
        details - Text displayed when the Details button is pressed. Null for disabled Details button.
        timeoutSecs - = -1 -> use default timeout, 0 -> no timeout, other -> timeout in secs
      • MessageSlideShell

        private MessageSlideShell​(org.eclipse.swt.widgets.Display display,
                                  MessageSlideShell.PopupParams popupParams,
                                  boolean bSlide)
    • Method Detail

      • displayLastMessage

        public static void displayLastMessage​(org.eclipse.swt.widgets.Display display,
                                              boolean last_unread)
      • recordMessage

        public static void recordMessage​(int iconID,
                                         java.lang.String title,
                                         java.lang.String text,
                                         java.lang.String details,
                                         java.lang.Object[] relatedTo,
                                         int timeoutSecs)
        Adds this message to the slide shell without forcing it to be displayed.
        Parameters:
        relatedTo -
      • createLinkLabel

        private void createLinkLabel​(org.eclipse.swt.widgets.Composite shell,
                                     MessageSlideShell.PopupParams popupParams)
        Parameters:
        shell2 -
        b -
        Since:
        3.0.0.9
      • setButtonNextText

        private void setButtonNextText​(int numAfter)
        Parameters:
        numAfter -
      • showPopup

        private void showPopup​(org.eclipse.swt.widgets.Display display,
                               MessageSlideShell.PopupParams item,
                               boolean bSlide)
        Show the popup with the specified parameters.
        Parameters:
        display - Display to show on
        item - popup to display. Must already exist in historyList
        bSlide - Whether to slide in or show immediately
      • addMouseTrackListener

        private void addMouseTrackListener​(org.eclipse.swt.widgets.Composite parent,
                                           org.eclipse.swt.events.MouseTrackListener listener)
        Adds mousetracklistener to composite and all it's children
        Parameters:
        parent - Composite to start at
        listener - Listener to add
      • removeMouseTrackListener

        private void removeMouseTrackListener​(org.eclipse.swt.widgets.Composite parent,
                                              org.eclipse.swt.events.MouseTrackListener listener)
        removes mousetracklistener from composite and all it's children
        Parameters:
        parent - Composite to start at
        listener - Listener to remove
      • runPopup

        private void runPopup​(org.eclipse.swt.graphics.Rectangle endBounds,
                              int idx,
                              boolean bSlide,
                              int timeoutSecs)
        Start the slid in, wait specified time while notifying user of impending auto-close, then slide out. Run on separate thread, so this method returns immediately
        Parameters:
        endBounds - end location and size wanted
        idx - Index in historyList of popup (Used to calculate # prev, next)
        bSlide - Whether to slide in, or show immediately
      • disposeShell

        private void disposeShell​(org.eclipse.swt.widgets.Shell shell)
      • waitUntilClosed

        public static void waitUntilClosed()
        Waits until all slideys are closed before returning to caller.
      • main

        public static void main​(java.lang.String[] args)
        Test
        Parameters:
        args -
      • test

        public static void test​(org.eclipse.swt.widgets.Display display)
      • getUrlColor

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

        public void setUrlColor​(org.eclipse.swt.graphics.Color urlColor)
      • getColorFG

        public org.eclipse.swt.graphics.Color getColorFG()
      • setColorFG

        public void setColorFG​(org.eclipse.swt.graphics.Color colorFG)