List of usage examples for com.vaadin.server FontAwesome TRASH_O
FontAwesome TRASH_O
To view the source code for com.vaadin.server FontAwesome TRASH_O.
Click Source Link
From source file:org.eclipse.hawkbit.ui.distributions.footer.DistributionsConfirmationWindowLayout.java
License:Open Source License
private void deleteDistAll(final ConfirmationTab tab) { final Long[] deletedIds = manageDistUIState.getDeletedDistributionList().stream() .map(idName -> idName.getId()).toArray(Long[]::new); if (manageDistUIState.getAssignedList() != null && !manageDistUIState.getAssignedList().isEmpty()) { manageDistUIState.getDeletedDistributionList().forEach(distSetName -> { if (manageDistUIState.getAssignedList().containsKey(distSetName)) { manageDistUIState.getAssignedList().remove(distSetName); }/*from ww w . j a va 2s . co m*/ }); } distributionSetManagement.delete(Arrays.asList(deletedIds)); eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(deletedIds))); addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE + i18n.getMessage("message.dist.deleted", deletedIds.length)); manageDistUIState.getDeletedDistributionList() .forEach(deletedIdname -> manageDistUIState.getAssignedList().remove(deletedIdname)); removeCurrentTab(tab); manageDistUIState.getDeletedDistributionList().clear(); eventBus.publish(this, SaveActionWindowEvent.DELETED_DISTRIBUTIONS); }
From source file:org.eclipse.hawkbit.ui.distributions.footer.DistributionsConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createDistSetTypeDeleteConfirmationTab() { final ConfirmationTab tab = new ConfirmationTab(); tab.getConfirmAll().setId(UIComponentIdProvider.SAVE_DELETE_DIST_SET_TYPE); tab.getConfirmAll().setIcon(FontAwesome.TRASH_O); tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL)); tab.getConfirmAll().addClickListener(event -> deleteDistSetTypeAll(tab)); tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); tab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_DIST_SET_TYPE); tab.getDiscardAll().addClickListener(event -> discardDistSetTypeAll(tab)); // Add items container to the table. tab.getTable().setContainerDataSource(getDistSetTypeTableContainer()); // Add the discard action column tab.getTable().addGeneratedColumn(DISCARD, (source, itemId, columnId) -> { final ClickListener clickListener = event -> discardDistTypeDelete( (String) ((Button) event.getComponent()).getData(), itemId, tab); return createDiscardButton(itemId, clickListener); });//from w ww . j ava 2 s . c om tab.getTable().setVisibleColumns(DIST_SET_NAME, DISCARD); tab.getTable().setColumnHeaders(i18n.getMessage("header.first.delete.dist.type.table"), i18n.getMessage("header.second.delete.dist.type.table")); tab.getTable().setColumnExpandRatio(DIST_SET_NAME, 2); tab.getTable().setColumnExpandRatio(DISCARD, SPUIDefinitions.DISCARD_COLUMN_WIDTH); tab.getTable().setColumnAlignment(DISCARD, Align.CENTER); return tab; }
From source file:org.eclipse.hawkbit.ui.filtermanagement.TargetFilterTable.java
License:Open Source License
private Button getDeleteButton(final Long itemId) { final Item row = getItem(itemId); final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue(); final Button deleteIcon = SPUIComponentProvider.getButton(getDeleteIconId(tfName), "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE_CUSTOM_FILTER), ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class); deleteIcon.setData(itemId);/*from w ww . j ava 2 s .c o m*/ deleteIcon.addClickListener(this::onDelete); return deleteIcon; }
From source file:org.eclipse.hawkbit.ui.management.footer.ManagementConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createDeletedTargetTab() { final ConfirmationTab tab = new ConfirmationTab(); // TobeDone ? y to set caption every time?? tab.getConfirmAll().setId(UIComponentIdProvider.TARGET_DELETE_ALL); tab.getConfirmAll().setIcon(FontAwesome.TRASH_O); tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL)); tab.getConfirmAll().addClickListener(event -> deleteAllTargets(tab)); tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); tab.getDiscardAll().addClickListener(event -> discardAllTargets(tab)); /* Add items container to the table. */ tab.getTable().setContainerDataSource(getTargetModuleTableContainer()); /* Add the discard action column */ tab.getTable().addGeneratedColumn(DISCARD_CHANGES, (source, itemId, columnId) -> { final ClickListener clickListener = event -> discardTargetDelete((TargetIdName) itemId, tab); return createDiscardButton(itemId, clickListener); });// ww w.j a v a 2 s .com tab.getTable().setVisibleColumns(TARGET_NAME, DISCARD_CHANGES); tab.getTable().setColumnHeaders(i18n.getMessage("header.first.deletetarget.table"), i18n.getMessage("header.second.deletetarget.table")); tab.getTable().setColumnExpandRatio(TARGET_NAME, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH); tab.getTable().setColumnExpandRatio(DISCARD_CHANGES, SPUIDefinitions.DISCARD_COLUMN_WIDTH); tab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER); return tab; }
From source file:org.eclipse.hawkbit.ui.management.footer.ManagementConfirmationWindowLayout.java
License:Open Source License
private ConfirmationTab createDeletedDistributionTab() { final ConfirmationTab tab = new ConfirmationTab(); // TobeDone ? y to set caption every time?? tab.getConfirmAll().setId(UIComponentIdProvider.DIST_DELETE_ALL); tab.getConfirmAll().setIcon(FontAwesome.TRASH_O); tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL)); tab.getConfirmAll().addClickListener(event -> deleteAllDistributions(tab)); tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL)); tab.getDiscardAll().addClickListener(event -> discardAllDistributions(tab)); /* Add items container to the table. */ tab.getTable().setContainerDataSource(getDSModuleTableContainer()); /* Add the discard action column */ tab.getTable().addGeneratedColumn(DISCARD_CHANGES, (source, itemId, columnId) -> { final ClickListener clickListener = event -> discardDSDelete((DistributionSetIdName) itemId, tab); return createDiscardButton(itemId, clickListener); });/*from w w w . jav a 2 s. co m*/ tab.getTable().setColumnExpandRatio(DISTRIBUTION_NAME, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH); tab.getTable().setColumnExpandRatio(DISCARD_CHANGES, SPUIDefinitions.DISCARD_COLUMN_WIDTH); tab.getTable().setVisibleColumns(DISTRIBUTION_NAME, DISCARD_CHANGES); tab.getTable().setColumnHeaders(i18n.getMessage("header.one.deletedist.table"), i18n.getMessage("header.second.deletedist.table")); tab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER); return tab; }
From source file:org.eclipse.hawkbit.ui.management.footer.ManagementConfirmationWindowLayout.java
License:Open Source License
private void deleteAllDistributions(final ConfirmationTab tab) { final Collection<Long> deletedIds = managementUIState.getDeletedDistributionList().stream() .map(DistributionSetIdName::getId).collect(Collectors.toList()); distributionSetManagement.delete(deletedIds); eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.REMOVE_ENTITY, deletedIds)); addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE + i18n.getMessage("message.dist.deleted", managementUIState.getDeletedDistributionList().size())); removeDeletedDistributionsFromAssignmentTab(); removeCurrentTab(tab);/*from w ww. ja va 2 s. c o m*/ setActionMessage(i18n.getMessage("message.dist.delete.success")); managementUIState.getTargetTableFilters().getPinnedDistId() .ifPresent(distId -> unPinDeletedDS(deletedIds, distId)); managementUIState.getDeletedDistributionList().clear(); }
From source file:org.eclipse.hawkbit.ui.management.footer.ManagementConfirmationWindowLayout.java
License:Open Source License
private void deleteAllTargets(final ConfirmationTab tab) { final Set<TargetIdName> targetIdNames = managementUIState.getDeletedTargetList(); final Set<Long> targetIds = targetIdNames.stream().map(TargetIdName::getTargetId) .collect(Collectors.toSet()); targetManagement.delete(targetIds);/*w ww .j a v a 2 s. c o m*/ eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.REMOVE_ENTITY, targetIds)); addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE + i18n.getMessage("message.target.deleted", targetIds.size())); removeCurrentTab(tab); setActionMessage(i18n.getMessage("message.target.delete.success")); removeDeletedTargetsFromAssignmentTab(); managementUIState.getDistributionTableFilters().getPinnedTarget().ifPresent(this::unPinDeletedTarget); eventBus.publish(this, SaveActionWindowEvent.SHOW_HIDE_TAB); managementUIState.getDeletedTargetList().clear(); }
From source file:org.eclipse.hawkbit.ui.management.footer.ManangementConfirmationWindowLayout.java
License:Open Source License
private void deleteAllDistributions(final ConfirmationTab tab) { final Collection<Long> deletedIds = managementUIState.getDeletedDistributionList().stream() .map(DistributionSetIdName::getId).collect(Collectors.toList()); distributionSetManagement.deleteDistributionSet(deletedIds); eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.REMOVE_ENTITY, deletedIds)); addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE + i18n.getMessage("message.dist.deleted", managementUIState.getDeletedDistributionList().size())); removeDeletedDistributionsFromAssignmentTab(); removeCurrentTab(tab);// ww w .j av a 2 s . c om setActionMessage(i18n.getMessage("message.dist.delete.success")); managementUIState.getTargetTableFilters().getPinnedDistId() .ifPresent(distId -> unPinDeletedDS(deletedIds, distId)); managementUIState.getDeletedDistributionList().clear(); }
From source file:org.eclipse.hawkbit.ui.management.footer.ManangementConfirmationWindowLayout.java
License:Open Source License
private void deleteAllTargets(final ConfirmationTab tab) { final Set<TargetIdName> targetIdNames = managementUIState.getDeletedTargetList(); final Set<Long> targetIds = targetIdNames.stream().map(TargetIdName::getTargetId) .collect(Collectors.toSet()); targetManagement.deleteTargets(targetIds); eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.REMOVE_ENTITY, targetIds)); addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE + i18n.getMessage("message.target.deleted", targetIds.size())); removeCurrentTab(tab);//w w w . jav a2 s. c o m setActionMessage(i18n.getMessage("message.target.delete.success")); removeDeletedTargetsFromAssignmentTab(); managementUIState.getDistributionTableFilters().getPinnedTarget().ifPresent(this::unPinDeletedTarget); eventBus.publish(this, SaveActionWindowEvent.SHOW_HIDE_TAB); managementUIState.getDeletedTargetList().clear(); }
From source file:org.eclipse.hawkbit.ui.rollout.rollout.RolloutListGrid.java
License:Open Source License
private StatusFontIcon createDeleteButtonMetadata(final RolloutStatus rolloutStatus) { final boolean isDisabled = hasToBeDisabled(rolloutStatus, DELETE_COPY_BUTTON_ENABLED); return new StatusFontIcon(FontAwesome.TRASH_O, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE), UIComponentIdProvider.ROLLOUT_DELETE_BUTTON_ID, isDisabled); }