private boolean populateGrid() { boolean bFound = false; form.grdSymptoms().getRows().clear(); SymptomsCollection lkpCollSymptoms = LookupHelper.getSymptoms(domain.getLookupService()); if(lkpCollSymptoms == null) return bFound; TreeNode[] nodes = lkpCollSymptoms.getRootNodes(); if(nodes.length < lkpCollSymptoms.size()) bFound = true; for(int x = 0; x < nodes.length; x++) { if(nodes[x] instanceof Symptoms) { addRow(null, (Symptoms) nodes[x]); } } form.grdSymptoms().expandAll(); return bFound; }
private void addRow(GenForm.grdSymptomsRow parentRow, Symptoms value) { if(value == null) return; if(value.getParent() != null && value.getParent().getParent() != null) return; grdSymptomsRow row = null; if(parentRow == null) row = form.grdSymptoms().getRows().newRow(); else row = parentRow.getRows().newRow(); row.setcolSymptom((Symptoms) value); if(value.getExpandedImage() != null) row.setExpandedImage(value.getExpandedImage()); if(value.getCollapsedImage() != null) row.setCollapsedImage(value.getCollapsedImage()); row.setIsParentRow(value.getParent() == null); row.setReadOnly(!(value.getParent() != null && value.getParent().getParent() == null)); row.setcolSelectReadOnly(!(value.getParent() != null && value.getParent().getParent() == null)); TreeNode[] nodes = value.getChildren(); for(int x = 0; x < nodes.length; x++) { if(nodes[x] instanceof Symptoms) { addRow(row, (Symptoms) nodes[x]); } } }