Class MessageBoxShell
java.lang.Object
com.biglybt.ui.swt.shells.MessageBoxShell
- All Implemented Interfaces:
UIFunctionsUserPrompter
A messagebox that allows you config the button
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate intprivate booleanprivate String[]private Integer[]private booleanprivate Stringprivate intprivate intprivate intprivate org.eclipse.swt.widgets.Listenerprivate booleanprivate Stringprivate org.eclipse.swt.graphics.Imageprivate Stringprivate org.eclipse.swt.graphics.Imageprivate Stringprotected booleanprivate static Map<String, MessageBoxShell> private intprivate static final intprivate static final intprivate intprivate static final intprivate intprivate static final intprivate booleanprivate static intprivate booleanprivate org.eclipse.swt.widgets.Shellprivate Object[]private booleanprivate Stringprivate intprivate Stringprivate intprivate UserPrompterResultListenerprivate org.eclipse.swt.widgets.Shellprivate booleanstatic final Stringprivate booleanprivate final Stringprivate final Stringprivate Stringprotected org.eclipse.swt.graphics.Colorprivate booleanFields inherited from interface UIFunctionsUserPrompter
ICON_ERROR, ICON_INFO, ICON_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionMessageBoxShell(int style, String title, String text) Open a messagebox with actual title and textMessageBoxShell(int style, String keyPrefix, String[] textParams) Open a messagebox using resource keys for title/textMessageBoxShell(String title, String text) MessageBoxShell(String title, String text, String[] buttons, int defaultOption) MessageBoxShell(org.eclipse.swt.widgets.Shell parent, String title, String text, String[] buttons, int defaultOption) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate void_open()voidaddCheckBox(String cbMessageID, int cbMinUserMode, boolean defaultOn) Adds a checkbox to the message box.voidclose()private org.eclipse.swt.widgets.CanvascreateLinkLabel(org.eclipse.swt.widgets.Composite shell, String text) private org.eclipse.swt.widgets.ControlcreateTextBox(org.eclipse.swt.widgets.Composite textComposite, String text2) booleanintReturns the number milliseconds the prompt will wait around until it auto closes.private intgetButtonPos(int buttonVal) String[]private intgetButtonVal(int buttonPos) booleangetHtml()Returns the HTML that will be displayed along with the promptorg.eclipse.swt.widgets.ShellObject[]Retrieves the Remember ID associated with this promptintRetrieves the text to be displayed by the "Remember this Action" checkboxintorg.eclipse.swt.graphics.ColorbooleanDetermines if the prompt was auto closed afterwas called, or if the user chose an option.invalid reference
#open()static booleanisOpen()booleanstatic voidintopen()Deprecated.private voidopen(boolean useCustomShell) voidOpens the prompt.static voidopen(org.eclipse.swt.widgets.Shell parent, String title, String text, String[] buttons, int defaultOption, String rememberID, String rememberText, boolean bRememberByDefault, int autoCloseInMS, UserPrompterResultListener l) voidvoidsetAutoCloseInMS(int autoCloseInMS) Sets the # of milliseconds before auto closing.voidsetBrowserFollowLinks(boolean follow) voidsetButtons(int defaltButtonPos, String[] buttons, Integer[] buttonVals) voidsetButtons(String[] buttons) voidsetDefaultButtonUsingStyle(int defaultStyle) voidsetHandleHTML(boolean handleHTML) voidvoidsetIconResource(String resource) voidsetLeftImage(int icon) Replaces Image on left with iconvoidsetLeftImage(String id) voidsetLeftImage(org.eclipse.swt.graphics.Image imgLeft) voidsetModal(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 classvoidsetOneInstanceOf(String instanceID) Prevent more than one dialog of instanceID from showing up at oncevoidsetParent(org.eclipse.swt.widgets.Shell parent) voidsetRelatedObject(Object relatedObject) voidsetRelatedObjects(Object[] relatedObjects) voidsetRemember(String rememberID, boolean rememberByDefault, String rememberText) voidsetRememberOnlyIfButton(int rememberOnlyIfButton) voidsetRememberText(String rememberText) voidsetSize(int width, int height) voidsetSquish(boolean b) voidsetStyle(int style) voidvoidsetUrlColor(org.eclipse.swt.graphics.Color colorURL) voidsetUseTextBox(boolean useTextBox) private static Object[]swtButtonStylesToText(int style) private voidtriggerResultListener(int returnVal) booleanintNOT RECOMMENDED!
-
Field Details
-
STATUS_TEXT_CLOSE
- See Also:
-
MIN_SIZE_X_DEFAULT
private static final int MIN_SIZE_X_DEFAULT- See Also:
-
MIN_SIZE_Y_DEFAULT
private static final int MIN_SIZE_Y_DEFAULT- See Also:
-
MAX_SIZE_X_DEFAULT
private static final int MAX_SIZE_X_DEFAULT- See Also:
-
MIN_BUTTON_SIZE
private static final int MIN_BUTTON_SIZE- See Also:
-
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
-
text
-
buttons
-
buttonVals
-
defaultButtonPos
private int defaultButtonPos -
rememberID
-
rememberText
-
rememberByDefault
private boolean rememberByDefault -
rememberOnlyIfButtonPos
private int rememberOnlyIfButtonPos -
autoCloseInMS
private int autoCloseInMS -
html
-
url
-
squish
private boolean squish -
autoClosed
private boolean autoClosed -
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
-
resultListener
-
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
-
cbMinUserMode
private int cbMinUserMode -
cbEnabled
private boolean cbEnabled -
instanceID
-
modal
private boolean modal -
explicit_style
private int explicit_style -
mapInstances
-
-
Constructor Details
-
MessageBoxShell
-
MessageBoxShell
@Deprecated public MessageBoxShell(org.eclipse.swt.widgets.Shell parent, String title, String text, String[] buttons, int defaultOption) Deprecated.ONLY FOR OLD EMP. DO NOT USE -
MessageBoxShell
-
MessageBoxShell
Open a messagebox using resource keys for title/text- Parameters:
style- SWT styles for messageboxkeyPrefix- 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 textparent- Parent shell for messagebox
-
MessageBoxShell
-
-
Method Details
-
open
-
isOpen
public static boolean isOpen() -
setDefaultButtonUsingStyle
public void setDefaultButtonUsingStyle(int defaultStyle) -
open
Deprecated.ONLY FOR OLD EMP. DO NOT USE.- Returns:
-
open
Description copied from interface:UIFunctionsUserPrompterOpens the prompt. returns when user has chosen an action, or auto-close- Specified by:
openin interfaceUIFunctionsUserPrompter
-
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, String text2) - Parameters:
textComposite-text2-- Returns:
-
createLinkLabel
private org.eclipse.swt.widgets.Canvas createLinkLabel(org.eclipse.swt.widgets.Composite shell, String text) -
setStyle
public void setStyle(int style) - Specified by:
setStylein interfaceUIFunctionsUserPrompter
-
getHtml
Description copied from interface:UIFunctionsUserPrompterReturns the HTML that will be displayed along with the promptTODO: Create a boolean canHandleHTML()
- Specified by:
getHtmlin interfaceUIFunctionsUserPrompter- Returns:
-
setHtml
- Specified by:
setHtmlin interfaceUIFunctionsUserPrompter- Parameters:
html-
-
setUrl
- Specified by:
setUrlin interfaceUIFunctionsUserPrompter- Parameters:
url-
-
setSize
public void setSize(int width, int height) -
getRememberID
Description copied from interface:UIFunctionsUserPrompterRetrieves the Remember ID associated with this prompt- Specified by:
getRememberIDin interfaceUIFunctionsUserPrompter- Returns:
- the rememberID
-
setRemember
- Specified by:
setRememberin interfaceUIFunctionsUserPrompter- Parameters:
rememberID-rememberByDefault-rememberText- null if you want the default
-
getRememberText
Description copied from interface:UIFunctionsUserPrompterRetrieves the text to be displayed by the "Remember this Action" checkbox- Specified by:
getRememberTextin interfaceUIFunctionsUserPrompter- Returns:
- the rememberText
-
setRememberText
- Specified by:
setRememberTextin interfaceUIFunctionsUserPrompter- Parameters:
rememberText- the rememberText to set
-
getAutoCloseInMS
public int getAutoCloseInMS()Description copied from interface:UIFunctionsUserPrompterReturns the number milliseconds the prompt will wait around until it auto closes. Timer starts after the user is prompted (whenis called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)invalid reference
#open()- Specified by:
getAutoCloseInMSin interfaceUIFunctionsUserPrompter- Returns:
- the autoCloseInMS
-
setAutoCloseInMS
public void setAutoCloseInMS(int autoCloseInMS) Description copied from interface:UIFunctionsUserPrompterSets the # of milliseconds before auto closing. Timer starts after the user is prompted (whenis called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)invalid reference
#open()- Specified by:
setAutoCloseInMSin interfaceUIFunctionsUserPrompter- Parameters:
autoCloseInMS- the autoCloseInMS to set
-
setSquish
public void setSquish(boolean b) -
isAutoClosed
public boolean isAutoClosed()Description copied from interface:UIFunctionsUserPrompterDetermines if the prompt was auto closed afterwas called, or if the user chose an option.invalid reference
#open()- Specified by:
isAutoClosedin interfaceUIFunctionsUserPrompter- 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-
-
setRelatedObject
- Specified by:
setRelatedObjectin interfaceUIFunctionsUserPrompter- Parameters:
relatedObject-
-
setRelatedObjects
- Specified by:
setRelatedObjectsin interfaceUIFunctionsUserPrompter
-
getRelatedObjects
-
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
- Specified by:
setIconResourcein interfaceUIFunctionsUserPrompter- Parameters:
resource- image repository resource name (e.g. "error", "warning", "info")
-
main
-
getRememberOnlyIfButton
public int getRememberOnlyIfButton() -
setRememberOnlyIfButton
public void setRememberOnlyIfButton(int rememberOnlyIfButton) - Specified by:
setRememberOnlyIfButtonin interfaceUIFunctionsUserPrompter- Parameters:
rememberOnlyIfButton-
-
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() -
waitUntilClosed
public int waitUntilClosed()NOT RECOMMENDED!TODO: Occasionaly inspect list of callers and make them use
UserPrompterResultListenerif possible- Specified by:
waitUntilClosedin interfaceUIFunctionsUserPrompter
-
getResult
public int getResult() -
swtButtonStylesToText
-
getButtons
-
setButtons
-
setButtons
-
addCheckBox
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
-
setOneInstanceOf
Description copied from interface:UIFunctionsUserPrompterPrevent more than one dialog of instanceID from showing up at once- Specified by:
setOneInstanceOfin interfaceUIFunctionsUserPrompter- Parameters:
instanceID-
-