Package java.awt.dnd

Examples of java.awt.dnd.DropTargetContext


        dropStatus   = STATUS_WAIT; // drop pending ACK
        dropComplete = false;

        if (c.isShowing() && dt != null && dt.isActive()) {
            DropTargetContext dtc = dt.getDropTargetContext();

            currentDT = dt;

            if (currentDTC != null) {
                currentDTC.removeNotify();
View Full Code Here


  private class FileDropper extends DropTargetAdapter {
   
    @Override
        public void drop(DropTargetDropEvent e) {
      try {
        DropTargetContext context = e.getDropTargetContext();
        e.acceptDrop( DnDConstants.ACTION_COPY_OR_MOVE );
        Transferable t = e.getTransferable();
        Object data = t.getTransferData( DataFlavor.javaFileListFlavor );
        if( data instanceof java.util.List ) {
          for( Iterator<?> it = ((java.util.List<?>)data).iterator(); it.hasNext(); ) {
            Object o = it.next();
            if( o instanceof File ) {
                fireFileDropped( (File)o );
            }
          }
        }
        context.dropComplete(true);
      }
      catch (InvalidDnDOperationException e1) {
        e1.printStackTrace();
      }
      catch (UnsupportedFlavorException e1) {
View Full Code Here

    private String lastAction;
    private void describe(String type, DropTargetEvent e) {
        if (false) {
            String msg = "drop: " + type;
            if (e instanceof DropTargetDragEvent) {
                DropTargetContext dtc = e.getDropTargetContext();
                DropTarget dt = dtc.getDropTarget();
                DropTargetDragEvent ev = (DropTargetDragEvent)e;
                msg += ": src=" + DragHandler.actionString(ev.getSourceActions())
                    + " tgt=" + DragHandler.actionString(dt.getDefaultActions())
                    + " act=" + DragHandler.actionString(ev.getDropAction());
            }
            else if (e instanceof DropTargetDropEvent) {
                DropTargetContext dtc = e.getDropTargetContext();
                DropTarget dt = dtc.getDropTarget();
                DropTargetDropEvent ev = (DropTargetDropEvent)e;
                msg += ": src=" + DragHandler.actionString(ev.getSourceActions())
                + " tgt=" + DragHandler.actionString(dt.getDefaultActions())
                + " act=" + DragHandler.actionString(ev.getDropAction());
            }
View Full Code Here

TOP

Related Classes of java.awt.dnd.DropTargetContext

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.