I tried to add our custom STLayout to window builder but it does not render correctly.
I also tried another Layout with simpler constraints which did render correctly in WindowBuilder.
This is what it looks like in window builder:
And this is what it should look like.
This is what I've done to add the new Layout:
- create a plugin project with STLayoutInfo and STLayoutEditPolicy. These classes do nothing yet but the other CustomLayout I tried showed up fine with empty Info and Policy.
- create the component description: STLayout.wbp-component.xml
The attachement contains 2 workspaces:
- WindowBuilderSTLayout: Contains the com.shark.eclipse.wb.swing.STLayout Plugin Project and the STLayout
- WindowBuilderSTLayoutEclipseApplication: The Eclipse Run Application workspace with the Layout Test class.
WindowBuilder executes method invocations and field assignments only for know objects, such as components or known layout constraints.
Your FramingSpec is not know for standard WindowBuilder.
You should tell WindowBuilder that this class belongs to Swing toolkit.
Put into wbp-meta, in same package as STLayout.wbp-component.xml, new file FramingSpec.wbp-forced-toolkit.txt, with content "org.eclipse.wb.swing" (i.e. ID of Swing toolkit). After this WindowBuilder will create model for it, execute field assignments and even allow to edit properties.
to allow Component selection editor. If this is still not exactly what you want, look on org.eclipse.wb.internal.swt.model.layout.form.ControlSelectionPropertyEditor - it is for SWT and Control, but it should be easy to adapt for Swing.