Search in sources :

Example 1 with PropertyShortcutLoader

use of io.jmix.ui.xml.PropertyShortcutLoader in project jmix by jmix-framework.

the class AbstractComponentLoader method loadShortcutFromAlias.

@Nullable
protected String loadShortcutFromAlias(String shortcut) {
    if (shortcut.endsWith("_SHORTCUT}")) {
        PropertyShortcutLoader propertyShortcutLoader = applicationContext.getBean(PropertyShortcutLoader.class);
        String alias = shortcut.substring(2, shortcut.length() - 1);
        if (propertyShortcutLoader.contains(alias)) {
            return propertyShortcutLoader.getShortcut(alias);
        } else {
            String message = String.format("An error occurred while loading shortcut. " + "Can't find shortcut for alias \"%s\"", alias);
            throw new GuiDevelopmentException(message, context);
        }
    }
    return null;
}
Also used : GuiDevelopmentException(io.jmix.ui.GuiDevelopmentException) PropertyShortcutLoader(io.jmix.ui.xml.PropertyShortcutLoader) Nullable(javax.annotation.Nullable)

Aggregations

GuiDevelopmentException (io.jmix.ui.GuiDevelopmentException)1 PropertyShortcutLoader (io.jmix.ui.xml.PropertyShortcutLoader)1 Nullable (javax.annotation.Nullable)1