Search in sources :

Example 1 with CompanionDependencyInjector

use of com.haulmont.cuba.gui.sys.CompanionDependencyInjector in project cuba by cuba-platform.

the class WindowLoader method loadCompanions.

@Deprecated
protected void loadCompanions(Window resultComponent, Element element) {
    Screen controller = resultComponent.getFrameOwner();
    if (controller instanceof AbstractWindow) {
        Element companionsElem = element.element("companions");
        if (companionsElem != null) {
            StopWatch companionStopWatch = createStopWatch(ScreenLifeCycle.COMPANION, controller.getId());
            Object companion = initCompanion(companionsElem, (AbstractWindow) controller);
            companionStopWatch.stop();
            if (companion != null) {
                getComponentContext().addInjectTask((c, w) -> {
                    CompanionDependencyInjector cdi = new CompanionDependencyInjector((LegacyFrame) controller, companion);
                    cdi.setBeanLocator(beanLocator);
                    cdi.inject();
                });
            }
        }
    }
}
Also used : Screen(com.haulmont.cuba.gui.screen.Screen) Element(org.dom4j.Element) CompanionDependencyInjector(com.haulmont.cuba.gui.sys.CompanionDependencyInjector) StopWatch(org.perf4j.StopWatch) UIPerformanceLogger.createStopWatch(com.haulmont.cuba.gui.logging.UIPerformanceLogger.createStopWatch)

Aggregations

UIPerformanceLogger.createStopWatch (com.haulmont.cuba.gui.logging.UIPerformanceLogger.createStopWatch)1 Screen (com.haulmont.cuba.gui.screen.Screen)1 CompanionDependencyInjector (com.haulmont.cuba.gui.sys.CompanionDependencyInjector)1 Element (org.dom4j.Element)1 StopWatch (org.perf4j.StopWatch)1