List of usage examples for com.vaadin.server FontAwesome SEARCH
FontAwesome SEARCH
To view the source code for com.vaadin.server FontAwesome SEARCH.
Click Source Link
From source file:com.mycollab.module.crm.view.contact.ContactSimpleSearchPanel.java
License:Open Source License
private void createBasicSearchLayout() { layoutSearchPane = new GridLayout(3, 3); layoutSearchPane.setSpacing(true);//from w w w.j av a 2s. com group = new ValueComboBox(false, "Name", "Email", "Phone", AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE)); group.select("Name"); group.setImmediate(true); group.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { removeComponents(); String searchType = (String) group.getValue(); if (searchType.equals("Name")) { addTextFieldSearch(); } else if (searchType.equals("Email")) { addTextFieldSearch(); } else if (searchType.equals("Phone")) { addTextFieldSearch(); } else if (searchType.equals(AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE))) { addUserListSelectField(); } } }); layoutSearchPane.addComponent(group, 1, 0); layoutSearchPane.setComponentAlignment(group, Alignment.MIDDLE_CENTER); addTextFieldSearch(); Button searchBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SEARCH)); searchBtn.setStyleName(UIConstants.BUTTON_ACTION); searchBtn.setIcon(FontAwesome.SEARCH); searchBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { doSearch(); } }); layoutSearchPane.addComponent(searchBtn, 2, 0); layoutSearchPane.setComponentAlignment(searchBtn, Alignment.MIDDLE_CENTER); this.setCompositionRoot(layoutSearchPane); }
From source file:com.mycollab.module.crm.view.lead.LeadSimpleSearchPanel.java
License:Open Source License
private void createBasicSearchLayout() { searchPanel = new GridLayout(3, 3); searchPanel.setSpacing(true);/* www. java2 s.com*/ group = new ValueComboBox(false, "Name", "Email", "Phone", AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE)); group.select("Name"); group.setImmediate(true); group.addValueChangeListener(new Property.ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { removeComponents(); String searchType = (String) group.getValue(); if (searchType.equals("Name")) { addTextFieldSearch(); } else if (searchType.equals("Email")) { addTextFieldSearch(); } else if (searchType.equals("Phone")) { addTextFieldSearch(); } else if (searchType.equals(AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE))) { addUserListSelectField(); } } }); searchPanel.addComponent(group, 1, 0); searchPanel.setComponentAlignment(group, Alignment.MIDDLE_CENTER); addTextFieldSearch(); Button searchBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SEARCH)); searchBtn.setStyleName(UIConstants.BUTTON_ACTION); searchBtn.setIcon(FontAwesome.SEARCH); searchBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { doSearch(); } }); searchPanel.addComponent(searchBtn, 2, 0); searchPanel.setComponentAlignment(searchBtn, Alignment.MIDDLE_CENTER); this.setCompositionRoot(searchPanel); }
From source file:com.mycollab.module.crm.view.opportunity.OpportunitySimpleSearchPanel.java
License:Open Source License
private void createBasicSearchLayout() { searchPanel = new GridLayout(3, 3); searchPanel.setSpacing(true);//from w ww . ja v a 2 s . c o m group = new ValueComboBox(false, "Name", "Account Name", "Sales Stage", AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE)); group.select("Name"); group.setImmediate(true); group.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { removeComponents(); String searchType = (String) group.getValue(); if (searchType.equals("Name")) { addTextFieldSearch(); } else if (searchType.equals("Account Name")) { addTextFieldSearch(); } else if (searchType.equals("Sales Stage")) { addTextFieldSearch(); } else if (searchType.equals(AppContext.getMessage(GenericI18Enum.FORM_ASSIGNEE))) { addUserListSelectField(); } } }); searchPanel.addComponent(group, 1, 0); searchPanel.setComponentAlignment(group, Alignment.MIDDLE_CENTER); addTextFieldSearch(); Button searchBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SEARCH)); searchBtn.setStyleName(UIConstants.BUTTON_ACTION); searchBtn.setIcon(FontAwesome.SEARCH); searchBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { doSearch(); } }); searchPanel.addComponent(searchBtn, 2, 0); searchPanel.setComponentAlignment(searchBtn, Alignment.MIDDLE_CENTER); this.setCompositionRoot(searchPanel); }
From source file:com.mycollab.module.project.view.user.ProjectSearchItemsViewImpl.java
License:Open Source License
@Override public void displayResults(String value) { this.removeAllComponents(); ELabel headerLbl = ELabel.h2(""); DefaultBeanPagedList<ProjectGenericItemService, ProjectGenericItemSearchCriteria, ProjectGenericItem> searchItemsTable = new DefaultBeanPagedList<>( AppContextUtil.getSpringBean(ProjectGenericItemService.class), new GenericItemRowDisplayHandler()); searchItemsTable.setControlStyle("borderlessControl"); this.with(headerLbl, searchItemsTable); ProjectGenericItemSearchCriteria criteria = new ProjectGenericItemSearchCriteria(); criteria.setPrjKeys(new SetSearchField<>(CurrentProjectVariables.getProjectId())); criteria.setTxtValue(StringSearchField.and(value)); int foundNum = searchItemsTable.setSearchCriteria(criteria); headerLbl.setValue(String.format( FontAwesome.SEARCH.getHtml() + " " + UserUIContext.getMessage(ProjectI18nEnum.OPT_SEARCH_TERM), value, foundNum));/* ww w . j av a 2 s. co m*/ }
From source file:com.mycollab.vaadin.web.ui.DynamicQueryParamLayout.java
License:Open Source License
private HorizontalLayout createButtonControls() { MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction()).withStyleName(WebThemes.BUTTON_ACTION) .withIcon(FontAwesome.SEARCH); MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> clearFields()).withStyleName(WebThemes.BUTTON_OPTION); MButton basicSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_BASIC_SEARCH), clickEvent -> ((DefaultGenericSearchPanel<S>) searchPanel).moveToBasicSearchLayout()) .withStyleName(WebThemes.BUTTON_LINK); return new MHorizontalLayout(searchBtn, clearBtn, basicSearchBtn) .withMargin(new MarginInfo(false, true, false, true)); }
From source file:com.mycollab.vaadin.web.ui.SearchTextField.java
License:Open Source License
public SearchTextField() { this.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT); ELabel icon = ELabel.fontIcon(FontAwesome.SEARCH); innerField = new TextField(); innerField.setImmediate(true);//from w ww.j a v a2 s . co m innerField.setInputPrompt(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH)); innerField.setWidth("180px"); this.with(icon, innerField).withStyleName("searchfield"); ShortcutListener shortcutListener = new ShortcutListener("searchfield", ShortcutAction.KeyCode.ENTER, null) { @Override public void handleAction(Object sender, Object target) { String value = ((TextField) target).getValue(); if (isNotBlank(value)) { doSearch(value); } else { emptySearch(); } } }; ShortcutExtension.installShortcutAction(innerField, shortcutListener); }
From source file:com.wintindustries.pfserver.interfaces.container.components.PFSearch.PFSearchBar.java
private TextField BuildSearchBar() { searchbar = new TextField(); searchbar.setWidth("100%"); searchbar.setInputPrompt("Search"); searchbar.addStyleName("small"); searchbar.addStyleName("inline-icon"); searchbar.addStyleName("searchbar"); searchbar.setIcon(FontAwesome.SEARCH); return searchbar; }
From source file:de.fatalix.bookery.AppHeader.java
License:Open Source License
private MHorizontalLayout createSearchBar() { Label header = new Label("Bookery"); header.addStyleName(ValoTheme.LABEL_BOLD); header.setSizeUndefined();//ww w .j av a2 s . c om header.addStyleName(ValoTheme.LABEL_H3); searchText = new TextField(); searchText.setIcon(FontAwesome.SEARCH); searchText.addStyleName(ValoTheme.TEXTFIELD_LARGE); searchText.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); searchText.setWidth(100, Unit.PERCENTAGE); searchText.setInputPrompt("hier einfach suchen.."); Button searchButton = new Button("such!", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Navigator navigator = ((App) UI.getCurrent()).getNavigator(); if (navigator.getState().contains("search")) { navigator.navigateTo(navigator.getState()); } else { navigator.navigateTo(SearchView.id); } } }); searchButton.addStyleName(ValoTheme.BUTTON_LARGE); searchText.addShortcutListener(new Button.ClickShortcut(searchButton, ShortcutAction.KeyCode.ENTER)); MHorizontalLayout layout = new MHorizontalLayout(header, searchText, searchButton); layout.setWidth(100, Unit.PERCENTAGE); layout.setExpandRatio(searchText, 1.0f); return layout; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.SearchBarView.java
License:Open Source License
public void initUI() { mainlayout = new Panel(); mainlayout.addStyleName(ValoTheme.PANEL_BORDERLESS); // static information for the user // Label info = new Label(); // info.setValue(infotext); // info.setStyleName(ValoTheme.LABEL_LIGHT); // info.setStyleName(ValoTheme.LABEL_H4); // mainlayout.addComponent(info); // Search bar // *----------- search text field .... search button-----------* HorizontalLayout searchbar = new HorizontalLayout(); searchbar.setSpacing(true);//w w w . ja v a 2 s . c o m final TextField searchfield = new TextField(); searchfield.setHeight("44px"); searchfield.setImmediate(true); searchfield.setInputPrompt("search for sample"); // TODO would be nice to have a autofill or something similar searchbar.addComponent(searchfield); Button searchOk = new Button("GoTo"); searchOk.addStyleName(ValoTheme.BUTTON_BORDERLESS); searchOk.setIcon(FontAwesome.SEARCH); searchOk.addClickListener(new ClickListener() { private static final long serialVersionUID = -2409450448301908214L; @Override public void buttonClick(ClickEvent event) { // TODO how to deal with entities Pattern pattern = Pattern.compile("Q[A-Z0-9]{4}[0-9]{3}[A-Z0-9]{2}"); Pattern pattern2 = Pattern.compile("Q[A-Z0-9]{4}ENTITY-[0-9]+"); LOGGER.info("searching for sample: " + (String) searchfield.getValue()); if (searchfield.getValue() == null || searchfield.getValue().toString().equals("")) { Notification.show("Please provide a Barcode before clicking GoTo.", Type.WARNING_MESSAGE); } else { String entity = (String) searchfield.getValue().toString(); Matcher matcher = pattern.matcher(entity); Matcher matcher2 = pattern2.matcher(entity); Boolean patternFound1 = matcher.find(); Boolean patternFound2 = matcher2.find(); if (patternFound1) { try { Sample foundSample = datahandler.getOpenBisClient() .getSampleByIdentifier(matcher.group(0).toString()); String identifier = foundSample.getIdentifier(); State state = (State) UI.getCurrent().getSession().getAttribute("state"); ArrayList<String> message = new ArrayList<String>(); message.add("clicked"); message.add(identifier); message.add("sample"); state.notifyObservers(message); } catch (Exception e) { Notification.show("No Sample found for given barcode.", Type.WARNING_MESSAGE); } } else if (patternFound2) { try { Sample foundSample = datahandler.getOpenBisClient() .getSampleByIdentifier(matcher2.group(0).toString()); String identifier = foundSample.getIdentifier(); State state = (State) UI.getCurrent().getSession().getAttribute("state"); ArrayList<String> message = new ArrayList<String>(); message.add("clicked"); message.add(identifier); message.add("sample"); state.notifyObservers(message); } catch (Exception e) { Notification.show("No Sample found for given barcode.", Type.WARNING_MESSAGE); } } else { Notification.show("Please provide a valid Sample Barcode.", Type.WARNING_MESSAGE); } } } }); // setClickShortcut() would add global shortcut, instead we // 'scope' the shortcut to the panel: mainlayout.addAction(new com.vaadin.ui.Button.ClickShortcut(searchOk, KeyCode.ENTER)); // searchfield.addItems(this.getSearchResults("Q")); searchfield.setDescription(infotext); searchfield.addValidator(new NullValidator("Field must not be empty", false)); searchfield.setValidationVisible(false); searchbar.addComponent(searchOk); // searchbar.setMargin(new MarginInfo(true, false, true, false)); mainlayout.setContent(searchbar); // mainlayout.setComponentAlignment(searchbar, Alignment.MIDDLE_RIGHT); // mainlayout.setWidth(100, Unit.PERCENTAGE); setCompositionRoot(mainlayout); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.SearchEngineView.java
License:Open Source License
public void initUI() { mainlayout = new Panel(); mainlayout.addStyleName(ValoTheme.PANEL_BORDERLESS); // Search bar // *----------- search text field .... search button-----------* VerticalLayout searchbar = new VerticalLayout(); searchbar.setWidth(100, Unit.PERCENTAGE); setResponsive(true);//from w w w. j av a 2 s .c om searchbar.setResponsive(true); // searchbar.setWidth(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setResponsive(true); buttonLayout.setWidth(75, Unit.PERCENTAGE); // searchbar.setSpacing(true); final TextField searchfield = new TextField(); searchfield.setHeight("44px"); searchfield.setImmediate(true); searchfield.setResponsive(true); searchfield.setWidth(75, Unit.PERCENTAGE); buttonLayout.setSpacing(true); searchfield.setInputPrompt("search DB"); // searchfield.setCaption("QSearch"); // searchfield.setWidth(25.0f, Unit.EM); // searchfield.setWidth(60, Unit.PERCENTAGE); // TODO would be nice to have a autofill or something similar // searchFieldLayout.addComponent(searchfield); searchbar.addComponent(searchfield); searchbar.setComponentAlignment(searchfield, Alignment.MIDDLE_RIGHT); final NativeSelect navsel = new NativeSelect(); navsel.addItem("Whole DB"); navsel.addItem("Projects Only"); navsel.addItem("Experiments Only"); navsel.addItem("Samples Only"); navsel.setValue("Whole DB"); navsel.setHeight("20px"); navsel.setNullSelectionAllowed(false); navsel.setResponsive(true); navsel.setWidth(100, Unit.PERCENTAGE); navsel.addValueChangeListener(new Property.ValueChangeListener() { /** * */ private static final long serialVersionUID = -6896454887050432147L; @Override public void valueChange(ValueChangeEvent event) { // TODO Auto-generated method stub Notification.show((String) navsel.getValue()); switch ((String) navsel.getValue()) { case "Whole DB": datahandler.setShowOptions(Arrays.asList("Projects", "Experiments", "Samples")); break; case "Projects Only": datahandler.setShowOptions(Arrays.asList("Projects")); break; case "Experiments Only": datahandler.setShowOptions(Arrays.asList("Experiments")); break; case "Samples Only": datahandler.setShowOptions(Arrays.asList("Samples")); break; default: datahandler.setShowOptions(Arrays.asList("Projects", "Experiments", "Samples")); break; } } }); searchbar.addComponent(buttonLayout); searchbar.setComponentAlignment(buttonLayout, Alignment.MIDDLE_RIGHT); Button searchOk = new Button(""); searchOk.setStyleName(ValoTheme.BUTTON_TINY); // searchOk.addStyleName(ValoTheme.BUTTON_BORDERLESS); searchOk.setIcon(FontAwesome.SEARCH); searchOk.setSizeUndefined(); // searchOk.setWidth(15.0f, Unit.EM); searchOk.setResponsive(true); searchOk.setHeight("20px"); searchOk.addClickListener(new ClickListener() { private static final long serialVersionUID = -2409450448301908214L; @Override public void buttonClick(ClickEvent event) { String queryString = (String) searchfield.getValue().toString(); LOGGER.debug("the query was " + queryString); if (searchfield.getValue() == null || searchfield.getValue().toString().equals("") || searchfield.getValue().toString().trim().length() == 0) { Notification.show("Query field was empty!", Type.WARNING_MESSAGE); } else { try { /** * Sample foundSample = datahandler.getOpenBisClient() .getSampleByIdentifier( * matcher.group(0).toString()); */ datahandler.setSampleResults(querySamples(queryString)); datahandler.setExpResults(queryExperiments(queryString)); datahandler.setProjResults(queryProjects(queryString)); datahandler.setLastQueryString(queryString); State state = (State) UI.getCurrent().getSession().getAttribute("state"); ArrayList<String> message = new ArrayList<String>(); message.add("clicked"); message.add("view" + queryString); message.add("searchresults"); state.notifyObservers(message); } catch (Exception e) { LOGGER.error("after query: ", e); Notification.show("No Sample found for given barcode.", Type.WARNING_MESSAGE); } } } }); // setClickShortcut() would add global shortcut, instead we // 'scope' the shortcut to the panel: mainlayout.addAction(new com.vaadin.ui.Button.ClickShortcut(searchOk, KeyCode.ENTER)); // searchfield.addItems(this.getSearchResults("Q")); searchfield.setDescription(infotext); searchfield.addValidator(new NullValidator("Field must not be empty", false)); searchfield.setValidationVisible(false); buttonLayout.addComponent(navsel); // buttonLayout.addComponent(new Label("")); buttonLayout.addComponent(searchOk); // searchFieldLayout.setComponentAlignment(searchOk, Alignment.TOP_RIGHT); // buttonLayout.setExpandRatio(searchOk, 1); // buttonLayout.setExpandRatio(navsel, 1); // searchFieldLayout.setSpacing(true); buttonLayout.setComponentAlignment(searchOk, Alignment.BOTTOM_RIGHT); // buttonLayout.setComponentAlignment(navsel, Alignment.BOTTOM_LEFT); buttonLayout.setExpandRatio(searchOk, 1); buttonLayout.setExpandRatio(navsel, 2); // searchbar.setMargin(new MarginInfo(true, false, true, false)); mainlayout.setContent(searchbar); // mainlayout.setComponentAlignment(searchbar, Alignment.MIDDLE_RIGHT); // mainlayout.setWidth(100, Unit.PERCENTAGE); setCompositionRoot(mainlayout); }