Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2812 times and has 4 replies Next Thread
Alex42
Newbie




Joined: Dec 22, 2011
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
confused how to add package resource bundles?

Hi,

what's the correct way to add a package resource (package.properties) bundle from inside a plugin to the UserPreferences in a way that a panel (defined inside the plugin) can access the bundle?

As far as I've seen the plugin's classloader is not registered and therefore not returned from UserPreferences#getResourceClassLoaders(). But adding it to this list does not solve the issue as the used class is FileUserPreferences and this owns a list of classloaders by its own which is initialized only inside updateSupportedLanguages() which is private and not called after all the plugins were loaded. :-(

If there's no way to register a plugin's classloader to resolve resources correctly the attached patch would solve the issue. (Hope that I'm able to attach a file as I do not see any way right now confused)

Regards,
Alex
[Dec 26, 2011, 4:35:35 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Alex42
Newbie




Joined: Dec 22, 2011
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to add package resource bundles?

Sorry but haven't found a way to attach a file to my post.
Alex
[Dec 26, 2011, 4:41:31 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to add package resource bundles?

What about using the getPluginClassLoader method?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 26, 2011, 5:08:31 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Alex42
Newbie




Joined: Dec 22, 2011
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to add package resource bundles?

I've seen it but then I can't use SwingTools#getLocalizedLabelText(). If you're aware of this it's ok for me but I would prefer to handle resources in the same way all over the application.

Regards,
Alex
[Dec 26, 2011, 5:20:04 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to add package resource bundles?

That wouldn't work in the current implementation.
Plug-in class loaders and language libraries class loaders are different and not handled at the same place.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 26, 2011, 6:45:50 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved