use of org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method initializeDrop.
protected void initializeDrop(ITextViewer textViewer) {
int operations = DND.DROP_COPY | DND.DROP_MOVE;
fDropTarget = new DropTarget(textViewer.getTextWidget(), operations);
fDropAdapter = new ReadOnlyAwareDropTargetAdapter(true);
fDropAdapter.setTargetEditor(this);
fDropAdapter.setTargetIDs(getConfigurationPoints());
fDropAdapter.setTextViewer(textViewer);
fDropTarget.setTransfer(fDropAdapter.getTransfers());
fDropTarget.addDropListener(fDropAdapter);
fDropTarget.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
fDropTarget.removeDropListener(fDropAdapter);
fDropTarget.removeDisposeListener(this);
fDropTarget.dispose();
}
});
}
Aggregations