use of org.eclipse.jface.util.DelegatingDragAdapter in project webtools.sourceediting by eclipse.
the class ConfigurableContentOutlinePage method createControl.
/**
* @see ContentOutlinePage#createControl
*/
public void createControl(Composite parent) {
super.createControl(parent);
getTreeViewer().setUseHashlookup(true);
ColumnViewerToolTipSupport.enableFor(getTreeViewer());
IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
if (page != null) {
fEditor = page.getActiveEditor();
}
fDragAdapter = new DelegatingDragAdapter();
fDragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
fDropAdapter = new DelegatingDropAdapter();
fDropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
setConfiguration(getConfiguration());
/*
* ContentOutlinePage only implements ISelectionProvider while the
* tree viewer implements both ISelectionProvider and
* IPostSelectionProvider. Use an ISelectionProvider that listens to
* post selection from the tree viewer and forward only post selection
* to the selection service.
*/
getTreeViewer().addPostSelectionChangedListener(fSelectionProvider.getPostSelectionChangedListener());
getTreeViewer().addSelectionChangedListener(fSelectionProvider.getSelectionChangedListener());
if (fDoubleClickProvider == null) {
fDoubleClickProvider = new DoubleClickProvider();
}
getTreeViewer().addDoubleClickListener(fDoubleClickProvider);
getSite().setSelectionProvider(fSelectionProvider);
}
use of org.eclipse.jface.util.DelegatingDragAdapter in project mylyn.docs by eclipse.
the class DndConfigurationStrategy method configure.
public void configure(CommandManager commandManager, Control control, ISelectionProvider provider) {
dragAdapter = new DelegatingDragAdapter();
dragSource = new DragSource(control, DND.DROP_COPY | DND.DROP_MOVE);
dragAdapter.addDragSourceListener(new OutlineDragSourceListener(provider));
dragSource.addDragListener(dragAdapter);
dragSource.setTransfer(dragAdapter.getTransfers());
dropAdapter = new DelegatingDropAdapter();
dropTarget = new DropTarget(control, DND.DROP_COPY | DND.DROP_MOVE);
dropAdapter.addDropTargetListener(new OutlineDropTargetListener(commandManager));
dropTarget.addDropListener(dropAdapter);
dropTarget.setTransfer(dropAdapter.getTransfers());
}
Aggregations