org.eclipse.swt.dnd.DropTargetListener Java Examples

The following examples show how to use org.eclipse.swt.dnd.DropTargetListener. 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 Project: neoscada   Author: eclipse   File: ChartManager.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public DropTarget createDropTarget ( final Transfer[] transfers, final DropTargetListener dropTargetListener )
{
    checkWidget ();

    final DropTarget target = new DropTarget ( this.chartArea, DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_LINK );
    target.setTransfer ( transfers );
    target.addDropListener ( dropTargetListener );
    return target;
}
 
Example #2
Source Project: tlaplus   Author: tlaplus   File: ApplicationWorkbenchWindowAdvisor.java    License: MIT License 5 votes vote down vote up
public void preWindowOpen()
{
    IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
    configurer.setInitialSize(new Point(800, 600));
    configurer.setShowFastViewBars(true);
    configurer.setShowStatusLine(true);
    configurer.setShowProgressIndicator(true);
    configurer.setShowCoolBar(false);
    
    // A DropTargetAdapter is need for editor DND support
    final DropTargetListener dtl = new EditorAreaDropAdapter(
            configurer.getWindow());
    configurer.configureEditorAreaDropListener(dtl);
}
 
Example #3
Source Project: statecharts   Author: Yakindu   File: ExampleDropTargetInstaller.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void hookRecursive(Control child, DropTargetListener dropListener) {
	DropTarget childTarget = findDropTarget(child);
	if (childTarget != null) {
		registerWithExistingTarget(childTarget);
		registerDropListener(childTarget, dropListener);
	}
	if (child instanceof Composite) {
		Composite composite = (Composite) child;
		Control[] children = composite.getChildren();
		for (Control control : children) {
			hookRecursive(control, dropListener);
		}
	}
}
 
Example #4
Source Project: statecharts   Author: Yakindu   File: ExampleDropTargetInstaller.java    License: Eclipse Public License 1.0 4 votes vote down vote up
protected void registerDropListener(DropTarget target, DropTargetListener dropListener) {
	target.removeDropListener(dropListener);
	target.addDropListener(dropListener);
}
 
Example #5
Source Project: Eclipse-Postfix-Code-Completion   Author: trylimits   File: PackageViewerWrapper.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener) {
	fViewer.addDropSupport(operations, transferTypes, listener);
}