Thanks Greg, that would also work nicely without having to deal with annotation :) Austin
On Wed, Oct 7, 2009 at 1:58 PM, GH <gregjho...@gmail.com> wrote: > > I just came across something in the Java API that I thought might be > useful in your situation. It seems like the following may be a > slightly more elegant solution: > > blip.getDocument().appendMarkup("<a href=\"http://www.google.com\">To > Google </a>"); > > I haven't used appendMarkup() before, so I am making an educated > guess. > > On Oct 7, 2:42 pm, "Austin Chau (Google employee)" > <api.aus...@google.com> wrote: > > Glad to help :) > > Can you file a feature request to my documentation to include list of > native > > annotation names? > > > > http://code.google.com/p/google-wave-resources/issues/list > > > > Thanks, > > Austin > > > > On Wed, Oct 7, 2009 at 11:58 AM, EntropyFails <entropyfa...@gmail.com > >wrote: > > > > > > > > > > > > > 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. > > > .. > > > > > > > This seems strange to me as the native widget bar has an anchor > > > > > element in it. (Also, the documentation for ElementType is > terrible.) > > > > > > > Hopefully I'm missing something obvious. > > > > > > > Thanks for any help you can give. > > > > > > > -- > > > > > Entropyfails > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to google-wave-api@googlegroups.com To unsubscribe from this group, send email to google-wave-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en -~----------~----~----~----~------~----~------~--~---