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 booleanpaused state of auto-close delayprivate org.eclipse.swt.widgets.ButtonButton that hides all slideys in the popupList.private org.eclipse.swt.widgets.ButtonButton to move to next message.private org.eclipse.swt.graphics.Colorprotected org.eclipse.swt.graphics.Colorprivate org.eclipse.swt.widgets.CompositeComposite in shellprivate static intCurrent popup being displayedprivate static final booleanprivate static final intHeight of the details shellprivate static final intWidth of the details shellList of SWT objects needing disposalprivate static final intSlide until there's this much gap between shell and edge of screenprivate static intIndex 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 intPosition this popup is in the history listprivate org.eclipse.swt.widgets.Labelpopup could and closing in xx seconds labelprivate static final AEMonitorSynchronization for popupListprivate StringText to put into details popupprivate org.eclipse.swt.widgets.ShellShell for popupprivate static final intWidth used when BG image can't be loadedprivate static final intMaximum height of popup.private static final intStandard 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 SlideyprivateMessageSlideShell(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener) Adds mousetracklistener to composite and all it's childrenprivate static voidaddToHistory(MessageSlideShell.PopupParams popupParams) private voidcreate(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide) private voidcreateLinkLabel(org.eclipse.swt.widgets.Composite shell, MessageSlideShell.PopupParams popupParams) static voiddisplayLastMessage(org.eclipse.swt.widgets.Display display, boolean last_unread) private voiddisposeShell(org.eclipse.swt.widgets.Shell shell) org.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colorstatic voidTeststatic voidrecordMessage(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 voidremoveMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener) removes mousetracklistener from composite and all it's childrenprivate voidrunPopup(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 voidsetButtonNextText(int numAfter) voidsetColorFG(org.eclipse.swt.graphics.Color colorFG) voidsetUrlColor(org.eclipse.swt.graphics.Color urlColor) private voidshowPopup(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams item, boolean bSlide) Show the popup with the specified parameters.static voidtest(org.eclipse.swt.widgets.Display display) static voidWaits 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
-
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
-
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
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)
-