@Bean public class MessageBox extends AbstractWidget implements IMessageBox
MessageBoxes
to create a message box.Modifier and Type | Class and Description |
---|---|
protected class |
MessageBox.P_UIFacade |
propertySupport
CANCEL_OPTION, NO_OPTION, YES_OPTION
PROP_DISPOSE_DONE, PROP_INIT_CONFIG_DONE, PROP_INIT_DONE
PROP_CSS_CLASS
Constructor and Description |
---|
MessageBox() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener) |
protected void |
closeMessageBox() |
protected void |
fireClosed() |
protected void |
fireMessageBoxEvent(MessageBoxEvent e) |
long |
getAutoCloseMillis() |
String |
getBody() |
String |
getCancelButtonText() |
String |
getCopyPasteText() |
IDisplayParent |
getDisplayParent() |
String |
getHeader() |
String |
getHiddenText() |
org.eclipse.scout.rt.platform.html.IHtmlContent |
getHtml() |
String |
getIconId() |
String |
getNoButtonText() |
int |
getSeverity() |
IMessageBoxUIFacade |
getUIFacade() |
String |
getYesButtonText() |
protected void |
initConfig() |
boolean |
isOpen()
To query whether the message box is open or closed.
|
org.eclipse.scout.rt.platform.util.event.IFastListenerList<MessageBoxListener> |
messageBoxListeners() |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener) |
int |
show()
Displays the message box and waits for a response.
|
int |
show(int defaultResult)
Displays the message box and waits for a response.
|
protected void |
updateCopyPasteTextInternal() |
protected void |
waitFor() |
MessageBox |
withAutoCloseMillis(long autoCloseMillis)
To close the message box automatically after the specified period of time.
|
MessageBox |
withBody(String body)
Sets the body.
|
MessageBox |
withCancelButtonText(String cancelButtonText)
Sets the text for the cancel button.
|
MessageBox |
withCopyPasteText(String copyPasteText)
Sets the copy paste text.
|
IMessageBox |
withDisplayParent(IDisplayParent displayParent)
Sets the display parent to attach this
IMessageBox to. |
MessageBox |
withHeader(String header)
Sets the header.
|
MessageBox |
withHiddenText(String hiddenText)
Sets the hidden text.
|
MessageBox |
withHtml(org.eclipse.scout.rt.platform.html.IHtmlContent html)
Sets the html.
|
MessageBox |
withIconId(String iconId) |
MessageBox |
withNoButtonText(String noButtonText)
Sets the text for the no button.
|
MessageBox |
withSeverity(int severity)
Sets the severity.
|
MessageBox |
withYesButtonText(String yesButtonText)
Sets the text for the yes / ok button.
|
callInitializer, dispose, disposeChildren, disposeChildren, disposeInternal, getChildren, getConfiguredCssClass, getCssClass, init, initChildren, initChildren, initConfigInternal, initInternal, isDisposeDone, isInitConfigDone, isInitDone, reinit, setCssClass, setDisposeDone, setInitConfigDone, setInitDone, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
getPropertyChangeListeners, getSpecificPropertyChangeListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMessageBoxListener, removeMessageBoxListener
dispose, getChildren, init, isDisposeDone, isInitConfigDone, isInitDone, reinit, visit, visit, visit, visit, visit, visit, visit, visit
addCssClass, cssClassesAsList, getCssClass, removeCssClass, setCssClass, toggleCssClass
@PostConstruct protected void initConfig()
initConfig
in class AbstractWidget
public IDisplayParent getDisplayParent()
getDisplayParent
in interface IMessageBox
IDisplayParent
to attach this IMessageBox
to; is never null
.public IMessageBox withDisplayParent(IDisplayParent displayParent)
IMessageBox
IMessageBox
to.
A display parent is the anchor to attach this IMessageBox
to, and affects its accessibility and modality
scope. Possible parents are IDesktop
, IOutline
, or IForm
:
IMessageBox
is always accessible; blocks the entire desktop;IMessageBox
is only accessible when the given outline is active; only blocks the outline;IMessageBox
is only accessible when the given Form is active; only blocks the Form;withDisplayParent
in interface IMessageBox
displayParent
- like IDesktop
, IOutline
, IForm
, or null
to derive the
IDisplayParent
from the current calling context.public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface org.eclipse.scout.rt.platform.reflect.IPropertyObserver
addPropertyChangeListener
in class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface org.eclipse.scout.rt.platform.reflect.IPropertyObserver
removePropertyChangeListener
in class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener
in interface org.eclipse.scout.rt.platform.reflect.IPropertyObserver
addPropertyChangeListener
in class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
removePropertyChangeListener
in interface org.eclipse.scout.rt.platform.reflect.IPropertyObserver
removePropertyChangeListener
in class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
public String getHeader()
getHeader
in interface IMessageBox
#withHeader(String)}
public MessageBox withHeader(String header)
IMessageBox
The header is by default represented in bold font as first entry in the message box.
withHeader
in interface IMessageBox
public String getBody()
getBody
in interface IMessageBox
#withBody(String)}
public MessageBox withBody(String body)
IMessageBox
The body is by default represented in normal font as second entry after the header (if available).
withBody
in interface IMessageBox
public org.eclipse.scout.rt.platform.html.IHtmlContent getHtml()
getHtml
in interface IMessageBox
#withHtml(IHtmlContent)}
public MessageBox withHtml(org.eclipse.scout.rt.platform.html.IHtmlContent html)
IMessageBox
The html allows to use custom html and is positioned as third entry after the body (if available).
withHtml
in interface IMessageBox
public String getHiddenText()
getHiddenText
in interface IMessageBox
#withHiddenText(String)}
public MessageBox withHiddenText(String hiddenText)
IMessageBox
The hidden text is used for the default copy paste text, thus not visible in the UI directly.
Examples usages are stacktraces or more detailed information that should not be directly presented to the user.
withHiddenText
in interface IMessageBox
public String getYesButtonText()
getYesButtonText
in interface IMessageBox
#withYesButtonText(String)}
public MessageBox withYesButtonText(String yesButtonText)
IMessageBox
withYesButtonText
in interface IMessageBox
public String getNoButtonText()
getNoButtonText
in interface IMessageBox
#withNoButtonText(String)}
public MessageBox withNoButtonText(String noButtonText)
IMessageBox
withNoButtonText
in interface IMessageBox
public String getCancelButtonText()
getCancelButtonText
in interface IMessageBox
#withCancelButtonText(String)}
public MessageBox withCancelButtonText(String cancelButtonText)
IMessageBox
withCancelButtonText
in interface IMessageBox
public String getIconId()
getIconId
in interface IMessageBox
public MessageBox withIconId(String iconId)
withIconId
in interface IMessageBox
public int getSeverity()
getSeverity
in interface IMessageBox
#withSeverity(int)}
public MessageBox withSeverity(int severity)
IMessageBox
withSeverity
in interface IMessageBox
severity
- One of the IStatus
constants.public long getAutoCloseMillis()
getAutoCloseMillis
in interface IMessageBox
#withAutoCloseMillis(long)}
public MessageBox withAutoCloseMillis(long autoCloseMillis)
IMessageBox
IMessageBox.CANCEL_OPTION
is returned after being closed. This can be changed by using IMessageBox.show(int)
to construct
the message box.withAutoCloseMillis
in interface IMessageBox
autoCloseMillis
- timeout [ms]public String getCopyPasteText()
getCopyPasteText
in interface IMessageBox
#withCopyPasteText(String)}
public MessageBox withCopyPasteText(String copyPasteText)
IMessageBox
The text is used if the user applies the copy shortcut on the message box.
If not explicitly set, the default copy paste text is used, which is a combination of header, body, html (plain text) and hidden text (separated by newline).
withCopyPasteText
in interface IMessageBox
protected void updateCopyPasteTextInternal()
public org.eclipse.scout.rt.platform.util.event.IFastListenerList<MessageBoxListener> messageBoxListeners()
messageBoxListeners
in interface IMessageBox
protected void fireClosed()
protected void fireMessageBoxEvent(MessageBoxEvent e)
public IMessageBoxUIFacade getUIFacade()
getUIFacade
in interface IMessageBox
public boolean isOpen()
IMessageBox
isOpen
in interface IMessageBox
true
if the message box is open, false
if closed.public int show()
If getAutoCloseMillis()
is set, the message box will return with IMessageBox.CANCEL_OPTION
after
the specific time.
show
in interface IMessageBox
IMessageBox.YES_OPTION
, IMessageBox.NO_OPTION
, IMessageBox.CANCEL_OPTION
).public int show(int defaultResult)
If getAutoCloseMillis()
is set, the message box will return with given response after the specific time.
show
in interface IMessageBox
defaultResult
- default result to return if not closed by the user (e.g. by auto-close timer).IMessageBox.YES_OPTION
, IMessageBox.NO_OPTION
, IMessageBox.CANCEL_OPTION
).protected void waitFor()
protected void closeMessageBox()
Copyright © 2010–2018. All rights reserved.