Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Where did ThemeManager.getThemeAdapter(Class) disappeared from M5?
Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516533] Wed, 24 February 2010 11:20 Go to next message
Bogdan B. is currently offline Bogdan B.Friend
Messages: 50
Registered: July 2009
Member
Hi,

can somebody tell me where did org.eclipse.rwt.internal.theme.ThemeManager..getThemeAdapter (Class) disappeared from M5?
In M4 is still there.

You will probably tell me that I should not use a class from an internal package. All right, I'd do it, if you tell me how can I obtain the border width of a button in the current theme Smile . Meaning a way to replace:
ThemeManager themeMgr = ThemeManager.getInstance();
IControlThemeAdapter buttonThemeAdapter = ( IControlThemeAdapter)themeMgr.getThemeAdapter( Button.class );
int border = buttonThemeAdapter.getBorderWidth( this );
Re: Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516558 is a reply to message #516533] Wed, 24 February 2010 11:59 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Replace your code with the following:
IControlThemeAdapter themeAdapter =
( IControlThemeAdapter )control.getAdapter( IThemeAdapter.class );

HTH
Rüdiger

On 24.02.2010 12:20, Bogdan B. wrote:
> Hi,
>
> can somebody tell me where did
> org.eclipse.rwt.internal.theme.ThemeManager..getThemeAdapter (Class)
> disappeared from M5? In M4 is still there.
>
> You will probably tell me that I should not use a class from an internal
> package. All right, I'd do it, if you tell me how can I obtain the
> border width of a button in the current theme :) . Meaning a way to
> replace:
> ThemeManager themeMgr = ThemeManager.getInstance();
> IControlThemeAdapter buttonThemeAdapter = (
> IControlThemeAdapter)themeMgr.getThemeAdapter( Button.class );
> int border = buttonThemeAdapter.getBorderWidth( this );
Re: Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516562 is a reply to message #516533] Wed, 24 February 2010 12:06 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
.... or if you don't have an instance of a button ( like in the Upload
widget from sandbox ) create your own theme adapter - see
Upload#getButtonBorder() and UploadThemeAdapter.

HTH,
Ivan

On 2/24/2010 1:20 PM, Bogdan B. wrote:
> Hi,
>
> can somebody tell me where did
> org.eclipse.rwt.internal.theme.ThemeManager..getThemeAdapter (Class)
> disappeared from M5? In M4 is still there.
>
> You will probably tell me that I should not use a class from an
> internal package. All right, I'd do it, if you tell me how can I
> obtain the border width of a button in the current theme :) .
> Meaning a way to replace:
> ThemeManager themeMgr = ThemeManager.getInstance();
> IControlThemeAdapter buttonThemeAdapter = (
> IControlThemeAdapter)themeMgr.getThemeAdapter( Button.class );
> int border = buttonThemeAdapter.getBorderWidth( this );
Re: Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516569 is a reply to message #516558] Wed, 24 February 2010 12:33 Go to previous messageGo to next message
Bogdan B. is currently offline Bogdan B.Friend
Messages: 50
Registered: July 2009
Member
Sorry, I only saw now Ivan's post. I'll try it, please ignore the following!

Thank you!
Could you give me a hint please of what should I do if I needed this code inside a RAP custom widget and I have no instance of a "control"?

Rüdiger Herrmann wrote on Wed, 24 February 2010 06:59
Replace your code with the following:
IControlThemeAdapter themeAdapter =
( IControlThemeAdapter )control.getAdapter( IThemeAdapter.class );


[Updated on: Wed, 24 February 2010 12:35]

Report message to a moderator

Re: Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516623 is a reply to message #516569] Wed, 24 February 2010 15:30 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Bogdan,

see my comment below.. :-)

Best,
Ivan

On 2/24/2010 2:33 PM, Bogdan B. wrote:
> Thank you!
> Could you give me a hint please of what should I do if I needed this
> code inside a RAP custom widget and I have no instance of a "control"?
>
> Rüdiger Herrmann wrote on Wed, 24 February 2010 06:59
>> Replace your code with the following:
>> IControlThemeAdapter themeAdapter =
>> ( IControlThemeAdapter )control.getAdapter( IThemeAdapter.class );
>
>
Re: Where did ThemeManager.getThemeAdapter(Class) disappeared from M5? [message #516883 is a reply to message #516562] Thu, 25 February 2010 13:10 Go to previous message
Bogdan B. is currently offline Bogdan B.Friend
Messages: 50
Registered: July 2009
Member
Thank you, Ivan, this is exactly what I needed! Smile

Ivan Furnadjiev wrote on Wed, 24 February 2010 07:06
.... or if you don't have an instance of a button ( like in the Upload
widget from sandbox ) create your own theme adapter - see
Upload#getButtonBorder() and UploadThemeAdapter.

Previous Topic:IFontProvider NOT workiing
Next Topic:RAP and Jetty 7
Goto Forum:
  


Current Time: Sun Dec 05 05:44:32 GMT 2021

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

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

Back to the top