Disable choosing of resources when picking generic machines

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
Óscar González Fernández 2010-09-20 20:11:42 +02:00
parent 6b2ecbb288
commit 772f2d103f

View file

@ -23,11 +23,12 @@ package org.navalplanner.web.resources.search;
import static org.navalplanner.web.I18nHelper._;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.navalplanner.business.resources.entities.Criterion;
@ -155,9 +156,17 @@ public class NewAllocationSelectorController extends
onType(currentAllocationType);
}
private void onType(AllocationType type) {
listBoxResources.setDisabled(AllocationType.GENERIC_WORKERS == type);
currentAllocationType = type;
listBoxResources.setDisabled(isGenericType());
}
private static final EnumSet<AllocationType> genericTypes = EnumSet.of(
AllocationType.GENERIC_MACHINES, AllocationType.GENERIC_WORKERS);
private boolean isGenericType() {
return genericTypes.contains(currentAllocationType);
}
@SuppressWarnings("unchecked")