private void populateChildCollectionFromGrid(MobilisationsVo voMobilisation) { if (form.grdTreatments().getValue() == null) return; if (voMobilisation.getMobilisationsTreatment() == null) voMobilisation.setMobilisationsTreatment(new MobilisationsTreatmentVoCollection()); GenForm.grdTreatmentsRow parentRow = form.grdTreatments().getValue() instanceof MobilisationsShortVo || form.grdTreatments().getValue() instanceof MobilisationsVo ? form.grdTreatments().getSelectedRow() : form.grdTreatments().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voMobilisation.getMobilisationsTreatment().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voMobilisation.getMobilisationsTreatment().add((MobilisationsTreatmentVo) parentRow.getRows().get(i).getValue()); } }
private void showHeaderOrDetailsTab() { if (form.getMode().equals(FormMode.VIEW)) { // In view mode just show the selected node if (form.grdTreatments().getValue() instanceof MobilisationsVo) form.ctnMob().lyrMob().showtabHeader(); else if (form.grdTreatments().getValue() instanceof MobilisationsShortVo) form.ctnMob().lyrMob().showtabHeader(); else if (form.grdTreatments().getValue() instanceof MobilisationsTreatmentVo) form.ctnMob().lyrMob().showtabDetails(); else form.ctnMob().lyrMob().showtabEmpty(); } else { if (form.getLocalContext().getUpdatingParent().equals(Boolean.TRUE)) form.ctnMob().lyrMob().showtabHeader(); else form.ctnMob().lyrMob().showtabDetails(); } }
private void newParentNode(MobilisationsVo voNewParent) { if (voNewParent == null) return; MobilisationsShortVo voParentShort = new MobilisationsShortVo(); voParentShort.setAuthoringCP(form.ctnMob().lyrMob().tabHeader().qmbAuthoringCP().getValue()); voParentShort.setAuthoringDateTime(form.ctnMob().lyrMob().tabHeader().dtimAuthoring().getValue()); voParentShort.setClinicalContact(voNewParent.getClinicalContact()); GenForm.grdTreatmentsRow parentRow = form.grdTreatments().getRows().newRow(); if(voParentShort.getAuthoringCP() != null) parentRow.setColTreatment(voParentShort.getAuthoringDateTime().toString()+ " - " + voParentShort.getAuthoringCP().toString()); parentRow.setValue(voParentShort); parentRow.setBackColor(Color.Beige); form.getLocalContext().setGoldenInstanceSelected(new Boolean(true)); parentRow.setExpanded(true); form.grdTreatments().setValue(voParentShort); }
private void populateParentNode(MobilisationsShortVo voMobilisationsShort) { GenForm.grdTreatmentsRow parRow = form.grdTreatments().getRows().newRow(); parRow.setColTreatment(voMobilisationsShort.getAuthoringDateTime().toString()+ " - " + voMobilisationsShort.getAuthoringCP().toString()); parRow.setValue(voMobilisationsShort); if(form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() && voMobilisationsShort.getClinicalContact().getID_ClinicalContact().equals (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) { form.grdTreatments().setValue(voMobilisationsShort); expandParentNode(parRow); } }
private void expandParentNode(grdTreatmentsRow parRow) { if (parRow.getValue() instanceof MobilisationsShortVo == false ) return; form.getLocalContext().setSelectedParentInstance(getParentFromDomain((MobilisationsShortVo)parRow.getValue())); if (form.getLocalContext().getSelectedParentInstance() == null ) return; MobilisationsVo voParentInstance = form.getLocalContext().getSelectedParentInstance(); if(form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() && voParentInstance.getClinicalContact().getID_ClinicalContact().equals (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) { // If this is the Golden Node then we'll colour it golden (ok then beige). form.getLocalContext().setGoldenInstanceFound(new Boolean(true)); form.getLocalContext().setGoldenInstanceSelected(new Boolean(true)); form.getLocalContext().setUpdatingParentInstance(voParentInstance); parRow.setBackColor(Color.Beige); } if (voParentInstance.getMobilisationsTreatment() != null) { parRow.setValue(voParentInstance); parRow.setExpanded(true); populateChildNodes(parRow, voParentInstance.getMobilisationsTreatment()); } populateParentInstanceControls(voParentInstance); }
private MobilisationsVo getParentFromDomain(MobilisationsShortVo voMobilisationsShort) { if(Boolean.TRUE.equals(engine.isRIEMode())) //wdev-13564 return domain.getMobilisationById(voMobilisationsShort); //wdev-13564 else return domain.getMobilisation(voMobilisationsShort.getClinicalContact()); }
private void updateInstance() { form.getLocalContext().setUpdatingParent(new Boolean(form.grdTreatments().getValue() instanceof MobilisationsShortVo || form.grdTreatments().getValue() instanceof MobilisationsVo)); form.setMode(FormMode.EDIT); if (form.grdTreatments().getValue() instanceof MobilisationsTreatmentVo) { MobilisationsTreatmentVo voCachedChild = (MobilisationsTreatmentVo) form.grdTreatments().getValue(); if (voCachedChild.getID_MobilisationsTreatment() == null) { populateChildInstanceControls(voCachedChild); } } disableHeaderInfo(); }
private void getSelectedInstance() { // In update mode we can select nodes without displaying anything but the context // menus can change based on what's selected so we need to update them if (form.getMode().equals(FormMode.EDIT)) { updateContextMenusState(); return; } GenForm.grdTreatmentsRow parentRow = null; if(form.grdTreatments().getValue() instanceof MobilisationsVo) { populateParentInstanceControls((MobilisationsVo) form.grdTreatments().getValue()); } else if(form.grdTreatments().getValue() instanceof MobilisationsShortVo) { parentRow = form.grdTreatments().getSelectedRow(); expandParentNode(form.grdTreatments().getSelectedRow()); form.getLocalContext().setSelectedChildInstance(null); clearChildInstanceControls(); } else if(form.grdTreatments().getValue() instanceof MobilisationsTreatmentVo) { parentRow = form.grdTreatments().getSelectedRow().getParentRow(); populateParentInstanceControls((MobilisationsVo) parentRow.getValue()); form.getLocalContext().setSelectedParentInstance((MobilisationsVo) parentRow.getValue()); MobilisationsTreatmentVo voMobilisationTreat = (MobilisationsTreatmentVo) form.grdTreatments().getValue(); populateChildInstanceControls(voMobilisationTreat); if(parentRow.getValue() instanceof MobilisationsVo && form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) { MobilisationsVo voMobilisation = (MobilisationsVo) parentRow.getValue(); if(voMobilisation.getClinicalContact().getID_ClinicalContact().equals(form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact())) form.getLocalContext().setSelectedChildInstance(voMobilisationTreat); } } else { parentRow = form.grdTreatments().getSelectedRow(); form.getLocalContext().setSelectedParentInstance((MobilisationsVo) form.grdTreatments().getValue()); populateParentInstanceControls((MobilisationsVo) form.grdTreatments().getValue()); } if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) form.getLocalContext().setGoldenInstanceSelected(new Boolean(form.getLocalContext().getSelectedParentInstanceIsNotNull() && form.getLocalContext().getSelectedParentInstance().getClinicalContactIsNotNull() && form.getLocalContext().getSelectedParentInstance().getClinicalContact().getID_ClinicalContactIsNotNull() && form.getLocalContext().getSelectedParentInstance().getClinicalContact().getID_ClinicalContact().equals(form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact()))); //wdev-13513 updateControlsState(); }