Exemplo n.º 1
0
 public void setOrg(long _orgID, D_Organization org) throws P2PDDSQLException {
   if (DEBUG) System.out.println("ConstituentsTest:setOrg: id=" + _orgID);
   organization = org;
   if (tree != null) {
     tree.clean();
   }
   organizationID = _orgID;
   constituentID = net.ddp2p.common.config.Identity.getDefaultConstituentIDForOrg(organizationID);
   global_constituentID = D_Constituent.getGIDFromLID(constituentID);
   if (global_constituentID == null) {
     constituentID = -1;
     MainFrame.status.setMeConstituent(null);
   } else {
     MainFrame.status.setMeConstituent(D_Constituent.getConstByLID(constituentID, true, false));
   }
   ConstituentsModel cm =
       new ConstituentsModel(
           Application.db, organizationID, constituentID, global_constituentID, org, this);
   tree = new ConstituentsTree(cm);
   long cID = cm.getConstituentIDMyself();
   cm.expandConstituentID(tree, ((cID <= 0) ? null : ("" + cID)), true);
   JScrollPane scrollPane = new JScrollPane(tree);
   scrollPane.setPreferredSize(new Dimension(200, 200));
   this.removeAll();
   if (org_label != null) {
     org_label.setText(getLabelText());
     add(getNorthComponent(), BorderLayout.NORTH);
     disableRefresh();
     this.refresh_button.addActionListener(this);
     // add(org_label, BorderLayout.NORTH);
   }
   add(scrollPane, BorderLayout.CENTER);
 }