use of com.haulmont.cuba.gui.xml.DeclarativeTrackingAction in project cuba by cuba-platform.
the class AbstractComponentLoader method loadDeclarativeActionDefault.
protected Action loadDeclarativeActionDefault(Component.ActionsHolder actionsHolder, Element element) {
String id = element.attributeValue("id");
if (id == null) {
Element component = element;
for (int i = 0; i < 2; i++) {
if (component.getParent() != null)
component = component.getParent();
else
throw new GuiDevelopmentException("No action ID provided", context.getFullFrameId());
}
throw new GuiDevelopmentException("No action ID provided", context.getFullFrameId(), "Component ID", component.attributeValue("id"));
}
String trackSelection = element.attributeValue("trackSelection");
String shortcut = StringUtils.trimToNull(element.attributeValue("shortcut"));
shortcut = loadShortcut(shortcut);
if (Boolean.parseBoolean(trackSelection)) {
DeclarativeTrackingAction action = new DeclarativeTrackingAction(id, loadResourceString(element.attributeValue("caption")), loadResourceString(element.attributeValue("description")), getIconPath(element.attributeValue("icon")), element.attributeValue("enable"), element.attributeValue("visible"), element.attributeValue("invoke"), shortcut, actionsHolder);
loadActionConstraint(action, element);
return action;
} else {
return new DeclarativeAction(id, loadResourceString(element.attributeValue("caption")), loadResourceString(element.attributeValue("description")), getIconPath(element.attributeValue("icon")), element.attributeValue("enable"), element.attributeValue("visible"), element.attributeValue("invoke"), shortcut, actionsHolder);
}
}
Aggregations