Icons for Palette

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Icons for Palette

Postby mkornatzki » Thu Aug 13, 2009 8:13 am

Hello,

in the "old" SwingDesigner (V6.9) it was possible to configure the icon shown for a component.
In the actual SwingDesigner i miss this function (or i don't know how to add one).

Is it possible to show my own icon for a componnet or the factory-methods?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Thu Aug 13, 2009 8:35 am

Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Fri Aug 14, 2009 1:45 am

thank you for the documentation.

maybe i misunderstood something and you can help me.

i have a class DateValueField in com.mypackage in the folder src.
to add an icon to the palette i figure out that i can add a folder wbp-meta (at same position as src) and then i add the package com.mypackage and there i store a DateValueField.gif.

The component in the palette didn't change the image.

The second question: i also add a file in the same location named DateValueField.wbp-component.xml with
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.instantiations.com/D2/WBPComponent">
    <description>Datumseingabefeld</description>
</component>


and hope that this discription was used for the component in the palette.

Can you please give me an advice what my mistakes are?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Fri Aug 14, 2009 5:34 am

As long as the wbp-meta directory is in the correct place and everything is named correctly, what you have done should work.

As an experiment, try placing those files in the exact same package as the component's .java file to see if they work.

If you want to send us the project (or maybe just a screen shot of its exact structure), we might be able to see what is wrong.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Sun Aug 16, 2009 3:21 pm

hello,

i can not upload images to the forum so i tried the easy way and copy the image and the xml-file to the same place as the java-file is.
i make a restart of the eclipse...nothing changed and i delete the component and add it again...nothing happend.
btw i tried an icon in gif and png.
the test was made with the the latest build (20090814...)

do you have any idea?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Sun Aug 16, 2009 8:42 pm

No idea. Send us an test project and we will take a look.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Fri Sep 18, 2009 1:55 am

Hello,

now i know how to post screenshots :)
This is my project structure
Image
My DateValueField.wbp-component.xml looks like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.instantiations.com/D2/WBPComponent">
    <description>Datumseingabefeld</description>
</component>

No image and the wrong description but the image is shown in the structure-view
Image

If i try also to set the properties
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.instantiations.com/D2/WBPComponent">
    <description>Datumseingabefeld</description>
   
    <!-- PROPERTIES -->
    <properties-preferred names="backgroundtext value">
    <properties-hidden names="text">
</component>

i get aWindowBuildError "No detailed description for error (502), please contact support."

The location seems to be right, because of the error but what is my mistake?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Fri Sep 18, 2009 6:01 am

mkornatzki wrote:No image and the wrong description but the image is shown in the structure-view

The palette caches the presentation of a component (including icon) to improve performance. You can remove the older cached files from .metadata\.plugins\com.instantiations.designer.core\descriptions\

mkornatzki wrote:i get aWindowBuildError "No detailed description for error (502), please contact support."
The location seems to be right, because of the error but what is my mistake?

The "<properties>" tags are not properly closed.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Sun Sep 20, 2009 11:07 pm

thank you very much.

now it works.

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby mkornatzki » Sun Sep 20, 2009 11:31 pm

no, not all works :(

after deleting the cache-file i can see the icon in the palette and my preffered properties.
The description is not the description out of the file in the tags description. it shows the classname.

I deleted the component from the palette and delete .metadata\.plugins\com.instantiations.designer.core\descriptions\ then i restart eclipse and add the component.
Should i have to delete more?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Mon Sep 21, 2009 4:46 am

mkornatzki wrote:after deleting the cache-file i can see the icon in the palette and my preffered properties.

If you update to the latest Swing Designer v7.1 build, you won't need to continue to delete the cache file as it will no longer cache component descriptions from components defined in user projects.

mkornatzki wrote:The description is not the description out of the file in the tags description. it shows the classname.

As this works in general, I can only guess that there is a problem with your XML file (maybe some syntax issue as before). If it is a caching issue of some sort, updating to the latest build should help.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Mon Sep 21, 2009 11:15 pm

i only delete the cache-file because it works for the images.
i update my swingdesigner every day.

this is the *.wbp-component.xml for my component:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.instantiations.com/D2/WBPComponent">
    <description>Datumseingabefeld</description>
   
    <!-- PROPERTIES -->
    <properties-preferred names="backgroundText value" />
    <properties-hidden names="text" />
</component>


i tried to add the component with "add component" and "choose component" but the description is nearly the same (the classname).
btw. i use eclipse 3.5

maybe you see another failure in my xml-file.

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Wed Sep 23, 2009 5:18 am

There are two different ways to add a component to the palette: 1) use a palette definition file or 2) use the Palette Manager and the Add Component dialog.

When you use the Add Component dialog, the description shown in the palette is the one entered in the Description field of the dialog.

Image

In the latest build, if that is left blank or at its default value (the class name), it will now use the description provided in the component definition file.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Icons for Palette

Postby mkornatzki » Thu Sep 24, 2009 12:02 am

yes..., now it works as i expected :)

thanks,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Icons for Palette

Postby Eric Clayberg » Thu Sep 24, 2009 3:31 am

Glad it is now working for you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Next

Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest