Package org.nasutekds.guitools.controlpanel.ui.nodes

Examples of org.nasutekds.guitools.controlpanel.ui.nodes.DndBrowserNodes


          {
            e.rejectDrop();
          }

          //cast into appropriate data type
          DndBrowserNodes nodes =
            (DndBrowserNodes) tr.getTransferData(DndBrowserNodes.INFO_FLAVOR);

          StringBuilder sb = new StringBuilder();
          sb.append(groups.getText());
          for (BrowserNodeInfo node : nodes.getNodes())
          {
            if (sb.length() > 0)
            {
              sb.append("\n");
            }
View Full Code Here


        JTree tree = treePane.getTree();
        TreePath[] paths = tree.getSelectionPaths();
        if (paths != null)
        {
          BrowserNodeInfo[] nodes = new BrowserNodeInfo[paths.length];
          DndBrowserNodes dndNodes = new DndBrowserNodes();
          for (int i=0; i<paths.length; i++)
          {
            BrowserNodeInfo node = controller.getNodeInfoFromPath(paths[i]);
            nodes[i] = node;
          }
          dndNodes.setParent(tree);
          dndNodes.setNodes(nodes);
          //Select the appropriate cursor;
          Cursor cursor = DragSource.DefaultCopyNoDrop;
          // begin the drag
          dragSource.startDrag(e, cursor, dndNodes, dragSourceListener);
        }
View Full Code Here

          {
            e.rejectDrop();
          }

          //cast into appropriate data type
          DndBrowserNodes nodes =
            (DndBrowserNodes) tr.getTransferData(DndBrowserNodes.INFO_FLAVOR);

          Component comp = e.getDropTargetContext().getComponent();
          if (comp instanceof JTextArea)
          {
            JTextArea ta = (JTextArea)comp;
            StringBuilder sb = new StringBuilder();
            sb.append(ta.getText());
            for (BrowserNodeInfo node : nodes.getNodes())
            {
              if (sb.length() > 0)
              {
                sb.append("\n");
              }
              sb.append(node.getNode().getDN());
            }
            ta.setText(sb.toString());
            ta.setCaretPosition(sb.length());
          }
          else if (comp instanceof JTextField)
          {
            JTextField tf = (JTextField)comp;
            if (nodes.getNodes().length > 0)
            {
              String dn = nodes.getNodes()[0].getNode().getDN();
              tf.setText(dn);
              tf.setCaretPosition(dn.length());
            }
          }
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
View Full Code Here

          {
            e.rejectDrop();
          }

          //cast into appropriate data type
          DndBrowserNodes nodes =
            (DndBrowserNodes) tr.getTransferData(DndBrowserNodes.INFO_FLAVOR);

          Component comp = e.getDropTargetContext().getComponent();
          if (comp == staticMembers)
          {
            StringBuilder sb = new StringBuilder();
            sb.append(staticMembers.getText());
            for (BrowserNodeInfo node : nodes.getNodes())
            {
              if (sb.length() > 0)
              {
                sb.append("\n");
              }
              sb.append(node.getNode().getDN());
            }
            staticMembers.setText(sb.toString());
            staticMembers.setCaretPosition(sb.length());
          }
          else if (comp == referenceGroup)
          {
            if (nodes.getNodes().length > 0)
            {
              String dn = nodes.getNodes()[0].getNode().getDN();
              referenceGroup.setText(dn);
              referenceGroup.setCaretPosition(dn.length());
            }
          }
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.ui.nodes.DndBrowserNodes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.