我正在尝试使用 draw2d 进行插件开发。现在,我的代码中只有:
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.*;
public class GraphView extends ViewPart {
public GraphView() {
}
@Override
public void createPartControl(Composite parent) {
//use LightweightSystem to create the bridge between SWT and draw2D
final LightweightSystem lws = new LightweightSystem(new Canvas(parent, SWT.NONE));
}
@Override
public void setFocus() {
// TODO Auto-generated method stub
}
}
当我启动我的 Eclipse 应用程序时,我得到了 org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: org/eclipse/draw2d/LightweightSystem 。我已将 org.eclipse.draw2d 作为外部 jar 添加到我的项目中。
有人可以帮我吗?提前致谢!