Ejemplo n.º 1
0
 public void drop(DropTargetEvent e) {
   QTree tree = (QTree) ((DropTarget) e.getSource()).getControl();
   Point loc = tree.toControl(e.x, e.y);
   QItem destItem = tree.getItem(loc.x, loc.y);
   if (destItem == null) return;
   Model destModel = (Model) destItem.getData();
   QItem srcItem = DragHelper.getDraggedItem();
   User member = (User) srcItem.getData();
   switch (destModel.type) {
     case ORGANIZATION:
       Organization o = (Organization) destModel;
       if (member.cluster == o.cluster) {
         if (o.id != member.organizationId) moveMember(o.id, o.cluster, member);
       }
       break;
     case DUMMY:
       Dummy dummy = (Dummy) destModel;
       if (member.cluster == dummy.cluster && dummy.dummyType == DummyType.CLUSTER_ORGANIZATION) {
         if (member.organizationId != 0) moveMember(0, dummy.cluster, member);
       }
       break;
   }
 }