This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
when create project, the css file already contains some predefined css class like
but is it necessary to explicit call the
when create a VerticalSplitPanel?
I have this doubt because I found sometimes even the widget (e.g. treee, treeitem) has not explicit call setStylePrimaryName, it can still automatically refer to the corresponding css class in css file,
but some cannot (like gwt-HorizontalPanel).
that is, if the css file default has that classname, then when create the widget, the component will automatically set their stylePrimaryName corresponding to the css file,
but if the widget has no default css style class in css file and we add it manually, then even using their naming convention "gwt-"+ WidgetName, the widget still cannot automatically set
Not all widgets use primary styles, in particular many panel types. For HorizontalPanel, there is nothing that would need to be set for its style for general use. And it wouldn't necessarily be good for Google to have set a primary style, since the same class might be used multiple times within an app for totally different purposes. BTW, the Javadocs usually list the styles used by a widget (but unfortunately, not always). But, if there is no rule in the CSS, then GWT isn't going to bother setting a primary style.
If you want a primary style for a DockPanel, you can either manually set it for each instance, as you did, or extend DockPanel with a new class that sets its own primary style with its own name.
Joined: Mar 15, 2008
or extend DockPanel with a new class that sets its own primary style with its own name.