addAttributes(jsonObj, parent);//apply attribute when the widget hierarchy is ready
}
protected void addAttributes(JSONObject childObj, Widget widget) {
JSONString attributeStringObj;
JSONNumber attributeNumberObj;
JSONBoolean attributeBooleanObj;
JSONValue attributeJsObj = childObj.get("style");
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
VkDesignerUtil.setCssText(widget, attributeStringObj.stringValue());
attributeJsObj = childObj.get("title");
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
DOM.setElementAttribute(widget.getElement(), "title", attributeStringObj.stringValue());
attributeJsObj = childObj.get("id");
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
DOM.setElementAttribute(widget.getElement(), "id", attributeStringObj.stringValue());
attributeJsObj = childObj.get("className");
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
DOM.setElementAttribute(widget.getElement(), "className", attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkText.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkText)widget).setText(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkAccessKey.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkAccessKey)widget).setAccessKey(attributeStringObj.stringValue().charAt(0));
attributeJsObj = childObj.get(HasVkTabIndex.NAME);
if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null)
((HasVkTabIndex)widget).setTabIndex((int)attributeNumberObj.isNumber().doubleValue());
attributeJsObj = childObj.get(HasVkHtml.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkHtml)widget).setHTML(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkEnabled.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkEnabled)widget).setEnabled(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkWordWrap.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkWordWrap)widget).setWordWrap(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkDirection.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkDirection)widget).setDirection(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkMaxLength.NAME);
if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null){
int maxLength = (int)attributeNumberObj.doubleValue();
if(maxLength > 0)
((HasVkMaxLength)widget).setMaxLength(maxLength);
}
attributeJsObj = childObj.get(HasVkHorizontalAlignment.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkHorizontalAlignment)widget).setHorizontalAlignment(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkAnimation.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkAnimation)widget).setAnimationEnabled(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkVerticalAlignment.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkVerticalAlignment)widget).setVerticalAlignment(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkTarget.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkTarget)widget).setTarget(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkUrl.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkUrl)widget).setUrl(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkFormMethod.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkFormMethod)widget).setMethod(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkImageUrl.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkImageUrl)widget).setImageUrl(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkScrollBarShowing.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkScrollBarShowing)widget).setAlwaysShowScrollBars(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null && attributeNumberObj.doubleValue() > -1)
((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
attributeJsObj = childObj.get(HasVkName.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkName)widget).setName(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkValue.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkValue<?>)widget).setValue(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkCaptionText.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkCaptionText)widget).setCaptionText(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkCaptionHtml.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkCaptionHtml)widget).setCaptionHtml(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkAutoHide.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkAutoHide)widget).setAutoHideEnabled(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkGlass.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkGlass)widget).setGlassEnabled(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkGlassStyle.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkGlassStyle)widget).setGlassStyleName(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkModal.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkModal)widget).setModal(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkFormEncoding.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkFormEncoding)widget).setEncoding(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkHistoryToken.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkHistoryToken)widget).setTargetHistoryToken(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkAlternateText.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkAlternateText)widget).setAlt(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkListBoxMultiple.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkListBoxMultiple)widget).setMultipleEnabled(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkListBoxRenderMode.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkListBoxRenderMode)widget).setDropDown(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkAutoOpen.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkAutoOpen)widget).setAutoOpen(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkInitiallyShowing.NAME);
if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
((HasVkInitiallyShowing)widget).setInitiallyShowing(attributeBooleanObj.booleanValue());
attributeJsObj = childObj.get(HasVkTabHeaderText.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
((HasVkTabHeaderText)widget).setTabText(attributeStringObj.stringValue());
attributeJsObj = childObj.get(HasVkTabHeaderHtml.NAME);
if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)