Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.DragSourceAdapter


          onRemove();
      }
    });

    /* Drag Support */
    fItemViewer.addDragSupport(DND.DROP_MOVE, new Transfer[] { LocalSelectionTransfer.getTransfer() }, new DragSourceAdapter() {
      @Override
      public void dragStart(final DragSourceEvent event) {
        SafeRunnable.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            IStructuredSelection selection = (IStructuredSelection) fItemViewer.getSelection();
View Full Code Here


        updateMoveEnablement();
      }
    });

    /* Drag Support */
    fViewer.addDragSupport(DND.DROP_MOVE, new Transfer[] { LocalSelectionTransfer.getTransfer() }, new DragSourceAdapter() {
      @Override
      public void dragStart(final DragSourceEvent event) {
        SafeRunnable.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
View Full Code Here

                getManagedForm().fireSelectionChanged(BundleCalculatedImportsPart.this, event.getSelection());
            }
        });
        viewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, new Transfer[] {
            LocalSelectionTransfer.getTransfer()
        }, new DragSourceAdapter() {
            @Override
            public void dragSetData(DragSourceEvent event) {
                LocalSelectionTransfer transfer = LocalSelectionTransfer.getTransfer();
                if (transfer.isSupportedType(event.dataType))
                    transfer.setSelection(viewer.getSelection());
View Full Code Here

    editorPage.getSite().registerContextMenu(menuManager, servicesViewer);

    // Create drag source on the table
    int ops = DND.DROP_COPY;
    Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
    DragSourceAdapter listener = new DragSourceAdapter() {
      @Override
      public void dragSetData(DragSourceEvent event) {
        IStructuredSelection selection = (IStructuredSelection) servicesViewer.getSelection();
        event.data = selection.getFirstElement();
        LocalSelectionTransfer.getTransfer().setSelection(selection);
View Full Code Here

        treeViewer.setLabelProvider(new ModelLabelProvider());

        treeViewer.addDragSupport(DND.DROP_LINK,
            new Transfer[] { LocalSelectionTransfer.getTransfer() },
            new DragSourceAdapter()
            {
                @Override
                public void dragFinished(DragSourceEvent event)
                {
                    // TODO Auto-generated method stub
View Full Code Here

        table.getTable().setHeaderVisible(true);
        table.getTable().setLinesVisible(true);
        table.addSelectionChangedListener(tableListener);

        Transfer[] types = new Transfer[] { UDigByteAndLocalTransfer.getInstance() };
        table.addDragSupport(DND.DROP_MOVE | DND.DROP_DEFAULT, types, new DragSourceAdapter() {
            @Override
            public void dragSetData(DragSourceEvent event) {
                IStructuredSelection selection = (IStructuredSelection) table.getSelection();

                if (UDigByteAndLocalTransfer.getInstance().isSupportedType(event.dataType)) {
View Full Code Here

   
    // Install drag source
    final ISelectionProvider selectionProvider= viewer.getSelectionProvider();
    final DragSource source= new DragSource(st, DND.DROP_COPY | DND.DROP_MOVE);
    source.setTransfer(new Transfer[] {TextTransfer.getInstance()});
    source.addDragListener(new DragSourceAdapter() {
      String fSelectedText;
      Point fSelection;
      public void dragStart(DragSourceEvent event) {
        fTextDragAndDropToken= null;
       
View Full Code Here

    // Drag source
    Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
    DragSource source = new DragSource(viewer.getTable(), DND.DROP_MOVE);
    source.setTransfer(types);   
       
    source.addDragListener(new DragSourceAdapter() {     
      public void dragSetData(DragSourceEvent event) {       
        event.data = PodcastListView.ID;       
      }
      public void dragStart(DragSourceEvent event) {         
        event.data = PodcastListView.ID;
View Full Code Here

    // Drag source
    Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
    DragSource source = new DragSource(viewer.getTable(), DND.DROP_MOVE);
    source.setTransfer(types);   
       
    source.addDragListener(new DragSourceAdapter() {     
      public void dragSetData(DragSourceEvent event) {       
        event.data = _id;       
      }
      public void dragStart(DragSourceEvent event) {         
        event.data = _id;
View Full Code Here

    // Drag source
    Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
    DragSource source = new DragSource(treeViewer.getTree(), DND.DROP_COPY);
    source.setTransfer(types);   
       
    source.addDragListener(new DragSourceAdapter() {     
      public void dragSetData(DragSourceEvent event) {       
        event.data = ID;       
      }
      @SuppressWarnings("unchecked")
      public void dragStart(DragSourceEvent event) {       
View Full Code Here

TOP

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

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.