How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"? [message #838831] |
Sat, 07 April 2012 14:47  |
Ildar Kh Messages: 2 Registered: April 2012 |
Junior Member |
|
|
Hello people. I use Window Builder for GWT Project. I downloaded it from google's site as "GWT Designer". As I understood theese are the same thing. Please do anybody know how to solve some my problems?
1. I have two projects. In first I have two components. The components should be in certain category, for example "Category 1". I created in com.google.gdt.eclipse.designer.wbp-palette.xml this category and inserted components into it. In the second project I have three components and I also added the same category and added theese three components into it. When I added jars exported from theese projects into the the third project, then it the third project I saw that category "Category 1", but only with two components from the first project in the components palette. Obviously it happened due to initializer of components palette recreated this category because this category was mentioned to create in both jars. Is it possible to check is the category already created? Or is there any instruction not to recreate category but simply to add corresponding components to it?
2. The second question is for example I have a datagrid added component in the GUI form editor, also there is a datasource component bound to the datagrid. In the properties editor of datagrid I need to have property for example "setQueryOfDatasource" with options. Theese options should be given from execution of method of that datasource.How can I do it using com.google.gdt.eclipse.designer.wbp-palette.xml or *.component-wbp.xml?
[Updated on: Sat, 07 April 2012 15:00] Report message to a moderator
|
|
|
| Re: How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"? [message #838884 is a reply to message #838831] |
Sat, 07 April 2012 16:47   |
Konstantin Scheglov Messages: 547 Registered: July 2009 |
Senior Member |
|
|
1. You don't need to declare "category" second time. Declare it one time in one project and in other project use just "component", but with "category" attribute, which specifies same value as for "id" attribute in "category" declaration.
setFileContent(
"wbp-meta",
TOOLKIT_ID + ".wbp-palette.xml",
getSourceDQ(
"<palette>",
" <category id='categoryId.1' name='name 1' description='desc 1'/>",
" <component class='javax.swing.JButton' category='categoryId.1'/>",
"</palette>"));
2. I don't understand your question. In general you can use "method" to specify method which can be executed during analyzing source code.
<!-- METHODS -->
<methods>
<!-- addColumn() -->
<method name="addColumn">
<parameter type="com.google.gwt.user.cellview.client.Column" child="true"/>
</method>
<method name="addColumn">
<parameter type="com.google.gwt.user.cellview.client.Column" child="true"/>
<parameter type="com.google.gwt.user.cellview.client.Header"/>
</method>
</methods>
Konstantin Scheglov,
Google, Inc.
|
|
|
|
| Re: How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"? [message #840286 is a reply to message #839174] |
Mon, 09 April 2012 18:54   |
Konstantin Scheglov Messages: 547 Registered: July 2009 |
Senior Member |
|
|
1. OK, now if you will define second category with same ID as existing category, WindowBuilder will use first category. If there was no such category - it will create new one. This is implemented in trunk now.
2. No, you can not do this using just wbp-component.xml descriptions. You will need to create extension plugin. Look on some existing simple plugin, for example org.eclipse.wb.rcp.swing2swt. org.eclipse.wb.internal.rcp.swing2swt.layout.BorderLayoutInfo shows how to add custom property.
Konstantin Scheglov,
Google, Inc.
|
|
|
|
Powered by
FUDForum. Page generated in 0.01797 seconds