com.vaadin.ui.Button Java Examples
The following examples show how to use
com.vaadin.ui.Button.
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: JobLogTable.java From chipster with MIT License | 6 votes |
public Component generateCell(Table source, final Object itemId, Object columnId) { Button link = new Button("Output"); link.setStyleName(BaseTheme.BUTTON_LINK); link.setDescription("Show job output"); link.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { select(itemId); view.showOutput(itemId); } }); return link; }
Example #2
Source File: DistributionTable.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
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(); 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; }
Example #3
Source File: ElementCollectionField.java From viritin with Apache License 2.0 | 6 votes |
@Override public void setPersisted(ET v, boolean persisted) { int row = itemsIdentityIndexOf(v) + 1; if (isAllowRemovingItems()) { Button c = (Button) layout.getComponent(layout.getColumns() - 1, row); if (persisted) { c.setDescription(getDeleteElementDescription()); } else { for (int i = 0; i < getVisibleProperties().size(); i++) { try { AbstractField f = (AbstractField) layout. getComponent(i, row); // FIXME //f.setValidationVisible(false); } catch (Exception e) { } } c.setDescription(getDisabledDeleteElementDescription()); } c.setEnabled(persisted); } }
Example #4
Source File: WebPopupButton.java From cuba with Apache License 2.0 | 6 votes |
protected void actionPropertyChanged(PropertyChangeEvent evt) { Action action = (Action) evt.getSource(); Button button = actionButtons.get(action); if (Action.PROP_ICON.equals(evt.getPropertyName())) { if (showActionIcons) { setPopupButtonIcon(button, action.getIcon()); } else { setPopupButtonIcon(button, null); } } else if (Action.PROP_CAPTION.equals(evt.getPropertyName())) { button.setCaption(action.getCaption()); } else if (Action.PROP_DESCRIPTION.equals(evt.getPropertyName())) { button.setDescription(action.getDescription()); } else if (Action.PROP_ENABLED.equals(evt.getPropertyName())) { button.setEnabled(action.isEnabled()); } else if (Action.PROP_VISIBLE.equals(evt.getPropertyName())) { button.setVisible(action.isVisible()); } }
Example #5
Source File: ConfirmDialogExt.java From mycollab with GNU Affero General Public License v3.0 | 6 votes |
@Override public ConfirmDialog create(String caption, String message, String okCaption, String cancelCaption, String notOkCaption) { ConfirmDialog d = super.create(caption, message, okCaption, cancelCaption, notOkCaption); d.getContent().setStyleName("custom-dialog"); d.getContent().setHeightUndefined(); d.setHeightUndefined(); Button ok = d.getOkButton(); ok.setStyleName(WebThemes.BUTTON_ACTION); HorizontalLayout buttons = (HorizontalLayout) ok.getParent(); buttons.setHeightUndefined(); Button cancelBtn = d.getCancelButton(); cancelBtn.setStyleName(WebThemes.BUTTON_OPTION); cancelBtn.focus(); return d; }
Example #6
Source File: ServiceButtonsBottom.java From primecloud-controller with GNU General Public License v2.0 | 6 votes |
private void deleteButtonClick(Button.ClickEvent event) { final ComponentDto component = (ComponentDto) sender.servicePanel.serviceTable.getValue(); // 確認ダイアログを表示 String message = ViewMessages.getMessage("IUI-000018", component.getComponent().getComponentName()); DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message, Buttons.OKCancel); dialog.setCallback(new DialogConfirm.Callback() { @Override public void onDialogResult(Result result) { if (result != Result.OK) { return; } delete(component.getComponent().getComponentNo()); } }); getApplication().getMainWindow().addWindow(dialog); }
Example #7
Source File: TargetTagFilterButtonClick.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
@Override protected void filterUnClicked(final Button clickedButton) { if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) { if (managementUIState.getTargetTableFilters().isNoTagSelected()) { managementUIState.getTargetTableFilters().setNoTagSelected(false); eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG); } } else { if (null != managementUIState.getTargetTableFilters().getClickedTargetTags() && managementUIState .getTargetTableFilters().getClickedTargetTags().contains(clickedButton.getId())) { managementUIState.getTargetTableFilters().getClickedTargetTags().remove(clickedButton.getId()); eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG); } } }
Example #8
Source File: ServerButtonsBottom.java From primecloud-controller with GNU General Public License v2.0 | 6 votes |
private void startMonitoringButtonClick(Button.ClickEvent event) { final InstanceDto instance = (InstanceDto) sender.serverPanel.serverTable.getValue(); // 確認ダイアログを表示 String message = ViewMessages.getMessage("IUI-000121", instance.getInstance().getInstanceName()); DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message, Buttons.OKCancel); dialog.setCallback(new DialogConfirm.Callback() { @Override public void onDialogResult(Result result) { if (result != Result.OK) { return; } startMonitoring(instance); } }); getApplication().getMainWindow().addWindow(dialog); }
Example #9
Source File: MButtonClickListeners.java From viritin with Apache License 2.0 | 6 votes |
@Override public Component getTestComponent() { MButton b = new MButton("Say hola"); // And the same without lambdas as the project is 1.6 compatible b.addClickListener(new MClickListener() { @Override public void onClick() { sayHola(); } }); b.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 5019806363620874205L; @Override public void buttonClick(ClickEvent event) { sayHolaOldSchool(event); } }); return new MVerticalLayout(b); }
Example #10
Source File: ServiceTable.java From primecloud-controller with GNU General Public License v2.0 | 6 votes |
private Button createLoadBalancerButton(final LoadBalancerDto loadBalancer) { Button button = new Button(); button.setCaption(loadBalancer.getLoadBalancer().getLoadBalancerName()); button.setIcon(Icons.LOADBALANCER_TAB.resource()); button.setData(loadBalancer); button.addStyleName("borderless"); button.addStyleName("loadbalancer-button"); button.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // ロードバランサを選択 sender.loadBalancerPanel.loadBalancerTable.select(loadBalancer); // ロードバランサタブに移動 sender.tab.setSelectedTab(sender.loadBalancerPanel); } }); return button; }
Example #11
Source File: ArtifactDetailsLayout.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private Button getArtifactDownloadButton(final Table table, final Object itemId) { final String fileName = (String) table.getContainerDataSource().getItem(itemId) .getItemProperty(PROVIDED_FILE_NAME).getValue(); final Button downloadIcon = SPUIComponentProvider.getButton( fileName + "-" + UIComponentIdProvider.ARTIFACT_FILE_DOWNLOAD_ICON, "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_ARTIFACT_DOWNLOAD), ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.DOWNLOAD, SPUIButtonStyleNoBorder.class); downloadIcon.setData(itemId); FileDownloader fileDownloader = new FileDownloader(createStreamResource((Long) itemId)); fileDownloader.extend(downloadIcon); fileDownloader.setErrorHandler(new ErrorHandler() { /** * Error handler for file downloader */ private static final long serialVersionUID = 4030230501114422570L; @Override public void error(com.vaadin.server.ErrorEvent event) { uINotification.displayValidationError(i18n.getMessage(UIMessageIdProvider.ARTIFACT_DOWNLOAD_FAILURE_MSG)); } }); return downloadIcon; }
Example #12
Source File: TargetFilterTable.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button customFilterDistributionSetButton(final Long itemId) { final Item row1 = getItem(itemId); final ProxyDistribution distSet = (ProxyDistribution) row1 .getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET).getValue(); final ActionType actionType = (ActionType) row1.getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_ACTION_TYPE) .getValue(); final String buttonId = "distSetButton"; Button updateIcon; if (distSet == null) { updateIcon = SPUIComponentProvider.getButton(buttonId, i18n.getMessage(UIMessageIdProvider.BUTTON_NO_AUTO_ASSIGNMENT), i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false, null, SPUIButtonStyleNoBorder.class); } else { updateIcon = actionType == ActionType.FORCED ? SPUIComponentProvider.getButton(buttonId, distSet.getNameVersion(), i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false, FontAwesome.BOLT, SPUIButtonStyleNoBorderWithIcon.class) : SPUIComponentProvider.getButton(buttonId, distSet.getNameVersion(), i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false, null, SPUIButtonStyleNoBorder.class); updateIcon.setSizeUndefined(); } updateIcon.addClickListener(this::onClickOfDistributionSetButton); updateIcon.setData(row1); updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link"); return updateIcon; }
Example #13
Source File: DistributionTable.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private void saveDistributionPinnedBtn(final Button pinBtn) { if (pinBtn.getData() == null) { return; } final Long pinnedId = ((DistributionSetIdName) pinBtn.getData()).getId(); if (managementUIState.getTargetTableFilters().getPinnedDistId().map(pinnedId::equals).orElse(false)) { setDistributionPinnedBtn(pinBtn); } }
Example #14
Source File: LoadBalancerDescBasic.java From primecloud-controller with GNU General Public License v2.0 | 5 votes |
private void editButtonClick(Button.ClickEvent event) { LoadBalancerListener listener = (LoadBalancerListener) event.getButton().getData(); WinLoadBalancerConfigListener win = new WinLoadBalancerConfigListener(listener.getLoadBalancerNo(), listener.getLoadBalancerPort()); win.addListener(new Window.CloseListener() { @Override public void windowClose(Window.CloseEvent e) { refreshTable(); } }); getWindow().addWindow(win); }
Example #15
Source File: ArtifactDetailsLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button getArtifactDeleteButton(final Table table, final Object itemId) { final String fileName = (String) table.getContainerDataSource().getItem(itemId) .getItemProperty(PROVIDED_FILE_NAME).getValue(); final Button deleteIcon = SPUIComponentProvider.getButton( fileName + "-" + UIComponentIdProvider.UPLOAD_FILE_DELETE_ICON, "", i18n.getMessage(UIMessageIdProvider.CAPTION_DISCARD), ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class); deleteIcon.setData(itemId); deleteIcon.addClickListener(event -> confirmAndDeleteArtifact((Long) itemId, fileName)); return deleteIcon; }
Example #16
Source File: AbstractGridHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button createAddButton() { final Button button = SPUIComponentProvider.getButton(getAddIconId(), "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS, SPUIButtonStyleNoBorder.class); button.addClickListener(this::addNewItem); return button; }
Example #17
Source File: GoogleMapDemo.java From serverside-elements with Apache License 2.0 | 5 votes |
@Override protected Component getDemoView() { CssLayout wrapper = new CssLayout(); Root root = ElementIntegration.getRoot(wrapper); final Element googleMap = Elements.create("google-map"); googleMap.setAttribute("style", "height: 500px; width: 500px; display: block"); googleMap.setAttribute("latitude", "60.45235"); googleMap.setAttribute("longitude", "22.299727"); googleMap.setAttribute("zoom", "17"); root.appendChild(googleMap); HorizontalLayout buttons = new HorizontalLayout( new Button("GWT.create US", event -> { googleMap.setAttribute("latitude", "37.414274"); googleMap.setAttribute("longitude", "-122.077409"); }), new Button("GWT.create EU", event -> { googleMap.setAttribute("latitude", "48.152663"); googleMap.setAttribute("longitude", "11.598418"); })); buttons.setSpacing(true); VerticalLayout layout = new VerticalLayout(buttons, wrapper); layout.setSpacing(true); return layout; }
Example #18
Source File: ProjectBreadcrumb.java From mycollab with GNU Affero General Public License v3.0 | 5 votes |
public void gotoPageAdd() { addSummaryLink(); buildPageBreadcrumbChain(); addLink(new Button(UserUIContext.getMessage(PageI18nEnum.NEW))); AppUI.addFragment(ProjectLinkGenerator.generatePageAdd( project.getId(), CurrentProjectVariables.getCurrentPagePath()), UserUIContext.getMessage(PageI18nEnum.NEW)); }
Example #19
Source File: TargetFilterHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button createAddButton() { final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS, SPUIButtonStyleNoBorder.class); button.addClickListener(event -> addNewFilter()); return button; }
Example #20
Source File: AgentOperationsOverviewPageModContentFactoryImpl.java From cia with Apache License 2.0 | 5 votes |
@Secured({ "ROLE_ADMIN" }) @Override public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout content = createPanelContent(); getMenuItemFactory().createMainPageMenuBar(menuBar); LabelFactory.createHeader2Label(content,ADMIN_AGENT_OPERATION); final VerticalLayout overviewLayout = new VerticalLayout(); overviewLayout.setSizeFull(); content.addComponent(overviewLayout); content.setExpandRatio(overviewLayout, ContentRatio.LARGE); final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout); for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) { final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget) , VaadinIcons.BULLSEYE); importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT)); importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget)); RowUtil.createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE); } final String pageId = getPageId(parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId); return content; }
Example #21
Source File: TargetBulkUpdateWindowLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button getMinimizeButton() { final Button minimizeBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.BULK_UPLOAD_MINIMIZE_BUTTON_ID, "", "", "", true, FontAwesome.MINUS, SPUIButtonStyleNoBorder.class); minimizeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS); minimizeBtn.addClickListener(event -> minimizeWindow()); minimizeBtn.setEnabled(false); return minimizeBtn; }
Example #22
Source File: TagListField.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Initializes the Tag panel with all assigned tags. * * @param assignedTags * assigned tags */ void initializeAssignedTags(final List<TagData> assignedTags) { removeAllComponents(); assignedTags.forEach(tag -> { final Button tagButton = createButton(tag.getName(), tag.getColor()); tagButtons.put(tag.getName(), tagButton); }); addTagButtonsAsComponents(); }
Example #23
Source File: DistributionSetTypeSoftwareModuleSelectLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private HorizontalLayout createTwinColumnLayout() { final HorizontalLayout twinColumnLayout = new HorizontalLayout(); twinColumnLayout.setSizeFull(); twinColumnLayout.setWidth("400px"); buildSourceTable(); buildSelectedTable(); final VerticalLayout selectButtonLayout = new VerticalLayout(); final Button selectButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SELECT_DIST_TYPE, "", "", "arrow-button", true, FontAwesome.FORWARD, SPUIButtonStyleNoBorder.class); selectButton.addClickListener(event -> addSMType()); final Button unSelectButton = SPUIComponentProvider.getButton("unselect-dist-type", "", "", "arrow-button", true, FontAwesome.BACKWARD, SPUIButtonStyleNoBorder.class); unSelectButton.addClickListener(event -> removeSMType()); selectButtonLayout.addComponent(selectButton); selectButtonLayout.addComponent(unSelectButton); selectButtonLayout.setComponentAlignment(selectButton, Alignment.MIDDLE_CENTER); selectButtonLayout.setComponentAlignment(unSelectButton, Alignment.MIDDLE_CENTER); twinColumnLayout.addComponent(sourceTable); twinColumnLayout.addComponent(selectButtonLayout); twinColumnLayout.addComponent(selectedTable); twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT); twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER); twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT); twinColumnLayout.setExpandRatio(sourceTable, 0.45F); twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F); twinColumnLayout.setExpandRatio(selectedTable, 0.48F); sourceTable.setVisibleColumns(DIST_TYPE_NAME); return twinColumnLayout; }
Example #24
Source File: AbstractGridHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Button createCloseButton() { final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null, false, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class); button.addClickListener(this::onClose); return button; }
Example #25
Source File: GitPushWindow.java From XACML with MIT License | 5 votes |
protected Object generateConflictingEntry(final GitEntry entry) { Button resolve = new Button("Resolve"); resolve.setImmediate(true); resolve.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { } }); return resolve; }
Example #26
Source File: UserManagement.java From XACML with MIT License | 5 votes |
@AutoGenerated private HorizontalLayout buildHorizontalLayoutToolbar() { // common part: create layout horizontalLayoutToolbar = new HorizontalLayout(); horizontalLayoutToolbar.setImmediate(false); horizontalLayoutToolbar.setWidth("-1px"); horizontalLayoutToolbar.setHeight("-1px"); horizontalLayoutToolbar.setMargin(true); horizontalLayoutToolbar.setSpacing(true); // buttonAdd buttonAdd = new Button(); buttonAdd.setCaption("Add User"); buttonAdd.setImmediate(false); buttonAdd.setWidth("-1px"); buttonAdd.setHeight("-1px"); horizontalLayoutToolbar.addComponent(buttonAdd); // buttonRemove buttonRemove = new Button(); buttonRemove.setCaption("Remove User"); buttonRemove.setImmediate(false); buttonRemove.setWidth("-1px"); buttonRemove.setHeight("-1px"); horizontalLayoutToolbar.addComponent(buttonRemove); return horizontalLayoutToolbar; }
Example #27
Source File: DashboardMenu.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Component buildToggleButton() { final Button valoMenuToggleButton = new Button(i18n.getMessage("label.menu"), new MenuToggleClickListenerMyClickListener()); valoMenuToggleButton.setIcon(FontAwesome.LIST); valoMenuToggleButton.addStyleName("valo-menu-toggle"); valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS); valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL); return valoMenuToggleButton; }
Example #28
Source File: DistSMTypeFilterButtonClick.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
@Override protected void filterClicked(final Button clickedButton) { softwareModuleTypeManagement.getByName(clickedButton.getData().toString()).ifPresent(smType -> { manageDistUIState.getSoftwareModuleFilters().setSoftwareModuleType(smType); eventBus.publish(this, new RefreshSoftwareModuleByFilterEvent()); }); }
Example #29
Source File: Parameter.java From chipster with MIT License | 5 votes |
private Button getDeleteButton(final Object itemId) { Button btDelete = new Button(); btDelete.setIcon(new ThemeResource("images/close.png")); btDelete.setStyleName(BaseTheme.BUTTON_LINK); btDelete.addClickListener(new ClickListener() { private static final long serialVersionUID = -3695725710938486562L; @Override public void buttonClick(ClickEvent event) { typeTable.removeItem(itemId); enumDefaultValue.removeItem(itemId); } }); return btDelete; }
Example #30
Source File: LogLayout.java From usergrid with Apache License 2.0 | 5 votes |
private void addRefreshButton() { Button button = new Button( "Refresh" ); button.setWidth("100px"); button.addClickListener( new Button.ClickListener() { public void buttonClick( Button.ClickEvent event ) { loadData(); } }); addComponent( button ); setComponentAlignment( button, Alignment.BOTTOM_CENTER ); this.setExpandRatio( button, 0.05f ); }