01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.util;
09:
10: import com.google.gwt.user.client.DOM;
11: import com.google.gwt.user.client.Element;
12: import com.google.gwt.user.client.ui.Widget;
13:
14: /**
15: * DOM related helper methods.
16: */
17: public class DOMUtil {
18:
19: public static String getID(Widget widget) {
20: return getID(widget.getElement());
21: }
22:
23: public static String getID(Element element) {
24: String id = DOM.getElementProperty(element, "id");
25: return id == null || id.equals("") ? null : id;
26:
27: }
28:
29: public static void setID(Widget widget, String id) {
30: setID(widget.getElement(), id);
31: }
32:
33: public static void setID(Element element, String id) {
34: DOM.setElementProperty(element, "id", id);
35: }
36:
37: }
|