Examples of DropTargetAdapter


Examples of java.awt.dnd.DropTargetAdapter

     *
     * @param comp a JComponent that will be enabled for Drag'n'Drop and the
     * current DataFlavor's
     */
    public void addDropTarget(final JComponent comp) {
        addDropTarget(comp, new DropTargetAdapter() {

            @Override
            public void dragExit(DropTargetEvent dte) {
                super.dragExit(dte);
                dte.getDropTargetContext().getComponent().setCursor(Cursor.getDefaultCursor());
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

            public void windowClosing(WindowEvent e) {
                getApplication().getActionManager().getAction(ExitAction.class).exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

        });

        this.scrollPane = new JScrollPane(this.panel);

        // Set up drag and drop
        DropTargetListener dropTargetListener = new DropTargetAdapter() {
            public void drop(DropTargetDropEvent event) {
                GraphCanvas.this.drop(event);
            }
        };
        new DropTarget(this.panel, DnDConstants.ACTION_COPY_OR_MOVE, dropTargetListener);
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

                ((ExitAction) getApplication().getAction(ExitAction.getActionName()))
                        .exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

        statusPanel.add(dateLabel);
        statusPanel.setMargin(4);
       
        setUI(view);
       
        DropTarget dt = new DropTarget(view, new DropTargetAdapter() {

            @Override
            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
                table.getTransferHandler().importData(table, dtde.getTransferable());
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

            public void windowClosing(WindowEvent e) {
                getApplication().getActionManager().getAction(ExitAction.class).exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

                                            DnDConstants.ACTION_COPY_OR_MOVE,
                                            dgl);

      final DataFlavor flavor = moduleFlavor;

      dt = new DropTarget(this, new DropTargetAdapter() {
       
        public void drop(DropTargetDropEvent dtde) {
          try {
            if (dtde.getCurrentDataFlavorsAsList().contains(flavor)) {
              dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
View Full Code Here

Examples of java.awt.dnd.DropTargetAdapter

      Color c = getBackground();
      setEditable(false);
      setBackground(c);
      final LibraryTextField fld = this;

      dt = new DropTarget(fld, new DropTargetAdapter() {
        public void drop(DropTargetDropEvent dtde) {
          try {
            if (dtde.getCurrentDataFlavorsAsList().contains(libraryFlavor)) {
              dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
              Transferable trf = dtde.getTransferable();
View Full Code Here

Examples of org.eclipse.swt.dnd.DropTargetAdapter

    documentSource.setLayoutData(fdata1);
    documentSource.setToolTipText("Document source folder...");
    documentSource.setMessage("Document source folder...");
    DropTarget dt = new DropTarget(documentSource, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt.addDropListener(new DropTargetAdapter() {
      @Override
      public void drop(DropTargetEvent event) {
        String fileList[] = null;
        FileTransfer ft = FileTransfer.getInstance();
        if (ft.isSupportedType(event.currentDataType)) {
          fileList = (String[]) event.data;
        }
        if (fileList != null && fileList.length > 0) {
          String fileString = fileList[0];
          documentSource.setText(fileString);
        }
      }
    });

    documentSink = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData fdatag = new FormData();
    fdatag.width = 200;
    fdatag.left = new FormAttachment(0, 1000, 5);
    fdatag.top = new FormAttachment(0, 1000, 30);
    fdatag.right = new FormAttachment(1000, 1000, -5);
    documentSink.setLayoutData(fdatag);
    documentSink.setToolTipText("Document gold output folder...");
    documentSink.setMessage("Document gold output folder...");
    DropTarget dtg = new DropTarget(documentSink, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dtg.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dtg.addDropListener(new DropTargetAdapter() {
      @Override
      public void drop(DropTargetEvent event) {
        String fileList[] = null;
        FileTransfer ft = FileTransfer.getInstance();
        if (ft.isSupportedType(event.currentDataType)) {
          fileList = (String[]) event.data;
        }
        if (fileList != null && fileList.length > 0) {
          String fileString = fileList[0];
          documentSink.setText(fileString);
        }
      }
    });

    typeSystem = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData fdata2 = new FormData();
    fdata2.width = 200;
    fdata2.left = new FormAttachment(0, 1000, 5);
    fdata2.top = new FormAttachment(0, 1000, 55);
    fdata2.right = new FormAttachment(1000, 1000, -5);
    typeSystem.setLayoutData(fdata2);
    typeSystem.setToolTipText("Type System...");
    typeSystem.setMessage("Type System...");
    DropTarget dt1 = new DropTarget(typeSystem, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt1.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt1.addDropListener(new DropTargetAdapter() {
      @Override
      public void drop(DropTargetEvent event) {
        String fileList[] = null;
        FileTransfer ft = FileTransfer.getInstance();
        if (ft.isSupportedType(event.currentDataType)) {
View Full Code Here

Examples of org.eclipse.swt.dnd.DropTargetAdapter

    });
   
    DropTarget dt = new DropTarget(tabFolder,
        DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt.setTransfer(new Transfer[] {FileTransfer.getInstance()});
    dt.addDropListener(new DropTargetAdapter() {
      public void drop(DropTargetEvent ev) {
        for (final String s : (String[])ev.data) {
          TabPanelController.instance().openLocalFileReq(
              new File(s).toURI(),
              Configurer.application.getInt("reader.remote.defaultNrLines"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.