public class InputDialog
extends com.google.gwt.user.client.ui.Composite
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
InputDialog.Binder
GWT binder.
|
static class |
InputDialog.Field<ValType>
A single input dialog field.
|
static class |
InputDialog.Group
The root interface for items having other sub items.
|
static interface |
InputDialog.Item
The root interface of the input dialog model.
|
static class |
InputDialog.MultiSelectField
Multi selection field.
|
static class |
InputDialog.Panel
Group of items positioned on a single form panel.
|
static class |
InputDialog.SelectField
Select input field.
|
private static class |
InputDialog.SensitiveBlankValidatorWrapper
This class wraps any validator and relaxes its validation logic in such a way that
it always considers the disabled editor valid.
|
static class |
InputDialog.Span
Group of items spanning one line.
|
static class |
InputDialog.WidgetItem
Field item wrapping arbitrary widget.
|
Modifier and Type | Field and Description |
---|---|
private java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> |
actionHandler
The handler that will be closed when the dialog is dismissed
|
private org.gwtbootstrap3.client.ui.Form |
activeForm
Currently displayed form
|
private InputDialog.Panel |
activePanel
Currently displayed panel
|
private boolean |
autoHide
Ato hide flag
|
(package private) org.gwtbootstrap3.client.ui.Button |
bCancel
Widget
|
(package private) com.google.gwt.user.client.ui.HTML |
bodyMessage
Widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bSave
Widget
|
(package private) org.gwtbootstrap3.client.ui.ButtonGroup |
extraButtonGroup
Widget
|
private java.util.Map<InputDialog.Panel,org.gwtbootstrap3.client.ui.Form> |
forms
Mao of panel forms
|
(package private) org.gwtbootstrap3.client.ui.html.Div |
formsPanel
Widget
|
private com.google.web.bindery.event.shared.HandlerRegistration |
hideHandlerReg
Hide dialog handler registration
|
private int |
labelSize
Size of the labels in the first column of fields.
|
(package private) org.gwtbootstrap3.client.ui.Modal |
modal
Widget
|
(package private) org.gwtbootstrap3.client.ui.ModalFooter |
modalFooter
Widget
|
(package private) org.gwtbootstrap3.client.ui.NavTabs |
navTabs
Widget
|
private boolean |
tabbed
If
true the dialog will show the top level panels as tabs |
private java.util.Map<InputDialog.Panel,org.gwtbootstrap3.client.ui.AnchorListItem> |
tabs
Map of tabs
|
(package private) org.gwtbootstrap3.client.ui.html.Span |
title
Widget
|
private java.util.Map<java.lang.String,java.lang.String> |
translationMap
Text translation map
|
private java.util.Map<InputDialog.Field,com.google.gwt.user.client.ui.HasValue> |
widgets
Map of fields to widgets
|
Constructor and Description |
---|
InputDialog(InputDialog.Binder binder)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addButtons(org.gwtbootstrap3.client.ui.Button... buttons)
Adds extra buttons.
|
void |
addValidators(InputDialog.Field f,
org.gwtbootstrap3.client.ui.form.validator.Validator... validators)
Adds field validators.
|
void |
bCancelClick(com.google.gwt.event.dom.client.ClickEvent event)
Click event handler.
|
void |
bSaveClick(com.google.gwt.event.dom.client.ClickEvent event)
Click event handler.
|
void |
build(java.lang.String title,
InputDialog.Item... items)
Build the dialog.
|
void |
build(java.lang.String title,
java.lang.String helpText,
InputDialog.Item... items)
Build the dialog.
|
private com.google.gwt.user.client.ui.Widget |
buildLabel(InputDialog.Field f,
com.google.gwt.user.client.ui.HasValue w)
Builds label widget.
|
private com.google.gwt.user.client.ui.Widget |
buildValidatorUI(InputDialog.Field f,
com.google.gwt.user.client.ui.HasValue w)
Assembles the field widget into a set of widgets capable to validate and show validation
errors.
|
private void |
buildWidgets(InputDialog.Item[] items)
Builds the dialog widgets from the input dialog model.
|
private org.gwtbootstrap3.client.ui.form.validator.Validator |
createBlankValidator()
Creates a blank validator with the default message.
|
private org.gwtbootstrap3.client.ui.form.validator.Validator |
createBlankValidator(java.lang.String errMessage)
Creates a blank validator with a custom message.
|
void |
dismiss()
Dismisses the dialog.
|
org.gwtbootstrap3.client.ui.base.AbstractListItem |
getTab(InputDialog.Panel p)
Get tab widget for the supplied panel.
|
java.util.Map<java.lang.String,java.lang.String> |
getTranslationMap()
Text translation map.
|
<T> T |
getValue(InputDialog.Field field,
T defValue)
Returns the value of a specified field.
|
com.google.gwt.user.client.ui.HasValue |
getWidget(InputDialog.Field f)
Returns the widget of a specified field.
|
private boolean |
hasLabels(InputDialog.Item... items)
Checks whether the supplied input dialog model has any defined label.
|
private void |
layout(InputDialog.Item[] items)
Layouts the input dialog.
|
private org.gwtbootstrap3.client.ui.FieldSet |
layoutPanel(org.gwtbootstrap3.client.ui.Form f,
InputDialog.Panel panel,
boolean nolabel)
Layouts one panel, this is part of the main layout logic.
|
private org.gwtbootstrap3.client.ui.Row |
layoutSpan(InputDialog.Span span,
int labelSize)
Layouts one line of widgets.
|
void |
setLabelSize(int size)
Sets the default label size.
|
void |
setSaveButtonText(java.lang.String saveButtonText)
Allows to override the default label of the save button.
|
void |
setTabbed(boolean tabbed)
Sets the tabbed flag.
|
void |
setTranslationMap(java.util.Map<java.lang.String,java.lang.String> translationMap)
Setups the translation map that holds pairs of a key and its presentation value.
|
void |
setValue(InputDialog.Field field,
java.lang.Object value)
Sets field value.
|
void |
setValue(InputDialog.Field field,
java.lang.Object value,
boolean fireEvents)
Sets field value.
|
void |
show(com.google.gwt.user.client.ui.HasWidgets parent,
boolean autoHide,
java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> actionHandler)
Show the dialog.
|
void |
show(com.google.gwt.user.client.ui.HasWidgets parent,
java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> actionHandler)
Show the dialog.
|
void |
showFilterDialog(java.lang.String filter,
com.google.gwt.user.client.ui.HasWidgets parent,
java.util.function.Consumer<java.lang.String> actionHandler)
Deprecated.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
@UiField com.google.gwt.user.client.ui.HTML bodyMessage
@UiField org.gwtbootstrap3.client.ui.html.Span title
@UiField org.gwtbootstrap3.client.ui.Button bSave
@UiField org.gwtbootstrap3.client.ui.Button bCancel
@UiField org.gwtbootstrap3.client.ui.Modal modal
@UiField org.gwtbootstrap3.client.ui.ModalFooter modalFooter
@UiField org.gwtbootstrap3.client.ui.ButtonGroup extraButtonGroup
@UiField org.gwtbootstrap3.client.ui.html.Div formsPanel
@UiField org.gwtbootstrap3.client.ui.NavTabs navTabs
private int labelSize
private boolean autoHide
private java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> actionHandler
private com.google.web.bindery.event.shared.HandlerRegistration hideHandlerReg
private java.util.Map<InputDialog.Field,com.google.gwt.user.client.ui.HasValue> widgets
private java.util.Map<InputDialog.Panel,org.gwtbootstrap3.client.ui.Form> forms
private java.util.Map<InputDialog.Panel,org.gwtbootstrap3.client.ui.AnchorListItem> tabs
private org.gwtbootstrap3.client.ui.Form activeForm
private InputDialog.Panel activePanel
private java.util.Map<java.lang.String,java.lang.String> translationMap
private boolean tabbed
true
the dialog will show the top level panels as tabs@Inject InputDialog(InputDialog.Binder binder)
binder
- GWT binder.public void build(java.lang.String title, InputDialog.Item... items)
title
- Dialog title.items
- Input form items.public void build(java.lang.String title, java.lang.String helpText, InputDialog.Item... items)
title
- Dialog title.helpText
- Help text to be displayed above the table or null
items
- Input form items.public void addButtons(org.gwtbootstrap3.client.ui.Button... buttons)
buttons
- Extra buttons array.public void addValidators(InputDialog.Field f, org.gwtbootstrap3.client.ui.form.validator.Validator... validators)
f
- Field.validators
- Array of validators.public void setSaveButtonText(java.lang.String saveButtonText)
saveButtonText
- public void setLabelSize(int size)
size
- New size.public void setTabbed(boolean tabbed)
tabbed
- Tabbed flag.public com.google.gwt.user.client.ui.HasValue getWidget(InputDialog.Field f)
f
- A field.null
if widget not foundpublic <T> T getValue(InputDialog.Field field, T defValue)
T
- Value type.field
- A field.defValue
- Value that will be returned when the field value is null
.public void setValue(InputDialog.Field field, java.lang.Object value)
field
- A field.value
- A value.public void setValue(InputDialog.Field field, java.lang.Object value, boolean fireEvents)
field
- A field.value
- A value.fireEvents
- When true
the widget will trigger a value-change event.public org.gwtbootstrap3.client.ui.base.AbstractListItem getTab(InputDialog.Panel p)
p
- A panel.public void show(com.google.gwt.user.client.ui.HasWidgets parent, java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> actionHandler)
parent
- Parent widget where this widget will be revealed in.actionHandler
- Invoked when Save or Cancel button is clicked.public void show(com.google.gwt.user.client.ui.HasWidgets parent, boolean autoHide, java.util.function.Consumer<java.util.Map<InputDialog.Field,java.lang.Object>> actionHandler)
parent
- Parent widget where this widget will be revealed in.autoHide
- When true, the dialog will hide when Save is clicked automatically.
When false, dismiss() must be called by the user code to make the dialog go away.
Note that the dialog always hides when Cancel is clicked.actionHandler
- Invoked when Save or Cancel button is clicked.public void dismiss()
@UiHandler(value="bSave") public void bSaveClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bCancel") public void bCancelClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.public java.util.Map<java.lang.String,java.lang.String> getTranslationMap()
public void setTranslationMap(java.util.Map<java.lang.String,java.lang.String> translationMap)
translationMap
- The translation mapprivate void buildWidgets(InputDialog.Item[] items)
items
- The input dialog model.private void layout(InputDialog.Item[] items)
items
- The input dialog model.private org.gwtbootstrap3.client.ui.FieldSet layoutPanel(org.gwtbootstrap3.client.ui.Form f, InputDialog.Panel panel, boolean nolabel)
f
- Form item.panel
- Panel item.nolabel
- Whether labels should be visible.private org.gwtbootstrap3.client.ui.Row layoutSpan(InputDialog.Span span, int labelSize)
span
- The items on one line.labelSize
- Label size.private com.google.gwt.user.client.ui.Widget buildLabel(InputDialog.Field f, com.google.gwt.user.client.ui.HasValue w)
f
- Field for which to build the label.w
- The field widget.private com.google.gwt.user.client.ui.Widget buildValidatorUI(InputDialog.Field f, com.google.gwt.user.client.ui.HasValue w)
f
- Field for which to build the validation UI.w
- The field widget.private org.gwtbootstrap3.client.ui.form.validator.Validator createBlankValidator()
private org.gwtbootstrap3.client.ui.form.validator.Validator createBlankValidator(java.lang.String errMessage)
private boolean hasLabels(InputDialog.Item... items)
items
- The input dialog model.true
when there is any label defined in the supplied model@Deprecated public void showFilterDialog(java.lang.String filter, com.google.gwt.user.client.ui.HasWidgets parent, java.util.function.Consumer<java.lang.String> actionHandler)
filter
- The initial filter value.parent
- The modal dialog parent.actionHandler
- The callback called when the dialog is dismissed.