List of usage examples for com.vaadin.ui Button setDescription
public void setDescription(String description)
From source file:org.asi.ui.customcomponentdemo.demo.CustomTextFieldDemo.java
private void init() { Button menu = new Button("Main Menu"); addComponent(menu);/*from www.jav a 2s. c o m*/ menu.setDescription("Go to Main Menu"); setComponentAlignment(menu, Alignment.MIDDLE_CENTER); menu.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { getUI().getNavigator().navigateTo(Custom.NAME); } }); CustomTextField component = new CustomTextField(); addComponent(component); setComponentAlignment(component, Alignment.MIDDLE_CENTER); component.addClickListener(new CustomTextField.ClickListener() { @Override public void click(CustomTextField.ClickEvent event) { CustomWindow ob = new CustomWindow("Window"); ui.makeWindowStyles(ob); ob.setWidth("200px"); ob.setHeight("200px"); UI.getCurrent().addWindow(ob); } }); }
From source file:org.asi.ui.customcomponentdemo.demo.CustomWindowDemo.java
private void init() { // Initialize our new UI component final LookUp win = new LookUp("Abhiram"); final LookUp win1 = new LookUp(); Button x = new Button("First Window"); Button y = new Button("Second Window"); setSizeFull();/* w w w.j av a 2 s .c om*/ Button menu = new Button("Main Menu"); addComponent(menu); menu.setDescription("Go to Main Menu"); setComponentAlignment(menu, Alignment.MIDDLE_CENTER); menu.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { getUI().getNavigator().navigateTo(Custom.NAME); } }); addComponent(x); x.setDescription("Added minimize to tray"); setComponentAlignment(x, Alignment.MIDDLE_CENTER); x.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (win.getParent() == null) { win.setClosable(false); win.setMinimizeToTray(); ui.makeWindowStyles(win); UI.getCurrent().addWindow(win); } else { LookUp win3 = new LookUp("Abhi" + (i++)); win3.setMinimizeToTray(); ui.makeWindowStyles(win3); UI.getCurrent().addWindow(win3); } } }); y.setDescription("Not Added minimize to tray"); addComponent(y); setComponentAlignment(y, Alignment.MIDDLE_CENTER); y.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (win1.getParent() == null) { ui.makeWindowStyles(win1); win1.setMinimizeToTray(new MiniM()); UI.getCurrent().addWindow(win1); } } }); }
From source file:org.asi.ui.customcomponentdemo.demo.ExtCustomCheckBoxDemo.java
private void init() { Button menu = new Button("Main Menu"); addComponent(menu);/* w w w . j a v a 2 s .c o m*/ menu.setDescription("Go to Main Menu"); setComponentAlignment(menu, Alignment.MIDDLE_CENTER); menu.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { getUI().getNavigator().navigateTo(Custom.NAME); } }); ExtCustomCheckBox component = new ExtCustomCheckBox("ExtCustomCheckBox: "); addComponent(component); setComponentAlignment(component, Alignment.MIDDLE_CENTER); component.addClickListener(new ExtCustomCheckBox.ClickListener() { @Override public void click(ExtCustomCheckBox.ClickEvent event) { CustomWindow ob = new CustomWindow("Window"); ui.makeWindowStyles(ob); ob.setWidth("200px"); ob.setHeight("200px"); UI.getCurrent().addWindow(ob); } }); }
From source file:org.asi.ui.customcomponentdemo.demo.ExtFilteringTableDemo.java
private void init() { setMargin(true);// w w w . j a v a 2 s . co m setSpacing(true); loadData(); getMapVisibleCols(); Button menu = new Button("Main Menu"); addComponent(menu); menu.setDescription("Go to Main Menu"); setComponentAlignment(menu, Alignment.MIDDLE_CENTER); menu.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { getUI().getNavigator().navigateTo(Custom.NAME); } }); loadTables(); }
From source file:org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons.java
License:Open Source License
private Object addDeleteCell(final Object itemId) { if (itemId instanceof TagIdName && noTagLabel.equals(((TagIdName) itemId).getName())) { return null; }//from w w w .j a v a 2 s . com final Button deleteButton = SPUIComponentProvider.getButton("", "", "", "", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class); if (itemId instanceof TagIdName) { deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + ((TagIdName) itemId).getName()); } else { deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + itemId.toString()); } deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE)); deleteButton.addClickListener(this::addDeleteButtonClickListener); return deleteButton; }
From source file:org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons.java
License:Open Source License
private Button addUpdateCell(final Object itemId) { if (itemId instanceof TagIdName && noTagLabel.equals(((TagIdName) itemId).getName())) { return null; }//from w ww. j a v a 2 s . c o m final Button editButton = SPUIComponentProvider.getButton("", "", "", "", true, FontAwesome.EDIT, SPUIButtonStyleNoBorder.class); if (itemId instanceof TagIdName) { editButton.setId(UIComponentIdProvider.UPDATE_TAG_ID + ((TagIdName) itemId).getName()); } else { editButton.setId(UIComponentIdProvider.UPDATE_TAG_ID + itemId.toString()); } editButton.setDescription(SPUIDefinitions.EDIT); editButton.addClickListener(this::addEditButtonClickListener); return editButton; }
From source file:org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons.java
License:Open Source License
private Button createFilterButton(final Long id, final String name, final String description, final String color, final Object itemId) { /** * No icon displayed for "NO TAG" button. *//*w w w . j a v a2 s .com*/ final Button button = SPUIComponentProvider.getButton("", name, description, "", false, null, SPUITagButtonStyle.class); button.setId(createButtonId(name)); button.setCaptionAsHtml(true); if (id != null) { // Use button.getCaption() since the caption name is modified // according to the length // available in UI. button.setCaption(prepareFilterButtonCaption(button.getCaption(), color)); } if (!StringUtils.isEmpty(description)) { button.setDescription(description); } else { button.setDescription(name); } button.setData(id == null ? SPUIDefinitions.NO_TAG_BUTTON_ID : itemId); return button; }
From source file:org.eclipse.hawkbit.ui.common.table.AbstractTable.java
License:Open Source License
private Object createDeleteButton(final Object itemId) { final Button deleteButton = SPUIComponentProvider.getButton("", "", "", "", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorderWithIcon.class); final String id = getEntityId(itemId); deleteButton.setId("delete.entity." + id); deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE)); deleteButton.addClickListener(this::addDeleteButtonClickListener); return deleteButton; }
From source file:org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterHeader.java
License:Open Source License
private Button createBreadcrumbButton() { final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, SPUIButtonStyleNoBorder.class); createFilterViewLink// w w w . j a v a 2 s. com .setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); createFilterViewLink.setDescription(i18n.getMessage(BREADCRUMB_CUSTOM_FILTERS)); createFilterViewLink.setCaption(i18n.getMessage(BREADCRUMB_CUSTOM_FILTERS)); createFilterViewLink.addClickListener(value -> showCustomFiltersView()); return createFilterViewLink; }
From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionTable.java
License:Open Source License
private Button createPinBtn(final Object itemId) { final Item item = getContainerDataSource().getItem(itemId); final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue(); final String version = (String) item.getItemProperty(SPUILabelDefinitions.VAR_VERSION).getValue(); final DistributionSetIdName distributionSetIdName = new DistributionSetIdName((Long) itemId, name, version); final Button pinBtn = new Button(); pinBtn.setIcon(FontAwesome.THUMB_TACK); pinBtn.setHeightUndefined();//from w w w . j av a 2s . c om pinBtn.addStyleName(getPinStyle()); pinBtn.setData(distributionSetIdName); pinBtn.setId(getPinButtonId(name, version)); pinBtn.setImmediate(true); pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN)); return pinBtn; }