Search in sources :

Example 21 with DropTarget

use of org.eclipse.swt.dnd.DropTarget in project cubrid-manager by CUBRID.

the class UnifyHostConfigDialogDNDController method registerDropTarget.

/**
	 * register drag source and DB tree target
	 */
public void registerDropTarget() {
    synchronized (this) {
        DropTarget target = new DropTarget(dialog.getTableComposite(), DND.DROP_MOVE);
        target.setTransfer(new Transfer[] { TextTransfer.getInstance() });
        target.addDropListener(new DropTargetAdapter() {

            /**
				 * @see org.eclipse.swt.dnd.DropTargetAdapter#drop(org.eclipse.swt.dnd.DropTargetEvent)
				 * @param event the information associated with the drop event
				 */
            public void drop(DropTargetEvent event) {
                addHost();
            }
        });
    }
}
Also used : DropTargetAdapter(org.eclipse.swt.dnd.DropTargetAdapter) DropTargetEvent(org.eclipse.swt.dnd.DropTargetEvent) DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 22 with DropTarget

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

the class Schema2XMLDragAndDropHandler method createDropTarget.

/**
     * 
     * create DropTarget.
     */
private void createDropTarget() {
    if (loopDropTarget != null) {
        loopDropTarget.dispose();
    }
    loopDropTarget = new DropTarget(linker.getTarget(), DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    loopDropTarget.setTransfer(new Transfer[] { LocalDataTransfer.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)

Example 23 with DropTarget

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

the class DragNDrop method createDropTarget.

/**
     * 
     * create DropTarget.
     */
private void createDropTarget(DropTargetListener targetListener) {
    if (dropTarget != null) {
        dropTarget.dispose();
    }
    dropTarget = new DropTarget(draggableTable, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    dropTarget.setTransfer(new Transfer[] { TableEntriesTransfer.getInstance() });
    dropTarget.addDropListener(targetListener);
}
Also used : DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 24 with DropTarget

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

the class DropTargetOperationListener method addControl.

/**
     * DOC amaumont Comment method "addControl".
     * 
     * @param outputTablesZoneView
     */
public void addControl(Control control) {
    DropTarget dropTarget = new DropTarget(control, authorizedOperations);
    dropTarget.setTransfer(authorizedTransfers);
    dropTarget.addDropListener(dropTargetListener);
}
Also used : DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 25 with DropTarget

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

the class SchemaXMLDragAndDropHandler method createDropTarget.

/**
     * 
     * create DropTarget.
     */
private void createDropTarget() {
    if (loopDropTarget != null) {
        loopDropTarget.dispose();
    }
    loopDropTarget = new DropTarget(linker.getTarget(), DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    loopDropTarget.setTransfer(new Transfer[] { LocalDataTransfer.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