Hi there,

I spent some hours now trying to figure out if I don't understand the
API or if it's not my fault.
I'm writing a bot in Java and I need to delete Images.
Here's a sample code that shows how I tried it:

Image insertion:

Image img = new Image();
img.setProperty("url", "http://www.googlewatchblog.de/graphics/logos/
Google_Wave_logo.png");
textView.appendElement(img);

Waiting for a button to be clicked and then remove all Elements and
display removed elements types.

if ( e.getType() == EventType.FORM_BUTTON_CLICKED) {
          if (e.getButtonName().equals("button")) {
                  Blip b = e.getBlip();
                  TextView textView = b.getDocument();
                  textView.append("\nPressed");

                  List<Element> elems = textView.getElements();
                  for ( int i=0; i<elems.size(); i++ ){
                          int pos = textView.getPosition(elems.get(i));
                          textView.deleteElement(pos);
                          textView.append("Element of Type " + 
elems.get(i).getType
() + " deleted.");
                  }
          }
}

This deletes the button but doesn't find the image.

What am I doing wrong?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to