Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.DragSource


  }

  private void buildDND() {
    // 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 = PlaylistOverview.ID;       
      }
      public void dragStart(DragSourceEvent event) {         
        event.data = PlaylistOverview.ID;
View Full Code Here


      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

    changeAnnotationMode();

    // TODO: create a listener interface ... for editor listener
    editor.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

        // not needed
      }

    });

    DragSource dragSource = new DragSource(getSourceViewer().getTextWidget(), DND.DROP_COPY);

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

    dragSource.setTransfer(types);

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

    getSite().getPage().addSelectionListener(this);

    getSourceViewer().getTextWidget().setEditable(false);
    getSourceViewer().setEditable(false);
View Full Code Here

        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

    if (page != null) {
      fEditor = page.getActiveEditor();
    }

    fDragAdapter = new DelegatingDragAdapter();
    fDragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
    fDropAdapter = new DelegatingDropAdapter();
    fDropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);

    setConfiguration(getConfiguration());
View Full Code Here

    setCellEditors(new CellEditor[] {null, new TextCellEditor(this.getTree())});

    setCellModifier(new XMLCMCellModifier());
    createContextMenu();

    DragSource dragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
    dragSource.addDragListener(createDragSourceListener());
    dragSource.setTransfer(new Transfer[] {LocalSelectionTransfer.getTransfer()});
    DropTarget dropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
    dropTarget.addDropListener(createDropTargetListener());
    dropTarget.setTransfer(new Transfer[] {LocalSelectionTransfer.getTransfer()});

    this.getTree().addPaintListener(fContentPaintListener);
View Full Code Here

    if (page != null) {
      fEditor = page.getActiveEditor();
    }

    fDragAdapter = new DelegatingDragAdapter();
    fDragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
    fDropAdapter = new DelegatingDropAdapter();
    fDropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);

    setConfiguration(getConfiguration());
View Full Code Here

    {
        if ( ConnectionTransfer.getInstance().isSupportedType( event.dataType ) )
        {
            if ( event.widget instanceof DragSource )
            {
                DragSource dragSource = ( DragSource ) event.widget;
                if ( dragSource.getControl() instanceof Table )
                {
                    Table table = ( Table ) dragSource.getControl();
                    TableItem[] items = table.getSelection();
                    List<IConnection> connectionList = new ArrayList<IConnection>();
                    for ( int i = 0; i < items.length; i++ )
                    {
                        if ( items[i].getData() instanceof IConnection )
View Full Code Here

    {
        if ( ConnectionTransfer.getInstance().isSupportedType( event.dataType ) )
        {
            if ( event.widget instanceof DragSource )
            {
                DragSource dragSource = ( DragSource ) event.widget;
                if ( dragSource.getControl() instanceof Tree )
                {
                    Tree tree = ( Tree ) dragSource.getControl();
                    TreeItem[] items = tree.getSelection();
                    List<Object> objectList = new ArrayList<Object>();
                    for ( int i = 0; i < items.length; i++ )
                    {
                        if ( items[i].getData() instanceof Connection || items[i].getData() instanceof ConnectionFolder )
View Full Code Here

TOP

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

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.