protected void walk(ItemTreeModel model, Group gr, Object o) { int cc = model.getChildCount(o); for (int i = 0; i < cc; i++) { ActivableMutableTreeNode child = (ActivableMutableTreeNode) model.getChild(o, i); if (child.isActive()) { final Item userObject = (Item) child.getUserObject(); if (userObject instanceof Group) { final Group item = new Group(userObject.getId()); item.setLocalHint(new LayoutHints(userObject.getLocalHint())); gr.add(item); walk(model, item, child); } else { final Item item = new Item(userObject.getId()); item.setLocalHint(new LayoutHints(userObject.getLocalHint())); final SQLTable table = ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable(n.getTable()); if (table.contains(userObject.getId())) { SQLField field = table.getField(userObject.getId()); if (!field.isPrimaryKey() && !field.getName().endsWith("ORDRE") && !field.getName().endsWith("ARCHIVE")) { gr.add(item); } } } } } }
public void initGroupFromTable(List<String> fields) { System.out.println("GroupEditor.initGroupFromTable()"); System.out.println("GroupEditor.initGroupFromTable Component group"); this.tableGroup = new Group(n.getId()); for (String field : fields) { Item i = n.getItemFromId(field); Item newItem = new Item(field); if (i != null) { System.out.println( "GroupEditor.initGroupFromTable() searching found: " + i + ":" + i.getLocalHint()); newItem.setLocalHint(new LayoutHints(i.getLocalHint())); } this.tableGroup.add(newItem); } System.out.println("GroupEditor.initGroupFromTable Table group"); }