Just to get things right. Even in your complete example the usage of 
@Import in the case of InitButtonCSS is useless. Its useless because the 
css class initButton2 will be a unique name anyways and thus it doesn't 
really make sense to define the css rule as .global-genButton.initButton2.

@Import is usually used the other way around. That means you have some sort 
of a parent container widget and you want to change the default style of 
its child widgets. In that case you would @Import the css of the child 
widget into the parent widget css and then define css rules like .parent 
.childwidget-header { ... } to change the header of the child widget if 
this child widget will be put into that specific parent container.

@Shared works best when you generalize some common state like focus / 
selected / disabled / enabled. For example you could have some sort of a 
SecurityManager that enables/disables widgets based on permissions. Such a 
SecurityManager would use a minimal CssResource like

@Shared
interface HasEnabledDisabledStateCss extends CssResource {
  String enabled();
  String disabled();
}

Then any widget can inherit this minimal CssResource and define on its own 
how it will look like in enabled / disabled state (= you would not add 
enableddisabled.css to the various widgets @Source annotation although you 
extend HasEnabledDisabledStateCss).



So either @Shared nor @Import do not really fit into your example above. If 
you delete all these annotations then you example will work without issues 
and it will look like the short snippet I posted earlier.


-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to