Merge pull request #61 from bsinno/Sonar_issue_Fields_and_methods_have_conflicting_names

👍 looks good, thx
This commit is contained in:
Kai Zimmermann
2016-03-08 08:42:43 +01:00
8 changed files with 91 additions and 92 deletions

View File

@@ -438,17 +438,17 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
if (permChecker.hasUpdateDistributionPermission()) { if (permChecker.hasUpdateDistributionPermission()) {
optionValues.add(updateType.getValue()); optionValues.add(updateType.getValue());
} }
createOptionGroup(optionValues); createOptionGroupByValues(optionValues);
} }
private void singleMultiOptionGroup() { private void singleMultiOptionGroup() {
final List<String> optionValues = new ArrayList<>(); final List<String> optionValues = new ArrayList<>();
optionValues.add(singleAssign.getValue()); optionValues.add(singleAssign.getValue());
optionValues.add(multiAssign.getValue()); optionValues.add(multiAssign.getValue());
assignOptionGroup(optionValues); assignOptionGroupByValues(optionValues);
} }
private void createOptionGroup(final List<String> tagOptions) { private void createOptionGroupByValues(final List<String> tagOptions) {
createOptiongroup = new OptionGroup("", tagOptions); createOptiongroup = new OptionGroup("", tagOptions);
createOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL); createOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
createOptiongroup.addStyleName("custom-option-group"); createOptiongroup.addStyleName("custom-option-group");
@@ -458,7 +458,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
} }
} }
private void assignOptionGroup(final List<String> tagOptions) { private void assignOptionGroupByValues(final List<String> tagOptions) {
assignOptiongroup = new OptionGroup("", tagOptions); assignOptiongroup = new OptionGroup("", tagOptions);
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL); assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
assignOptiongroup.addStyleName("custom-option-group"); assignOptiongroup.addStyleName("custom-option-group");

View File

@@ -50,9 +50,9 @@ public class ArtifactUploadState implements Serializable {
private boolean swTypeFilterClosed = Boolean.FALSE; private boolean swTypeFilterClosed = Boolean.FALSE;
private boolean isSwModuleTableMaximized = Boolean.FALSE; private boolean swModuleTableMaximized = Boolean.FALSE;
private boolean isArtifactDetailsMaximized = Boolean.FALSE; private boolean artifactDetailsMaximized = Boolean.FALSE;
private final Set<String> selectedDeleteSWModuleTypes = new HashSet<>(); private final Set<String> selectedDeleteSWModuleTypes = new HashSet<>();
@@ -152,15 +152,15 @@ public class ArtifactUploadState implements Serializable {
* @return the isSwModuleTableMaximized * @return the isSwModuleTableMaximized
*/ */
public boolean isSwModuleTableMaximized() { public boolean isSwModuleTableMaximized() {
return isSwModuleTableMaximized; return swModuleTableMaximized;
} }
/** /**
* @param isSwModuleTableMaximized * @param isSwModuleTableMaximized
* the isSwModuleTableMaximized to set * the isSwModuleTableMaximized to set
*/ */
public void setSwModuleTableMaximized(final boolean isSwModuleTableMaximized) { public void setSwModuleTableMaximized(final boolean swModuleTableMaximized) {
this.isSwModuleTableMaximized = isSwModuleTableMaximized; this.swModuleTableMaximized = swModuleTableMaximized;
} }
public Set<String> getSelectedDeleteSWModuleTypes() { public Set<String> getSelectedDeleteSWModuleTypes() {
@@ -171,15 +171,15 @@ public class ArtifactUploadState implements Serializable {
* @return the isArtifactDetailsMaximized * @return the isArtifactDetailsMaximized
*/ */
public boolean isArtifactDetailsMaximized() { public boolean isArtifactDetailsMaximized() {
return isArtifactDetailsMaximized; return artifactDetailsMaximized;
} }
/** /**
* @param isArtifactDetailsMaximized * @param isArtifactDetailsMaximized
* the isArtifactDetailsMaximized to set * the isArtifactDetailsMaximized to set
*/ */
public void setArtifactDetailsMaximized(final boolean isArtifactDetailsMaximized) { public void setArtifactDetailsMaximized(final boolean artifactDetailsMaximized) {
this.isArtifactDetailsMaximized = isArtifactDetailsMaximized; this.artifactDetailsMaximized = artifactDetailsMaximized;
} }
/** /**

View File

@@ -555,10 +555,10 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
if (permChecker.hasUpdateDistributionPermission()) { if (permChecker.hasUpdateDistributionPermission()) {
optionValues.add(updateDistType.getValue()); optionValues.add(updateDistType.getValue());
} }
createOptionGroup(optionValues); createOptionGroupByValues(optionValues);
} }
private void createOptionGroup(final List<String> typeOptions) { private void createOptionGroupByValues(final List<String> typeOptions) {
createOptiongroup = new OptionGroup("", typeOptions); createOptiongroup = new OptionGroup("", typeOptions);
createOptiongroup.setId(SPUIDefinitions.CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID); createOptiongroup.setId(SPUIDefinitions.CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID);
createOptiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL); createOptiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);

View File

@@ -62,9 +62,9 @@ public class ManageDistUIState implements Serializable {
private final Map<Long, String> deleteSofwareModulesList = new HashMap<>(); private final Map<Long, String> deleteSofwareModulesList = new HashMap<>();
private boolean isSwModuleTableMaximized = Boolean.FALSE; private boolean swModuleTableMaximized = Boolean.FALSE;
private boolean isDsTableMaximized = Boolean.FALSE; private boolean dsTableMaximized = Boolean.FALSE;
private final Map<String, SoftwareModuleIdName> assignedSoftwareModuleDetails = new HashMap<>(); private final Map<String, SoftwareModuleIdName> assignedSoftwareModuleDetails = new HashMap<>();
@@ -219,7 +219,7 @@ public class ManageDistUIState implements Serializable {
* @return boolean * @return boolean
*/ */
public boolean isDsTableMaximized() { public boolean isDsTableMaximized() {
return isDsTableMaximized; return dsTableMaximized;
} }
/*** /***
@@ -227,8 +227,8 @@ public class ManageDistUIState implements Serializable {
* *
* @param isDsModuleTableMaximized * @param isDsModuleTableMaximized
*/ */
public void setDsTableMaximized(final boolean isDsModuleTableMaximized) { public void setDsTableMaximized(final boolean dsModuleTableMaximized) {
isDsTableMaximized = isDsModuleTableMaximized; dsTableMaximized = dsModuleTableMaximized;
} }
public Map<String, SoftwareModuleIdName> getAssignedSoftwareModuleDetails() { public Map<String, SoftwareModuleIdName> getAssignedSoftwareModuleDetails() {
@@ -239,15 +239,15 @@ public class ManageDistUIState implements Serializable {
* @return the isSwModuleTableMaximized * @return the isSwModuleTableMaximized
*/ */
public boolean isSwModuleTableMaximized() { public boolean isSwModuleTableMaximized() {
return isSwModuleTableMaximized; return swModuleTableMaximized;
} }
/** /**
* @param isSwModuleTableMaximized * @param isSwModuleTableMaximized
* the isSwModuleTableMaximized to set * the isSwModuleTableMaximized to set
*/ */
public void setSwModuleTableMaximized(final boolean isSwModuleTableMaximized) { public void setSwModuleTableMaximized(final boolean swModuleTableMaximized) {
this.isSwModuleTableMaximized = isSwModuleTableMaximized; this.swModuleTableMaximized = swModuleTableMaximized;
} }
/** /**

View File

@@ -94,8 +94,8 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
@Autowired @Autowired
private transient TenantMetaDataRepository tenantMetaDataRepository; private transient TenantMetaDataRepository tenantMetaDataRepository;
private Button saveDistribution; private Button saveDistributionBtn;
private Button discardDistribution; private Button discardDistributionBtn;
private TextField distNameTextField; private TextField distNameTextField;
private TextField distVersionTextField; private TextField distVersionTextField;
private Label madatoryLabel; private Label madatoryLabel;
@@ -103,7 +103,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
private CheckBox reqMigStepCheckbox; private CheckBox reqMigStepCheckbox;
private ComboBox distsetTypeNameComboBox; private ComboBox distsetTypeNameComboBox;
private boolean editDistribution = Boolean.FALSE; private boolean editDistribution = Boolean.FALSE;
private Long editDistId = null; private Long editDistId;
private Window addDistributionWindow; private Window addDistributionWindow;
private String originalDistName; private String originalDistName;
private String originalDistVersion; private String originalDistVersion;
@@ -131,9 +131,9 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
final HorizontalLayout buttonsLayout = new HorizontalLayout(); final HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setSizeFull(); buttonsLayout.setSizeFull();
buttonsLayout.setStyleName("dist-buttons-horz-layout"); buttonsLayout.setStyleName("dist-buttons-horz-layout");
buttonsLayout.addComponents(saveDistribution, discardDistribution); buttonsLayout.addComponents(saveDistributionBtn, discardDistributionBtn);
buttonsLayout.setComponentAlignment(saveDistribution, Alignment.BOTTOM_LEFT); buttonsLayout.setComponentAlignment(saveDistributionBtn, Alignment.BOTTOM_LEFT);
buttonsLayout.setComponentAlignment(discardDistribution, Alignment.BOTTOM_RIGHT); buttonsLayout.setComponentAlignment(discardDistributionBtn, Alignment.BOTTOM_RIGHT);
buttonsLayout.addStyleName("window-style"); buttonsLayout.addStyleName("window-style");
/* /*
@@ -186,14 +186,14 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
reqMigStepCheckbox.setId(SPUIComponetIdProvider.DIST_ADD_MIGRATION_CHECK); reqMigStepCheckbox.setId(SPUIComponetIdProvider.DIST_ADD_MIGRATION_CHECK);
/* save or update button */ /* save or update button */
saveDistribution = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_SAVE, "", "", "", true, saveDistributionBtn = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_SAVE, "", "", "", true,
FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class); FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class);
saveDistribution.addClickListener(event -> saveDistribution()); saveDistributionBtn.addClickListener(event -> saveDistribution());
/* close button */ /* close button */
discardDistribution = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_DISCARD, "", "", "", true, discardDistributionBtn = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_DISCARD, "", "", "",
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class); true, FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
discardDistribution.addClickListener(event -> discardDistribution()); discardDistributionBtn.addClickListener(event -> discardDistribution());
} }
/** /**
@@ -216,7 +216,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
} }
private void enableSaveButton() { private void enableSaveButton() {
saveDistribution.setEnabled(true); saveDistributionBtn.setEnabled(true);
} }
private DistributionSetType getDefaultDistributionSetType() { private DistributionSetType getDefaultDistributionSetType() {
@@ -226,7 +226,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
} }
private void disableSaveButton() { private void disableSaveButton() {
saveDistribution.setEnabled(false); saveDistributionBtn.setEnabled(false);
} }
private void saveDistribution() { private void saveDistribution() {
@@ -415,7 +415,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
distsetTypeNameComboBox.removeStyleName(SPUIStyleDefinitions.SP_COMBOFIELD_ERROR); distsetTypeNameComboBox.removeStyleName(SPUIStyleDefinitions.SP_COMBOFIELD_ERROR);
descTextArea.clear(); descTextArea.clear();
reqMigStepCheckbox.clear(); reqMigStepCheckbox.clear();
saveDistribution.setEnabled(true); saveDistributionBtn.setEnabled(true);
removeListeners(); removeListeners();
changedComponents.clear(); changedComponents.clear();
} }
@@ -497,7 +497,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
public void populateValuesOfDistribution(final Long editDistId) { public void populateValuesOfDistribution(final Long editDistId) {
this.editDistId = editDistId; this.editDistId = editDistId;
editDistribution = Boolean.TRUE; editDistribution = Boolean.TRUE;
saveDistribution.setEnabled(false); saveDistributionBtn.setEnabled(false);
final DistributionSet distSet = distributionSetManagement.findDistributionSetByIdWithDetails(editDistId); final DistributionSet distSet = distributionSetManagement.findDistributionSetByIdWithDetails(editDistId);
if (distSet != null) { if (distSet != null) {
distNameTextField.setValue(distSet.getName()); distNameTextField.setValue(distSet.getName());

View File

@@ -62,20 +62,20 @@ public class ManagementUIState implements Serializable {
private boolean distTagFilterClosed = true; private boolean distTagFilterClosed = true;
private Long targetsTruncated = null; private Long targetsTruncated;
private final AtomicLong targetsCountAll = new AtomicLong(); private final AtomicLong targetsCountAll = new AtomicLong();
private boolean isDsTableMaximized = Boolean.FALSE; private boolean dsTableMaximized = Boolean.FALSE;
// Contains ID and NAme of last selected target // Contains ID and NAme of last selected target
private DistributionSetIdName lastSelectedDsIdName; private DistributionSetIdName lastSelectedDsIdName;
// Contains list of ID and Names of all the selected Targets // Contains list of ID and Names of all the selected Targets
private Set<DistributionSetIdName> selectedDsIdName = Collections.emptySet(); private Set<DistributionSetIdName> selectedDsIdName = Collections.emptySet();
private boolean isTargetTableMaximized = Boolean.FALSE; private boolean targetTableMaximized = Boolean.FALSE;
private boolean isActionHistoryMaximized = Boolean.FALSE; private boolean actionHistoryMaximized = Boolean.FALSE;
private boolean noDataAvilableTarget = Boolean.FALSE; private boolean noDataAvilableTarget = Boolean.FALSE;
@@ -255,11 +255,11 @@ public class ManagementUIState implements Serializable {
} }
public boolean isDsTableMaximized() { public boolean isDsTableMaximized() {
return isDsTableMaximized; return dsTableMaximized;
} }
public void setDsTableMaximized(final boolean isDsTableMaximized) { public void setDsTableMaximized(final boolean isDsTableMaximized) {
this.isDsTableMaximized = isDsTableMaximized; this.dsTableMaximized = isDsTableMaximized;
} }
public DistributionSetIdName getLastSelectedDsIdName() { public DistributionSetIdName getLastSelectedDsIdName() {
@@ -282,7 +282,7 @@ public class ManagementUIState implements Serializable {
* @return the isTargetTableMaximized * @return the isTargetTableMaximized
*/ */
public boolean isTargetTableMaximized() { public boolean isTargetTableMaximized() {
return isTargetTableMaximized; return targetTableMaximized;
} }
/** /**
@@ -290,14 +290,14 @@ public class ManagementUIState implements Serializable {
* the isTargetTableMaximized to set * the isTargetTableMaximized to set
*/ */
public void setTargetTableMaximized(final boolean isTargetTableMaximized) { public void setTargetTableMaximized(final boolean isTargetTableMaximized) {
this.isTargetTableMaximized = isTargetTableMaximized; this.targetTableMaximized = isTargetTableMaximized;
} }
/** /**
* @return the isActionHistoryMaximized * @return the isActionHistoryMaximized
*/ */
public boolean isActionHistoryMaximized() { public boolean isActionHistoryMaximized() {
return isActionHistoryMaximized; return actionHistoryMaximized;
} }
/** /**
@@ -305,7 +305,7 @@ public class ManagementUIState implements Serializable {
* the isActionHistoryMaximized to set * the isActionHistoryMaximized to set
*/ */
public void setActionHistoryMaximized(final boolean isActionHistoryMaximized) { public void setActionHistoryMaximized(final boolean isActionHistoryMaximized) {
this.isActionHistoryMaximized = isActionHistoryMaximized; this.actionHistoryMaximized = isActionHistoryMaximized;
} }
/** /**

View File

@@ -128,9 +128,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private TextArea description; private TextArea description;
private Button saveRollout; private Button saveRolloutBtn;
private Button discardRolllout; private Button discardRollloutBtn;
private OptionGroup errorThresholdOptionGroup; private OptionGroup errorThresholdOptionGroup;
@@ -138,7 +138,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private Window addUpdateRolloutWindow; private Window addUpdateRolloutWindow;
private Boolean editRollout; private Boolean editRolloutEnabled;
private Rollout rolloutForEdit; private Rollout rolloutForEdit;
@@ -167,7 +167,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
* Reset the field values. * Reset the field values.
*/ */
public void resetComponents() { public void resetComponents() {
editRollout = Boolean.FALSE; editRolloutEnabled = Boolean.FALSE;
rolloutName.clear(); rolloutName.clear();
targetFilterQuery.clear(); targetFilterQuery.clear();
resetFields(); resetFields();
@@ -212,7 +212,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
final HorizontalLayout groupLayout = new HorizontalLayout(); final HorizontalLayout groupLayout = new HorizontalLayout();
groupLayout.setSizeFull(); groupLayout.setSizeFull();
groupLayout.addComponents(noOfGroups, groupSizeLabel); groupLayout.addComponents(noOfGroups, groupSizeLabel);
groupLayout.setExpandRatio(noOfGroups, 1.0f); groupLayout.setExpandRatio(noOfGroups, 1.0F);
groupLayout.setComponentAlignment(groupSizeLabel, Alignment.MIDDLE_LEFT); groupLayout.setComponentAlignment(groupSizeLabel, Alignment.MIDDLE_LEFT);
return groupLayout; return groupLayout;
} }
@@ -221,7 +221,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
final HorizontalLayout errorThresoldLayout = new HorizontalLayout(); final HorizontalLayout errorThresoldLayout = new HorizontalLayout();
errorThresoldLayout.setSizeFull(); errorThresoldLayout.setSizeFull();
errorThresoldLayout.addComponents(errorThreshold, errorThresholdOptionGroup); errorThresoldLayout.addComponents(errorThreshold, errorThresholdOptionGroup);
errorThresoldLayout.setExpandRatio(errorThreshold, 1.0f); errorThresoldLayout.setExpandRatio(errorThreshold, 1.0F);
return errorThresoldLayout; return errorThresoldLayout;
} }
@@ -229,9 +229,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
final HorizontalLayout targetFilterLayout = new HorizontalLayout(); final HorizontalLayout targetFilterLayout = new HorizontalLayout();
targetFilterLayout.setSizeFull(); targetFilterLayout.setSizeFull();
targetFilterLayout.addComponents(targetFilterQueryCombo, targetFilterQuery, totalTargetsLabel); targetFilterLayout.addComponents(targetFilterQueryCombo, targetFilterQuery, totalTargetsLabel);
targetFilterLayout.setExpandRatio(targetFilterQueryCombo, 0.71f); targetFilterLayout.setExpandRatio(targetFilterQueryCombo, 0.71F);
targetFilterLayout.setExpandRatio(targetFilterQuery, 0.70f); targetFilterLayout.setExpandRatio(targetFilterQuery, 0.70F);
targetFilterLayout.setExpandRatio(totalTargetsLabel, 0.29f); targetFilterLayout.setExpandRatio(totalTargetsLabel, 0.29F);
targetFilterLayout.setComponentAlignment(totalTargetsLabel, Alignment.MIDDLE_LEFT); targetFilterLayout.setComponentAlignment(totalTargetsLabel, Alignment.MIDDLE_LEFT);
return targetFilterLayout; return targetFilterLayout;
} }
@@ -240,7 +240,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
final HorizontalLayout triggerThresholdLayout = new HorizontalLayout(); final HorizontalLayout triggerThresholdLayout = new HorizontalLayout();
triggerThresholdLayout.setSizeFull(); triggerThresholdLayout.setSizeFull();
triggerThresholdLayout.addComponents(triggerThreshold, getPercentHintLabel()); triggerThresholdLayout.addComponents(triggerThreshold, getPercentHintLabel());
triggerThresholdLayout.setExpandRatio(triggerThreshold, 1.0f); triggerThresholdLayout.setExpandRatio(triggerThreshold, 1.0F);
return triggerThresholdLayout; return triggerThresholdLayout;
} }
@@ -254,9 +254,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private HorizontalLayout getSaveDiscardButtonLayout() { private HorizontalLayout getSaveDiscardButtonLayout() {
final HorizontalLayout buttonsLayout = new HorizontalLayout(); final HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setSizeFull(); buttonsLayout.setSizeFull();
buttonsLayout.addComponents(saveRollout, discardRolllout); buttonsLayout.addComponents(saveRolloutBtn, discardRollloutBtn);
buttonsLayout.setComponentAlignment(saveRollout, Alignment.BOTTOM_LEFT); buttonsLayout.setComponentAlignment(saveRolloutBtn, Alignment.BOTTOM_LEFT);
buttonsLayout.setComponentAlignment(discardRolllout, Alignment.BOTTOM_RIGHT); buttonsLayout.setComponentAlignment(discardRollloutBtn, Alignment.BOTTOM_RIGHT);
buttonsLayout.addStyleName("window-style"); buttonsLayout.addStyleName("window-style");
return buttonsLayout; return buttonsLayout;
} }
@@ -277,8 +277,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
description = createDescription(); description = createDescription();
errorThresholdOptionGroup = createErrorThresholdOptionGroup(); errorThresholdOptionGroup = createErrorThresholdOptionGroup();
setDefaultSaveStartGroupOption(); setDefaultSaveStartGroupOption();
saveRollout = createSaveButton(); saveRolloutBtn = createSaveButton();
discardRolllout = createDiscardButton(); discardRollloutBtn = createDiscardButton();
actionTypeOptionGroupLayout.selectDefaultOption(); actionTypeOptionGroupLayout.selectDefaultOption();
totalTargetsLabel = createTotalTargetsLabel(); totalTargetsLabel = createTotalTargetsLabel();
@@ -383,8 +383,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private Container createTargetFilterComboContainer() { private Container createTargetFilterComboContainer() {
final BeanQueryFactory<TargetFilterBeanQuery> targetFilterQF = new BeanQueryFactory<>( final BeanQueryFactory<TargetFilterBeanQuery> targetFilterQF = new BeanQueryFactory<>(
TargetFilterBeanQuery.class); TargetFilterBeanQuery.class);
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, return new LazyQueryContainer(
SPUILabelDefinitions.VAR_NAME), targetFilterQF); new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_NAME),
targetFilterQF);
} }
@@ -410,7 +411,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private void onRolloutSave() { private void onRolloutSave() {
if (editRollout) { if (editRolloutEnabled) {
editRollout(); editRollout();
} else { } else {
createRollout(); createRollout();
@@ -422,8 +423,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
rolloutForEdit.setName(rolloutName.getValue()); rolloutForEdit.setName(rolloutName.getValue());
rolloutForEdit.setDescription(description.getValue()); rolloutForEdit.setDescription(description.getValue());
final DistributionSetIdName distributionSetIdName = (DistributionSetIdName) distributionSet.getValue(); final DistributionSetIdName distributionSetIdName = (DistributionSetIdName) distributionSet.getValue();
rolloutForEdit.setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName rolloutForEdit.setDistributionSet(
.getId())); distributionSetManagement.findDistributionSetById(distributionSetIdName.getId()));
rolloutForEdit.setActionType(getActionType()); rolloutForEdit.setActionType(getActionType());
rolloutForEdit.setForcedTime(getForcedTimeStamp()); rolloutForEdit.setForcedTime(getForcedTimeStamp());
final int amountGroup = Integer.parseInt(noOfGroups.getValue()); final int amountGroup = Integer.parseInt(noOfGroups.getValue());
@@ -453,8 +454,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private long getForcedTimeStamp() { private long getForcedTimeStamp() {
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup() return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
.getValue()) == ActionTypeOption.AUTO_FORCED) ? actionTypeOptionGroupLayout.getForcedTimeDateField() .getValue()) == ActionTypeOption.AUTO_FORCED)
.getValue().getTime() : Action.NO_FORCE_TIME; ? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
: Action.NO_FORCE_TIME;
} }
private ActionType getActionType() { private ActionType getActionType() {
@@ -487,8 +489,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
rolloutToCreate.setName(rolloutName.getValue()); rolloutToCreate.setName(rolloutName.getValue());
rolloutToCreate.setDescription(description.getValue()); rolloutToCreate.setDescription(description.getValue());
rolloutToCreate.setTargetFilterQuery(targetFilter); rolloutToCreate.setTargetFilterQuery(targetFilter);
rolloutToCreate.setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName rolloutToCreate
.getId())); .setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName.getId()));
rolloutToCreate.setActionType(getActionType()); rolloutToCreate.setActionType(getActionType());
rolloutToCreate.setForcedTime(getForcedTimeStamp()); rolloutToCreate.setForcedTime(getForcedTimeStamp());
@@ -499,8 +501,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private String getTargetFilterQuery() { private String getTargetFilterQuery() {
if (null != targetFilterQueryCombo.getValue() if (null != targetFilterQueryCombo.getValue()
&& HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) != null) { && HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) != null) {
final Item filterItem = targetFilterQueryCombo.getContainerDataSource().getItem( final Item filterItem = targetFilterQueryCombo.getContainerDataSource()
targetFilterQueryCombo.getValue()); .getItem(targetFilterQueryCombo.getValue());
return (String) filterItem.getItemProperty("query").getValue(); return (String) filterItem.getItemProperty("query").getValue();
} }
return null; return null;
@@ -568,8 +570,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private boolean duplicateCheck() { private boolean duplicateCheck() {
if (rolloutManagement.findRolloutByName(getRolloutName()) != null) { if (rolloutManagement.findRolloutByName(getRolloutName()) != null) {
uiNotification.displayValidationError(i18n.get("message.rollout.duplicate.check", uiNotification.displayValidationError(
new Object[] { getRolloutName() })); i18n.get("message.rollout.duplicate.check", new Object[] { getRolloutName() }));
return false; return false;
} }
return true; return true;
@@ -580,9 +582,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private TextArea createDescription() { private TextArea createDescription() {
final TextArea descriptionField = SPUIComponentProvider.getTextArea("text-area-style", final TextArea descriptionField = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY,
ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.description"), false, null, i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID); descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID);
descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY); descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
descriptionField.setSizeFull(); descriptionField.setSizeFull();
@@ -647,8 +648,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private Container createDsComboContainer() { private Container createDsComboContainer() {
final BeanQueryFactory<DistBeanQuery> distributionQF = new BeanQueryFactory<>(DistBeanQuery.class); final BeanQueryFactory<DistBeanQuery> distributionQF = new BeanQueryFactory<>(DistBeanQuery.class);
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, return new LazyQueryContainer(
SPUILabelDefinitions.VAR_DIST_ID_NAME), distributionQF); new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
distributionQF);
} }
@@ -682,8 +684,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
try { try {
if (HawkbitCommonUtil.trimAndNullIfEmpty(noOfGroups.getValue()) == null if (HawkbitCommonUtil.trimAndNullIfEmpty(noOfGroups.getValue()) == null
|| HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) == null) { || HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) == null) {
uiNotification.displayValidationError(i18n uiNotification
.get("message.rollout.noofgroups.or.targetfilter.missing")); .displayValidationError(i18n.get("message.rollout.noofgroups.or.targetfilter.missing"));
} else { } else {
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value); new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
final int groupSize = getGroupSize(); final int groupSize = getGroupSize();
@@ -708,8 +710,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
public void validate(final Object value) { public void validate(final Object value) {
try { try {
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value); new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100).validate(Integer new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100)
.valueOf(value.toString())); .validate(Integer.valueOf(value.toString()));
} catch (final InvalidValueException ex) { } catch (final InvalidValueException ex) {
throw ex; throw ex;
} }
@@ -723,8 +725,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
public void validate(final Object value) { public void validate(final Object value) {
try { try {
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value); new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 500), 0, 500).validate(Integer new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 500), 0, 500)
.valueOf(value.toString())); .validate(Integer.valueOf(value.toString()));
} catch (final InvalidValueException ex) { } catch (final InvalidValueException ex) {
throw ex; throw ex;
} }
@@ -740,7 +742,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
*/ */
public void populateData(final Long rolloutId) { public void populateData(final Long rolloutId) {
resetComponents(); resetComponents();
editRollout = Boolean.TRUE; editRolloutEnabled = Boolean.TRUE;
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId); rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
rolloutName.setValue(rolloutForEdit.getName()); rolloutName.setValue(rolloutForEdit.getName());
description.setValue(rolloutForEdit.getDescription()); description.setValue(rolloutForEdit.getDescription());

View File

@@ -86,7 +86,7 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac
gatewayTokenNameTextField.setImmediate(true); gatewayTokenNameTextField.setImmediate(true);
// hide text field until we support multiple gateway tokens for a tenan // hide text field until we support multiple gateway tokens for a tenan
gatewayTokenNameTextField.setVisible(false); gatewayTokenNameTextField.setVisible(false);
gatewayTokenNameTextField.addTextChangeListener(event -> keyNameChanged()); gatewayTokenNameTextField.addTextChangeListener(event -> doKeyNameChanged());
final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "", final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "",
ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class); ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class);
@@ -116,10 +116,7 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac
} }
} }
/** private void doKeyNameChanged() {
* @return
*/
private void keyNameChanged() {
keyNameChanged = true; keyNameChanged = true;
notifyConfigurationChanged(); notifyConfigurationChanged();
} }