Package com.biglybt.ui.swt.shells
Class MessageSlideShell
java.lang.Object
com.biglybt.ui.swt.shells.MessageSlideShell
+=====================================+
| +----+ |
| |Icon| Big Bold Title |
| +----+ |
| Wrapping message text |
| with optional URL links |
| +-----+ |
| |BGImg| XX more slideys.. |
| | Icon| Closing in XX secs |
| +-----+ [HideAll] [Details] [Hide] |
+=====================================+
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
paused state of auto-close delayprivate org.eclipse.swt.widgets.Button
Button that hides all slideys in the popupList.private org.eclipse.swt.widgets.Button
Button to move to next message.private org.eclipse.swt.graphics.Color
protected org.eclipse.swt.graphics.Color
private org.eclipse.swt.widgets.Composite
Composite in shellprivate static int
Current popup being displayedprivate static final boolean
private static final int
Height of the details shellprivate static final int
Width of the details shellList of SWT objects needing disposalprivate static final int
Slide until there's this much gap between shell and edge of screenprivate static int
Index of first message which the user has not seen (index) - set to -1 if we don't care.private static ArrayList
<MessageSlideShell.PopupParams> List of all popups ever createdprivate int
Position this popup is in the history listprivate org.eclipse.swt.widgets.Label
popup could and closing in xx seconds labelprivate static final AEMonitor
Synchronization for popupListprivate String
Text to put into details popupprivate org.eclipse.swt.widgets.Shell
Shell for popupprivate static final int
Width used when BG image can't be loadedprivate static final int
Maximum height of popup.private static final int
Standard height of the shell. -
Constructor Summary
ConstructorsModifierConstructorDescriptionMessageSlideShell
(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, int timeoutSecs) Open a popup using resource keys for title/textMessageSlideShell
(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, Object[] relatedObjects, int timeoutSecs) MessageSlideShell
(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, int timeoutSecs) MessageSlideShell
(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, Object[] relatedObjects, int timeoutSecs) Open Mr Slideyprivate
MessageSlideShell
(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addMouseTrackListener
(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener) Adds mousetracklistener to composite and all it's childrenprivate 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
org.eclipse.swt.graphics.Color
static void
Teststatic void
recordMessage
(int iconID, String title, String text, String details, 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 childrenprivate 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
Waits until all slideys are closed before returning to caller.
-
Field Details
-
DEBUG
private static final boolean DEBUG- See Also:
-
EDGE_GAP
private static final int EDGE_GAPSlide until there's this much gap between shell and edge of screen- See Also:
-
SHELL_DEF_WIDTH
private static final int SHELL_DEF_WIDTHWidth used when BG image can't be loaded- See Also:
-
SHELL_MIN_HEIGHT
private static final int SHELL_MIN_HEIGHTStandard height of the shell. Shell may grow depending on text- See Also:
-
SHELL_MAX_HEIGHT
private static final int SHELL_MAX_HEIGHTMaximum height of popup. If text is too long, the full text will be put into details.- See Also:
-
DETAILS_WIDTH
private static final int DETAILS_WIDTHWidth of the details shell- See Also:
-
DETAILS_HEIGHT
private static final int DETAILS_HEIGHTHeight of the details shell- See Also:
-
monitor
Synchronization for popupList -
historyList
List of all popups ever created -
currentPopupIndex
private static int currentPopupIndexCurrent popup being displayed -
firstUnreadMessage
private static int firstUnreadMessageIndex 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 shellShell for popup -
cShell
private org.eclipse.swt.widgets.Composite cShellComposite in shell -
lblCloseIn
private org.eclipse.swt.widgets.Label lblCloseInpopup could and closing in xx seconds label -
btnHideAll
private org.eclipse.swt.widgets.Button btnHideAllButton that hides all slideys in the popupList. Visible only when there's more than 1 slidey -
btnNext
private org.eclipse.swt.widgets.Button btnNextButton to move to next message. Text changes from "Hide" to "Next" appropriately. -
bDelayPaused
private boolean bDelayPausedpaused state of auto-close delay -
disposeList
List of SWT objects needing disposal -
sDetails
Text to put into details popup -
idxHistory
private int idxHistoryPosition this popup is in the history list -
colorURL
protected org.eclipse.swt.graphics.Color colorURL -
colorFG
private org.eclipse.swt.graphics.Color colorFG
-
-
Constructor Details
-
MessageSlideShell
public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, int timeoutSecs) Open a popup using resource keys for title/text- Parameters:
display
- Display to create the shell oniconID
- SWT.ICON_* constant for icon in top leftkeyPrefix
- 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, String keyPrefix, String details, String[] textParams, Object[] relatedObjects, int timeoutSecs) - Parameters:
display
-iconID
-keyPrefix
-details
-textParams
-relatedObjects
-timeoutSecs
- = -1 -> use default timeout, 0 -> no timeout, other -> timeout in secs
-
MessageSlideShell
-
MessageSlideShell
public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, Object[] relatedObjects, int timeoutSecs) Open Mr Slidey- Parameters:
display
- Display to create the shell oniconID
- SWT.ICON_* constant for icon in top lefttitle
- Text to put in the titletext
- Text to put in the bodydetails
- 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 Details
-
addToHistory
- Parameters:
popupParams
-- Since:
- 4.1.0.5
-
displayLastMessage
public static void displayLastMessage(org.eclipse.swt.widgets.Display display, boolean last_unread) -
recordMessage
public static void recordMessage(int iconID, String title, String text, String details, Object[] relatedTo, int timeoutSecs) Adds this message to the slide shell without forcing it to be displayed.- Parameters:
relatedTo
-
-
create
private void create(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide) -
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 onitem
- popup to display. Must already exist in historyListbSlide
- 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 atlistener
- 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 atlistener
- 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 wantedidx
- 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
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)
-