Java Code Examples for org.eclipse.gef.GraphicalViewer#addDragSourceListener()

The following examples show how to use org.eclipse.gef.GraphicalViewer#addDragSourceListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ERDiagramEditor.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void initDragAndDrop(final GraphicalViewer viewer) {
    final AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);

    final AbstractTransferDropTargetListener dropTargetListener = new ERDiagramTransferDropTargetListener(viewer, TemplateTransfer.getInstance());

    viewer.addDropTargetListener(dropTargetListener);
}
 
Example 2
Source File: MainDiagramEditor.java    From erflute with Apache License 2.0 5 votes vote down vote up
protected void initDragAndDrop(GraphicalViewer viewer) {
    final AbstractTransferDragSourceListener dragSourceListener =
            new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);
    final AbstractTransferDropTargetListener dropTargetListener =
            new ERDiagramTransferDropTargetListener(viewer, TemplateTransfer.getInstance());
    viewer.addDropTargetListener(dropTargetListener);
}
 
Example 3
Source File: ERDiagramEditor.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
protected void initDragAndDrop(GraphicalViewer viewer) {
	AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(
			viewer, TemplateTransfer.getInstance());
	viewer.addDragSourceListener(dragSourceListener);

	AbstractTransferDropTargetListener dropTargetListener = new ERDiagramTransferDropTargetListener(
			viewer, TemplateTransfer.getInstance());

	viewer.addDropTargetListener(dropTargetListener);
}