Package org.jboss.hal.ballroom.dialog
Class Dialog
- java.lang.Object
-
- org.jboss.hal.ballroom.dialog.Dialog
-
- All Implemented Interfaces:
org.jboss.elemento.IsElement
- Direct Known Subclasses:
BlockingDialog
public class Dialog extends Object implements org.jboss.elemento.IsElement
A modal dialog with optional secondary and primary buttons. Only one dialog can be open at a time. The buttons can be placed on the left or the right side. Each button has a callback. The callback is either aCallbackwhich always closes the dialog or aDialog.ResultCallbackwith a boolean return value. A value oftrueindicates that the dialog should be closed whereasfalsekeeps the dialog open. You can add as many buttons as you like, but only one of them should be the primary button.There are convenience methods to add primary and secondary buttons which come with pre-defined placements. If you want to define the placement by yourself use negative numbers to place the buttons on the left side and positive numbers for the right side. On each side the buttons are ordered according to the placement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDialog.Builderstatic interfaceDialog.ResultCallbackA button callback which returns a boolean to indicate whether the dialog should be closed or stay open.static classDialog.Size
-
Field Summary
Fields Modifier and Type Field Description static intPRIMARY_POSITION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description elemental2.dom.HTMLElementelement()elemental2.dom.HTMLButtonElementgetButton(int position)static booleanisOpen()voidregisterAttachable(Attachable first, Attachable... rest)voidsetTitle(String title)voidshow()
-
-
-
Field Detail
-
PRIMARY_POSITION
public static final int PRIMARY_POSITION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isOpen
public static boolean isOpen()
-
element
public elemental2.dom.HTMLElement element()
- Specified by:
elementin interfaceorg.jboss.elemento.IsElement
-
registerAttachable
public void registerAttachable(Attachable first, Attachable... rest)
-
show
public void show()
-
setTitle
public void setTitle(String title)
-
getButton
public elemental2.dom.HTMLButtonElement getButton(int position)
-
-