karthik vadapalli
karthik vadapalli

Reputation: 363

want to access the css styles from my java code

i have a css in my GWTApplication which contains several classes in that,I want to access the class attributes through my program,is there any way to access them via java code or CssResource. If there is any let me know with the sample code?

Upvotes: 0

Views: 353

Answers (2)

Abhijith Nagaraja
Abhijith Nagaraja

Reputation: 3380

One can access CSS classes through GWT code but not its class attributes through setStyleName(String) method. For example

Button button = new Button();
button.setStyleName("Stylename");

for example css of

.StyleName {
 background : #abcdef;
 }

Further you can change the value of some attributes without css like

button.setWidth("100px");
button.setHeight("20px");

Upvotes: 1

Navneeth G
Navneeth G

Reputation: 7305

Take a look at SAC : http://www.w3.org/Style/CSS/SAC/Overview.en.html

Upvotes: 1

Related Questions