/** Returns the widget class (a.k.a., widget type), or null if not defined. * <p>Default: return the widget class based on the current mold * (by use of {@link ComponentDefinition#getWidgetClass}), or null * if not found. * <p>To override in Java, you could invoke {@link #setWidgetClass}. * To override in ZUML, you could use the client namespace as follows. * <pre><code> <window xmlns:w="http://www.zkoss.org/2005/zk/client" w:use="foo.MyWindow"> </window> *</code></pre> * @since 5.0.0 */ public String getWidgetClass() { if (_auxinf != null && _auxinf.wgtcls != null) return _auxinf.wgtcls; final String widgetClass = _def.getWidgetClass(this, getMold()); return widgetClass != null ? widgetClass : _def.getDefaultWidgetClass(this); }
public void setMold(String mold) { if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0)) mold = null; if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT, mold)) { if (!_def.hasMold(mold != null ? mold : DEFAULT)) throw new UiException("Unknown mold: " + mold + "; allowed: " + _def.getMoldNames()); final String oldtype = getWidgetClass(); initAuxInfo().mold = mold; if (Objects.equals(oldtype, getWidgetClass())) smartUpdate("mold", getMold()); else invalidate(); } }