Formatted the code
This commit is contained in:
@@ -174,7 +174,8 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
final Item saveTblitem = getContainerDataSource().addItem(swModType.getName());
|
final Item saveTblitem = getContainerDataSource().addItem(swModType.getName());
|
||||||
final Label mandatoryLabel = createMandatoryLabel(isMandatory);
|
final Label mandatoryLabel = createMandatoryLabel(isMandatory);
|
||||||
final Label typeName = HawkbitCommonUtil.getFormatedLabel(swModType.getName());
|
final Label typeName = HawkbitCommonUtil.getFormatedLabel(swModType.getName());
|
||||||
final VerticalLayout verticalLayout = createSoftModuleLayout(swModType,distributionSet, alreadyAssignedSwModules);
|
final VerticalLayout verticalLayout = createSoftModuleLayout(swModType, distributionSet,
|
||||||
|
alreadyAssignedSwModules);
|
||||||
|
|
||||||
saveTblitem.getItemProperty(SOFT_TYPE_MANDATORY).setValue(mandatoryLabel);
|
saveTblitem.getItemProperty(SOFT_TYPE_MANDATORY).setValue(mandatoryLabel);
|
||||||
saveTblitem.getItemProperty(SOFT_TYPE_NAME).setValue(typeName);
|
saveTblitem.getItemProperty(SOFT_TYPE_NAME).setValue(typeName);
|
||||||
@@ -205,18 +206,20 @@ public class SoftwareModuleDetailsTable extends Table {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType,
|
||||||
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType,DistributionSet distributionSet, Set<SoftwareModule> alreadyAssignedSwModules){
|
final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) {
|
||||||
VerticalLayout verticalLayout = new VerticalLayout();
|
final VerticalLayout verticalLayout = new VerticalLayout();
|
||||||
for (final SoftwareModule sw : alreadyAssignedSwModules) {
|
for (final SoftwareModule sw : alreadyAssignedSwModules) {
|
||||||
if (swModType.getKey().equals(sw.getType().getKey())) {
|
if (swModType.getKey().equals(sw.getType().getKey())) {
|
||||||
HorizontalLayout horizontalLayout = new HorizontalLayout();
|
final HorizontalLayout horizontalLayout = new HorizontalLayout();
|
||||||
horizontalLayout.setSizeFull();
|
horizontalLayout.setSizeFull();
|
||||||
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
||||||
final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true,
|
final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true,
|
||||||
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
||||||
reassignSoftModule.addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
|
reassignSoftModule
|
||||||
String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(), sw.getVersion());
|
.addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
|
||||||
|
final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(),
|
||||||
|
sw.getVersion());
|
||||||
softwareModule.setValue(softwareModNameVersion);
|
softwareModule.setValue(softwareModNameVersion);
|
||||||
softwareModule.setDescription(softwareModNameVersion);
|
softwareModule.setDescription(softwareModNameVersion);
|
||||||
softwareModule.setId(sw.getName() + "-label");
|
softwareModule.setId(sw.getName() + "-label");
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
||||||
item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.getItemProperty(SOFT_MODULE)
|
item.getItemProperty(SOFT_MODULE).setValue(createSoftModuleLayout(entry.getValue().toString()));
|
||||||
.setValue(createSoftModuleLayout(entry.getValue().toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,15 +204,14 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
|
|||||||
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
for (final Map.Entry<String, StringBuilder> entry : assignedSWModule.entrySet()) {
|
||||||
final Item item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
final Item item = softwareModuleTable.getContainerDataSource().getItem(entry.getKey());
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
item.getItemProperty(SOFT_MODULE)
|
item.getItemProperty(SOFT_MODULE).setValue(createSoftModuleLayout(entry.getValue().toString()));
|
||||||
.setValue(createSoftModuleLayout(entry.getValue().toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private VerticalLayout createSoftModuleLayout(String softwareModuleName){
|
private VerticalLayout createSoftModuleLayout(final String softwareModuleName) {
|
||||||
VerticalLayout verticalLayout = new VerticalLayout();
|
final VerticalLayout verticalLayout = new VerticalLayout();
|
||||||
HorizontalLayout horizontalLayout = new HorizontalLayout();
|
final HorizontalLayout horizontalLayout = new HorizontalLayout();
|
||||||
horizontalLayout.setSizeFull();
|
horizontalLayout.setSizeFull();
|
||||||
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(HawkbitCommonUtil.SP_STRING_EMPTY);
|
||||||
final Button reassignSoftModule = assignSoftModuleButton(softwareModuleName);
|
final Button reassignSoftModule = assignSoftModuleButton(softwareModuleName);
|
||||||
|
|||||||
Reference in New Issue
Block a user