Re: How do you over ride a css definition in GWT using CSSResource?

225 views
Skip to first unread message

Jerome Chan

unread,
Jul 29, 2012, 11:09:52 PM7/29/12
to google-we...@googlegroups.com
I found my errors!

--- NewGridStyle.css ---
@external dataGridSelectedRowCell

.dataGridSelectedRowCell {
border:inherit;
}
--- end ---

I have to include it in as a RssResource not a Style.

public interface NewGridStyle extends com.google.gwt.user.cellview.client.DataGrid.Resources {
@Override
@Source({DataGrid.Style.DEFAULT_CSS,"NewGridStyle.css"})
// public String dataGridSelectedRowCell(); // delete this line
DataGrid.Style dataGridStyle();
}

On Sunday, 29 July 2012 22:50:11 UTC+8, Jerome Chan wrote:
Hello!

Been working on my first GWT app and have come across this problem where I need to override a CSS in an existing widget. Specifically to remove the Grid Selection border around a cell when a row has focus. From my research I gather I need to perform several steps. I've traced this css down to

.dataGridSelectedRowCell

So I create this in a new css file (lets say "mods.css").

--- mods.css
@external dataGridSelectedRowCell

.dataGridSelectedRowCell {
}
---

At this point I have to include it in a RssResource.

public interface NewGridStyle extends com.google.gwt.user.cellview.client.DataGrid.Style {
@Override
@Source({DataGrid.Style.DEFAULT_CSS,"NewGridStyle.css"})
public String dataGridSelectedRowCell();

}

In my code I use the following lines

DataGrid.Resources resources = GWT.create(NewGridStyle.class);
dg = new DataGrid<Plan>(PAGE_SIZE, resources, getDataProvider()
.getKeyProvider());

When I try to compile my app, I get the following error:

Rebind result 'net.tofusoft.GWT.NewGridStyle' must be a class

So what did I do wrong?

Reply all
Reply to author
Forward
0 new messages