So I have a skeleton that looks like this:

TextColumn<StatusRpcBean> statusColumn = new TextColumn<StatusRpcBean>() {
@Override
public String getCellStyleNames(Context context, StatusRpcBean object) {
return ???;
}
 @Override
public String getValue(StatusRpcBean object) {
return String.valueOf(object.getStatus());
}
};

Problem is, I really don't know what I'm looking at, I'm searching around 
trying to find an explanation of what's happening here but no luck yet. 
 What is the "Context"?  Lets say each cell in this statusColumn will hold 
one of two strings "Available" and "Busy" and I want to make all the "Busy" 
cells red (with a style), how do I override getCellStyleNames to do 
something like that?

Thanks again,
Ryan

On Wednesday, September 21, 2011 7:32:51 AM UTC-6, ozgur aydinli wrote:
>
> Hi, 
>
> You can develop a custom cell. And in the render method do something 
> like below: 
>
> interface Template extends SafeHtmlTemplates { 
> @Template("<div class=\"{0}\">{1}</div>") 
> SafeHtml html(String className, String value); 
> } 
>
>  Template  template = GWT.create(Template.class); 
>
> @Override 
> public void render(.......){ 
>   if(some condition is true){ 
>     sb.append(template.html("class name", "cell value"); 
>   } 
> } 
>
> On Sep 20, 6:41 pm, Rike255 <[email protected]> wrote: 
> > Hey all, 
> > 
> > So I have a celltable that contains a few textcolumns.  I want to be 
> > able to set a style for individual cells based on its contents. 
> > 
> > I can set a style for a specific column by calling something like: 
> > cellTable.getColumn(index).setStyleNames(style.disabled()); 
> > 
> > The above works but I can't figure out how to only apply a style to 
> > one (or more) cells. 
> > 
> > Thanks in advance! 
> > Ryan

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/f5TBK0NHWEAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to