You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ErrorMessage.java 847B

1234567891011121314151617181920212223242526272829303132
  1. package com.itmill.toolkit.terminal.gwt.client;
  2. import java.util.Iterator;
  3. import com.google.gwt.user.client.ui.FlowPanel;
  4. import com.google.gwt.user.client.ui.HTML;
  5. public class ErrorMessage extends FlowPanel {
  6. public static final String CLASSNAME = "i-error";
  7. public ErrorMessage() {
  8. super();
  9. setStyleName(CLASSNAME);
  10. }
  11. public void updateFromUIDL(UIDL uidl) {
  12. clear();
  13. for(Iterator it = uidl.getChildIterator();it.hasNext();) {
  14. Object child = it.next();
  15. if (child instanceof String) {
  16. String errorMessage = (String) child;
  17. add(new HTML(errorMessage));
  18. } else if (child instanceof UIDL.XML) {
  19. UIDL.XML xml = (UIDL.XML) child;
  20. add(new HTML(xml.getXMLAsString()));
  21. } else {
  22. ErrorMessage childError = new ErrorMessage();
  23. add(childError);
  24. childError.updateFromUIDL((UIDL) child);
  25. }
  26. }
  27. }
  28. }