Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Style setting mechanism
Style setting mechanism [message #759845] Wed, 30 November 2011 09:53 Go to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
I have custom components in my application that have a control elements such as SWT Button, SWT CheckBox etc. When I specify styles for 'Button' element in the css, the style is not picked up by the Button control in the custom component. Its being picked up by independent buttons though.
So for setting the styles for the controls in the custom components, I made changes in the code. I'm not very happy with this method though. Here the second issue arises. Programmatically I can only set very few style elements for the control. Not all style properties supported in css are available if I want to do it programmatically.

I would like to know how exactly the style is set to the components. Which I think would explain why all the style support is not available programmatically.
Re: Style setting mechanism [message #760089 is a reply to message #759845] Thu, 01 December 2011 09:44 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

> I have custom components in my application that have a control elements
> such as SWT Button, SWT CheckBox etc. When I specify styles for 'Button'
> element in the css, the style is not picked up by the Button control in
> the custom component. Its being picked up by independent buttons though.

I do not see why the states are not applied to widgets in your custom
components. Could you provide a code snippet to demonstrate this?

> So for setting the styles for the controls in the custom components, I
> made changes in the code. I'm not very happy with this method though.

What kind of changes did you make?

> Here the second issue arises. Programmatically I can only set very few
> style elements for the control. Not all style properties supported in
> css are available if I want to do it programmatically.

Feel free to open an enhancement request for missing styling API.

> I would like to know how exactly the style is set to the components.
> Which I think would explain why all the style support is not available
> programmatically.

Styles are read from your CSS files, pre-processed and transferred to
the client, where they are applied to the widgets on state changes. What
exactly is the missing piece?

Regards, Ralf


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Style setting mechanism [message #760143 is a reply to message #760089] Thu, 01 December 2011 13:34 Go to previous messageGo to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
What kind of changes did you make?
I set the style properties programmatically using methods such as setBackGroundColor and so on.


I'l provide a code snippet for the same very soon.



[Updated on: Thu, 01 December 2011 13:36]

Report message to a moderator

Re: Style setting mechanism [message #760145 is a reply to message #760089] Thu, 01 December 2011 13:34 Go to previous messageGo to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
What kind of changes did you make?

I set the style properties programmatically using methods such as set setBackGroundColor and so on.

I'l provide a code snippet for the same very soon.
Re: Style setting mechanism [message #760788 is a reply to message #760145] Mon, 05 December 2011 09:46 Go to previous messageGo to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
I tried to produce the same with a code snippet. But the style did get set properly.

What I missed was that in my code, the base class extended by all the custom component classes, was overwriting the css style. I cannot change this. So I will have to set my style programmatically in the required custom component.
Re: Style setting mechanism [message #760791 is a reply to message #760143] Mon, 05 December 2011 09:46 Go to previous message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
I tried to produce the same with a code snippet. But the style did get set properly.

What I missed was that in my code, the base class extended by all the custom component classes, was overwriting the css style. I cannot change this. So I will have to set my style programmatically in the required custom component.
Previous Topic:Style setting mechanism
Next Topic:Eclipse View Refresh Problem
Goto Forum:
  


Current Time: Sat Oct 16 13:15:29 GMT 2021

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

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

Back to the top