public void populateParameterCombo( SECSTypesCollection usedItemsLookupCollection ) { form.cmbParameter().clear(); SECSTypesCollection lookupCollection = LookupHelper.getSECSTypes(this.domain.getLookupService()); for(int x = 0; x < lookupCollection.size(); x++) { boolean bAllowAdd = true; if(usedItemsLookupCollection != null) { for(int p=0;p<usedItemsLookupCollection.size();p++) { if(lookupCollection.get(x).equals(usedItemsLookupCollection.get(p))) { bAllowAdd = false; break; } } } if(bAllowAdd) form.cmbParameter().newRow(lookupCollection.get(x), lookupCollection.get(x).getText()); } }
private SECSTypesCollection getUsedItemsLookupCollection() { if(form.dyngrdSecs().getRows().size() == 0) return null; SECSTypesCollection collLookups = new SECSTypesCollection(); if(form.getLocalContext().getSelectedInstance() != null) { SECSConfigurationVoCollection voCollConfig = form.getLocalContext().getSelectedInstance().getConfiguration(); if(voCollConfig != null) { for(int i=0;i<voCollConfig.size();i++) { collLookups.add(voCollConfig.get(i).getType()); } } } return collLookups; }
private boolean areAllParametersUsed() { SECSTypesCollection collSECSTypes = getUsedItemsLookupCollection(); if(collSECSTypes==null) return false; int usedItems = collSECSTypes.size(); if(usedItems > 0 && usedItems == form.cmbParameter().getValues().size()) return true; return false; }