Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"?
icon5.gif  How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"? [message #838831] Sat, 07 April 2012 18:47 Go to next message
Ildar Kh is currently offline Ildar KhFriend
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 19: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 20:47 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
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 #839174 is a reply to message #838884] Sun, 08 April 2012 08:06 Go to previous messageGo to next message
Ildar Kh is currently offline Ildar KhFriend
Messages: 2
Registered: April 2012
Junior Member
Thank you for reply.
1. Problem is that jars from firt and second projects can be used separately. In the third project there should not be declared this category otherwise there would be unneсessary dependency in the third project on the other projects. In another case if we would declare the category in the first project only ,for example, then we would get dependency in the second project on the project 1. I want there would not be any cross dependencies between projects 1, 2 and the third. Also I don't want to declare the category in the project 3, because project 3 should know nothing about other pluggable jar modules. So I want to declare the category in the projects 1 and 2 but with checking if it is created already to avoid recreating. Is it possible somehow?
2. Can I add a "propery 1" to a "component 1" so that possible values for this property would be selected from dropdown list in the properties view but items for this list would not be static but given from method in the "component 1". Also I need to have "property 2" in the component 1 that when it would be changed then items in "the property 1" would be recreated too. Is that possible to create?
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 22:54 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
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.
Re: How to check is category created in "com.google.gdt.eclipse.designer.wbp-palette.xml"? [message #861585 is a reply to message #840286] Sat, 28 April 2012 16:44 Go to previous message
Hans Mueller is currently offline Hans MuellerFriend
Messages: 28
Registered: April 2012
Junior Member
very good
Previous Topic:Error parsing refactored code
Next Topic:2 performance problems with wb.
Goto Forum:
  


Current Time: Thu Apr 18 06:55:27 GMT 2024

Powered by FUDForum. Page generated in 0.02820 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top