List of usage examples for java.awt.dnd DragSource DefaultCopyNoDrop
Cursor DefaultCopyNoDrop
To view the source code for java.awt.dnd DragSource DefaultCopyNoDrop.
Click Source Link
From source file:Main.java
public void dragGestureRecognized(DragGestureEvent e) { try {// w w w .java 2 s .com Transferable t = new StringSelection(getText()); e.startDrag(DragSource.DefaultCopyNoDrop, t, this); } catch (InvalidDnDOperationException e2) { System.out.println(e2); } }
From source file:MainClass.java
public void dragEnter(DragSourceDragEvent e) { System.out.println("Entering drop target #2"); DragSourceContext ctx = e.getDragSourceContext(); int action = e.getDropAction(); if ((action & DnDConstants.ACTION_COPY) != 0) ctx.setCursor(DragSource.DefaultCopyDrop); else//w ww .j ava2s .c o m ctx.setCursor(DragSource.DefaultCopyNoDrop); }
From source file:org.kuali.test.ui.components.repositorytree.RepositoryTree.java
@Override public void dragGestureRecognized(DragGestureEvent event) { if (getSelectionPath() != null) { DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) getSelectionPath() .getLastPathComponent(); if (isSuiteTest(selectedNode)) { TestSuite testSuite = (TestSuite) getParentUserObject(selectedNode); if (testSuite != null) { event.startDrag(DragSource.DefaultCopyNoDrop, new RepositoryTransferable<TestSuite, SuiteTest>( new RepositoryTransferData(testSuite, selectedNode.getUserObject()), DndHelper.getTestOrderDataFlavor()), new RepositoryDragSourceAdapter()); }/* w ww . j a v a2 s . co m*/ } } }