* Imports a new library
*/
public WidgetDefinition buildWidgetDefinition(Element widgetElement)
throws Exception {
if (this.context == null || this.context.getLocalLibrary() == null) {
throw new FormsException("Import statement seen and context is empty.",
DomHelper.getLocationObject(widgetElement));
}
Library lib = this.context.getLocalLibrary();
String prefix = DomHelper.getAttribute(widgetElement, PREFIX_ATTRIBUTE);
String uri = DomHelper.getAttribute(widgetElement, URI_ATTRIBUTE);
if (!lib.includeAs(prefix, uri)) {
throw new FormsException("Import statement did not succeed (probably used ':' in the prefix?).",
DomHelper.getLocationObject(widgetElement));
}
return null;
}