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);
}
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);
}
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);
}
Aggregations