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.EntryValue<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
|
(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.EntryValue<TRowObject> |
entryTextParser
The parser for text entry presentation values
|
private GridHandle<TRowObject> |
gridHandle
The grid handle that manages 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.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 |
displayPopup()
Displays the dropdown.
|
private void |
focusDataGrid()
Requests the input focus for its data grid.
|
com.google.gwt.user.cellview.client.DataGrid<TRowObject> |
getDataGrid()
Returns the data grid.
|
com.google.gwt.view.client.ListDataProvider<TRowObject> |
getDataProvider()
Returns the data provider.
|
CustomComboBox.EntryValue<TRowObject> |
getEntryTextParser()
Returns the combobox text entry parser.
|
com.google.gwt.view.client.SelectionModel<TRowObject> |
getSelectionModel()
Returns the selection model.
|
java.util.Set<TRowObject> |
getValue()
Gets the selected set.
|
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(TRowObject[] data)
Set data.
|
void |
setEntryTextParser(CustomComboBox.EntryValue<TRowObject> entryTextParser)
Sets the combobox text entry parser.
|
void |
setGridHandle(GridHandle<TRowObject> gridHandle) |
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, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringprivate 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 com.google.web.bindery.event.shared.HandlerRegistration selectionModelHandler
private CustomComboBox.EntryValue<TRowObject> entryTextParser
private GridHandle<TRowObject> gridHandle
@UiConstructor
public CustomComboBox(java.lang.String popupWidth,
java.lang.String popupHeight)
popupWidth - The css widthpopupHeight - The css heightpublic CustomComboBox.EntryValue<TRowObject> getEntryTextParser()
public void setEntryTextParser(CustomComboBox.EntryValue<TRowObject> entryTextParser)
entryTextParser - The text entry parserpublic void setGridHandle(GridHandle<TRowObject> gridHandle)
public void setData(TRowObject[] data)
data - The table rowspublic java.util.Set<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 selectorpublic com.google.gwt.user.cellview.client.DataGrid<TRowObject> getDataGrid()
public com.google.gwt.view.client.SelectionModel<TRowObject> getSelectionModel()
public com.google.gwt.view.client.ListDataProvider<TRowObject> getDataProvider()
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