List of usage examples for com.vaadin.ui Button setTabIndex
@Override public void setTabIndex(int tabIndex)
From source file:com.haulmont.cuba.web.sys.WindowBreadCrumbs.java
License:Apache License
public void update() { AppUI ui = AppUI.getCurrent();/* ww w .j av a 2s . c o m*/ boolean isTestMode = ui.isTestMode(); linksLayout.removeAllComponents(); btn2win.clear(); for (Iterator<Window> it = windows.iterator(); it.hasNext();) { Window window = it.next(); Button button = new CubaButton(StringUtils.trimToEmpty(window.getCaption()), new BtnClickListener()); button.setSizeUndefined(); button.setStyleName(BaseTheme.BUTTON_LINK); button.setTabIndex(-1); if (isTestMode) { button.setCubaId("breadCrubms_Button_" + window.getId()); button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId())); } btn2win.put(button, window); if (it.hasNext()) { linksLayout.addComponent(button); Label separatorLab = new Label(" > "); separatorLab.setStyleName("c-breadcrumbs-separator"); separatorLab.setSizeUndefined(); separatorLab.setContentMode(ContentMode.HTML); linksLayout.addComponent(separatorLab); } else { Label captionLabel = new Label(window.getCaption()); captionLabel.setStyleName("c-breadcrumbs-win-caption"); captionLabel.setSizeUndefined(); linksLayout.addComponent(captionLabel); this.label = captionLabel; } } }
From source file:com.haulmont.cuba.web.toolkit.ui.CubaPickerField.java
License:Apache License
public void addButton(Button button, int index) { button.setTabIndex(-1); button.setStyleName("c-pickerfield-button"); buttons.add(index, button);/*from ww w . jav a 2 s. c o m*/ container.addComponent(button, index + 1); // 0 - field }
From source file:de.kaiserpfalzEdv.infopir.ui.register.editor.RegisterEditorViewImpl.java
License:Apache License
private Button createButton(final String i18nBase, final int tabIndex) { Button result = new Button(i18n.get(i18nBase + ".caption"), FontAwesome.valueOf(i18n.get(i18nBase + ".icon"))); result.setSizeFull();/*w w w. j ava 2 s .c o m*/ result.setDescription(i18n.get(i18nBase + ".description")); result.setTabIndex(tabIndex); buttonLayout.addComponent(result); return result; }
From source file:de.kaiserpfalzEdv.vaadin.ui.defaultviews.editor.impl.BaseEditorViewImpl.java
License:Apache License
private Button initializeButton(final String buttonKey, int tabIndex) { Button result = new Button(presenter.translate("button." + buttonKey + ".caption")); result.setDescription(presenter.translate("button." + buttonKey + ".description")); result.setIcon(FontAwesome.valueOf(presenter.translate("button." + buttonKey + ".icon"))); result.setWidth(100f, PERCENTAGE);//from ww w.j a va 2 s. co m result.setTabIndex(tabIndex); return result; }
From source file:info.magnolia.configuration.app.problem.toolbar.ProblemToolbarViewImpl.java
License:Open Source License
private void iniSearchField() { Button clearSearchBoxButton = new Button(); clearSearchBoxButton.setStyleName("m-closebutton"); clearSearchBoxButton.addStyleName("icon-delete-search"); clearSearchBoxButton.addStyleName("searchbox-clearbutton"); // Preventing the button to spoil the tab-navigation due to its changing display value. clearSearchBoxButton.setTabIndex(-1); clearSearchBoxButton.addClickListener(new Button.ClickListener() { @Override//from w w w . ja va 2s . c om public void buttonClick(Button.ClickEvent event) { searchField.setValue(""); } }); Icon searchIcon = new Icon("search"); searchIcon.addStyleName("searchbox-icon"); Icon searchArrow = new Icon("arrow2_s"); searchArrow.addStyleName("searchbox-arrow"); searchField = buildSearchField(); searchLayout.setVisible(true); searchLayout.addComponent(searchField); searchLayout.addComponent(clearSearchBoxButton); searchLayout.addComponent(searchIcon); searchLayout.addComponent(searchArrow); searchLayout.setStyleName("searchbox"); VerticalLayout searchLayoutWrapper = new VerticalLayout(); searchLayoutWrapper.setStyleName("workbench"); searchLayoutWrapper.addComponent(searchLayout); addComponent(searchLayoutWrapper); }
From source file:info.magnolia.ui.workbench.contenttool.search.SearchContentToolViewImpl.java
License:Open Source License
@Inject public SearchContentToolViewImpl(SimpleTranslator i18n) { this.i18n = i18n; Button clearSearchBoxButton = new Button(); clearSearchBoxButton.setStyleName("m-closebutton"); clearSearchBoxButton.addStyleName("icon-delete-search"); clearSearchBoxButton.addStyleName("searchbox-clearbutton"); // Preventing the button to spoil the tab-navigation due to its changing display value. clearSearchBoxButton.setTabIndex(-1); clearSearchBoxButton.addClickListener(new Button.ClickListener() { @Override// w w w. ja va2 s . co m public void buttonClick(Button.ClickEvent event) { searchField.setValue(""); } }); Icon searchIcon = new Icon("search"); searchIcon.addStyleName("searchbox-icon"); Icon searchArrow = new Icon("arrow2_s"); searchArrow.addStyleName("searchbox-arrow"); searchField = buildSearchField(); setVisible(true); addComponent(searchField); addComponent(clearSearchBoxButton); addComponent(searchIcon); addComponent(searchArrow); setStyleName("searchbox"); }