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.

ICustomComponent.java 935B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.itmill.toolkit.terminal.gwt.client.ui;
  2. import com.google.gwt.user.client.ui.SimplePanel;
  3. import com.google.gwt.user.client.ui.Widget;
  4. import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
  5. import com.itmill.toolkit.terminal.gwt.client.Paintable;
  6. import com.itmill.toolkit.terminal.gwt.client.UIDL;
  7. public class ICustomComponent extends SimplePanel implements Paintable {
  8. private static final String CLASSNAME = "i-customcomponent";
  9. public ICustomComponent() {
  10. super();
  11. setStyleName(CLASSNAME);
  12. }
  13. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
  14. UIDL child = uidl.getChildUIDL(0);
  15. if (child != null) {
  16. Paintable p = (Paintable) client.getWidget(child);
  17. if (p != getWidget()) {
  18. if (getWidget() != null) {
  19. client.unregisterPaintable((Paintable) getWidget());
  20. clear();
  21. }
  22. setWidget((Widget) p);
  23. }
  24. p.updateFromUIDL(child, client);
  25. }
  26. }
  27. }