Absolutely perfect. Thank you so much!
Here is the documentation for setAnnotation in TextView. I believe
that is insufficient for me to have discovered this on my own. Is
there a list of acceptable annotations anywhere? Can we get proper
links to these in the documentation?
void setAnnotation(Range range,
java.lang.String name,
java.lang.String value)
Sets an annotation affecting the specified range of the document.
Parameters:
range - The range over the document affected by this operation.
name - The name of the annotation.
value - The value of the annotation.
Thanks again for your help!
---
Entropyfails
On Oct 7, 12:25 am, "Austin Chau (Google employee)"
<
api.aus...@google.com> wrote:
> Hi,
> If you just append the straight URL, Wave will automatically linkify into an
> anchor link with the URL as its anchor text. But it seems like you would
> like to have customized anchor text, you would need annotation to do that.
> The annotation name for anchor link is "link/manual", this is an example
> how this is done -
>
> TextView textView = yourBlip.getDocument();
> String content = textView.getText();
> String anchorText = "click here";
> textView.insert(content.length(), anchorText);
>
> int start = content.length();
> int end = start + anchorText.length();
>
> textView.setAnnotation(new Range(start, end), "link/manual", "
http://www.google.com");
>
> This snippet above would add an anchor text at the end of a blip and
> annotate it with the URLhttp://
www.google.com.
>
> Austin
>
>
>
> On Tue, Oct 6, 2009 at 2:47 PM, EntropyFails <
entropyfa...@gmail.com> wrote:
>
> > Hello,
>
> > I've been playing around a bit with wave bots on the app engine
> > architecture and I was wondering if anyone knows how to add a direct
> > anchor link without using a wavelet?
>
> > For example, if I have a blip named "blip", obviously doing something
> > like
>
> > blip.getDocument().append("<a href=\"
http://www.google.com\"> To
> > Google </a>");
>
> > will not work as that will only insert the escaped text of the anchor
> > instead of the anchor itself.
>
> > Now I would assume that I would use something like
>
> > blip.getDocument().appendElement(?)
>
> > but there is no element type for anchors defined at
>
> >
http://wave-robot-java-client.googlecode.com/svn/trunk/doc/com/google...