private void populateDiscriminatorsGrid( ProtocolDiscriminatorVoCollection newdiscriminatorCollection) { grdDiscriminatorsRowCollection addedDiscriminatorCollection = form.grdDiscriminators().getRows(); if (addedDiscriminatorCollection.size() == 0) { addNewRow(newdiscriminatorCollection); } else { ProtocolDiscriminatorVoCollection remainingDiscriminatorCollection = new ProtocolDiscriminatorVoCollection(); for (int x = 0; x < newdiscriminatorCollection.size(); x++) { remainingDiscriminatorCollection.add(newdiscriminatorCollection.get(x)); } for (int a = newdiscriminatorCollection.size() - 1; a >= 0; a--) { for (int n = addedDiscriminatorCollection.size() - 1; n >= 0; n--) { if (addedDiscriminatorCollection .get(n) .getcolDiscriminator() .equals( newdiscriminatorCollection.get(a).getDiscriminator().getDiscriminatorName())) { addedDiscriminatorCollection .get(n) .setcolPriority(newdiscriminatorCollection.get(a).getPriority().toString()); addedDiscriminatorCollection.get(n).setValue(newdiscriminatorCollection.get(a)); remainingDiscriminatorCollection.remove(a); } } } addNewRow(remainingDiscriminatorCollection); } }
private ProtocolDiscriminatorVoCollection getDiscriminators() { grdDiscriminatorsRowCollection discriminators = form.grdDiscriminators().getRows(); ProtocolDiscriminatorVoCollection discriminatorCollection = new ProtocolDiscriminatorVoCollection(); for (int i = 0; i < discriminators.size(); i++) { discriminatorCollection.add(discriminators.get(i).getValue()); } return discriminatorCollection; }