CTabFolder tabFolder = <"CTabFolder" composite that hosts editor-parts>; int Operations = DND.DROP_COPY DND.DROP_DEFAULT; DragSource dragSource = new DragSource(tabFolder, operations); Transfer[] transferTypes = new Transfer[] {EditorInputTransfer.getInstance()}; dragSource.setTransfer(transferTypes); dragSource.addDragListener(new DragSourceListener() { public void dragStart(DragSourceEvent dsEvent) { } public void dragSetData(DragSourceEvent dsEvent) { //code to perform operation-1 and operation-2 } public void dragFinished(DragSourceEvent dsEvent) { } });
新闻热点
疑难解答