Plausible CSS class names in GWT 2.1 CellTable?

172 views
Skip to first unread message

vsdev

unread,
Oct 28, 2010, 8:38:54 AM10/28/10
to Google Web Toolkit
I'm trying to style a GWT2.1 cell table. Unfortunately I couldn't find
any documentation on the default styles. So far all GWT widgets I
worked with had default styles like

.gwt-DecoratedStackPanel {
}
.gwt-DecoratedStackPanel .gwt-StackPanelItem {
}
.gwt-DecoratedStackPanel .gwt-StackPanelItem-selected {
}
etc.

I couldn't find any of that on the cell table, instead there were
styles like class="GL0PBETBKC GL0PBETBIC" etc. (generated by GWT I
suppose?) on the elements, So what I did was defining a style for the
table with myTable.setStyleName("gwt-CellTable"); and then simply
referring to the different table elements with normal css selectors
like

.gwt-CellTable{
}
.gwt-CellTable thead tr th{
}
.gwt-CellTable tbody tr td{
}

Sure that works, but isn't the way I want it. First I'd have to call
setStyleName on each table I create and additionally it is kind of
hard to give elements a different style, lets say, first and last
column with different background, first td in first row upperleft
corner rounded, put different colors for hovering etc.

Does anyone know how to achieve that - have "plausible" classes on the
elements of the table? Or better yet an example to study? Thanks so
much!

John LaBanca

unread,
Oct 28, 2010, 10:58:23 AM10/28/10
to google-we...@googlegroups.com
CellTable uses a ClientBundle (see CellTable.Resources/Style) instead of style names.  ClientBundles allow GWT to perform optimizations on your CSS, including inlining, obfuscation, and dead code elimination.  You can extend or replace the default styles by extending CellTable.Style and passing a CellTable.Resources into the CellTable constructor.

More info is in the ClientBundle dev guide:

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


vsdev

unread,
Nov 2, 2010, 11:26:35 AM11/2/10
to Google Web Toolkit
John, Thank for your comment. I figured out how to set custom style,
see
http://www.devcomments.com/GWT-2-1-CELL-TABLE-at1033370.htm and
http://comments.gmane.org/gmane.org.google.gwt/51623
Reply all
Reply to author
Forward
0 new messages