IUserDataConstants.XWT_RESOURCES_KEY);
}
public static void setObjectName(Object object, String name) {
Widget widget = getWidget(object);
ScopeKeeper nameScoped;
if (UserData.findElementByName(widget, name) != null) {
// throw an exception or log a message?
return;
}
Widget parent = UserData.getTreeParent(widget);
UserData dataDictionary = (UserData) parent
.getData(IUserDataConstants.XWT_USER_DATA_KEY);
if (dataDictionary != null) {
if (dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
nameScoped = (ScopeKeeper) dataDictionary
.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
} else {
ScopeKeeper parentNameScope = findScopeKeeper(parent);
nameScoped = new ScopeKeeper(parentNameScope, widget);
bindNameContext(parent, nameScoped);
}
nameScoped.addNamedObject(name, widget);
}
// throw an exception or log a message?