private void setGlobalContextValues() { grdSelectedDiscriminatorsRowCollection colDiscriminators = form.grdSelectedDiscriminators().getRows(); ProtocolDiscriminatorVoCollection discriminatorsList = new ProtocolDiscriminatorVoCollection(); for (int i = 0; i < colDiscriminators.size(); i++) { if (colDiscriminators.get(i).getcolSelected() == true) { ProtocolDiscriminatorVo protocolDiscriminator = new ProtocolDiscriminatorVo(); protocolDiscriminator.setDiscriminator(colDiscriminators.get(i).getValue()); protocolDiscriminator.setPriority(form.cmbDefaultPriority().getValue()); discriminatorsList.add(protocolDiscriminator); } } String[] errors = discriminatorsList.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return; } form.getGlobalContext().Emergency.setManchesterTriageProtocol(discriminatorsList); engine.close(DialogResult.OK); }
public int compare(Object ob1, Object ob2) { String name1 = null; String name2 = null; if (ob1 instanceof ProtocolDiscriminatorVo) { ProtocolDiscriminatorVo ps1 = (ProtocolDiscriminatorVo) ob1; if (ps1.getPriority().equals(" ")) { return 0; } name1 = ps1 != null ? ps1.getPriority().getText() : null; } if (ob2 instanceof ProtocolDiscriminatorVo) { ProtocolDiscriminatorVo ps2 = (ProtocolDiscriminatorVo) ob2; if (ps2.getPriority().getText().equals(" ")) { return 0; } name2 = ps2 != null ? ps2.getPriority().getText() : null; } if (name1 != null) return name1.compareTo(name2) * direction; if (name2 != null) return (-1) * direction; return 0; }