在你的applicationworkbenchadvisor里面添加DropTarget对象然后DropTargetAdapter() { public void drop(DropTargetEvent event) { // add your codes.... } }这个是在RCP plugIn的里面完成调用就好!
final Display display = new Display(); final Shell shell = new Shell(display); shell.setText("GCT2"); final Canvas canvas = new Canvas(shell, SWT.NONE); canvas.setBounds(0, 0, 200, 200); // shell必须在canvas之后,gc 之前open shell.open(); GC gc = new GC(canvas); gc.drawLine(0, 10, 140, 150); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); }
public void drop(DropTargetEvent event) {
// add your codes....
}
}这个是在RCP plugIn的里面完成调用就好!
final Shell shell = new Shell(display);
shell.setText("GCT2");
final Canvas canvas = new Canvas(shell, SWT.NONE);
canvas.setBounds(0, 0, 200, 200);
// shell必须在canvas之后,gc 之前open
shell.open();
GC gc = new GC(canvas);
gc.drawLine(0, 10, 140, 150);
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}