Hello all developers
I have a question about Zest framework. I am trying to use Zest to draw a
UML class diagram in an eclipse plugin.
1) I thought the only possible way to do so, is using pure SWT + Zest
instead of using Jface content providers. since they are not flexible for
drawing custom Node's figures. Is that so?
2) So I used SWT approach by the following code:
public class SWTGraphView extends ViewPart implements IModelChangeListener{
private Composite parent=null;
//public Graph graph=null;
public void createPartControl(Composite parent) {
ModelBase.getInstance().addModelChangeListener(this);
this.parent=parent;
final Display d = parent.getDisplay();
Graph g = new Graph(parent, SWT.NONE);
g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
GraphNode n1 = new GraphNode(g, SWT.NONE);
GraphNode n2 = new GraphNode(g, SWT.NONE);
n1.setCustomFigure(UMLExample.createClassFigure1());
n2.setCustomFigure(UMLExample.createClassFigure2());
new GraphConnection(g, SWT.NONE, n1, n2);
g.setLayoutAlgorithm(new SpringLayoutAlgorithm(
LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
.........................
}
}
However, I get the following error which I do not get when using Zest Jface
examples with simple node shapes in as a plugin:
java.lang.NoClassDefFoundError:
org/eclipse/mylyn/zest/core/widgets/internal/IContainer
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
.....................
I used whatever bundling approach I knew (e.g. Require-Bundle: in manifest
file or same jar in the plug-in). Is it possible that, it is because Zest
packaging (e.g IContainer being in internal package)? or you think it is
only classloaders and ....?
Thank you in advance for your answers,
Hamoun
_______________________________________________
nebula-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/nebula-dev