List of usage examples for com.vaadin.server FontAwesome SAVE
FontAwesome SAVE
To view the source code for com.vaadin.server FontAwesome SAVE.
Click Source Link
From source file:management.limbr.ui.entity.EntityEditorViewImpl.java
License:Open Source License
@PostConstruct public void init() { FormLayout content = new FormLayout(); content.setWidthUndefined();//from ww w. j a v a 2 s .com for (java.lang.reflect.Field field : entityClass.getDeclaredFields()) { if ("id".equals(field.getName())) { continue; } Field uiField = getUIField(field); fieldMap.put(field.getName(), uiField); content.addComponent(uiField); } save = new Button(messages.get("saveButtonLabel"), FontAwesome.SAVE); Button cancel = new Button(messages.get("cancelButtonLabel")); delete = new Button(messages.get("deleteButtonLabel"), FontAwesome.TRASH_O); CssLayout actions = new CssLayout(save, cancel, delete); content.addComponent(actions); content.setMargin(true); setContent(content); setClosable(true); setResizable(false); setModal(true); save.addClickListener(event -> listeners.forEach(EntityEditorView.Listener::save)); delete.addClickListener(event -> listeners.forEach(EntityEditorView.Listener::deleteClicked)); cancel.addClickListener(event -> listeners.forEach(EntityEditorView.Listener::cancel)); }
From source file:me.uni.emuseo.view.common.form.FormPopUpWindow.java
License:Open Source License
private void buildButtons() { ClickListener clickListener = new ClickListener() { private static final long serialVersionUID = 5320702365033343873L; @Override/* w w w .java2 s . co m*/ public void buttonClick(ClickEvent event) { Button button = event.getButton(); if (button.equals(saveButton)) { onPreSave(); } else if (button.equals(cancelButton)) { onCancel(); } } }; buttonLayout = new HorizontalLayout(); saveButton = new Button(); saveButton.addStyleName("primary"); saveButton.setIcon(FontAwesome.SAVE); saveButton.addClickListener(clickListener); cancelButton = new Button(); cancelButton.addStyleName("primary"); cancelButton.setIcon(FontAwesome.UNDO); cancelButton.addClickListener(clickListener); buttonLayout.addComponent(saveButton); buttonLayout.addComponent(cancelButton); buttonLayout.setSpacing(true); buttonLayout.addStyleName("form-buttons"); }
From source file:me.uni.emuseo.view.common.form.FormWithButtonsLayout.java
License:Open Source License
protected HorizontalLayout buildButtons() { final Button saveButton = new Button(); final Button cancelButton = new Button(); ClickListener clickListener = new ClickListener() { private static final long serialVersionUID = 5320702365033343873L; @Override//from ww w .j a va2 s. c om public void buttonClick(ClickEvent event) { Button button = event.getButton(); if (button.equals(saveButton)) { onPreSave(); } else if (button.equals(cancelButton)) { onCancel(); } } }; HorizontalLayout buttonLayout = new HorizontalLayout(); saveButton.addStyleName("primary"); saveButton.setIcon(FontAwesome.SAVE); saveButton.addClickListener(clickListener); cancelButton.addStyleName("primary"); cancelButton.setIcon(FontAwesome.UNDO); cancelButton.addClickListener(clickListener); buttonLayout.addComponent(saveButton); buttonLayout.addComponent(cancelButton); buttonLayout.setSpacing(true); buttonLayout.addStyleName("form-buttons"); return buttonLayout; }
From source file:org.eclipse.hawkbit.ui.common.CommonDialogWindow.java
License:Open Source License
private void createSaveButton() { saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON, i18n.getMessage(UIMessageIdProvider.BUTTON_SAVE), "", "", true, FontAwesome.SAVE, SPUIButtonStyleNoBorderWithIcon.class); saveButton.setSizeUndefined();// ww w .jav a 2 s .c o m saveButton.addStyleName("default-color"); addCloseListenerForSaveButton(); saveButton.setEnabled(false); saveButton.setClickShortcut(KeyCode.ENTER); buttonsLayout.addComponent(saveButton); buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT); buttonsLayout.setExpandRatio(saveButton, 1.0F); }
From source file:org.eclipse.hawkbit.ui.distributions.footer.DistributionsConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createAssignSWModuleConfirmationTab() { assignmnetTab = new ConfirmationTab(); assignmnetTab.getConfirmAll().setId(UIComponentIdProvider.SAVE_ASSIGNMENT); assignmnetTab.getConfirmAll().setIcon(FontAwesome.SAVE); assignmnetTab.getConfirmAll().setCaption(i18n.getMessage("button.assign.all")); assignmnetTab.getConfirmAll().addClickListener(event -> saveAllAssignments(assignmnetTab)); assignmnetTab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); assignmnetTab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_ASSIGNMENT); assignmnetTab.getDiscardAll().addClickListener(event -> discardAllSWAssignments(assignmnetTab)); // Add items container to the table. assignmnetTab.getTable().setContainerDataSource(getSWAssignmentsTableContainer()); // Add the discard action column assignmnetTab.getTable().addGeneratedColumn(DISCARD, (source, itemId, columnId) -> { final StringBuilder style = new StringBuilder(ValoTheme.BUTTON_TINY); style.append(' '); style.append(SPUIStyleDefinitions.REDICON); final Button deleteIcon = SPUIComponentProvider.getButton("", "", SPUILabelDefinitions.DISCARD, style.toString(), true, FontAwesome.REPLY, SPUIButtonStyleSmallNoBorder.class); deleteIcon.setData(itemId);// w w w . j ava2 s . c o m deleteIcon.setImmediate(true); deleteIcon.addClickListener(event -> discardSWAssignment( (String) ((Button) event.getComponent()).getData(), itemId, assignmnetTab)); return deleteIcon; }); assignmnetTab.getTable().setVisibleColumns(DIST_NAME, SOFTWARE_MODULE_NAME, DISCARD); assignmnetTab.getTable().setColumnHeaders(i18n.getMessage("header.dist.first.assignment.table"), i18n.getMessage("header.dist.second.assignment.table"), i18n.getMessage("header.third.assignment.table")); assignmnetTab.getTable().setColumnExpandRatio(DIST_NAME, 2); assignmnetTab.getTable().setColumnExpandRatio(SOFTWARE_MODULE_NAME, 2); assignmnetTab.getTable().setColumnExpandRatio(DISCARD, SPUIDefinitions.DISCARD_COLUMN_WIDTH); assignmnetTab.getTable().setColumnAlignment(DISCARD, Align.CENTER); return assignmnetTab; }
From source file:org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterHeader.java
License:Open Source License
private Button createSaveButton() { saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, i18n.getMessage(UIMessageIdProvider.TOOLTIP_SAVE), null, false, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class); saveButton.addClickListener(this); saveButton.setEnabled(false);//ww w.j a va 2s . c o m return saveButton; }
From source file:org.eclipse.hawkbit.ui.management.footer.ManagementConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createAssignmentTab() { assignmentTab = new ConfirmationTab(); assignmentTab.getConfirmAll().setId(UIComponentIdProvider.SAVE_ASSIGNMENT); assignmentTab.getConfirmAll().setIcon(FontAwesome.SAVE); assignmentTab.getConfirmAll().setCaption(i18n.getMessage("button.assign.all")); assignmentTab.getConfirmAll().addClickListener(event -> saveAllAssignments(assignmentTab)); assignmentTab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); assignmentTab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_ASSIGNMENT); assignmentTab.getDiscardAll().addClickListener(event -> discardAllAssignments(assignmentTab)); // Add items container to the table. assignmentTab.getTable().setContainerDataSource(getAssignmentsTableContainer()); // Add the discard action column assignmentTab.getTable().addGeneratedColumn(DISCARD_CHANGES, (source, itemId, columnId) -> { final ClickListener clickListener = event -> discardAssignment((TargetIdName) itemId, assignmentTab); return createDiscardButton(itemId, clickListener); });/*www . j a v a 2 s .c o m*/ assignmentTab.getTable().setColumnExpandRatio(TARGET_NAME, 2); assignmentTab.getTable().setColumnExpandRatio(DISTRIBUTION_NAME, 2); assignmentTab.getTable().setColumnExpandRatio(DISCARD_CHANGES, 1); assignmentTab.getTable().setVisibleColumns(TARGET_NAME, DISTRIBUTION_NAME, DISCARD_CHANGES); assignmentTab.getTable().setColumnHeaders(i18n.getMessage("header.first.assignment.table"), i18n.getMessage("header.second.assignment.table"), i18n.getMessage("header.third.assignment.table")); assignmentTab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER); actionTypeOptionGroupLayout.selectDefaultOption(); assignmentTab.addComponent(actionTypeOptionGroupLayout, 1); assignmentTab.addComponent(enableMaintenanceWindowLayout(), 2); initMaintenanceWindow(); assignmentTab.addComponent(maintenanceWindowLayout, 3); return assignmentTab; }
From source file:org.eclipse.hawkbit.ui.management.footer.ManangementConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createAssignmentTab() { assignmentTab = new ConfirmationTab(); assignmentTab.getConfirmAll().setId(UIComponentIdProvider.SAVE_ASSIGNMENT); assignmentTab.getConfirmAll().setIcon(FontAwesome.SAVE); assignmentTab.getConfirmAll().setCaption(i18n.getMessage("button.assign.all")); assignmentTab.getConfirmAll().addClickListener(event -> saveAllAssignments(assignmentTab)); assignmentTab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); assignmentTab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_ASSIGNMENT); assignmentTab.getDiscardAll().addClickListener(event -> discardAllAssignments(assignmentTab)); // Add items container to the table. assignmentTab.getTable().setContainerDataSource(getAssignmentsTableContainer()); // Add the discard action column assignmentTab.getTable().addGeneratedColumn(DISCARD_CHANGES, (source, itemId, columnId) -> { final ClickListener clickListener = event -> discardAssignment((TargetIdName) itemId, assignmentTab); return createDiscardButton(itemId, clickListener); });//from w w w. ja v a 2s . c o m assignmentTab.getTable().setColumnExpandRatio(TARGET_NAME, 2); assignmentTab.getTable().setColumnExpandRatio(DISTRIBUTION_NAME, 2); assignmentTab.getTable().setColumnExpandRatio(DISCARD_CHANGES, 1); assignmentTab.getTable().setVisibleColumns(TARGET_NAME, DISTRIBUTION_NAME, DISCARD_CHANGES); assignmentTab.getTable().setColumnHeaders(i18n.getMessage("header.first.assignment.table"), i18n.getMessage("header.second.assignment.table"), i18n.getMessage("header.third.assignment.table")); assignmentTab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER); actionTypeOptionGroupLayout.selectDefaultOption(); assignmentTab.addComponent(actionTypeOptionGroupLayout, 1); return assignmentTab; }
From source file:org.eclipse.hawkbit.ui.tenantconfiguration.TenantConfigurationDashboardView.java
License:Open Source License
private HorizontalLayout saveConfigurationButtonsLayout() { final HorizontalLayout hlayout = new HorizontalLayout(); hlayout.setSpacing(true);/* www .j av a 2s . c o m*/ saveConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_SAVE, "", "", "", true, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class); saveConfigurationBtn.setEnabled(false); saveConfigurationBtn.setDescription(i18n.getMessage("configuration.savebutton.tooltip")); saveConfigurationBtn.addClickListener(event -> saveConfiguration()); hlayout.addComponent(saveConfigurationBtn); undoConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_CANCEL, "", "", "", true, FontAwesome.UNDO, SPUIButtonStyleNoBorder.class); undoConfigurationBtn.setEnabled(false); undoConfigurationBtn.setDescription(i18n.getMessage("configuration.cancellbutton.tooltip")); undoConfigurationBtn.addClickListener(event -> undoConfiguration()); hlayout.addComponent(undoConfigurationBtn); final Link linkToSystemConfigHelp = SPUIComponentProvider.getHelpLink(i18n, uiProperties.getLinks().getDocumentation().getSystemConfigurationView()); hlayout.addComponent(linkToSystemConfigHelp); return hlayout; }
From source file:org.lucidj.browser.BrowserView.java
License:Apache License
private void build_toolbar() { current_toolbar = new CssLayout(); CssLayout local_toolbar = new CssLayout(); current_toolbar.addComponent(local_toolbar); CssLayout navigation = new CssLayout(); navigation.addStyleName("v-component-group"); navigation.addStyleName("ui-toolbar-spacer"); createButton(navigation, "prev-smartbox", FontAwesome.CHEVRON_LEFT, null, ShortcutAction.KeyCode.ARROW_UP, ShortcutAction.ModifierKey.CTRL); createButton(navigation, "next-smartbox", FontAwesome.CHEVRON_RIGHT, null, ShortcutAction.KeyCode.ARROW_DOWN, ShortcutAction.ModifierKey.CTRL); local_toolbar.addComponent(navigation); createButton(local_toolbar, "save", FontAwesome.SAVE).addStyleName("ui-toolbar-spacer"); // createButton (local_toolbar, "test", FontAwesome.MAGIC) // .addStyleName("ui-toolbar-spacer"); // createButton (local_toolbar, "test2", FontAwesome.FLASK) // .addStyleName("ui-toolbar-spacer"); CssLayout edition = new CssLayout(); edition.addStyleName("v-component-group"); edition.addStyleName("ui-toolbar-spacer"); createButton(edition, "undo-cell-edit", FontAwesome.UNDO, "Undo"); createButton(edition, "redo-cell-edit", FontAwesome.REPEAT, null); createButton(edition, "delete-cell", FontAwesome.TRASH_O, null); local_toolbar.addComponent(edition); CssLayout view_controls = new CssLayout(); view_controls.addStyleName("v-component-group"); view_controls.addStyleName("ui-toolbar-spacer"); createButton(view_controls, VM_NOTEBOOK, new ExternalResource("vaadin://~/Browser_libraries/notebook-view.png")); createButton(view_controls, VM_SINGLE, new ExternalResource("vaadin://~/Browser_libraries/single-view.png"), null, ShortcutAction.KeyCode.INSERT, ShortcutAction.ModifierKey.CTRL); local_toolbar.addComponent(view_controls); // TODO: CTRL+ENTER => RUN AND SKIP TO NEXT // TODO: SELECTION + SHIFT+ENTER => RUN ONLY SELECTED STATEMENTS final Button source_view = new Button(); source_view.setId("output"); source_view.addStyleName("ui-toolbar-spacer"); source_view.setHtmlContentAllowed(true); String ico = "<path class=\"path1\" d=\"M1088 128h-64v-64c0-35.2-28.8-64-64-64h-896c-35.2 0-64 28.8-64 64v768c0 35.2 28.8 64 64 64h64v64c0 35.2 28.8 64 64 64h896c35.2 0 64-28.8 64-64v-768c0-35.2-28.8-64-64-64zM128 192v640h-63.886c-0.040-0.034-0.082-0.076-0.114-0.116v-767.77c0.034-0.040 0.076-0.082 0.114-0.114h895.77c0.040 0.034 0.082 0.076 0.116 0.116v63.884h-768c-35.2 0-64 28.8-64 64v0zM1088 959.884c-0.034 0.040-0.076 0.082-0.116 0.116h-895.77c-0.040-0.034-0.082-0.076-0.114-0.116v-767.77c0.034-0.040 0.076-0.082 0.114-0.114h895.77c0.040 0.034 0.082 0.076 0.116 0.116v767.768z\"></path>\n" + "<path class=\"path2\" d=\"M960 352c0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96 96 42.98 96 96z\"></path>\n" + "<path class=\"path3\" d=\"M1024 896h-768v-128l224-384 256 320h64l224-192z\"></path>"; source_view.setCaption(/*www. j a va2 s .c om*/ "<svg style=\"fill: currentColor; width: 1.5em; margin-top:0.3em;\" viewBox=\"0 0 1152 1024\">" + ico + "</svg>"); source_view.addStyleName("tiny"); source_view.addStyleName("toolbar"); source_view.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { handle_button_click(source_view); } }); local_toolbar.addComponent(source_view); // Button output_view = new Button (); // output_view.setHtmlContentAllowed(true); // String ico2 = "<path d=\"M249.649 792.806l-107.776 166.4 11.469 54.426 54.272-11.622 107.725-166.298c-11.469-6.144-22.835-12.698-33.843-19.968-11.162-7.219-21.811-14.95-31.846-22.938zM705.943 734.694c0.717-1.485 1.178-3.123 1.843-4.71 2.714-5.99 5.12-11.981 7.066-18.278 0.307-1.126 0.461-2.253 0.819-3.277 1.997-6.963 3.686-13.824 5.018-20.89 0-0.358 0-0.614 0-1.075 9.984-59.853-7.424-126.618-47.258-186.931l56.832-87.757c65.485 8.346 122.112-8.141 149.35-50.278 47.258-72.858-10.24-194.15-128.256-271.002-118.118-76.902-252.058-80.128-299.213-7.373-27.341 42.189-19.354 100.71 15.002 157.338l-56.934 87.757c-71.117-11.93-139.059-0.819-189.594 32.768-0.307 0.102-0.666 0.205-0.87 0.41-5.888 3.994-11.622 8.397-16.998 13.005-0.87 0.717-1.894 1.382-2.611 2.099-5.018 4.301-9.523 9.114-13.875 13.926-1.024 1.229-2.458 2.304-3.43 3.584-5.427 6.195-10.445 12.749-14.848 19.712-70.861 109.21-10.394 274.483 134.81 369.101 145.306 94.618 320.512 82.637 391.219-26.573 4.454-6.912 8.55-14.131 11.93-21.555zM664.215 224.845c-45.414-29.542-67.584-76.134-49.408-104.243 18.125-28.006 69.683-26.726 114.995 2.816 45.517 29.542 67.482 76.237 49.408 104.243s-69.53 26.726-114.995-2.816z\"></path>"; // output_view.setCaption("<svg style=\"fill: currentColor; width: 1.5em; margin-top:0.3em;\" viewBox=\"0 0 1024 1024\">" + ico2 + "</svg>"); // output_view.addStyleName("tiny"); // view_controls.addComponent (output_view); // // Button run = new Button (); // run.setHtmlContentAllowed(true); // String ico3 = "<path class=\"path1\" d=\"M192 128l640 384-640 384z\"></path>"; // run.setCaption("<svg style=\"fill: currentColor; width: 1.5em; margin-top:0.3em;\" viewBox=\"0 0 1024 1024\">" + ico3 + "</svg>"); // run.addStyleName("tiny"); // view_controls.addComponent (run); }