delete unused method

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-06-27 12:33:07 +02:00
parent 02e2f67193
commit 6692f92c61
6 changed files with 22 additions and 58 deletions

View File

@@ -223,11 +223,6 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout
@Override @Override
protected void save(final ClickEvent event) { protected void save(final ClickEvent event) {
if (!mandatoryValuesPresent()) {
window.setSaveButtonEnabled(false);
return;
}
final SoftwareModuleType existingSMTypeByKey = swTypeManagementService final SoftwareModuleType existingSMTypeByKey = swTypeManagementService
.findSoftwareModuleTypeByKey(typeKey.getValue()); .findSoftwareModuleTypeByKey(typeKey.getValue());
final SoftwareModuleType existingSMTypeByName = swTypeManagementService final SoftwareModuleType existingSMTypeByName = swTypeManagementService
@@ -237,10 +232,8 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout
createNewSWModuleType(); createNewSWModuleType();
} }
} else { } else {
updateSWModuleType(existingSMTypeByName); updateSWModuleType(existingSMTypeByName);
} }
// window.setSaveButtonEnabled(false);
} }
private void createNewSWModuleType() { private void createNewSWModuleType() {

View File

@@ -127,7 +127,7 @@ public class CommonDialogWindow extends Window implements Serializable {
public void checkMandatoryEditedTextField(final TextChangeEvent event, final String originalValue) { public void checkMandatoryEditedTextField(final TextChangeEvent event, final String originalValue) {
final Component component = event.getComponent(); final Component component = event.getComponent();
if (!(component instanceof AbstractComponent)) { if (!(component instanceof AbstractComponent)) {
throw new IllegalStateException("Only AbstractComponent not allow"); throw new IllegalStateException("Only AbstractComponent are allowed");
} }
if (requiredFields.containsKey(component.getId())) { if (requiredFields.containsKey(component.getId())) {
@@ -209,7 +209,6 @@ public class CommonDialogWindow extends Window implements Serializable {
* Boolean if field is filled * Boolean if field is filled
*/ */
public void updateRequiredFields(final String fieldId, final Boolean filled) { public void updateRequiredFields(final String fieldId, final Boolean filled) {
requiredFields.put(fieldId, filled); requiredFields.put(fieldId, filled);
checkSaveButtonEnabled(); checkSaveButtonEnabled();
} }

View File

@@ -639,19 +639,16 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout
@Override @Override
protected void save(final ClickEvent event) { protected void save(final ClickEvent event) {
final DistributionSetType existingDistTypeByKey = distributionSetManagement
if (mandatoryValuesPresent()) { .findDistributionSetTypeByKey(typeKey.getValue());
final DistributionSetType existingDistTypeByKey = distributionSetManagement final DistributionSetType existingDistTypeByName = distributionSetManagement
.findDistributionSetTypeByKey(typeKey.getValue()); .findDistributionSetTypeByName(tagName.getValue());
final DistributionSetType existingDistTypeByName = distributionSetManagement if (optiongroup.getValue().equals(createTypeStr)) {
.findDistributionSetTypeByName(tagName.getValue()); if (!checkIsDuplicateByKey(existingDistTypeByKey) && !checkIsDuplicate(existingDistTypeByName)) {
if (optiongroup.getValue().equals(createTypeStr)) { createNewDistributionSetType();
if (!checkIsDuplicateByKey(existingDistTypeByKey) && !checkIsDuplicate(existingDistTypeByName)) {
createNewDistributionSetType();
}
} else {
updateDistributionSetType(existingDistTypeByKey);
} }
} else {
updateDistributionSetType(existingDistTypeByKey);
} }
} }

View File

@@ -17,9 +17,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil; import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.SPUIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import com.google.common.base.Strings;
import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.server.Page; import com.vaadin.server.Page;
import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.shared.ui.colorpicker.Color;
@@ -289,24 +287,6 @@ public class CreateUpdateTypeLayout extends AbstractCreateUpdateTagLayout {
return Boolean.FALSE; return Boolean.FALSE;
} }
@Override
protected Boolean mandatoryValuesPresent() {
if (Strings.isNullOrEmpty(tagName.getValue()) || Strings.isNullOrEmpty(typeKey.getValue())) {
if (optiongroup.getValue().equals(createTypeStr)) {
displayValidationError(SPUILabelDefinitions.MISSING_TYPE_NAME_KEY);
}
if (optiongroup.getValue().equals(updateTypeStr)) {
if (null == tagNameComboBox.getValue()) {
displayValidationError(i18n.get("message.error.missing.tagName"));
} else {
displayValidationError(SPUILabelDefinitions.MISSING_TAG_NAME);
}
}
return Boolean.FALSE;
}
return Boolean.TRUE;
}
@Override @Override
protected void save(final ClickEvent event) { protected void save(final ClickEvent event) {
// is implemented in the inherited class // is implemented in the inherited class

View File

@@ -85,16 +85,13 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
*/ */
@Override @Override
public void save(final ClickEvent event) { public void save(final ClickEvent event) {
if (mandatoryValuesPresent()) { final DistributionSetTag existingDistTag = tagManagement.findDistributionSetTag(tagName.getValue());
final DistributionSetTag existingDistTag = tagManagement.findDistributionSetTag(tagName.getValue()); if (optiongroup.getValue().equals(createTagStr)) {
if (optiongroup.getValue().equals(createTagStr)) { if (!checkIsDuplicate(existingDistTag)) {
if (!checkIsDuplicate(existingDistTag)) { createNewTag();
createNewTag();
}
} else {
updateExistingTag(existingDistTag);
} }
} else {
updateExistingTag(existingDistTag);
} }
} }

View File

@@ -106,15 +106,13 @@ public class CreateUpdateTargetTagLayoutWindow extends AbstractCreateUpdateTagLa
@Override @Override
public void save(final ClickEvent event) { public void save(final ClickEvent event) {
if (mandatoryValuesPresent()) { final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue());
final TargetTag existingTag = tagManagement.findTargetTag(tagName.getValue()); if (optiongroup.getValue().equals(createTagStr)) {
if (optiongroup.getValue().equals(createTagStr)) { if (!checkIsDuplicate(existingTag)) {
if (!checkIsDuplicate(existingTag)) { createNewTag();
createNewTag();
}
} else {
updateExistingTag(existingTag);
} }
} else {
updateExistingTag(existingTag);
} }
} }