Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wb-xwt-dev] need help about WB and XWT for custom widget

Hello everybody,

       I’m a developer in the Eclipse Papyrus Team (https://www.eclipse.org/papyrus/ ). In Papyrus, we have Properties View described in XWT.

These XWT files references our own editors, which are not instance of Composite or Control.

 

My current works consists on the integration of all these editors with WindowBuilder, to be able to edit our Properties View.

- I declared a palette in a plugin.xml file, for the toolkit “org.eclipse.wb.rcp”.

- I created .wbp-component.xml files, referencing a x-model class for each of them, extending ControlInfo and added this parameter : <parameter name="XWT.hasModel">true</parameter>

 

Now, it seems work fine now, the Component Tree, the Palette and the selection of my widget in the renderer are OK, but I patched WindowBuilder to make it working.

 

I need help on these points :

                1. first patch:

- I removed the final modifier for the method org.eclipse.wb.internal.xwt.model.widgets.ControlInfo#getControl(), in order to be able to return the real control wrapped by our editor.

- In org.eclipse.wb.internal.xwt.model.layout.grid.GridLayoutInfo.replaceGridLayout() I replace the line

                               Control control = (Control) controlInfo.getObject();    with this one

Control control = controlInfo.getControl();

                               -  I have difficulties to understand, why it exists these 3 methods :

                                               - final Object getObject(), often casted in Control

                                               - final Control getControl(), it returns getObject()

                                               - Object getComponentObject, it returns getObject(), but I can override it. Unfortunately, this method is not called by org.eclipse.wb.internal.xwt.model.layout.grid.GridLayoutInfo.replaceGridLayout(), so I need to patch it too.

                              

 

                - Please, could you tell me if there is another way to make WB working with editors which are not instance of Control ?

                - If not, can I hope a such gerrit contribution will be accepted ?

 

 

2. second patch:

                At the beginning of my work, WindowBuilder generate an exception when I tried to open our XWT files. It was a ClassLoader trouble, because a part of the classes was loaded with org.eclipse.wb.internal.core.utils.reflect.ProjectClassLoader

and another one by the standard one, so I generate a ClassCastException. I assume it was because one of the class was in the Workspace and the other one only in the installation, but I admit, I’m not very familiar with ClassLoader).

                                To be more precise, we have 1 class called ‘A’ which implements an Interface ‘B’ and with the loading, we get (A instanceof B) == false!!!

 

I fix this trouble loading the Papyrus Properties View framework in the method org.eclipse.wb.internal.xwt.editor.XwtEditor.createDesignPage()). Of course, it is a temporary solution, to allow be to continue to work.

                               Please, do you have some ideas to force a good loading and remove this bad fix  ?

 

 

 

Best Regards,

--

Vincent LORENZO

01-69-08-17-24

CEA Saclay Nano-INNOV

Institut CARNOT CEA LIST

DILS/LISE

Point Courrier n° 174

91 191 Gif sur Yvette CEDEX

 


Back to the top