to.etc.domui.component.misc
Class MsgBox

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.Div
                  extended by to.etc.domui.component.layout.FloatingWindow
                      extended by to.etc.domui.component.misc.MsgBox
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, INodeErrorDelegate, IDraggable, IDropTargetable

public class MsgBox
extends FloatingWindow


Nested Class Summary
static interface MsgBox.IAnswer
           
static class MsgBox.Type
           
 
Constructor Summary
protected MsgBox()
           
 
Method Summary
protected  void addButton(MsgBoxButton mbb)
          Add a default kind of button.
protected  void addButton(java.lang.String lbl, java.lang.Object selval)
           
protected  void answer(java.lang.Object sel)
           
static DefaultButton areYouSureButton(java.lang.String text, java.lang.String message, IClicked<DefaultButton> ch)
          Create a button which will show an "are you sure" yes/no dialog with a specified text.
static DefaultButton areYouSureButton(java.lang.String text, java.lang.String icon, java.lang.String message, IClicked<DefaultButton> ch)
          Create a button which will show an "are you sure" yes/no dialog with a specified text.
static LinkButton areYouSureLinkButton(java.lang.String text, java.lang.String message, IClicked<LinkButton> ch)
          Create a button which will show an "are you sure" yes/no dialog with a specified text.
static LinkButton areYouSureLinkButton(java.lang.String text, java.lang.String icon, java.lang.String message, IClicked<LinkButton> ch)
          Create a LinkButton which will show an "are you sure" yes/no dialog with a specified text.
static void continueCancel(NodeBase dad, java.lang.String string, IClicked<MsgBox> onAnswer)
          Ask a continue/cancel confirmation, and call the IClicked handler for CONTINUE only.
static void continueCancel(NodeBase dad, java.lang.String string, MsgBox.IAnswer onAnswer)
          Ask a continue/cancel confirmation.
static MsgBox create(NodeBase parent)
           
 void createContent()
          Adjust dimensions in addition to inherited floater behavior.
static void error(NodeBase dad, java.lang.String string)
           
protected  INodeContentRenderer<java.lang.String> getDataRenderer()
           
protected  MsgBox.IAnswer getOnAnswer()
           
static void info(NodeBase dad, java.lang.String string)
           
static void message(NodeBase dad, MsgBox.Type mt, java.lang.String string)
           
static void message(NodeBase dad, MsgBox.Type mt, java.lang.String string, MsgBox.IAnswer onAnswer)
           
static void okMore(NodeBase dad, MsgBox.Type type, java.lang.String string, MsgBox.IAnswer onAnswer)
          Show message of specified type, and provide details (More...) button.
protected  void setDataRenderer(INodeContentRenderer<java.lang.String> dataRenderer)
           
protected  void setMessage(java.lang.String txt)
           
protected  void setOnAnswer(MsgBox.IAnswer onAnswer)
           
protected  void setType(MsgBox.Type type)
           
static void warning(NodeBase dad, java.lang.String string)
           
static void yesNo(NodeBase dad, MsgBox.Type msgtype, java.lang.String string, IClicked<MsgBox> onAnswer)
          Ask a yes/no confirmation; call the onAnswer handler if YES is selected and do nothing otherwise.
static void yesNo(NodeBase dad, java.lang.String string, IClicked<MsgBox> onAnswer)
          Ask a yes/no confirmation; call the onAnswer handler if YES is selected and do nothing otherwise.
static void yesNo(NodeBase dad, java.lang.String string, MsgBox.IAnswer onAnswer)
          Ask a yes/no confirmation, and pass either YES or NO to the onAnswer delegate.
static void yesNo(NodeBase dad, java.lang.String string, MsgBox.IAnswer onAnswer, INodeContentRenderer<java.lang.String> msgRenderer)
          Ask a yes/no confirmation, and pass either YES or NO to the onAnswer delegate.
static void yesNoCancel(NodeBase dad, java.lang.String string, MsgBox.IAnswer onAnswer)
           
 
Methods inherited from class to.etc.domui.component.layout.FloatingWindow
close, closePressed, create, create, createTitleBar, getOnClose, getWindowTitle, isClosable, linkToPageModally, onAddedToPage, onRemoveFromPage, setClosable, setIcon, setOnClose, setWindowTitle
 
Methods inherited from class to.etc.domui.dom.html.Div
afterCreateContent, componentHandleWebAction, fadeIn, fadeOut, getCustomUpdatesCallJS, getDragHandler, getDropBody, getDropHandler, getDropMode, getReturnPressed, setDragHandler, setDropBody, setDropHandler, setReturnPressed, slideDown, slideUp, tb, visit
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, acceptRequestParameter, addCssClass, addGlobalMessage, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, findComponentBundle, getActualID, getAllocationTracepoint, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, hasError, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalOnValueChanged, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetLogAllocations, internalSetTag, isBuilt, isFocusRequested, isStretchHeight, onBeforeFullRender, onForceRebuild, onHeaderContributors, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setStretchHeight, setTestID, setTitle, setUserObject, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MsgBox

protected MsgBox()
Method Detail

create

public static MsgBox create(NodeBase parent)

setType

protected void setType(MsgBox.Type type)

setMessage

protected void setMessage(java.lang.String txt)

message

public static void message(NodeBase dad,
                           MsgBox.Type mt,
                           java.lang.String string)

info

public static void info(NodeBase dad,
                        java.lang.String string)

warning

public static void warning(NodeBase dad,
                           java.lang.String string)

error

public static void error(NodeBase dad,
                         java.lang.String string)

message

public static void message(NodeBase dad,
                           MsgBox.Type mt,
                           java.lang.String string,
                           MsgBox.IAnswer onAnswer)

yesNoCancel

public static void yesNoCancel(NodeBase dad,
                               java.lang.String string,
                               MsgBox.IAnswer onAnswer)

yesNo

public static void yesNo(NodeBase dad,
                         java.lang.String string,
                         MsgBox.IAnswer onAnswer)
Ask a yes/no confirmation, and pass either YES or NO to the onAnswer delegate. Use this if you need the NO action too, else use the IClicked variant.

Parameters:
dad -
string -
onAnswer -

yesNo

public static void yesNo(NodeBase dad,
                         java.lang.String string,
                         MsgBox.IAnswer onAnswer,
                         INodeContentRenderer<java.lang.String> msgRenderer)
Ask a yes/no confirmation, and pass either YES or NO to the onAnswer delegate. Use this if you need the NO action too, else use the IClicked variant.

Parameters:
dad -
string -
onAnswer -
msgRenderer - Provides custom rendering of specified string message.

yesNo

public static void yesNo(NodeBase dad,
                         java.lang.String string,
                         IClicked<MsgBox> onAnswer)
Ask a yes/no confirmation; call the onAnswer handler if YES is selected and do nothing otherwise.

Parameters:
dad -
string -
onAnswer -

yesNo

public static void yesNo(NodeBase dad,
                         MsgBox.Type msgtype,
                         java.lang.String string,
                         IClicked<MsgBox> onAnswer)
Ask a yes/no confirmation; call the onAnswer handler if YES is selected and do nothing otherwise.

Parameters:
dad -
string -
onAnswer -

okMore

public static void okMore(NodeBase dad,
                          MsgBox.Type type,
                          java.lang.String string,
                          MsgBox.IAnswer onAnswer)
Show message of specified type, and provide details (More...) button. Usually used to show some error details if user wants to see it.

Parameters:
dad -
type -
string -
onAnswer -

continueCancel

public static void continueCancel(NodeBase dad,
                                  java.lang.String string,
                                  MsgBox.IAnswer onAnswer)
Ask a continue/cancel confirmation. This passes either choice to the handler.

Parameters:
dad -
string -
onAnswer -

continueCancel

public static void continueCancel(NodeBase dad,
                                  java.lang.String string,
                                  IClicked<MsgBox> onAnswer)
Ask a continue/cancel confirmation, and call the IClicked handler for CONTINUE only.

Parameters:
dad -
string -
onAnswer -

areYouSureButton

public static DefaultButton areYouSureButton(java.lang.String text,
                                             java.lang.String icon,
                                             java.lang.String message,
                                             IClicked<DefaultButton> ch)
Create a button which will show an "are you sure" yes/no dialog with a specified text. Only if the user presses the "yes" button will the clicked handler be executed.

Parameters:
icon -
text - The button's text.
message - The message to show in the are you sure popup
ch - The delegate to call when the user is sure.
Returns:

areYouSureButton

public static DefaultButton areYouSureButton(java.lang.String text,
                                             java.lang.String message,
                                             IClicked<DefaultButton> ch)
Create a button which will show an "are you sure" yes/no dialog with a specified text. Only if the user presses the "yes" button will the clicked handler be executed.

Parameters:
text - The button's text.
message - The message to show in the are you sure popup
ch - The delegate to call when the user is sure.
Returns:

areYouSureLinkButton

public static LinkButton areYouSureLinkButton(java.lang.String text,
                                              java.lang.String icon,
                                              java.lang.String message,
                                              IClicked<LinkButton> ch)
Create a LinkButton which will show an "are you sure" yes/no dialog with a specified text. Only if the user presses the "yes" button will the clicked handler be executed.

Parameters:
icon -
text - The button's text.
message - The message to show in the are you sure popup
ch - The delegate to call when the user is sure.
Returns:

areYouSureLinkButton

public static LinkButton areYouSureLinkButton(java.lang.String text,
                                              java.lang.String message,
                                              IClicked<LinkButton> ch)
Create a button which will show an "are you sure" yes/no dialog with a specified text. Only if the user presses the "yes" button will the clicked handler be executed.

Parameters:
text - The button's text.
message - The message to show in the are you sure popup
ch - The delegate to call when the user is sure.
Returns:

createContent

public void createContent()
                   throws java.lang.Exception
Adjust dimensions in addition to inherited floater behavior.

Overrides:
createContent in class FloatingWindow
Throws:
java.lang.Exception
See Also:
NodeBase.createContent()

answer

protected void answer(java.lang.Object sel)
               throws java.lang.Exception
Throws:
java.lang.Exception

addButton

protected void addButton(MsgBoxButton mbb)
Add a default kind of button.

Parameters:
mbb -

addButton

protected void addButton(java.lang.String lbl,
                         java.lang.Object selval)

getOnAnswer

protected MsgBox.IAnswer getOnAnswer()

setOnAnswer

protected void setOnAnswer(MsgBox.IAnswer onAnswer)

getDataRenderer

protected INodeContentRenderer<java.lang.String> getDataRenderer()

setDataRenderer

protected void setDataRenderer(INodeContentRenderer<java.lang.String> dataRenderer)