TRowObject
- The grid row object typepublic class CustomComboBox<TRowObject>
extends com.google.gwt.user.client.ui.Composite
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
CustomComboBox.Binder
The GWT UI creator
|
static interface |
CustomComboBox.StringPresentation<TRowObject>
Defines the presentation method to parse a row into its presentation value.
|
Modifier and Type | Field and Description |
---|---|
private static CustomComboBox.Binder |
binder
The instance of the GWT UI creator
|
(package private) com.google.gwt.user.client.ui.HorizontalPanel |
container
The widget container
|
private com.google.gwt.view.client.ListDataProvider<TRowObject> |
dataProvider
The dropdown item data provider
|
(package private) com.google.gwt.user.client.ui.Button |
dropdown
The dropdown button
|
(package private) org.gwtbootstrap3.client.ui.TextBox |
entry
The text box
|
private CustomComboBox.StringPresentation<TRowObject> |
entryTextParser
The parser for text entry presentation values
|
private com.google.gwt.user.cellview.client.DataGrid<TRowObject> |
grid
The grid placed on the dropdown panel
|
private static java.util.logging.Logger |
logger
The logger
|
private com.google.gwt.user.client.ui.PopupPanel |
popup
The dropdown panel
|
private com.google.gwt.view.client.SingleSelectionModel<TRowObject> |
selectionModel
The single selection model
|
private com.google.web.bindery.event.shared.HandlerRegistration |
selectionModelHandler
The selection handler
|
Constructor and Description |
---|
CustomComboBox(java.lang.String popupWidth,
java.lang.String popupHeight)
Creates the instance of the grid combobox.
|
Modifier and Type | Method and Description |
---|---|
private void |
clearGridColumns()
Clears grid columns.
|
private void |
displayPopup()
Displays the dropdown.
|
private void |
focusDataGrid()
Requests the input focus for its data grid.
|
CustomComboBox.StringPresentation<TRowObject> |
getEntryTextParser()
Returns the combobox text entry parser.
|
TRowObject |
getValue()
Gets the selected value.
|
private boolean |
hasElement(com.google.gwt.dom.client.Element container,
com.google.gwt.dom.client.Element e)
Tests if the given container holds the target element.
|
private void |
hidePopup()
Hides the dropdown.
|
(package private) void |
onDropDown(com.google.gwt.event.dom.client.ClickEvent event)
Defines the dropdown button handler.
|
void |
resetValue()
Resets the current selection
|
void |
selectItem(com.google.common.base.Predicate<TRowObject> itemSelector)
Sets the selected value by item selector.
|
void |
setData(java.util.List<GridHelper.ColumnInfo<TRowObject>> columns,
TRowObject[] data)
Sets its model.
|
void |
setEntryTextParser(CustomComboBox.StringPresentation<TRowObject> entryTextParser)
Sets the combobox text entry parser.
|
void |
setValue(TRowObject row)
Sets the selected value.
|
private void |
toggleClass(com.google.gwt.dom.client.Element e,
java.lang.String style)
Imports the jQuery toggleClass function.
|
private void |
toggleDropdownStyle()
Changes the presentation icon for the dropdown button.
|
private void |
togglePopup()
Switches the dropdown to be visible or hidden.
|
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
private static java.util.logging.Logger logger
private static final CustomComboBox.Binder binder
@UiField com.google.gwt.user.client.ui.HorizontalPanel container
@UiField org.gwtbootstrap3.client.ui.TextBox entry
@UiField com.google.gwt.user.client.ui.Button dropdown
private com.google.gwt.user.client.ui.PopupPanel popup
private final com.google.gwt.user.cellview.client.DataGrid<TRowObject> grid
private final com.google.gwt.view.client.ListDataProvider<TRowObject> dataProvider
private final com.google.gwt.view.client.SingleSelectionModel<TRowObject> selectionModel
private com.google.web.bindery.event.shared.HandlerRegistration selectionModelHandler
private CustomComboBox.StringPresentation<TRowObject> entryTextParser
@UiConstructor public CustomComboBox(java.lang.String popupWidth, java.lang.String popupHeight)
popupWidth
- The css widthpopupHeight
- The css heightpublic CustomComboBox.StringPresentation<TRowObject> getEntryTextParser()
public void setEntryTextParser(CustomComboBox.StringPresentation<TRowObject> entryTextParser)
entryTextParser
- The text entry parserpublic void setData(java.util.List<GridHelper.ColumnInfo<TRowObject>> columns, TRowObject[] data)
columns
- The list of table columnsdata
- The table rowspublic TRowObject getValue()
public void setValue(TRowObject row)
row
- The selected rowpublic void resetValue()
@UiHandler(value="dropdown") void onDropDown(com.google.gwt.event.dom.client.ClickEvent event)
event
- The click eventpublic void selectItem(com.google.common.base.Predicate<TRowObject> itemSelector)
itemSelector
- The item selectorprivate void clearGridColumns()
private void focusDataGrid()
private void displayPopup()
private void togglePopup()
private void hidePopup()
private void toggleDropdownStyle()
private void toggleClass(com.google.gwt.dom.client.Element e, java.lang.String style)
e
- The html elementstyle
- The css classprivate boolean hasElement(com.google.gwt.dom.client.Element container, com.google.gwt.dom.client.Element e)
container
- The given containere
- The target element