diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-09-25 12:07:09 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-09-25 12:07:09 +0000 |
commit | 5ef5da15a7903262494d7e3fd7867dde7ed746c4 (patch) | |
tree | e8227a00f50dd110149c391301536c99a1dd035a /src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java | |
parent | 0da15b7ebb4b356e49bda9b9c0fb6faf95029fd2 (diff) | |
download | vaadin-framework-5ef5da15a7903262494d7e3fd7867dde7ed746c4.tar.gz vaadin-framework-5ef5da15a7903262494d7e3fd7867dde7ed746c4.zip |
steps toward simpler widgetset creation. Still needs a lot of cleaning and refining.
svn changeset:8930/svn branch:2009-09-widget-packaging_3332
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java index 89d5caceed..a8a5bea94d 100644 --- a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java +++ b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java @@ -18,13 +18,14 @@ public class VUIDLBrowser extends Tree { * */ private final UIDL uidl; + private ApplicationConfiguration conf; - public VUIDLBrowser(final UIDL uidl) { - + public VUIDLBrowser(final UIDL uidl, ApplicationConfiguration conf) { + this.conf = conf; this.uidl = uidl; DOM.setStyleAttribute(getElement(), "position", ""); - final UIDLItem root = new UIDLItem(this.uidl); + final UIDLItem root = new UIDLItem(this.uidl, conf); addItem(root); addOpenHandler(new OpenHandler<TreeItem>() { public void onOpen(OpenEvent<TreeItem> event) { @@ -46,10 +47,19 @@ public class VUIDLBrowser extends Tree { private UIDL uidl; - UIDLItem(UIDL uidl) { + UIDLItem(UIDL uidl, ApplicationConfiguration conf) { this.uidl = uidl; try { - setText(uidl.getTag()); + String name = uidl.getTag(); + try { + Integer.parseInt(name); + Class<? extends Paintable> widgetClassByDecodedTag = conf + .getWidgetClassByEncodedTag(name); + name = widgetClassByDecodedTag.getName(); + } catch (Exception e) { + // NOP + } + setText(name); addItem("LOADING"); } catch (Exception e) { setText(uidl.toString()); @@ -61,6 +71,15 @@ public class VUIDLBrowser extends Tree { removeItem(temp); String nodeName = uidl.getTag(); + try { + Integer.parseInt(nodeName); + Class<? extends Paintable> widgetClassByDecodedTag = conf + .getWidgetClassByEncodedTag(nodeName); + nodeName = widgetClassByDecodedTag.getName(); + } catch (Exception e) { + // NOP + } + Set<String> attributeNames = uidl.getAttributeNames(); for (String name : attributeNames) { if (uidl.isMapAttribute(name)) { @@ -121,7 +140,7 @@ public class VUIDLBrowser extends Tree { final Object child = i.next(); try { final UIDL c = (UIDL) child; - final TreeItem childItem = new UIDLItem(c); + final TreeItem childItem = new UIDLItem(c, conf); addItem(childItem); } catch (final Exception e) { |