I have a ViewPart in Eclipse that I want to add multiple composites, one per zest graph (that can be selective viewed or hidden by the user) along with controls, labels and combo boxes. I have been working with mxgraph to do this, but mxgraph is not fully compatible with the eclipse ViewPart, so I want to switch to Zest.
I have tried to create a zest graph and add it into an embedded composite as:
m_swtAwtComponent1 = new Composite(m_parentComposite, SWT.EMBEDDED);
m_swtAwtComponent1.setLayoutData(grid);
viewer = new GraphViewer(m_swtAwtComponent1, SWT.NONE);
But this does not work.
Also, I would "like" a method on the zest Graph or on the GraphViewer that would allow me set the configuration within GridLayout and a method to change the parent component. Is it possible to do this?
The parent component cannot be changed - that is an SWT decision.
However, if I understand correctly your task, you could create an SWT SashForm, and use that as the container of both the Zest graph and its corresponding Composite with the Combos. The SashForm also has an API to set one of its Sashes the only visible component (with the setMaximizedControl method).
So you would need something like follows (not checked in editor, only showing the basic idea: