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.

VUnknownComponent.java 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui;
  5. import com.google.gwt.user.client.ui.Composite;
  6. import com.google.gwt.user.client.ui.VerticalPanel;
  7. import com.google.gwt.user.client.ui.Widget;
  8. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  9. import com.vaadin.terminal.gwt.client.VPaintableWidget;
  10. import com.vaadin.terminal.gwt.client.SimpleTree;
  11. import com.vaadin.terminal.gwt.client.UIDL;
  12. import com.vaadin.terminal.gwt.client.VUIDLBrowser;
  13. public class VUnknownComponent extends Composite implements VPaintableWidget {
  14. com.google.gwt.user.client.ui.Label caption = new com.google.gwt.user.client.ui.Label();;
  15. SimpleTree uidlTree;
  16. private VerticalPanel panel;
  17. private String serverClassName = "unkwnown";
  18. public VUnknownComponent() {
  19. panel = new VerticalPanel();
  20. panel.add(caption);
  21. initWidget(panel);
  22. setStyleName("vaadin-unknown");
  23. caption.setStyleName("vaadin-unknown-caption");
  24. }
  25. public void setServerSideClassName(String serverClassName) {
  26. this.serverClassName = serverClassName;
  27. }
  28. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
  29. if (client.updateComponent(this, uidl, false)) {
  30. return;
  31. }
  32. setCaption("Widgetset does not contain implementation for "
  33. + serverClassName
  34. + ". Check its @ClientWidget mapping, widgetsets "
  35. + "GWT module description file and re-compile your"
  36. + " widgetset. In case you have downloaded a vaadin"
  37. + " add-on package, you might want to refer to "
  38. + "<a href='http://vaadin.com/using-addons'>add-on "
  39. + "instructions</a>. Unrendered UIDL:");
  40. if (uidlTree != null) {
  41. uidlTree.removeFromParent();
  42. }
  43. uidlTree = new VUIDLBrowser(uidl, client.getConfiguration());
  44. uidlTree.open(true);
  45. uidlTree.setText("Unrendered UIDL");
  46. panel.add(uidlTree);
  47. }
  48. public void setCaption(String c) {
  49. caption.getElement().setInnerHTML(c);
  50. }
  51. public Widget getWidgetForPaintable() {
  52. return this;
  53. }
  54. }