Examples of DragSource


Examples of org.eclipse.swt.dnd.DragSource

    changeAnnotationMode();

    // TODO: create a listener interface ... for editor listener
    mEditor.addAnnotationListener(new EditorListener());

    DragSource source = new DragSource(mTableViewer.getTree(), DND.DROP_COPY);

    source.setTransfer(new Transfer[] { FeatureStructureTransfer.getInstance() });

    source.addDragListener(new DragSourceListener() {
      TreeItem dragSourceItem = null;

      public void dragStart(DragSourceEvent event) {
        TreeItem[] selection = mTableViewer.getTree().getSelection();
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

      public void dropAccept(DropTargetEvent event) {
      }
    });


    DragSource source = new DragSource(viewer.getTree(), DND.DROP_COPY);

    source.setTransfer(new Transfer[] { FeatureStructureTransfer.getInstance() });

    source.addDragListener(new DragSourceListener() {
      TreeItem dragSourceItem = null;

      public void dragStart(DragSourceEvent event) {

        event.doit = false;
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

    changeAnnotationMode();

    editorChangeListener = new EditorListener();
    editor.addAnnotationListener(editorChangeListener);

    DragSource source = new DragSource(mTableViewer.getTree(), DND.DROP_COPY);

    source.setTransfer(new Transfer[] { FeatureStructureTransfer.getInstance() });

    source.addDragListener(new DragSourceListener() {
      TreeItem dragSourceItem = null;

      public void dragStart(DragSourceEvent event) {
        TreeItem[] selection = mTableViewer.getTree().getSelection();
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

      public void dropAccept(DropTargetEvent event) {
      }
    });


    DragSource source = new DragSource(viewer.getTree(), DND.DROP_COPY);

    source.setTransfer(new Transfer[] { FeatureStructureTransfer.getInstance() });

    source.addDragListener(new DragSourceListener() {
      TreeItem dragSourceItem = null;

      public void dragStart(DragSourceEvent event) {

        event.doit = false;
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

        mFeatureStructureSelectionProvider.setSelection(new AnnotationEditorSelection((ITextSelection) event.getSelection(),
                new StructuredSelection(ModelFeatureStructure.create(getDocument(), getSelectedAnnotations()))));
      }
    });
   
    DragSource dragSource = new DragSource(getSourceViewer().getTextWidget(), DND.DROP_COPY);

    Transfer[] types = new Transfer[] { FeatureStructureTransfer.getInstance() };

    dragSource.setTransfer(types);

    dragSource.addDragListener(new FeatureStructureDragListener(getSourceViewer().getTextWidget()));

    getSourceViewer().getTextWidget().setEditable(false);
    getSourceViewer().setEditable(false);

    getSite().setSelectionProvider(mFeatureStructureSelectionProvider);
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

  public static DragSourceDescriptor addDragSupport(Control control, ISelectionProvider provider) {
    int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT;
      Set<Transfer> transfers = getTransfers();
        transfers.remove(FileTransfer.getInstance());

      DragSource dragSource=new DragSource(control, dndOperations);
        DragController dragController = new DragController(dragSource, transfers);
        provider.addSelectionChangedListener(dragController);
        dragController.setTransfers((IStructuredSelection) provider.getSelection());
      UDIGControlDragListener controlDragListener = new UDIGControlDragListener(provider);
        dragSource.addDragListener(controlDragListener);
        return new DragSourceDescriptor(dragSource, controlDragListener);
  }
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

      });
  }

  private void setupDataManagerViewForDragAndDropOutOf(Composite parent) {
    Transfer[] types = new Transfer[] { new CIShellDataTransfer(Activator.context) };
    DragSource dragSource = new DragSource(parent, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dragSource.setTransfer(types);
    dragSource.addDragListener(new DragSourceListener() {
      private Data[] selectedData;

      public void dragStart(DragSourceEvent event) {
        System.err.println("dragStart");
        Data[] selectedData = AbstractDataManagerView.this.manager.getSelectedData();
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

    this.tree = treeView.getTree();
    display = tree.getDisplay();

    Transfer[] types = new Transfer[] { new JComponentTransfer() };
    int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
    final DragSource source = new DragSource(tree, operations);
    source.setTransfer(types);
    treeItems = new TreeItem[1];
    source.addDragListener(this);

    DropTarget target = new DropTarget(tree, operations);
    target.setDropTargetEffect(new MyDropTargetEffect(tree));
    target.setTransfer(types);
    target.addDropListener(this);
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

    /**
     * Creates DND source for the list
     */
    private void createDNDSource() {
      DragSource ds = new DragSource(list, DND.DROP_COPY);
      ds.setTransfer(new Transfer[] { TextTransfer.getInstance() });
      ds.addDragListener(new DragSourceListener() {
        public void dragFinished(DragSourceEvent event) {

        }

        public void dragSetData(DragSourceEvent event) {
View Full Code Here

Examples of org.eclipse.swt.dnd.DragSource

   
    final StyledText st= viewer.getTextWidget();
   
    // 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
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.