HTMLCell. Here it is:
1. The HTMLHeader class:
import com.google.gwt.user.cellview.client.Header;
public class HTMLHeader extends Header<String> {
private String html;
public HTMLHeader(String html) {
super(new HTMLCell());
this.html = html;
}
@Override
public String getValue() {
return html;
}
}
2. The HTMLCell class:
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
public class HTMLCell extends AbstractCell<String> {
public HTMLCell() {
}
@Override
public void render(Context context, String value, SafeHtmlBuilder sb)
{
if (value != null) {
sb.appendHtmlConstant(value);
}
}
}
3. Add a HTML header aligning it to the right:
myTable.addColumn(myColumn, new HTMLHeader("<div align=\"right
\">Hooray</div>"));
Bingo!
On Oct 31, 4:18 pm, Craig Mitchell <m...@craig-mitchell.com> wrote:
> Star the issue and hope Google adds the functionality:http://code.google.com/p/google-web-toolkit/issues/detail?id=6500
>
> On Oct 11, 7:58 pm, Thomas Trebbien Pedersen
>
>
>
>
>
>
>
> <thomas.trebbien.peder...@gmail.com> wrote:
> > Hi,
>
> > Can someone please help.
>
> > On 7 Okt., 10:28, Thomas Trebbien Pedersen
>
> > <thomas.trebbien.peder...@gmail.com> wrote:
> > > Hi,
>
> > > How do I set the horizontal alignment for headers/footers in a
> > > CellTable?
>
> > > I want to right align the text like I can do with a Column:
>
> > > someColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
>
> > > Isn't something similar possible for headers/footers - can anyone
> > > please help.
>
> > > Thanks.
>
> > > \Thomas
--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment