setStyle

4 views
Skip to first unread message

Fry

unread,
Jul 22, 2009, 1:35:59 PM7/22/09
to Google Wave API
I'm not sure if I'm missing something here. Just trying to test out
and bold a section of text in a blip.

TextView text = blip.getDocument();
text.setStyle(new Range(0,10), StyleType.BOLD);

This is what I'm using right now. Does calling setStyle actually
update the text or do I need to somehow update the blip for the
changes to be visible.

Thanks in advance,
Jeremy

Tom Maaswinkel

unread,
Jul 22, 2009, 7:41:09 PM7/22/09
to google-...@googlegroups.com
Hey Fry,

I tried this as well but it didn't work. After talking to Marcel (one of the devs on Google Wave) we found a work around (as Styles are obiously not workign as they should).

TextView text = blip.getDocument.
text.setAnnotation(new Range(0,10), "style/fontWeight", "bold");

this does exactly the same thing, but in a different way!

- Tom

2009/7/22 Fry <jeremy...@gmail.com>

Tomas

unread,
Jul 22, 2009, 7:49:29 PM7/22/09
to Google Wave API
And you should take into account that the ranges for annotations
consider the first letter of your text to be at position 2 and not 0.
Your code will work but is wasteful since it also annotates two tags.

On 23 Juli, 01:41, Tom Maaswinkel <tom.maaswin...@gmail.com> wrote:
> Hey Fry,
>
> I tried this as well but it didn't work. After talking to Marcel (one of the
> devs on Google Wave) we found a work around (as Styles are obiously not
> workign as they should).
>
> TextView text = blip.getDocument.
> text.setAnnotation(new Range(0,10), "style/fontWeight", "bold");
>
> this does exactly the same thing, but in a different way!
>
> - Tom
>
> 2009/7/22 Fry <jeremy.m....@gmail.com>

Fry

unread,
Jul 22, 2009, 8:44:34 PM7/22/09
to Google Wave API
Thanks Tom. That works great.

On Jul 22, 7:41 pm, Tom Maaswinkel <tom.maaswin...@gmail.com> wrote:
> Hey Fry,
>
> I tried this as well but it didn't work. After talking to Marcel (one of the
> devs on Google Wave) we found a work around (as Styles are obiously not
> workign as they should).
>
> TextView text = blip.getDocument.
> text.setAnnotation(new Range(0,10), "style/fontWeight", "bold");
>
> this does exactly the same thing, but in a different way!
>
> - Tom
>
> 2009/7/22 Fry <jeremy.m....@gmail.com>

Beldar

unread,
Jul 30, 2009, 7:20:18 PM7/30/09
to Google Wave API
Hi, I wonder if you could do that in python?

On 23 jul, 02:44, Fry <jeremy.m....@gmail.com> wrote:
> Thanks Tom. That works great.
>
> On Jul 22, 7:41 pm, Tom Maaswinkel <tom.maaswin...@gmail.com> wrote:
>
>
>
> > Hey Fry,
>
> > I tried this as well but it didn't work. After talking to Marcel (one of the
> > devs on Google Wave) we found a work around (as Styles are obiously not
> > workign as they should).
>
> > TextView text = blip.getDocument.
> > text.setAnnotation(new Range(0,10), "style/fontWeight", "bold");
>
> > this does exactly the same thing, but in a different way!
>
> > - Tom
>
> > 2009/7/22 Fry <jeremy.m....@gmail.com>
>
> > > I'm not sure if I'm missing something here. Just trying to test out
> > > andbolda section of text in a blip.

Andi Albrecht

unread,
Jul 31, 2009, 2:38:25 AM7/31/09
to google-...@googlegroups.com
On Fri, Jul 31, 2009 at 1:20 AM, Beldar<belda...@gmail.com> wrote:
>
> Hi, I wonder if you could do that in python?

Have a look at the syntax highlighting robot:
http://code.google.com/p/google-wave-resources/source/browse/trunk/samples/extensions/robots/python/syntaxy/syntaxy.py
Reply all
Reply to author
Forward
0 new messages