Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.DragSourceListener


  private void initDragAndDrop() {
    int ops = DND.DROP_COPY | DND.DROP_MOVE;
    Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance(), URLTransfer.getInstance() };

    /* Drag Support */
    fViewer.addDragSupport(ops, transfers, new DragSourceListener() {
      public void dragStart(final DragSourceEvent event) {
        SafeRunner.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            LocalSelectionTransfer.getTransfer().setSelection(fViewer.getSelection());
            LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL);
View Full Code Here


  private void initDragAndDrop() {
    int ops = DND.DROP_COPY | DND.DROP_MOVE;
    Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance(), URLTransfer.getInstance() };

    /* Drag Support */
    fResultViewer.addDragSupport(ops, transfers, new DragSourceListener() {
      public void dragStart(final DragSourceEvent event) {
        SafeRunner.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            LocalSelectionTransfer.getTransfer().setSelection(fResultViewer.getSelection());
            LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL);
View Full Code Here

    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

    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

    }

    private void addDragDropSupport() {
        // TODO: Support drag and drop of directories
        Transfer[] transfers = new Transfer[] { FileTransfer.getInstance()};
        viewer.addDragSupport(DND.DROP_COPY, transfers, new DragSourceListener() {
            private TreeObject[] target;

            public void dragFinished(DragSourceEvent event) {
                target = null;
                event.doit = true;
View Full Code Here

  /**
   * Configures DND in {@link #m_viewer}.
   */
  private void configureDND() {
    Transfer[] transfers = new Transfer[]{EmptyTransfer.INSTANCE};
    m_viewer.addDragSupport(DND.DROP_MOVE, transfers, new DragSourceListener() {
      public void dragStart(DragSourceEvent event) {
        m_dragElements = getSelectedElements();
        m_dragCategory = m_dragElements.get(0) instanceof CategoryInfo;
        // check that we drag only categories or only entries
        for (Object element : m_dragElements) {
View Full Code Here

            hideSelfImportsFilter
        });

        viewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, new Transfer[] {
            LocalSelectionTransfer.getTransfer()
        }, new DragSourceListener() {
            public void dragStart(DragSourceEvent event) {}

            public void dragSetData(DragSourceEvent event) {
                LocalSelectionTransfer transfer = LocalSelectionTransfer.getTransfer();
                if (transfer.isSupportedType(event.dataType))
View Full Code Here

    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

    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

  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

TOP

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

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.