Search in sources :

Example 26 with Window

use of io.jmix.ui.component.Window in project jmix by jmix-framework.

the class ScreenToolsImpl method openDefaultScreen.

@Override
public void openDefaultScreen(Screens screens) {
    String defaultScreenId = uiProperties.getDefaultScreenId();
    if (StringUtils.isEmpty(defaultScreenId)) {
        return;
    }
    if (!windowConfig.hasWindow(defaultScreenId)) {
        log.info("Can't find default screen: {}", defaultScreenId);
        return;
    }
    Screen screen = screens.create(defaultScreenId, OpenMode.NEW_TAB);
    if (screen instanceof EditorScreen) {
        ((EditorScreen) screen).setEntityToEdit(getEntityToEdit(defaultScreenId));
    }
    screen.show();
    Window window = screen.getWindow();
    setDefaultScreenWindow(window);
    if (!uiProperties.isDefaultScreenCanBeClosed()) {
        window.setCloseable(false);
    }
}
Also used : Window(io.jmix.ui.component.Window) EditorScreen(io.jmix.ui.screen.EditorScreen) EditorScreen(io.jmix.ui.screen.EditorScreen) Screen(io.jmix.ui.screen.Screen)

Example 27 with Window

use of io.jmix.ui.component.Window in project jmix by jmix-framework.

the class WindowBreadCrumbs method update.

public void update() {
    boolean isTestMode = ui.isTestMode();
    linksLayout.removeAllComponents();
    for (Iterator<Window> it = windows.iterator(); it.hasNext(); ) {
        Window window = it.next();
        Button button = new NavigationButton(window);
        button.setCaption(StringUtils.trimToEmpty(window.getCaption()));
        button.addClickListener(this::navigationButtonClicked);
        button.setSizeUndefined();
        button.setStyleName(ValoTheme.BUTTON_LINK);
        button.setTabIndex(-1);
        if (isTestMode) {
            button.setJTestId("breadCrubms_Button_" + window.getId());
        }
        if (ui.isPerformanceTestMode()) {
            button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
        }
        if (it.hasNext()) {
            linksLayout.addComponent(button);
            Label separatorLab = new Label("&nbsp;&gt;&nbsp;");
            separatorLab.setStyleName("jmix-breadcrumbs-separator");
            separatorLab.setSizeUndefined();
            separatorLab.setContentMode(ContentMode.HTML);
            linksLayout.addComponent(separatorLab);
        } else {
            Label captionLabel = new Label(window.getCaption());
            captionLabel.setStyleName("jmix-breadcrumbs-win-caption");
            captionLabel.setSizeUndefined();
            linksLayout.addComponent(captionLabel);
        }
    }
}
Also used : Window(io.jmix.ui.component.Window) Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label)

Example 28 with Window

use of io.jmix.ui.component.Window in project jmix by jmix-framework.

the class WindowBreadCrumbs method isCloseWithCloseButtonPrevented.

protected boolean isCloseWithCloseButtonPrevented(@Nullable Window currentWindow) {
    WindowImpl windowImpl = (WindowImpl) currentWindow;
    if (windowImpl != null) {
        Window.BeforeCloseEvent event = new Window.BeforeCloseEvent(windowImpl, CloseOriginType.CLOSE_BUTTON);
        windowImpl.fireBeforeClose(event);
        return event.isClosePrevented();
    }
    return false;
}
Also used : Window(io.jmix.ui.component.Window) WindowImpl(io.jmix.ui.component.impl.WindowImpl)

Example 29 with Window

use of io.jmix.ui.component.Window in project jmix by jmix-framework.

the class UiControllerPropertyInjector method findComponent.

@Nullable
protected Component findComponent(String componentId) {
    Component component = null;
    Window window = null;
    if (sourceScreen != null) {
        window = sourceScreen.getWindow();
    } else if (frameOwner instanceof ScreenFragment) {
        FrameOwner host = ((ScreenFragment) frameOwner).getHostController();
        if (host instanceof Screen) {
            window = ((Screen) host).getWindow();
        }
    } else if (frameOwner instanceof Screen) {
        window = ((Screen) frameOwner).getWindow();
    }
    if (window != null) {
        component = window.getComponent(componentId);
    }
    return component;
}
Also used : Window(io.jmix.ui.component.Window) ScreenFragment(io.jmix.ui.screen.ScreenFragment) FrameOwner(io.jmix.ui.screen.FrameOwner) Screen(io.jmix.ui.screen.Screen) Component(io.jmix.ui.component.Component) Nullable(javax.annotation.Nullable)

Aggregations

Window (io.jmix.ui.component.Window)29 FilterSelectWindow (com.haulmont.cuba.gui.components.filter.filterselect.FilterSelectWindow)5 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)4 FilterEntity (com.haulmont.cuba.security.entity.FilterEntity)4 MetaClass (io.jmix.core.metamodel.model.MetaClass)4 Filter (com.haulmont.cuba.gui.components.Filter)3 Action (io.jmix.ui.action.Action)3 Component (io.jmix.ui.component.Component)3 HashMap (java.util.HashMap)3 WindowManager (com.haulmont.cuba.gui.WindowManager)2 AbstractCondition (com.haulmont.cuba.gui.components.filter.condition.AbstractCondition)2 DsContext (com.haulmont.cuba.gui.data.DsContext)2 DsContextImplementation (com.haulmont.cuba.gui.data.impl.DsContextImplementation)2 Messages (io.jmix.core.Messages)2 UiScreenProperties (io.jmix.ui.UiScreenProperties)2 WindowInfo (io.jmix.ui.WindowInfo)2 BaseAction (io.jmix.ui.action.BaseAction)2 Frame (io.jmix.ui.component.Frame)2 Screen (io.jmix.ui.screen.Screen)2 CubaProperties (com.haulmont.cuba.CubaProperties)1