Search in sources :

Example 26 with DropTarget

use of org.eclipse.swt.dnd.DropTarget in project tdi-studio-se by Talend.

the class ReconcilerViewer method addDropSupport.

/**
     * Adds support for dropping items into this viewer via a user drag-and-drop operation.
     * 
     * @param operations a bitwise OR of the supported drag and drop operation types ( <code>DROP_COPY</code>,
     * <code>DROP_LINK</code>, and <code>DROP_MOVE</code>)
     * @param transferTypes the transfer types that are supported by the drop operation
     * @param listener the callback that will be invoked after the drag and drop operation finishes
     * @see org.eclipse.swt.dnd.DND
     */
public void addDropSupport(int operations, Transfer[] transferTypes, final DropTargetListener listener) {
    Control control = getTextWidget();
    DropTarget dropTarget = new DropTarget(control, operations);
    dropTarget.setTransfer(transferTypes);
    dropTarget.addDropListener(listener);
}
Also used : IInformationControl(org.eclipse.jface.text.IInformationControl) SourceViewerInformationControl(org.eclipse.jdt.internal.ui.text.java.hover.SourceViewerInformationControl) Control(org.eclipse.swt.widgets.Control) DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 27 with DropTarget

use of org.eclipse.swt.dnd.DropTarget in project tdi-studio-se by Talend.

the class JSONToSchemaDragAndDropHandler method createDropTarget.

/**
     * 
     * create DropTarget.
     */
private void createDropTarget() {
    if (loopDropTarget != null) {
        loopDropTarget.dispose();
    }
    loopDropTarget = new DropTarget(loopTable, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    loopDropTarget.setTransfer(new Transfer[] { XPathTransfer.getInstance() });
    DropTargetListener targetListener = new TableDropTargetListener();
    loopDropTarget.addDropListener(targetListener);
    if (fieldsDropTarget != null) {
        fieldsDropTarget.dispose();
    }
    fieldsDropTarget = new DropTarget(fieldsTable, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    fieldsDropTarget.setTransfer(new Transfer[] { XPathTransfer.getInstance() });
    targetListener = new TableDropTargetListener();
    fieldsDropTarget.addDropListener(targetListener);
}
Also used : TransferDropTargetListener(org.eclipse.jface.util.TransferDropTargetListener) DropTargetListener(org.eclipse.swt.dnd.DropTargetListener) DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 28 with DropTarget

use of org.eclipse.swt.dnd.DropTarget in project tdi-studio-se by Talend.

the class JSONTree2SchemaDragAndDropHandler method createDropTarget.

private void createDropTarget() {
    if (loopDropTarget != null) {
        loopDropTarget.dispose();
    }
    loopDropTarget = new DropTarget(table, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    loopDropTarget.setTransfer(new Transfer[] { XPathTransfer.getInstance() });
    DropTargetListener targetListener = new TableDropTargetListener();
    loopDropTarget.addDropListener(targetListener);
}
Also used : TransferDropTargetListener(org.eclipse.jface.util.TransferDropTargetListener) DropTargetListener(org.eclipse.swt.dnd.DropTargetListener) DropTarget(org.eclipse.swt.dnd.DropTarget)

Aggregations

DropTarget (org.eclipse.swt.dnd.DropTarget)28 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)12 DropTargetAdapter (org.eclipse.swt.dnd.DropTargetAdapter)8 DropTargetListener (org.eclipse.swt.dnd.DropTargetListener)8 TransferDropTargetListener (org.eclipse.jface.util.TransferDropTargetListener)6 Point (org.eclipse.swt.graphics.Point)5 Transfer (org.eclipse.swt.dnd.Transfer)4 DragSource (org.eclipse.swt.dnd.DragSource)3 TextTransfer (org.eclipse.swt.dnd.TextTransfer)3 Control (org.eclipse.swt.widgets.Control)3 TreeItem (org.eclipse.swt.widgets.TreeItem)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 StyledText (org.eclipse.swt.custom.StyledText)2 DragSourceEvent (org.eclipse.swt.dnd.DragSourceEvent)2 DragSourceListener (org.eclipse.swt.dnd.DragSourceListener)2 TreeDragSourceEffect (org.eclipse.swt.dnd.TreeDragSourceEffect)2 TreeDropTargetEffect (org.eclipse.swt.dnd.TreeDropTargetEffect)2 CubridDnDNodeHandler (com.cubrid.common.ui.common.navigator.dnd.CubridDnDNodeHandler)1 CubridGroupNode (com.cubrid.common.ui.spi.model.CubridGroupNode)1