Missing preference about ResourceManager

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

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

Missing preference about ResourceManager

Postby sdatchley » Thu Oct 15, 2009 6:27 am

There used to be a preference "Add ResourceManager class to existing project as necessary"

With this documentation:
This preference determines whether the ResourceManager class is added to the project any time it is needed.

We currently have one plugin that has the current versions of both of the resource classes, and don't want the 2 classes generated each time
we do something with designer in our plugins. How can we turn off the auto generation like in previous versions?

Thanks,
Dean
sdatchley
 
Posts: 6
Joined: Thu Oct 15, 2009 6:13 am

Re: Missing preference about ResourceManager

Postby Eric Clayberg » Fri Oct 16, 2009 4:21 am

sdatchley wrote:We currently have one plugin that has the current versions of both of the resource classes, and don't want the 2 classes generated each time
we do something with designer in our plugins.

That isn't the way it works now, so I'm not sure what such a preference would actually accomplish.
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: Missing preference about ResourceManager

Postby sdatchley » Mon Oct 19, 2009 1:55 pm

Eric Clayberg wrote:
sdatchley wrote:We currently have one plugin that has the current versions of both of the resource classes, and don't want the 2 classes generated each time
we do something with designer in our plugins.

That isn't the way it works now, so I'm not sure what such a preference would actually accomplish.


So in our RCP app I have a plugin A that has ResourceManager and SWTResourceManager, plus alot of common images..

And 3 dozen other plugins that use this plugin A (which exports the com.swtdesigner package)

Now whenever we use swtdesigner in any of the other plugins, the 2 files are being generated in those plugins. We still want the code generated in designer to use either ResourceManager or SWTResourceManager when we pick images, fonts etc, but we want don't want copies of the 2 files in all of our plugins. When you say it isn't the way it works now, are you saying it shouldn't generate the 2 files or we have to have a set of these files in each of our plugins all referencing plugin A again that has the images? Currently, I am deleting the files when they show up, but this is tedious.

What would be nice is to be able to specify a interface implementation in the preferences to allow us to use our own resource management classes that designer could work with.

Thanks,
Dean
sdatchley
 
Posts: 6
Joined: Thu Oct 15, 2009 6:13 am

Re: Missing preference about ResourceManager

Postby Konstantin.Scheglov » Tue Oct 20, 2009 1:40 am

sdatchley wrote:So in our RCP app I have a plugin A that has ResourceManager and SWTResourceManager, plus alot of common images..

And 3 dozen other plugins that use this plugin A (which exports the com.swtdesigner package)

Now whenever we use swtdesigner in any of the other plugins, the 2 files are being generated in those plugins. We still want the code generated in designer to use either ResourceManager or SWTResourceManager when we pick images, fonts etc, but we want don't want copies of the 2 files in all of our plugins. When you say it isn't the way it works now, are you saying it shouldn't generate the 2 files or we have to have a set of these files in each of our plugins all referencing plugin A again that has the images? Currently, I am deleting the files when they show up, but this is tedious.


This should not happen - WindowBuilder should not generate ResourceManager if it is already in classpath.
See in attachment archive with two projects, note that project_useResourceManagers has no resource managers, it uses ones from project_withResourceManagers.
Code for Dialog_2 was generated using WindowBuilder, and no copies of resource managers were added.
Attachments
projectsAndResourceManagers.zip
Use single copy of resource managers.
(30.22 KiB) Downloaded 35 times
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: Missing preference about ResourceManager

Postby sdatchley » Tue Oct 20, 2009 11:14 am

Hi Konstantin,

1) I created a new workspace, imported the 2 projects.
2) Opened Dialog_2.java with designer
3) Added a button to the "container" composite in designer
4) changed font...
--> added button.setFont(SWTResourceManager.getFont("Garamond", 12, SWT.BOLD | SWT.ITALIC));
5) SWTResourceManager.java was added to "project_useResourceManagers"... but when I F3 (windows) SWTResourceManager in the editor
it takes me to the SWTResourceManager in the "project_withResourceManagers" project.
6) Tried restarting eclipse, F3 still takes me to the SWTResourceManager in the other project, although one exists locally.

If I delete the newly created SWTResourceManager, everything is fine and it uses the original one from your other project.

Briefly,
running sun jdk 6 release 16 (tried jdk 5 initially, same results), galileo sr1 (RCP distro)

I can send the full output configuration if you need it, don't want to post it here.

As for instantiations products, I'm running RCP Developer (and it's windowbuilder, showing SWT Designer 7.1.0.200909140923 for eclipse 3.5), CodePro A.P.(6.3.0.200908241812 for eclipse 3.5)

Thanks,
Dean
sdatchley
 
Posts: 6
Joined: Thu Oct 15, 2009 6:13 am

Re: Missing preference about ResourceManager

Postby Eric Clayberg » Wed Oct 21, 2009 8:26 pm

sdatchley wrote:SWT Designer 7.1.0.200909140923

Please give this a try using the latest SWT Designer v7.2 build.

Also note that is the resource manager files that you are using are out of date, the tool will automatically update them to keep them in sync.
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: Missing preference about ResourceManager

Postby Konstantin.Scheglov » Thu Oct 22, 2009 10:41 am

sdatchley wrote:If I delete the newly created SWTResourceManager, everything is fine and it uses the original one from your other project.


OK, I've reproduced and fixed this.
WindowBuilder checks that if resource manager exists, but not latest one, then it should be replaced with latest.
But there was not perfect implementation - we check manager in "has" project, but add in current project, i.e. in "use".
Fixed, now we will update existing copy.

As Eric already told, you should download latest build, which will include this fix.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests