Java Code Examples for gwt.material.design.client.constants.IconType#SEARCH
The following examples show how to use
gwt.material.design.client.constants.IconType#SEARCH .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Header.java From lumongo with Apache License 2.0 | 4 votes |
public Header() { MaterialNavBar navBar = new MaterialNavBar(); navBar.setActivates("sideNav"); navBar.setType(NavBarType.FIXED); navBar.setWidth("100%"); navBar.setBackgroundColor(Color.GREY_DARKEN_2); MaterialNavSection navSection = new MaterialNavSection(); navSection.setTextAlign(TextAlign.RIGHT); navBar.add(navSection); sideNav = new MaterialSideNav(SideNavType.PUSH); sideNav.setWidth("60"); sideNav.setId("sideNav"); sideNav.setBackgroundColor(Color.GREY_LIGHTEN_3); sideNav.setCloseOnClick(true); sideNav.setType(SideNavType.PUSH); MaterialNavBrand navBrand = new MaterialNavBrand(); navBrand.add(new MaterialImage(MainResources.INSTANCE.logo())); navBrand.setHref("#"); navBrand.addClickHandler(clickEvent -> sideNav.hide()); sideNav.add(navBrand); { MaterialLink overView = new MaterialLink(IconType.INFO); overView.setTitle("Overview"); overView.addClickHandler(clickEvent -> MainController.get().goTo(new HomePlace())); sideNav.add(overView); } { MaterialLink indexes = new MaterialLink(IconType.SEARCH); indexes.setTitle("Query"); indexes.addClickHandler(clickEvent -> MainController.get().goTo(new QueryPlace(null))); sideNav.add(indexes); } add(navBar); add(sideNav); }
Example 2
Source File: QueryOptionsView.java From lumongo with Apache License 2.0 | 4 votes |
public QueryOptionsView(UIQueryResults uiQueryResults) { setMargin(15); setPadding(10); uiQueryObject = uiQueryResults.getUiQueryObject(); if (uiQueryObject == null) { uiQueryObject = new UIQueryObject(); } if (!uiQueryResults.getJsonDocs().isEmpty()) { MaterialBadge resultsBadge = new MaterialBadge("Total Results: " + NumberFormat.getFormat("#,##0").format(uiQueryResults.getTotalResults())); add(resultsBadge); add(new Br()); } MaterialButton executeButton = new MaterialButton("Execute", IconType.SEARCH); executeButton.addClickHandler(clickEvent -> runSearch()); executeButton.setMarginRight(2); add(executeButton); MaterialButton resetButton = new MaterialButton("Reset", IconType.REFRESH); resetButton.addClickHandler(clickEvent -> MainController.get().goTo(new QueryPlace(null))); add(resetButton); MaterialListBox indexesListBox = new MaterialListBox(); indexesListBox.setMultipleSelect(true); Option selectOneIndexOption = new Option("Select Indexes"); selectOneIndexOption.setDisabled(true); indexesListBox.add(selectOneIndexOption); fieldNameCollapsible = new MaterialCollapsible(); fieldNameCollapsible.setAccordion(false); for (IndexInfo indexInfo : uiQueryResults.getIndexes()) { createFieldNameCollapsible(indexInfo); Option option = new Option(indexInfo.getName()); if (uiQueryObject.getIndexNames().contains(indexInfo.getName())) { option.setSelected(true); fieldItems.get(indexInfo.getName()).setVisible(true); } indexesListBox.add(option); } indexesListBox.addValueChangeHandler(valueChangeEvent -> { for (String indexName : fieldItems.keySet()) { fieldItems.get(indexName).setVisible(false); } for (String itemsSelected : indexesListBox.getItemsSelected()) { uiQueryObject.getIndexNames().add(itemsSelected); fieldItems.get(itemsSelected).setVisible(true); } }); add(indexesListBox); add(fieldNameCollapsible); CustomTextBox searchBox = new CustomTextBox(true); searchBox.setPlaceHolder("q=*:*"); searchBox.setValue(uiQueryObject.getQuery()); searchBox.addKeyUpHandler(clickEvent -> { if (clickEvent.getNativeKeyCode() == KeyCodes.KEY_ENTER) { uiQueryObject.setQuery(searchBox.getValue()); runSearch(); } }); searchBox.getButton().setTitle("Execute Query"); searchBox.getButton().addClickHandler(clickEvent -> { uiQueryObject.setQuery(searchBox.getValue()); runSearch(); }); add(searchBox); CustomTextBox rowsIntegerBox = new CustomTextBox(); rowsIntegerBox.setPlaceHolder("rows (defaults to 10)"); if (uiQueryObject != null && uiQueryObject.getRows() != 10) { rowsIntegerBox.setValue(uiQueryObject.getRows() + ""); } rowsIntegerBox.getTextBox().addChangeHandler(changeEvent -> uiQueryObject.setRows(Integer.valueOf(rowsIntegerBox.getValue()))); rowsIntegerBox.addKeyUpHandler(clickEvent -> { if (clickEvent.getNativeKeyCode() == KeyCodes.KEY_ENTER) { runSearch(); } }); add(rowsIntegerBox); filterQueryDiv = new Div(); if (!uiQueryObject.getFilterQueries().isEmpty()) { for (String fq : uiQueryObject.getFilterQueries()) { createFilterQueryWidget(fq); } } else { createFilterQueryWidget(null); } add(filterQueryDiv); }