Search in sources :

Example 1 with ScreenOptions

use of io.jmix.ui.screen.ScreenOptions in project jmix by jmix-framework.

the class ActionScreenInitializer method initBuilder.

public ScreenBuilder initBuilder(ScreenBuilder builder) {
    if (screenClass != null) {
        builder = builder.withScreenClass(screenClass);
    }
    if (screenId != null) {
        builder = builder.withScreenId(screenId);
    }
    if (screenOptionsSupplier != null) {
        ScreenOptions screenOptions = screenOptionsSupplier.get();
        builder = builder.withOptions(screenOptions);
    }
    if (openMode != null) {
        builder = builder.withOpenMode(openMode);
    }
    return builder;
}
Also used : ScreenOptions(io.jmix.ui.screen.ScreenOptions)

Example 2 with ScreenOptions

use of io.jmix.ui.screen.ScreenOptions in project jmix by jmix-framework.

the class ActionScreenInitializer method initBuilder.

public LookupBuilder initBuilder(LookupBuilder builder) {
    if (screenClass != null) {
        builder = builder.withScreenClass(screenClass);
    }
    if (screenId != null) {
        builder = builder.withScreenId(screenId);
    }
    if (screenOptionsSupplier != null) {
        ScreenOptions screenOptions = screenOptionsSupplier.get();
        builder = builder.withOptions(screenOptions);
    }
    if (openMode != null) {
        builder = builder.withOpenMode(openMode);
    }
    return builder;
}
Also used : ScreenOptions(io.jmix.ui.screen.ScreenOptions)

Example 3 with ScreenOptions

use of io.jmix.ui.screen.ScreenOptions in project jmix by jmix-framework.

the class ActionScreenInitializer method initBuilder.

public EditorBuilder initBuilder(EditorBuilder builder) {
    if (screenClass != null) {
        builder = builder.withScreenClass(screenClass);
    }
    if (screenId != null) {
        builder = builder.withScreenId(screenId);
    }
    if (screenOptionsSupplier != null) {
        ScreenOptions screenOptions = screenOptionsSupplier.get();
        builder = builder.withOptions(screenOptions);
    }
    if (openMode != null) {
        builder = builder.withOpenMode(openMode);
    }
    return builder;
}
Also used : ScreenOptions(io.jmix.ui.screen.ScreenOptions)

Example 4 with ScreenOptions

use of io.jmix.ui.screen.ScreenOptions in project jmix by jmix-framework.

the class FragmentComponentLoader method loadComponent.

@Override
public void loadComponent() {
    loadAliases();
    if (getComponentContext().getFrame() != null) {
        resultComponent.setFrame(getComponentContext().getFrame());
    }
    String src = element.attributeValue("src");
    String screenId = element.attributeValue("screen");
    String screenPath = StringUtils.isEmpty(screenId) ? src : screenId;
    if (element.attributeValue("id") != null) {
        screenPath = element.attributeValue("id");
    }
    if (getComponentContext().getFrame() != null) {
        String parentId = getComponentContext().getFullFrameId();
        if (StringUtils.isNotEmpty(parentId)) {
            screenPath = parentId + "." + screenPath;
        }
    }
    Timer.Sample sample = Timer.start(getMeterRegistry());
    if (fragmentLoader != null) {
        fragmentLoader.loadComponent();
    }
    // load properties after inner context, they must override values defined inside of fragment
    assignXmlDescriptor(resultComponent, element);
    loadVisible(resultComponent, element);
    loadEnable(resultComponent, element);
    loadStyleName(resultComponent, element);
    loadResponsive(resultComponent, element);
    loadCss(resultComponent, element);
    loadAlign(resultComponent, element);
    loadHeight(resultComponent, element);
    loadWidth(resultComponent, element);
    loadIcon(resultComponent, element);
    loadCaption(resultComponent, element);
    loadDescription(resultComponent, element);
    sample.stop(createScreenTimer(getMeterRegistry(), ScreenLifeCycle.LOAD, screenPath));
    // propagate init phases
    ComponentLoaderContext parentContext = (ComponentLoaderContext) getContext();
    if (innerContext != null) {
        parentContext.getInjectTasks().addAll(innerContext.getInjectTasks());
        parentContext.getInitTasks().addAll(innerContext.getInitTasks());
        parentContext.getPostInitTasks().addAll(innerContext.getPostInitTasks());
    }
    ScreenOptions options = parentContext.getOptions();
    parentContext.addInjectTask(new FragmentLoaderInjectTask(resultComponent, options, applicationContext));
    parentContext.addInitTask(new FragmentLoaderInitTask(resultComponent, options, innerContext, applicationContext));
}
Also used : Timer(io.micrometer.core.instrument.Timer) UiMonitoring.createScreenTimer(io.jmix.ui.monitoring.UiMonitoring.createScreenTimer) FragmentLoaderInjectTask(io.jmix.ui.sys.FragmentHelper.FragmentLoaderInjectTask) FragmentLoaderInitTask(io.jmix.ui.sys.FragmentHelper.FragmentLoaderInitTask) ScreenOptions(io.jmix.ui.screen.ScreenOptions)

Example 5 with ScreenOptions

use of io.jmix.ui.screen.ScreenOptions in project jmix by jmix-framework.

the class RuntimePropertiesFrameLoader method loadComponent.

@Override
public void loadComponent() {
    if (getContext().getFrame() != null) {
        resultComponent.setFrame(getContext().getFrame());
    }
    String src = element.attributeValue("src");
    if (src == null) {
        src = DEFAULT_DESCRIPTOR;
    }
    String runtimeDs = element.attributeValue("runtimeDs");
    if (StringUtils.isEmpty(runtimeDs)) {
        throw new GuiDevelopmentException("runtimePropsDatasource is not set for runtimeProperties component", getContext().getFullFrameId());
    }
    getContext().getParams().put("runtimeDs", runtimeDs);
    String categoriesDs = element.attributeValue("categoriesDs");
    if (StringUtils.isEmpty(categoriesDs)) {
        throw new GuiDevelopmentException("categoriesDs is not set for runtimeProperties component", getContext().getFullFrameId());
    }
    getContext().getParams().put("categoriesDs", categoriesDs);
    String rows = element.attributeValue("rows");
    getContext().getParams().put("rows", rows);
    String cols = element.attributeValue("cols");
    getContext().getParams().put("cols", cols);
    String fieldWidth = element.attributeValue("fieldWidth");
    getContext().getParams().put("fieldWidth", fieldWidth);
    String fieldCaptionWidth = element.attributeValue("fieldCaptionWidth");
    getContext().getParams().put("fieldCaptionWidth", fieldCaptionWidth);
    String screenPath = Objects.equals(src, DEFAULT_DESCRIPTOR) ? "runtimeProperties" : src;
    if (element.attributeValue("id") != null) {
        screenPath = element.attributeValue("id");
    }
    if (getContext().getFrame() != null) {
        String parentId = getContext().getFullFrameId();
        if (StringUtils.isNotEmpty(parentId)) {
            screenPath = parentId + "." + screenPath;
        }
    }
    Timer.Sample loadSample = Timer.start(getMeterRegistry());
    if (fragmentLoader != null) {
        fragmentLoader.loadComponent();
    }
    // load properties after inner context, they must override values defined inside of fragment
    assignXmlDescriptor(resultComponent, element);
    loadVisible(resultComponent, element);
    loadEnable(resultComponent, element);
    loadStyleName(resultComponent, element);
    loadResponsive(resultComponent, element);
    loadCss(resultComponent, element);
    loadAlign(resultComponent, element);
    loadHeight(resultComponent, element);
    loadWidth(resultComponent, element);
    loadIcon(resultComponent, element);
    loadCaption(resultComponent, element);
    loadDescription(resultComponent, element);
    loadSample.stop(createScreenTimer(getMeterRegistry(), ScreenLifeCycle.LOAD, screenPath));
    // propagate init phases
    ComponentLoaderContext parentContext = (ComponentLoaderContext) getContext();
    if (innerContext != null) {
        parentContext.getInjectTasks().addAll(innerContext.getInjectTasks());
        parentContext.getInitTasks().addAll(innerContext.getInitTasks());
        parentContext.getPostInitTasks().addAll(innerContext.getPostInitTasks());
    }
    ScreenOptions options = parentContext.getOptions();
    parentContext.addInjectTask(new FragmentLoaderInjectTask((Fragment) resultComponent, options, applicationContext));
    parentContext.addInitTask(new FragmentHelper.FragmentLoaderInitTask((Fragment) resultComponent, options, (ComponentLoaderContext) context, applicationContext));
}
Also used : Timer(io.micrometer.core.instrument.Timer) UiMonitoring.createScreenTimer(io.jmix.ui.monitoring.UiMonitoring.createScreenTimer) FragmentLoaderInjectTask(io.jmix.ui.sys.FragmentHelper.FragmentLoaderInjectTask) FragmentHelper(io.jmix.ui.sys.FragmentHelper) GuiDevelopmentException(io.jmix.ui.GuiDevelopmentException) ScreenOptions(io.jmix.ui.screen.ScreenOptions) ScreenFragment(io.jmix.ui.screen.ScreenFragment) Fragment(io.jmix.ui.component.Fragment)

Aggregations

ScreenOptions (io.jmix.ui.screen.ScreenOptions)7 UiMonitoring.createScreenTimer (io.jmix.ui.monitoring.UiMonitoring.createScreenTimer)2 FragmentLoaderInjectTask (io.jmix.ui.sys.FragmentHelper.FragmentLoaderInjectTask)2 Timer (io.micrometer.core.instrument.Timer)2 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)1 GuiDevelopmentException (io.jmix.ui.GuiDevelopmentException)1 WindowInfo (io.jmix.ui.WindowInfo)1 Fragment (io.jmix.ui.component.Fragment)1 MapScreenOptions (io.jmix.ui.screen.MapScreenOptions)1 ScreenFragment (io.jmix.ui.screen.ScreenFragment)1 FragmentHelper (io.jmix.ui.sys.FragmentHelper)1 FragmentLoaderInitTask (io.jmix.ui.sys.FragmentHelper.FragmentLoaderInitTask)1 HashMap (java.util.HashMap)1