diff --git a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DefaultAmqpSenderService.java b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DefaultAmqpSenderService.java index d951cce5d..1eb6d31f2 100644 --- a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DefaultAmqpSenderService.java +++ b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DefaultAmqpSenderService.java @@ -9,6 +9,7 @@ package org.eclipse.hawkbit.amqp; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.UUID; import org.eclipse.hawkbit.util.IpUtil; @@ -46,7 +47,7 @@ public class DefaultAmqpSenderService implements AmqpSenderService { final String correlationId = UUID.randomUUID().toString(); final String exchange = extractExchange(replyTo); - message.getMessageProperties().setCorrelationId(correlationId.getBytes()); + message.getMessageProperties().setCorrelationId(correlationId.getBytes(StandardCharsets.UTF_8)); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, exchange, correlationId); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java index 15904169d..a9a14700d 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java @@ -53,42 +53,42 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta @Autowired private transient SoftwareManagement softwareManagement; - + @Autowired private SwMetadataPopupLayout swMetadataPopupLayout; - + @Autowired - private EntityFactory entityFactory; - + private transient EntityFactory entityFactory; + private SoftwareModuleMetadatadetailslayout swmMetadataTable; - + /** * softwareLayout Initialize the component. */ @Override protected void init() { swmMetadataTable = new SoftwareModuleMetadatadetailslayout(); - swmMetadataTable.init(getI18n(), getPermissionChecker(),softwareManagement,swMetadataPopupLayout,entityFactory); + swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout, + entityFactory); super.init(); } - + @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final MetadataEvent event) { - UI.getCurrent() - .access(() -> { - SoftwareModuleMetadata softwareModuleMetadata = event.getSoftwareModuleMetadata(); - if (softwareModuleMetadata != null - && isSoftwareModuleSelected(softwareModuleMetadata.getSoftwareModule())) { - if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_SOFTWARE_MODULE_METADATA) { - swmMetadataTable.createMetadata(event.getSoftwareModuleMetadata().getKey()); - } else if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_SOFTWARE_MODULE_METADATA) { - swmMetadataTable.deleteMetadata(event.getSoftwareModuleMetadata().getKey()); - } - } - }); + UI.getCurrent().access(() -> { + final SoftwareModuleMetadata softwareModuleMetadata = event.getSoftwareModuleMetadata(); + if (softwareModuleMetadata != null + && isSoftwareModuleSelected(softwareModuleMetadata.getSoftwareModule())) { + if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_SOFTWARE_MODULE_METADATA) { + swmMetadataTable.createMetadata(event.getSoftwareModuleMetadata().getKey()); + } else if (event + .getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_SOFTWARE_MODULE_METADATA) { + swmMetadataTable.deleteMetadata(event.getSoftwareModuleMetadata().getKey()); + } + } + }); } - - + @Override protected String getEditButtonId() { return SPUIComponentIdProvider.UPLOAD_SW_MODULE_EDIT_BUTTON; @@ -101,7 +101,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null); detailsTab.addTab(swmMetadataTable, getI18n().get("caption.metadata"), null); } - + @Override protected void onEdit(final ClickEvent event) { final Window addSoftwareModule = softwareModuleAddUpdateWindow @@ -126,7 +126,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta updateSoftwareModuleDetailsLayout(HawkbitCommonUtil.SP_STRING_EMPTY, HawkbitCommonUtil.SP_STRING_EMPTY, maxAssign); } - + populateMetadataDetails(); } @@ -188,38 +188,30 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta protected String getDetailsHeaderCaptionId() { return SPUIComponentIdProvider.TARGET_DETAILS_HEADER_LABEL_ID; } - - + @Override - protected void populateMetadataDetails(){ + protected void populateMetadataDetails() { swmMetadataTable.populateSMMetadata(getSelectedBaseEntity()); - } - - private boolean isSoftwareModuleSelected(SoftwareModule softwareModule) { - final SoftwareModule selectedUploadSWModule = artifactUploadState.getSelectedBaseSoftwareModule().isPresent() ? artifactUploadState - .getSelectedBaseSoftwareModule().get() : null; + } + + private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) { + final SoftwareModule selectedUploadSWModule = artifactUploadState.getSelectedBaseSoftwareModule().isPresent() + ? artifactUploadState.getSelectedBaseSoftwareModule().get() : null; return softwareModule != null && selectedUploadSWModule != null && selectedUploadSWModule.getName().equals(softwareModule.getName()) && selectedUploadSWModule.getVersion().equals(softwareModule.getVersion()); } - + @Override protected Boolean isMetadataIconToBeDisplayed() { return true; } - - @Override - protected String getShowMetadataButtonId() { - SoftwareModule selectedBaseEntity = getSelectedBaseEntity(); - return SPUIComponentIdProvider.SW_TABLE_MANAGE_METADATA_ID + "." + selectedBaseEntity.getName() + "." - + selectedBaseEntity.getVersion(); - } @Override - protected void showMetadata(ClickEvent event) { - SoftwareModule swmodule = softwareManagement.findSoftwareModuleWithDetails(getSelectedBaseEntityId()); - /* display the window */ - UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule,null)); + protected void showMetadata(final ClickEvent event) { + final SoftwareModule swmodule = softwareManagement.findSoftwareModuleWithDetails(getSelectedBaseEntityId()); + /* display the window */ + UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, null)); } - + } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java index 050d7c79f..ff1cc3db1 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java @@ -38,7 +38,6 @@ import com.vaadin.server.FontAwesome; import com.vaadin.ui.AbstractTextField.TextChangeEventMode; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.SelectionMode; @@ -98,7 +97,7 @@ public abstract class AbstractMetadataPopupLayout { if (ok) { - deleteMetadata(getSelectedEntity(), key, value); - uiNotification.displaySuccess(i18n.get("message.metadata.deleted.successfully", key)); - final Object selectedRow = metaDataGrid.getSelectedRow(); - metaDataGrid.getContainerDataSource().removeItem(event.getItemId()); - // force grid to refresh - metaDataGrid.clearSortOrder(); - if (!metaDataGrid.getContainerDataSource().getItemIds().isEmpty()) { - if (selectedRow != null) { - if (selectedRow.equals(event.getItemId())) { - metaDataGrid.select(metaDataGrid.getContainerDataSource().getIdByIndex(0)); - } else { - metaDataGrid.select(selectedRow); - } - } - } else { - keyTextField.clear(); - valueTextArea.clear(); - metaDataGrid.select(null); - if (hasCreatePermission()) { - keyTextField.setEnabled(true); - valueTextArea.setEnabled(true); - addIcon.setEnabled(false); - } - } + handleOkDeleteMetadata(event, key, value); } }); UI.getCurrent().addWindow(confirmDialog.getWindow()); confirmDialog.getWindow().bringToFront(); } + private void handleOkDeleteMetadata(final RendererClickEvent event, final String key, final String value) { + deleteMetadata(getSelectedEntity(), key, value); + uiNotification.displaySuccess(i18n.get("message.metadata.deleted.successfully", key)); + final Object selectedRow = metaDataGrid.getSelectedRow(); + metaDataGrid.getContainerDataSource().removeItem(event.getItemId()); + // force grid to refresh + metaDataGrid.clearSortOrder(); + if (!metaDataGrid.getContainerDataSource().getItemIds().isEmpty()) { + if (selectedRow != null) { + if (selectedRow.equals(event.getItemId())) { + metaDataGrid.select(metaDataGrid.getContainerDataSource().getIdByIndex(0)); + } else { + metaDataGrid.select(selectedRow); + } + } + } else { + clearTextFields(); + } + } + + private void clearTextFields() { + keyTextField.clear(); + valueTextArea.clear(); + metaDataGrid.select(null); + if (hasCreatePermission()) { + keyTextField.setEnabled(true); + valueTextArea.setEnabled(true); + addIcon.setEnabled(false); + } + } + private Button createAddIcon() { addIcon = SPUIComponentProvider.getButton(SPUIComponentIdProvider.METADTA_ADD_ICON_ID, i18n.get("button.save"), null, null, false, FontAwesome.PLUS, SPUIButtonStyleSmallNoBorder.class); - addIcon.addClickListener(event -> onAdd(event)); + addIcon.addClickListener(event -> onAdd()); return addIcon; } private Label createHeaderCaption() { - final Label captionLabel = SPUIComponentProvider.getLabel(i18n.get("caption.metadata"), - SPUILabelDefinitions.SP_WIDGET_CAPTION); - return captionLabel; + return SPUIComponentProvider.getLabel(i18n.get("caption.metadata"), SPUILabelDefinitions.SP_WIDGET_CAPTION); } - private IndexedContainer getMetadataContainer() { + private static IndexedContainer getMetadataContainer() { final IndexedContainer swcontactContainer = new IndexedContainer(); swcontactContainer.addContainerProperty(KEY, String.class, ""); swcontactContainer.addContainerProperty(VALUE, String.class, ""); @@ -340,7 +344,7 @@ public abstract class AbstractMetadataPopupLayout close(); + private final ClickListener closeClickListener = event -> close(); private final transient Map orginalValues; @@ -115,6 +115,10 @@ public class CommonDialogWindow extends Window implements Serializable { * the saveButtonClickListener * @param cancelButtonClickListener * the cancelButtonClickListener + * @param layout + * the abstract layout + * @param i18n + * the i18n service */ public CommonDialogWindow(final String caption, final Component content, final String helpLink, final ClickListener saveButtonClickListener, final ClickListener cancelButtonClickListener, @@ -233,11 +237,11 @@ public class CommonDialogWindow extends Window implements Serializable { } protected void addCloseListenerForSaveButton() { - saveButton.addClickListener(close); + saveButton.addClickListener(closeClickListener); } protected void addCloseListenerForCancelButton() { - cancelButton.addClickListener(close); + cancelButton.addClickListener(closeClickListener); } protected void addComponenetListeners() { @@ -275,7 +279,8 @@ public class CommonDialogWindow extends Window implements Serializable { return false; } - private boolean isValueEquals(final AbstractField field, final Object orginalValue, final Object currentValue) { + private static boolean isValueEquals(final AbstractField field, final Object orginalValue, + final Object currentValue) { if (Set.class.equals(field.getType())) { return CollectionUtils.isEqualCollection(CollectionUtils.emptyIfNull((Collection) orginalValue), CollectionUtils.emptyIfNull((Collection) currentValue)); @@ -289,7 +294,7 @@ public class CommonDialogWindow extends Window implements Serializable { return Objects.equals(orginalValue, currentValue); } - private Object getCurrentVaue(final Component currentChangedComponent, final Object newValue, + private static Object getCurrentVaue(final Component currentChangedComponent, final Object newValue, final AbstractField field) { Object currentValue = field.getValue(); if (field instanceof Table) { @@ -365,7 +370,7 @@ public class CommonDialogWindow extends Window implements Serializable { return false; } - private List> getAllComponents(final AbstractLayout abstractLayout) { + private static List> getAllComponents(final AbstractLayout abstractLayout) { final List> components = new ArrayList<>(); final Iterator iterate = abstractLayout.iterator(); @@ -464,6 +469,7 @@ public class CommonDialogWindow extends Window implements Serializable { private class ChangeListener implements ValueChangeListener, TextChangeListener, ItemSetChangeListener { + private static final long serialVersionUID = 1L; private final Field field; public ChangeListener(final Field field) { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java index b6475f647..b0b563f0e 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java @@ -64,7 +64,7 @@ public abstract class AbstractTableDetailsLayout extends private Button editButton; private Button manageMetadataBtn; - + private TabSheet detailsTab; private VerticalLayout detailsLayout; @@ -140,11 +140,11 @@ public abstract class AbstractTableDetailsLayout extends editButton.addClickListener(this::onEdit); editButton.setEnabled(false); - manageMetadataBtn = SPUIComponentProvider.getButton("", "", "", null, false, - FontAwesome.LIST_ALT, SPUIButtonStyleSmallNoBorder.class); + manageMetadataBtn = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.LIST_ALT, + SPUIButtonStyleSmallNoBorder.class); manageMetadataBtn.setId(getEditButtonId()); manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon")); - manageMetadataBtn.addClickListener(this::showMetadata); + manageMetadataBtn.addClickListener(this::showMetadata); manageMetadataBtn.setEnabled(false); detailsTab = SPUIComponentProvider.getDetailsTabSheet(); @@ -295,8 +295,8 @@ public abstract class AbstractTableDetailsLayout extends descriptionLayout = getTabLayout(); return descriptionLayout; } - - /** + + /** * Default caption of header to be displayed when no data row selected in * table. * @@ -341,7 +341,7 @@ public abstract class AbstractTableDetailsLayout extends } protected abstract void populateDetailsWidget(); - + protected abstract void populateMetadataDetails(); protected Long getSelectedBaseEntityId() { @@ -352,10 +352,8 @@ public abstract class AbstractTableDetailsLayout extends protected abstract String getName(); - protected abstract String getShowMetadataButtonId(); - protected abstract Boolean isMetadataIconToBeDisplayed(); - + protected abstract void showMetadata(Button.ClickEvent event); } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleMetadatadetailslayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleMetadatadetailslayout.java index 854347c11..d5753c033 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleMetadatadetailslayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleMetadatadetailslayout.java @@ -41,130 +41,142 @@ import com.vaadin.ui.themes.ValoTheme; @ViewScope public class SoftwareModuleMetadatadetailslayout extends Table { - private static final long serialVersionUID = 2913758299611838818L; + private static final long serialVersionUID = 2913758299611838818L; - private static final String METADATA_KEY = "Key"; + private static final String METADATA_KEY = "Key"; - private SpPermissionChecker permissionChecker; + private SpPermissionChecker permissionChecker; - private SoftwareManagement softwareManagement; + private transient SoftwareManagement softwareManagement; - private SwMetadataPopupLayout swMetadataPopupLayout; + private SwMetadataPopupLayout swMetadataPopupLayout; - private I18N i18n; + private I18N i18n; - private Long selectedSWModuleId; + private Long selectedSWModuleId; - private transient EntityFactory entityFactory; + private transient EntityFactory entityFactory; - public void init(final I18N i18n, final SpPermissionChecker permissionChecker, - final SoftwareManagement softwareManagement, final SwMetadataPopupLayout swMetadataPopupLayout, - final EntityFactory entityFactory) { - this.i18n = i18n; - this.permissionChecker = permissionChecker; - this.softwareManagement = softwareManagement; - this.swMetadataPopupLayout = swMetadataPopupLayout; - this.entityFactory = entityFactory; - createSWMMetadataTable(); - addCustomGeneratedColumns(); - } + /** + * Initialize the layout. + * + * @param i18n + * the i18n service + * @param permissionChecker + * the permission checker service + * @param softwareManagement + * the software management service + * @param swMetadataPopupLayout + * the software module metadata popup layout + * @param entityFactory + * the entity factory service + */ + public void init(final I18N i18n, final SpPermissionChecker permissionChecker, + final SoftwareManagement softwareManagement, final SwMetadataPopupLayout swMetadataPopupLayout, + final EntityFactory entityFactory) { + this.i18n = i18n; + this.permissionChecker = permissionChecker; + this.softwareManagement = softwareManagement; + this.swMetadataPopupLayout = swMetadataPopupLayout; + this.entityFactory = entityFactory; + createSWMMetadataTable(); + addCustomGeneratedColumns(); + } - /** - * Populate software module metadata table. - * - * @param swModule - */ - public void populateSMMetadata(final SoftwareModule swModule) { - removeAllItems(); - if (null == swModule) { - return; - } - selectedSWModuleId = swModule.getId(); - final List swMetadataList = swModule.getMetadata(); - if (null != swMetadataList && !swMetadataList.isEmpty()) { - swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata)); - } - } + /** + * Populate software module metadata table. + * + * @param swModule + */ + public void populateSMMetadata(final SoftwareModule swModule) { + removeAllItems(); + if (null == swModule) { + return; + } + selectedSWModuleId = swModule.getId(); + final List swMetadataList = swModule.getMetadata(); + if (null != swMetadataList && !swMetadataList.isEmpty()) { + swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata)); + } + } - /** - * Create metadata. - * - * @param metadataKeyName - */ - public void createMetadata(final String metadataKeyName) { - final IndexedContainer metadataContainer = (IndexedContainer) getContainerDataSource(); - final Item item = metadataContainer.addItem(metadataKeyName); - item.getItemProperty(METADATA_KEY).setValue(metadataKeyName); + /** + * Create metadata. + * + * @param metadataKeyName + */ + public void createMetadata(final String metadataKeyName) { + final IndexedContainer metadataContainer = (IndexedContainer) getContainerDataSource(); + final Item item = metadataContainer.addItem(metadataKeyName); + item.getItemProperty(METADATA_KEY).setValue(metadataKeyName); - } + } - /** - * Delete metadata. - * - * @param metadataKeyName - */ - public void deleteMetadata(final String metadataKeyName) { - final IndexedContainer metadataContainer = (IndexedContainer) getContainerDataSource(); - metadataContainer.removeItem(metadataKeyName); - } + /** + * Delete metadata. + * + * @param metadataKeyName + */ + public void deleteMetadata(final String metadataKeyName) { + final IndexedContainer metadataContainer = (IndexedContainer) getContainerDataSource(); + metadataContainer.removeItem(metadataKeyName); + } - private void createSWMMetadataTable() { - addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES); - addStyleName(ValoTheme.TABLE_NO_STRIPES); - addStyleName(SPUIStyleDefinitions.SW_MODULE_TABLE); - setSelectable(false); - setImmediate(true); - setContainerDataSource(getSwModuleMetadataContainer()); - setColumnHeaderMode(ColumnHeaderMode.EXPLICIT); - addSMMetadataTableHeader(); - setSizeFull(); - //same as height of other tabs in details tabsheet - setHeight(116,Unit.PIXELS); - } + private void createSWMMetadataTable() { + addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES); + addStyleName(ValoTheme.TABLE_NO_STRIPES); + addStyleName(SPUIStyleDefinitions.SW_MODULE_TABLE); + setSelectable(false); + setImmediate(true); + setContainerDataSource(getSwModuleMetadataContainer()); + setColumnHeaderMode(ColumnHeaderMode.EXPLICIT); + addSMMetadataTableHeader(); + setSizeFull(); + // same as height of other tabs in details tabsheet + setHeight(116, Unit.PIXELS); + } - private IndexedContainer getSwModuleMetadataContainer() { - final IndexedContainer container = new IndexedContainer(); - container.addContainerProperty(METADATA_KEY, String.class, ""); - setColumnAlignment(METADATA_KEY, Align.LEFT); - return container; - } + private IndexedContainer getSwModuleMetadataContainer() { + final IndexedContainer container = new IndexedContainer(); + container.addContainerProperty(METADATA_KEY, String.class, ""); + setColumnAlignment(METADATA_KEY, Align.LEFT); + return container; + } - private void addSMMetadataTableHeader() { - setColumnHeader(METADATA_KEY, i18n.get("header.key")); - } + private void addSMMetadataTableHeader() { + setColumnHeader(METADATA_KEY, i18n.get("header.key")); + } + private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata) { + final Item item = getContainerDataSource().addItem(swMetadata.getKey()); + item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey()); + } - private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata) { - final Item item = getContainerDataSource().addItem(swMetadata.getKey()); - item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey()); - } + private void addCustomGeneratedColumns() { + addGeneratedColumn(METADATA_KEY, (source, itemId, columnId) -> customMetadataDetailButton((String) itemId)); + } - private void addCustomGeneratedColumns() { - addGeneratedColumn(METADATA_KEY, (source, itemId, columnId) -> customMetadataDetailButton((String) itemId)); - } + private Button customMetadataDetailButton(final String metadataKey) { + final Button viewLink = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), metadataKey, + "View" + metadataKey + " Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class); + viewLink.setData(metadataKey); + if (permissionChecker.hasUpdateDistributionPermission()) { + viewLink.addStyleName(ValoTheme.BUTTON_TINY + " " + ValoTheme.BUTTON_LINK + " " + "on-focus-no-border link" + + " " + "text-style"); + viewLink.addClickListener(event -> showMetadataDetails(selectedSWModuleId, metadataKey)); + } + return viewLink; + } - private Button customMetadataDetailButton(final String metadataKey) { - final Button viewLink = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), metadataKey, "View" - + metadataKey + " Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class); - viewLink.setData(metadataKey); - if (permissionChecker.hasUpdateDistributionPermission()) { - viewLink.addStyleName(ValoTheme.BUTTON_TINY + " " + ValoTheme.BUTTON_LINK + " " + "on-focus-no-border link" - + " " + "text-style"); - viewLink.addClickListener(event -> showMetadataDetails(selectedSWModuleId, metadataKey)); - } - return viewLink; - } + private static String getDetailLinkId(final String name) { + return new StringBuilder(SPUIComponentIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name).toString(); + } - private static String getDetailLinkId(final String name) { - return new StringBuilder(SPUIComponentIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name).toString(); - } - - private void showMetadataDetails(final Long selectedSWModuleId, final String metadataKey) { - SoftwareModule swmodule = softwareManagement.findSoftwareModuleById(selectedSWModuleId); - /* display the window */ - UI.getCurrent().addWindow( - swMetadataPopupLayout.getWindow(swmodule, - entityFactory.generateSoftwareModuleMetadata(swmodule, metadataKey, ""))); - } + private void showMetadataDetails(final Long selectedSWModuleId, final String metadataKey) { + final SoftwareModule swmodule = softwareManagement.findSoftwareModuleById(selectedSWModuleId); + /* display the window */ + UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, + entityFactory.generateSoftwareModuleMetadata(swmodule, metadataKey, ""))); + } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java index 03a86c44d..6e428ffba 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java @@ -68,7 +68,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet private static final String SOFT_MODULE = "softwareModule"; private static final String UNASSIGN_SOFT_MODULE = "unassignSoftModule"; - + @Autowired private ManageDistUIState manageDistUIState; @@ -83,37 +83,35 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet @Autowired private transient DistributionSetManagement distributionSetManagement; - + @Autowired private DsMetadataPopupLayout dsMetadataPopupLayout; - + @Autowired - private EntityFactory entityFactory; + private transient EntityFactory entityFactory; private SoftwareModuleDetailsTable softwareModuleTable; - + private DistributionSetMetadatadetailslayout dsMetadataTable; private VerticalLayout tagsLayout; - + private final Map assignedSWModule = new HashMap<>(); - - + @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final MetadataEvent event) { - UI.getCurrent() - .access(() -> { - DistributionSetMetadata dsMetadata = event.getDistributionSetMetadata(); - if (dsMetadata != null && isDistributionSetSelected(dsMetadata.getDistributionSet())) { - if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_DISTRIBUTION_SET_METADATA) { - dsMetadataTable.createMetadata(event.getDistributionSetMetadata().getKey()); - } else if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA) { - dsMetadataTable.deleteMetadata(event.getDistributionSetMetadata().getKey()); - } - } - }); + UI.getCurrent().access(() -> { + final DistributionSetMetadata dsMetadata = event.getDistributionSetMetadata(); + if (dsMetadata != null && isDistributionSetSelected(dsMetadata.getDistributionSet())) { + if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_DISTRIBUTION_SET_METADATA) { + dsMetadataTable.createMetadata(event.getDistributionSetMetadata().getKey()); + } else if (event + .getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA) { + dsMetadataTable.deleteMetadata(event.getDistributionSetMetadata().getKey()); + } + } + }); } - /** * softwareLayout Initialize the component. @@ -124,8 +122,8 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet softwareModuleTable.init(getI18n(), true, getPermissionChecker(), distributionSetManagement, getEventBus(), manageDistUIState); dsMetadataTable = new DistributionSetMetadatadetailslayout(); - dsMetadataTable.init(getI18n(), getPermissionChecker(),distributionSetManagement, - dsMetadataPopupLayout,entityFactory); + dsMetadataTable.init(getI18n(), getPermissionChecker(), distributionSetManagement, dsMetadataPopupLayout, + entityFactory); super.init(); } @@ -141,7 +139,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet populateTags(); populateMetadataDetails(); } - + private void populateModule() { softwareModuleTable.populateModule(getSelectedBaseEntity()); showUnsavedAssignment(); @@ -271,12 +269,12 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet updateDistributionSetDetailsLayout(null, null); } } - + @Override - protected void populateMetadataDetails(){ + protected void populateMetadataDetails() { dsMetadataTable.populateDSMetadata(getSelectedBaseEntity()); - } - + } + private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) { final VerticalLayout detailsTabLayout = getDetailsLayout(); detailsTabLayout.removeAllComponents(); @@ -403,26 +401,18 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet protected Boolean isMetadataIconToBeDisplayed() { return true; } - - @Override - protected String getShowMetadataButtonId() { - DistributionSetIdName lastselectedDistDS = manageDistUIState.getLastSelectedDistribution().isPresent() ? manageDistUIState - .getLastSelectedDistribution().get() : null; - return SPUIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + lastselectedDistDS.getName() + "." - + lastselectedDistDS.getVersion(); - } - - private boolean isDistributionSetSelected(DistributionSet ds) { - DistributionSetIdName lastselectedDistDS = manageDistUIState.getLastSelectedDistribution().isPresent() ? manageDistUIState - .getLastSelectedDistribution().get() : null; + + private boolean isDistributionSetSelected(final DistributionSet ds) { + final DistributionSetIdName lastselectedDistDS = manageDistUIState.getLastSelectedDistribution().isPresent() + ? manageDistUIState.getLastSelectedDistribution().get() : null; return ds != null && lastselectedDistDS != null && lastselectedDistDS.getName().equals(ds.getName()) && lastselectedDistDS.getVersion().endsWith(ds.getVersion()); } - @Override - protected void showMetadata(ClickEvent event) { - DistributionSet ds = distributionSetManagement.findDistributionSetByIdWithDetails(getSelectedBaseEntityId()); - UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds,null)); + protected void showMetadata(final ClickEvent event) { + final DistributionSet ds = distributionSetManagement + .findDistributionSetByIdWithDetails(getSelectedBaseEntityId()); + UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds, null)); } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DsMetadataPopupLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DsMetadataPopupLayout.java index 2041944d4..26eecab8f 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DsMetadataPopupLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DsMetadataPopupLayout.java @@ -36,23 +36,24 @@ public class DsMetadataPopupLayout extends AbstractMetadataPopupLayout getMetadataList() { return getSelectedEntity().getMetadata(); } - + /** * Update metadata for DistributionSet. */ @Override - protected void deleteMetadata(DistributionSet entity, String key, String value) { - DistributionSetMetadata dsMetaData = entityFactory.generateDistributionSetMetadata(entity, key, value); + protected void deleteMetadata(final DistributionSet entity, final String key, final String value) { + final DistributionSetMetadata dsMetaData = entityFactory.generateDistributionSetMetadata(entity, key, value); distributionSetManagement.deleteDistributionSetMetadata(entity, key); eventBus.publish(this, new MetadataEvent(MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA, dsMetaData)); } - + @Override protected boolean hasCreatePermission() { return permChecker.hasCreateDistributionPermission(); } - + @Override protected boolean hasUpdatePermission() { return permChecker.hasUpdateDistributionPermission(); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java index 6cec80028..04a651b5e 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java @@ -49,49 +49,50 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay @Autowired private ManageDistUIState manageDistUIState; - + @Autowired private transient SoftwareManagement softwareManagement; - + @Autowired private SwMetadataPopupLayout swMetadataPopupLayout; - + @Autowired - private EntityFactory entityFactory; - + private transient EntityFactory entityFactory; + private SoftwareModuleMetadatadetailslayout swmMetadataTable; - /** + /** * softwareLayout Initialize the component. */ @Override protected void init() { swmMetadataTable = new SoftwareModuleMetadatadetailslayout(); - swmMetadataTable.init(getI18n(), getPermissionChecker(),softwareManagement,swMetadataPopupLayout,entityFactory); + swmMetadataTable.init(getI18n(), getPermissionChecker(), softwareManagement, swMetadataPopupLayout, + entityFactory); super.init(); } - + /** * MetadataEvent. * * @param event * as instance of {@link MetadataEvent} */ - + @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final MetadataEvent event) { - UI.getCurrent() - .access(() -> { - SoftwareModuleMetadata softwareModuleMetadata = event.getSoftwareModuleMetadata(); - if (softwareModuleMetadata != null - && isSoftwareModuleSelected(softwareModuleMetadata.getSoftwareModule())) { - if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_SOFTWARE_MODULE_METADATA) { - swmMetadataTable.createMetadata(event.getSoftwareModuleMetadata().getKey()); - } else if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_SOFTWARE_MODULE_METADATA) { - swmMetadataTable.deleteMetadata(event.getSoftwareModuleMetadata().getKey()); - } - } - }); + UI.getCurrent().access(() -> { + final SoftwareModuleMetadata softwareModuleMetadata = event.getSoftwareModuleMetadata(); + if (softwareModuleMetadata != null + && isSoftwareModuleSelected(softwareModuleMetadata.getSoftwareModule())) { + if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_SOFTWARE_MODULE_METADATA) { + swmMetadataTable.createMetadata(event.getSoftwareModuleMetadata().getKey()); + } else if (event + .getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_SOFTWARE_MODULE_METADATA) { + swmMetadataTable.deleteMetadata(event.getSoftwareModuleMetadata().getKey()); + } + } + }); } @EventBusListenerMethod(scope = EventScope.SESSION) @@ -119,7 +120,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null); detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null); detailsTab.addTab(swmMetadataTable, getI18n().get("caption.metadata"), null); - } + } @Override protected String getDefaultCaption() { @@ -196,15 +197,15 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay protected String getDetailsHeaderCaptionId() { return SPUIComponentIdProvider.TARGET_DETAILS_HEADER_LABEL_ID; } - + @Override protected void populateMetadataDetails() { swmMetadataTable.populateSMMetadata(getSelectedBaseEntity()); } - private boolean isSoftwareModuleSelected(SoftwareModule softwareModule) { - final Long selectedDistSWModuleId = manageDistUIState.getSelectedBaseSwModuleId().isPresent() ? manageDistUIState - .getSelectedBaseSwModuleId().get() : null; + private boolean isSoftwareModuleSelected(final SoftwareModule softwareModule) { + final Long selectedDistSWModuleId = manageDistUIState.getSelectedBaseSwModuleId().isPresent() + ? manageDistUIState.getSelectedBaseSwModuleId().get() : null; return softwareModule != null && selectedDistSWModuleId != null && selectedDistSWModuleId.equals(softwareModule.getId()); } @@ -213,17 +214,10 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay protected Boolean isMetadataIconToBeDisplayed() { return true; } - - @Override - protected String getShowMetadataButtonId() { - SoftwareModule selectedBaseEntity = getSelectedBaseEntity(); - return SPUIComponentIdProvider.SW_TABLE_MANAGE_METADATA_ID + "." + selectedBaseEntity.getName() + "." - + selectedBaseEntity.getVersion(); - } @Override - protected void showMetadata(ClickEvent event) { - SoftwareModule swmodule = softwareManagement.findSoftwareModuleWithDetails(getSelectedBaseEntityId()); + protected void showMetadata(final ClickEvent event) { + final SoftwareModule swmodule = softwareManagement.findSoftwareModuleWithDetails(getSelectedBaseEntityId()); UI.getCurrent().addWindow(swMetadataPopupLayout.getWindow(swmodule, null)); } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index b785ae8b6..1023d98ed 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -60,8 +60,7 @@ import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.ValoTheme; /** - * - * + * A Vaadin layout for create or update the target filter. */ @SpringComponent @ViewScope @@ -494,11 +493,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button if (filterManagementUIState.isCreateFilterViewDisplayed() && !doesAlreadyExists()) { createTargetFilterQuery(); } else { - if (!nameTextField.getValue().equals(oldFilterName) && !doesAlreadyExists()) { - updateCustomFilter(); - } else { - updateCustomFilter(); - } + updateCustomFilter(); } } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java index e59820e9c..4765e9ac1 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java @@ -53,48 +53,47 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail @Autowired private DistributionTagToken distributionTagToken; - + @Autowired - private transient DistributionSetManagement distributionSetManagement; - + private transient DistributionSetManagement distributionSetManagement; + @Autowired private DsMetadataPopupLayout dsMetadataPopupLayout; - + @Autowired - private EntityFactory entityFactory; + private transient EntityFactory entityFactory; private SoftwareModuleDetailsTable softwareModuleTable; private DistributionSetMetadatadetailslayout dsMetadataTable; - + @Override protected void init() { softwareModuleTable = new SoftwareModuleDetailsTable(); softwareModuleTable.init(getI18n(), false, getPermissionChecker(), null, null, null); - + dsMetadataTable = new DistributionSetMetadatadetailslayout(); - dsMetadataTable.init(getI18n(), getPermissionChecker(),distributionSetManagement, - dsMetadataPopupLayout,entityFactory); - + dsMetadataTable.init(getI18n(), getPermissionChecker(), distributionSetManagement, dsMetadataPopupLayout, + entityFactory); + super.init(); } @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final MetadataEvent event) { - UI.getCurrent() - .access(() -> { - DistributionSetMetadata dsMetadata = event.getDistributionSetMetadata(); - if (dsMetadata != null && isDistributionSetSelected(dsMetadata.getDistributionSet())) { - if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_DISTRIBUTION_SET_METADATA) { - dsMetadataTable.createMetadata(event.getDistributionSetMetadata().getKey()); - } else if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA) { - dsMetadataTable.deleteMetadata(event.getDistributionSetMetadata().getKey()); - } - } - }); + UI.getCurrent().access(() -> { + final DistributionSetMetadata dsMetadata = event.getDistributionSetMetadata(); + if (dsMetadata != null && isDistributionSetSelected(dsMetadata.getDistributionSet())) { + if (event.getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.CREATE_DISTRIBUTION_SET_METADATA) { + dsMetadataTable.createMetadata(event.getDistributionSetMetadata().getKey()); + } else if (event + .getMetadataUIEvent() == MetadataEvent.MetadataUIEvent.DELETE_DISTRIBUTION_SET_METADATA) { + dsMetadataTable.deleteMetadata(event.getDistributionSetMetadata().getKey()); + } + } + }); } - @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final DistributionTableEvent distributionTableEvent) { onBaseEntityEvent(distributionTableEvent); @@ -156,12 +155,11 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail populateMetadataDetails(); } - - + @Override - protected void populateMetadataDetails(){ + protected void populateMetadataDetails() { dsMetadataTable.populateDSMetadata(getSelectedBaseEntity()); - } + } private void populateDetails(final DistributionSet ds) { if (ds != null) { @@ -206,30 +204,24 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail protected String getDetailsHeaderCaptionId() { return SPUIComponentIdProvider.DISTRIBUTION_DETAILS_HEADER_LABEL_ID; } - + @Override protected Boolean isMetadataIconToBeDisplayed() { return true; } - - @Override - protected String getShowMetadataButtonId() { - DistributionSetIdName lastselectedDistDS = managementUIState.getLastSelectedDistribution().isPresent() ? managementUIState - .getLastSelectedDistribution().get() : null; - return SPUIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + lastselectedDistDS.getName() + "." - + lastselectedDistDS.getVersion(); - } - private boolean isDistributionSetSelected(DistributionSet ds) { - DistributionSetIdName lastselectedManageDS = managementUIState.getLastSelectedDistribution().isPresent() ? managementUIState - .getLastSelectedDistribution().get() : null; - return ds!=null && lastselectedManageDS != null && lastselectedManageDS.getName().equals(ds.getName()) + + private boolean isDistributionSetSelected(final DistributionSet ds) { + final DistributionSetIdName lastselectedManageDS = managementUIState.getLastSelectedDistribution().isPresent() + ? managementUIState.getLastSelectedDistribution().get() : null; + return ds != null && lastselectedManageDS != null && lastselectedManageDS.getName().equals(ds.getName()) && lastselectedManageDS.getVersion().endsWith(ds.getVersion()); } @Override - protected void showMetadata(ClickEvent event) { - DistributionSet ds = distributionSetManagement.findDistributionSetByIdWithDetails(getSelectedBaseEntityId()); - UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds,null)); + protected void showMetadata(final ClickEvent event) { + final DistributionSet ds = distributionSetManagement + .findDistributionSetByIdWithDetails(getSelectedBaseEntityId()); + UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds, null)); } - + } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java index ebb2ef185..f398c460c 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java @@ -107,7 +107,6 @@ public class TargetDetails extends AbstractTableDetailsLayout { return; } targetAddUpdateWindowLayout.getWindow(getSelectedBaseEntity().getControllerId()); - // targetAddUpdateWindowLayout.populateValuesOfTarget(getSelectedBaseEntity().getControllerId()); openWindow(); } @@ -229,7 +228,7 @@ public class TargetDetails extends AbstractTableDetailsLayout { * as Module (JVM|OS|AH) * @return Label as UI */ - private Label getSWModlabel(final String labelName, final SoftwareModule swModule) { + private static Label getSWModlabel(final String labelName, final SoftwareModule swModule) { return SPUIComponentProvider.createNameValueLabel(labelName + " : ", swModule.getName(), swModule.getVersion()); } @@ -253,24 +252,19 @@ public class TargetDetails extends AbstractTableDetailsLayout { return SPUIComponentIdProvider.TARGET_DETAILS_HEADER_LABEL_ID; } - @Override - protected String getShowMetadataButtonId() { - return null; - } - @Override protected Boolean isMetadataIconToBeDisplayed() { return false; } @Override - protected void showMetadata(ClickEvent event) { - //No implementation required + protected void showMetadata(final ClickEvent event) { + // No implementation required } @Override protected void populateMetadataDetails() { - //No implementation required + // No implementation required } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java index b58e2e7b8..9ebb1d065 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java @@ -443,7 +443,7 @@ public class RolloutListGrid extends AbstractGrid { return null; } - private String getDSDetails(final Item rolloutItem) { + private static String getDSDetails(final Item rolloutItem) { final StringBuilder swModuleNames = new StringBuilder(); final StringBuilder swModuleVendors = new StringBuilder(); final Set swModules = (Set) rolloutItem.getItemProperty(SW_MODULES).getValue();