@Override protected Optional<DistributionSetTag> findEntityByName() { return distributionSetTagManagement.getByName(getTagName().getValue()); }
@Override protected Optional<DistributionSetTag> findEntityByName() { return distributionSetTagManagement.getByName(getTagName().getValue()); }
final DistributionSetTag myTag = distributionSetTagManagement.getByName(tagName) .orElseThrow(() -> new EntityNotFoundException(DistributionSetTag.class, tagName));
final DistributionSetTag myTag = distributionSetTagManagement.getByName(tagName) .orElseThrow(() -> new EntityNotFoundException(DistributionSetTag.class, tagName));
@Override public void setTagDetails(final String selectedEntity) { final Optional<DistributionSetTag> selectedDistTag = getDistributionSetTagManagement() .getByName(selectedEntity); selectedDistTag.ifPresent(tag -> { getTagName().setValue(tag.getName()); getTagName().setEnabled(false); getTagDesc().setValue(selectedDistTag.get().getDescription()); if (selectedDistTag.get().getColour() == null) { setTagColor(getColorPickerLayout().getDefaultColor(), ColorPickerConstants.DEFAULT_COLOR); } else { setTagColor(ColorPickerHelper.rgbToColorConverter(selectedDistTag.get().getColour()), selectedDistTag.get().getColour()); } getWindow().setOrginaleValues(); }); }
@Override protected void deleteEntity(final String entityToDelete) { final Optional<DistributionSetTag> tagToDelete = distributionSetTagManagement.getByName(entityToDelete); tagToDelete.ifPresent(tag -> { if (managementUIState.getDistributionTableFilters().getDistSetTags().contains(entityToDelete)) { uiNotification.displayValidationError(getI18n().getMessage("message.tag.delete", entityToDelete)); removeUpdateAndDeleteColumn(); } else { distributionSetTagManagement.delete(entityToDelete); getEventBus().publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, tag)); uiNotification.displaySuccess(getI18n().getMessage("message.delete.success", entityToDelete)); } }); } }
@Override public void setTagDetails(final String selectedEntity) { final Optional<DistributionSetTag> selectedDistTag = getDistributionSetTagManagement() .getByName(selectedEntity); selectedDistTag.ifPresent(tag -> { getTagName().setValue(tag.getName()); getTagName().setEnabled(false); getTagDesc().setValue(selectedDistTag.get().getDescription()); if (selectedDistTag.get().getColour() == null) { setTagColor(getColorPickerLayout().getDefaultColor(), ColorPickerConstants.DEFAULT_COLOR); } else { setTagColor(ColorPickerHelper.rgbToColorConverter(selectedDistTag.get().getColour()), selectedDistTag.get().getColour()); } getWindow().setOrginaleValues(); }); }
@Override protected void deleteEntity(final String entityToDelete) { final Optional<DistributionSetTag> tagToDelete = distributionSetTagManagement.getByName(entityToDelete); tagToDelete.ifPresent(tag -> { if (managementUIState.getDistributionTableFilters().getDistSetTags().contains(entityToDelete)) { uiNotification.displayValidationError(getI18n().getMessage("message.tag.delete", entityToDelete)); removeUpdateAndDeleteColumn(); } else { distributionSetTagManagement.delete(entityToDelete); getEventBus().publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, tag)); uiNotification.displaySuccess(getI18n().getMessage("message.delete.success", entityToDelete)); } }); } }