List of usage examples for com.vaadin.ui Button setIcon
@Override public void setIcon(Resource icon)
From source file:org.bubblecloud.ilves.site.view.valo.DefaultValoView.java
License:Apache License
private void addMenuLink(final NavigationVersion navigationVersion, final String pageName) { final Site site = Site.getCurrent(); final ViewVersion pageVersion = site.getCurrentViewVersion(pageName); if (pageVersion == null) { throw new SiteException("Unknown page: " + pageName); }//from ww w . j a v a 2s . c o m if (pageVersion.getViewerRoles().length > 0) { boolean roleMatch = false; for (final String role : pageVersion.getViewerRoles()) { if (site.getSecurityProvider().getRoles().contains(role)) { roleMatch = true; break; } } if (!roleMatch) { return; } } final String localizedPageName = pageVersion.isDynamic() ? pageName : site.localize("page-link-" + pageName); final Resource iconResource = pageVersion.isDynamic() ? navigationVersion.hasChildPages(pageName) ? site.getIcon("page-icon-folder") : site.getIcon("page-icon-page") : site.getIcon("page-icon-" + pageName); Button b = new Button(localizedPageName, new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { UI.getCurrent().getNavigator().navigateTo(pageName); } }); b.setHtmlContentAllowed(true); b.setPrimaryStyleName("valo-menu-item"); b.setIcon(iconResource); menuItemsLayout.addComponent(b); }
From source file:org.bubblecloud.ilves.ui.administrator.company.CompaniesFlowlet.java
License:Apache License
@Override public void initialize() { entityManager = getSite().getSiteContext().getObject(EntityManager.class); gridLayout = new GridLayout(1, 2); gridLayout.setSizeFull();/*from w ww.j a va 2 s . c o m*/ gridLayout.setMargin(false); gridLayout.setSpacing(true); gridLayout.setRowExpandRatio(1, 1f); setViewContent(gridLayout); final List<FieldDescriptor> fieldDefinitions = SiteFields.getFieldDescriptors(Company.class); final List<FilterDescriptor> filterDefinitions = new ArrayList<FilterDescriptor>(); //filterDefinitions.add(new FilterDescriptor("companyName", "companyName", "Company Name", new TextField(), 101, "=", String.class, "")); entityContainer = new EntityContainer<Company>(entityManager, true, false, false, Company.class, 1000, new String[] { "companyName" }, new boolean[] { false }, "companyId"); for (final FieldDescriptor fieldDefinition : fieldDefinitions) { entityContainer.addContainerProperty(fieldDefinition.getId(), fieldDefinition.getValueType(), fieldDefinition.getDefaultValue(), fieldDefinition.isReadOnly(), fieldDefinition.isSortable()); } final Table table = new FormattingTable(); entityGrid = new Grid(table, entityContainer); entityGrid.setFields(fieldDefinitions); entityGrid.setFilters(filterDefinitions); table.setColumnCollapsed("created", true); table.setColumnCollapsed("modified", true); table.setColumnCollapsed("company", true); table.setColumnCollapsed("selfRegistration", true); table.setColumnCollapsed("emailPasswordReset", true); table.setColumnCollapsed("openIdLogin", true); table.setColumnCollapsed("certificateLogin", true); table.setColumnCollapsed("maxFailedLoginCount", true); table.setColumnCollapsed("passwordValidityPeriodDays", true); table.setColumnCollapsed("salesEmailAddress", true); table.setColumnCollapsed("supportEmailAddress", true); table.setColumnCollapsed("invoicingEmailAddress", true); table.setColumnCollapsed("gaTrackingId", true); gridLayout.addComponent(entityGrid, 0, 1); final HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setSizeUndefined(); gridLayout.addComponent(buttonLayout, 0, 0); final Button addButton = new Button("Add"); addButton.setIcon(getSite().getIcon("button-icon-add")); buttonLayout.addComponent(addButton); addButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final Company company = new Company(); company.setCreated(new Date()); company.setModified(company.getCreated()); company.setInvoicingAddress(new PostalAddress()); company.setDeliveryAddress(new PostalAddress()); final CompanyFlowlet companyView = getFlow().forward(CompanyFlowlet.class); companyView.edit(company, true); } }); final Button editButton = new Button("Edit"); editButton.setIcon(getSite().getIcon("button-icon-edit")); buttonLayout.addComponent(editButton); editButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Company entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final CompanyFlowlet companyView = getFlow().forward(CompanyFlowlet.class); companyView.edit(entity, false); } }); final Button removeButton = new Button("Remove"); removeButton.setIcon(getSite().getIcon("button-icon-remove")); buttonLayout.addComponent(removeButton); removeButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Company entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); SecurityService.removeCompany(getSite().getSiteContext(), entity); entityContainer.refresh(); } }); }
From source file:org.bubblecloud.ilves.ui.administrator.customer.CustomersFlowlet.java
License:Apache License
@Override public void initialize() { final List<FieldDescriptor> fieldDefinitions = SiteFields.getFieldDescriptors(Customer.class); final List<FilterDescriptor> filterDefinitions = new ArrayList<FilterDescriptor>(); //filterDefinitions.add(new FilterDescriptor("companyName", "companyName", "Company Name", new TextField(), 101, "=", String.class, "")); //filterDefinitions.add(new FilterDescriptor("lastName", "lastName", "Last Name", new TextField(), 101, "=", String.class, "")); final EntityManager entityManager = getSite().getSiteContext().getObject(EntityManager.class); entityContainer = new EntityContainer<Customer>(entityManager, true, false, false, Customer.class, 1000, new String[] { "companyName", "lastName", "firstName" }, new boolean[] { true, true, true }, "customerId"); for (final FieldDescriptor fieldDefinition : fieldDefinitions) { entityContainer.addContainerProperty(fieldDefinition.getId(), fieldDefinition.getValueType(), fieldDefinition.getDefaultValue(), fieldDefinition.isReadOnly(), fieldDefinition.isSortable()); }/*from w w w . j a va 2s . com*/ final GridLayout gridLayout = new GridLayout(1, 2); gridLayout.setSizeFull(); gridLayout.setMargin(false); gridLayout.setSpacing(true); gridLayout.setRowExpandRatio(1, 1f); setViewContent(gridLayout); final HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setSizeUndefined(); gridLayout.addComponent(buttonLayout, 0, 0); final Table table = new FormattingTable(); entityGrid = new Grid(table, entityContainer); entityGrid.setFields(fieldDefinitions); entityGrid.setFilters(filterDefinitions); //entityGrid.setFixedWhereCriteria("e.owner.companyId=:companyId"); table.setColumnCollapsed("created", true); table.setColumnCollapsed("modified", true); table.setColumnCollapsed("company", true); gridLayout.addComponent(entityGrid, 0, 1); final Button addButton = new Button("Add"); addButton.setIcon(getSite().getIcon("button-icon-add")); buttonLayout.addComponent(addButton); addButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final Customer customer = new Customer(); customer.setCreated(new Date()); customer.setModified(customer.getCreated()); customer.setInvoicingAddress(new PostalAddress()); customer.setDeliveryAddress(new PostalAddress()); customer.setOwner((Company) getSite().getSiteContext().getObject(Company.class)); final CustomerFlowlet customerView = getFlow().forward(CustomerFlowlet.class); customerView.edit(customer, true); } }); final Button editButton = new Button("Edit"); editButton.setIcon(getSite().getIcon("button-icon-edit")); buttonLayout.addComponent(editButton); editButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Customer entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final CustomerFlowlet customerView = getFlow().forward(CustomerFlowlet.class); customerView.edit(entity, false); } }); final Button removeButton = new Button("Remove"); removeButton.setIcon(getSite().getIcon("button-icon-remove")); buttonLayout.addComponent(removeButton); removeButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Customer entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); SecurityService.removeCustomer(getSite().getSiteContext(), entity); entityContainer.refresh(); } }); }
From source file:org.bubblecloud.ilves.ui.administrator.directory.UserDirectoriesFlowlet.java
License:Apache License
@Override public void initialize() { final List<FieldDescriptor> fieldDefinitions = new ArrayList<FieldDescriptor>( SiteFields.getFieldDescriptors(UserDirectory.class)); for (final FieldDescriptor fieldDescriptor : fieldDefinitions) { if (fieldDescriptor.getId().equals("loginPassword")) { fieldDefinitions.remove(fieldDescriptor); break; }/*from ww w. j ava 2s. c o m*/ } final List<FilterDescriptor> filterDefinitions = new ArrayList<FilterDescriptor>(); final EntityManager entityManager = getSite().getSiteContext().getObject(EntityManager.class); entityContainer = new EntityContainer<UserDirectory>(entityManager, true, false, false, UserDirectory.class, 1000, new String[] { "address", "port" }, new boolean[] { true, true }, "userDirectoryId"); for (final FieldDescriptor fieldDefinition : fieldDefinitions) { entityContainer.addContainerProperty(fieldDefinition.getId(), fieldDefinition.getValueType(), fieldDefinition.getDefaultValue(), fieldDefinition.isReadOnly(), fieldDefinition.isSortable()); } final GridLayout gridLayout = new GridLayout(1, 2); gridLayout.setSizeFull(); gridLayout.setMargin(false); gridLayout.setSpacing(true); gridLayout.setRowExpandRatio(1, 1f); setViewContent(gridLayout); final HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setSizeUndefined(); gridLayout.addComponent(buttonLayout, 0, 0); final Table table = new Table(); entityGrid = new Grid(table, entityContainer); entityGrid.setFields(fieldDefinitions); entityGrid.setFilters(filterDefinitions); //entityGrid.setFixedWhereCriteria("e.owner.companyId=:companyId"); table.setColumnCollapsed("loginDn", true); table.setColumnCollapsed("userEmailAttribute", true); table.setColumnCollapsed("userSearchBaseDn", true); table.setColumnCollapsed("groupSearchBaseDn", true); table.setColumnCollapsed("remoteLocalGroupMapping", true); table.setColumnCollapsed("created", true); table.setColumnCollapsed("modified", true); table.setColumnCollapsed("company", true); gridLayout.addComponent(entityGrid, 0, 1); final Button addButton = new Button("Add"); addButton.setIcon(getSite().getIcon("button-icon-add")); buttonLayout.addComponent(addButton); addButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final UserDirectory userDirectory = new UserDirectory(); userDirectory.setCreated(new Date()); userDirectory.setModified(userDirectory.getCreated()); userDirectory.setOwner((Company) getSite().getSiteContext().getObject(Company.class)); final UserDirectoryFlowlet userDirectoryView = getFlow().forward(UserDirectoryFlowlet.class); userDirectoryView.edit(userDirectory, true); } }); final Button editButton = new Button("Edit"); editButton.setIcon(getSite().getIcon("button-icon-edit")); buttonLayout.addComponent(editButton); editButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final UserDirectory entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final UserDirectoryFlowlet userDirectoryView = getFlow().forward(UserDirectoryFlowlet.class); userDirectoryView.edit(entity, false); } }); final Button removeButton = new Button("Remove"); removeButton.setIcon(getSite().getIcon("button-icon-remove")); buttonLayout.addComponent(removeButton); removeButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final UserDirectory entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); SecurityService.removeUserDirectory(getSite().getSiteContext(), entity); entityContainer.refresh(); } }); }
From source file:org.bubblecloud.ilves.ui.user.AccountFlowlet.java
License:Apache License
@Override public void initialize() { final GridLayout gridLayout = new GridLayout(1, 6); gridLayout.setRowExpandRatio(0, 0.0f); gridLayout.setRowExpandRatio(1, 0.0f); gridLayout.setRowExpandRatio(2, 0.0f); gridLayout.setRowExpandRatio(3, 0.0f); gridLayout.setRowExpandRatio(4, 0.0f); gridLayout.setRowExpandRatio(5, 1.0f); gridLayout.setSizeFull();//from ww w. j av a2 s .c om gridLayout.setMargin(false); gridLayout.setSpacing(true); gridLayout.setRowExpandRatio(4, 1f); setViewContent(gridLayout); final HorizontalLayout userAccountTitle = new HorizontalLayout(); userAccountTitle.setMargin(new MarginInfo(false, false, false, false)); userAccountTitle.setSpacing(true); final Embedded userAccountTitleIcon = new Embedded(null, getSite().getIcon("view-icon-user")); userAccountTitleIcon.setWidth(32, Unit.PIXELS); userAccountTitleIcon.setHeight(32, Unit.PIXELS); userAccountTitle.addComponent(userAccountTitleIcon); final Label userAccountTitleLabel = new Label("<h2>User Account</h2>", ContentMode.HTML); userAccountTitle.addComponent(userAccountTitleLabel); gridLayout.addComponent(userAccountTitle, 0, 0); final Button editUserButton = new Button("Edit User Account"); editUserButton.setIcon(getSite().getIcon("button-icon-edit")); gridLayout.addComponent(editUserButton, 0, 2); editUserButton.addClickListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final User entity = ((SecurityProviderSessionImpl) getSite().getSecurityProvider()) .getUserFromSession(); final UserAccountFlowlet customerView = getFlow().getFlowlet(UserAccountFlowlet.class); customerView.edit(entity, false); getFlow().forward(UserAccountFlowlet.class); } }); final Company company = getSite().getSiteContext().getObject(Company.class); if (company.isOpenIdLogin()) { final VerticalLayout mainPanel = new VerticalLayout(); mainPanel.setCaption("Choose OpenID Provider:"); gridLayout.addComponent(mainPanel, 0, 1); final HorizontalLayout openIdLayout = new HorizontalLayout(); mainPanel.addComponent(openIdLayout); openIdLayout.setMargin(new MarginInfo(false, false, true, false)); openIdLayout.setSpacing(true); final String returnViewName = "openidlink"; final Map<String, String> urlIconMap = OpenIdUtil.getOpenIdProviderUrlIconMap(); for (final String url : urlIconMap.keySet()) { openIdLayout.addComponent(OpenIdUtil.getLoginButton(url, urlIconMap.get(url), returnViewName)); } } if (SiteModuleManager.isModuleInitialized(CustomerModule.class)) { final List<FieldDescriptor> fieldDefinitions = SiteFields.getFieldDescriptors(Customer.class); final List<FilterDescriptor> filterDefinitions = new ArrayList<FilterDescriptor>(); filterDefinitions.add(new FilterDescriptor("companyName", "companyName", "Company Name", new TextField(), 101, "=", String.class, "")); filterDefinitions.add(new FilterDescriptor("lastName", "lastName", "Last Name", new TextField(), 101, "=", String.class, "")); final EntityManager entityManager = getSite().getSiteContext().getObject(EntityManager.class); entityContainer = new EntityContainer<Customer>(entityManager, true, false, false, Customer.class, 1000, new String[] { "companyName", "lastName" }, new boolean[] { false, false }, "customerId"); for (final FieldDescriptor fieldDefinition : fieldDefinitions) { entityContainer.addContainerProperty(fieldDefinition.getId(), fieldDefinition.getValueType(), fieldDefinition.getDefaultValue(), fieldDefinition.isReadOnly(), fieldDefinition.isSortable()); } final HorizontalLayout titleLayout = new HorizontalLayout(); titleLayout.setMargin(new MarginInfo(true, false, false, false)); titleLayout.setSpacing(true); final Embedded titleIcon = new Embedded(null, getSite().getIcon("view-icon-customer")); titleIcon.setWidth(32, Unit.PIXELS); titleIcon.setHeight(32, Unit.PIXELS); titleLayout.addComponent(titleIcon); final Label titleLabel = new Label("<h2>Customer Accounts</h2>", ContentMode.HTML); titleLayout.addComponent(titleLabel); gridLayout.addComponent(titleLayout, 0, 3); final Table table = new Table(); table.setPageLength(5); entityGrid = new Grid(table, entityContainer); entityGrid.setFields(fieldDefinitions); entityGrid.setFilters(filterDefinitions); //entityGrid.setFixedWhereCriteria("e.owner.companyId=:companyId"); table.setColumnCollapsed("created", true); table.setColumnCollapsed("modified", true); table.setColumnCollapsed("company", true); gridLayout.addComponent(entityGrid, 0, 5); final HorizontalLayout customerButtonsLayout = new HorizontalLayout(); gridLayout.addComponent(customerButtonsLayout, 0, 4); customerButtonsLayout.setMargin(false); customerButtonsLayout.setSpacing(true); final Button editCustomerDetailsButton = new Button("Edit Customer Details"); customerButtonsLayout.addComponent(editCustomerDetailsButton); editCustomerDetailsButton.setEnabled(false); editCustomerDetailsButton.setIcon(getSite().getIcon("button-icon-edit")); editCustomerDetailsButton.addClickListener(new ClickListener() { /** * Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Customer entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final CustomerFlowlet customerView = getFlow().forward(CustomerFlowlet.class); customerView.edit(entity, false); } }); final Button editCustomerMembersButton = new Button("Edit Customer Members"); customerButtonsLayout.addComponent(editCustomerMembersButton); editCustomerMembersButton.setEnabled(false); editCustomerMembersButton.setIcon(getSite().getIcon("button-icon-edit")); editCustomerMembersButton.addClickListener(new ClickListener() { /** * Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Customer entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final GroupFlowlet view = getFlow().forward(GroupFlowlet.class); view.edit(entity.getMemberGroup(), false); } }); final Button editCustomerAdminsButton = new Button("Edit Customer Admins"); customerButtonsLayout.addComponent(editCustomerAdminsButton); editCustomerAdminsButton.setEnabled(false); editCustomerAdminsButton.setIcon(getSite().getIcon("button-icon-edit")); editCustomerAdminsButton.addClickListener(new ClickListener() { /** * Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (entityGrid.getSelectedItemId() == null) { return; } final Customer entity = entityContainer.getEntity(entityGrid.getSelectedItemId()); final GroupFlowlet view = getFlow().forward(GroupFlowlet.class); view.edit(entity.getAdminGroup(), false); } }); table.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(final Property.ValueChangeEvent event) { editCustomerDetailsButton.setEnabled(table.getValue() != null); editCustomerMembersButton.setEnabled(table.getValue() != null); editCustomerAdminsButton.setEnabled(table.getValue() != null); } }); } }
From source file:org.eclipse.hawkbit.simulator.ui.SimulatorView.java
License:Open Source License
private void createToolbar() { final Button createDevicesButton = new Button("generate..."); createDevicesButton.setIcon(FontAwesome.GEARS); createDevicesButton.addClickListener(event -> openGenerateDialog()); final Button clearDevicesButton = new Button("clear"); clearDevicesButton.setIcon(FontAwesome.ERASER); clearDevicesButton.addClickListener(event -> clearSimulatedDevices()); toolbar.addComponent(createDevicesButton); toolbar.addComponent(clearDevicesButton); toolbar.setSpacing(true);// w w w . j a v a2 s .c o m }
From source file:org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout.java
License:Open Source License
private DragAndDropWrapper createDeleteWrapperLayout() { final Button dropToDelete = new Button(i18n.getMessage("label.components.drop.area")); dropToDelete.setCaptionAsHtml(true); dropToDelete.setIcon(FontAwesome.TRASH_O); dropToDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS); dropToDelete.addStyleName("drop-to-delete-button"); dropToDelete.addStyleName(SPUIStyleDefinitions.ACTION_BUTTON); dropToDelete.addStyleName(SPUIStyleDefinitions.DEL_ACTION_BUTTON); dropToDelete.addStyleName("delete-icon"); final DragAndDropWrapper wrapper = new DragAndDropWrapper(dropToDelete); wrapper.setStyleName(ValoTheme.BUTTON_PRIMARY); wrapper.setId(getDeleteAreaId());// w w w.j ava 2 s. c o m wrapper.setDropHandler(this); wrapper.addStyleName("delete-button-border"); return wrapper; }
From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleLargeIconNoBorder.java
License:Open Source License
/** * {@inheritDoc}/*from w ww . jav a 2s . com*/ */ @Override public Button decorate(Button button, String style, boolean setStyle, Resource icon) { button.addStyleName(ValoTheme.BUTTON_LARGE); button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); button.addStyleName(ValoTheme.BUTTON_ICON_ONLY); if (setStyle && style != null) { button.addStyleName(style); } button.setWidthUndefined(); // Set icon if (null != icon) { button.setIcon(icon); } return button; }
From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorder.java
License:Open Source License
/** * Decorate Button and return.//from w w w.j ava2s .co m * * @param button * as Button * @param style * as String * @param setStyle * as String * @param icon * as resource * @return Button */ @Override public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) { if (style != null && setStyle) { button.addStyleName(style); } button.addStyleName(ValoTheme.BUTTON_BORDERLESS); if (icon != null) { button.addStyleName(ValoTheme.BUTTON_ICON_ONLY); button.addStyleName("button-no-border"); button.setIcon(icon); } return button; }
From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStylePrimarySmall.java
License:Open Source License
@Override public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) { button.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL); // Set Style//from ww w. jav a 2 s . c om if (null != style) { if (setStyle) { button.setStyleName(style); } else { button.addStyleName(style); } } // Set icon if (null != icon) { button.addStyleName(ValoTheme.BUTTON_ICON_ONLY); button.setIcon(icon); } return button; }