Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.DropTargetAdapter


      }
    });
       
        DropTarget target = new DropTarget(tableViewer.getControl(), DND.DROP_COPY | DND.DROP_MOVE);
        target.setTransfer(new Transfer[]{ new CsvRowTransfer() });
        target.addDropListener(new DropTargetAdapter() {
     
            @Override
            public void dragEnter(DropTargetEvent event) {
                event.detail = DND.DROP_COPY;
            }
View Full Code Here


    Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
    DropTarget dropTarget = new DropTarget(table, DND.DROP_COPY
        | DND.DROP_MOVE);
    dropTarget.setTransfer(types);

    dropTarget.addDropListener(new DropTargetAdapter() {

      @Override
      public void drop(DropTargetEvent event) {
        java.util.List<MetaArtefactOperation> operations = Serializer
            .deserialize((String) event.data);
View Full Code Here

      RutaAddonsPlugin.error(e);
    }

    DropTarget dt = new DropTarget(inputDirectoryText, 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.length > 0)
          inputDirectoryText.setText(fileList[0]);
      }
    });

    DropTarget dt2 = new DropTarget(typeSystemFileText, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt2.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt2.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

      TextRulerPlugin.error(e);
    }

    DropTarget dt = new DropTarget(inputDirectoryText, 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.length > 0)
          inputDirectoryText.setText(fileList[0]);
      }
    });

    DropTarget dt3 = new DropTarget(additionalDirectoryText, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt3.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt3.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.length > 0)
          additionalDirectoryText.setText(fileList[0]);
      }
    });

    DropTarget dt4 = new DropTarget(testDirectoryText, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt4.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt4.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.length > 0)
          testDirectoryText.setText(fileList[0]);
      }
    });

    DropTarget dt2 = new DropTarget(preFileText, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt2.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt2.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

  }

  private void addDropTarget(final AddRemoveList list) {
    DropTarget fdt = new DropTarget(list, DND.DROP_DEFAULT | DND.DROP_MOVE);
    fdt.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    fdt.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

        }
      }
    };
    fTreeViewer.addDragSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] { TemplatesTransfer
        .getInstance() }, dragListener);
    DropTargetAdapter dropListener= new DropTargetAdapter() {
      Transfer textTransfer= TextTransfer.getInstance();
      Transfer templateTransfer= TemplatesTransfer.getInstance();

      /*
       * @see org.eclipse.swt.dnd.DropTargetAdapter#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
View Full Code Here

        }
      }
    });

    // Install drag target
    DropTargetListener dropTargetListener= new DropTargetAdapter() {

      private Point fSelection;

      public void dragEnter(DropTargetEvent event) {
        fTextDragAndDropToken= null;
View Full Code Here

                final DropTarget target = new DropTarget( this.table, DND.DROP_COPY | DND.DROP_MOVE );
                target.setTransfer( transfers );
               
                target.addDropListener
                (
                    new DropTargetAdapter()
                    {
                        public void dragOver( final DropTargetEvent event )
                        {
                            if( event.item != null )
                            {
View Full Code Here

   * @return the DropTarget for the table
   */
  private DropTarget createTableDropTarget(final Table table) {
    DropTarget dropTarget = new DropTarget(table, DND.DROP_MOVE | DND.DROP_COPY);
    dropTarget.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dropTarget.addDropListener(new DropTargetAdapter() {
      public void dragEnter(DropTargetEvent event) {
        isDropping = true;
      }

      public void dragLeave(DropTargetEvent event) {
View Full Code Here

   * @return the DropTarget for the tree
   */
  private DropTarget createTreeDropTarget(final Tree tree) {
    DropTarget dropTarget = new DropTarget(tree, DND.DROP_MOVE | DND.DROP_COPY);
    dropTarget.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dropTarget.addDropListener(new DropTargetAdapter() {
      public void dragEnter(DropTargetEvent event) {
        isDropping = true;
      }

      public void dragLeave(DropTargetEvent event) {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.dnd.DropTargetAdapter

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.