Search in sources :

Example 21 with AppUI

use of io.jmix.ui.AppUI in project jmix by jmix-framework.

the class AbstractDataGrid method setUiTestId.

protected void setUiTestId(DataGridItems<E> items) {
    AppUI ui = AppUI.getCurrent();
    if (ui != null && ui.isTestMode() && getComponent().getJTestId() == null) {
        String testId = uiTestIdsSupport.getInferredTestId(items, "DataGrid");
        if (testId != null) {
            getComponent().setJTestId(testId);
            componentComposition.setJTestId(testId + "_composition");
        }
    }
}
Also used : AppUI(io.jmix.ui.AppUI)

Example 22 with AppUI

use of io.jmix.ui.AppUI in project jmix by jmix-framework.

the class ExceptionHandlers method handle.

/**
 * Delegates exception handling to registered handlers.
 *
 * @param event error event generated by Vaadin
 */
public void handle(ErrorEvent event) {
    for (ExceptionHandler handler : handlers) {
        if (handler.handle(event, app)) {
            return;
        }
    }
    AppUI ui = AppUI.getCurrent();
    if (ui != null) {
        for (UiExceptionHandler handler : genericHandlers) {
            if (handler.handle(event.getThrowable(), ui)) {
                return;
            }
        }
    }
    defaultHandler.handle(event, app);
}
Also used : AppUI(io.jmix.ui.AppUI)

Example 23 with AppUI

use of io.jmix.ui.AppUI in project jmix by jmix-framework.

the class JmixWindow method close.

@Override
public void close() {
    AppUI ui = (AppUI) getUI();
    if (!ui.isAccessibleForUser(this)) {
        LoggerFactory.getLogger(JmixWindow.class).debug("Ignore close window attempt because Window is inaccessible for user");
        return;
    }
    PreCloseEvent event = new PreCloseEvent(this);
    fireEvent(event);
    if (!event.isPreventClose()) {
        super.close();
    }
}
Also used : AppUI(io.jmix.ui.AppUI)

Example 24 with AppUI

use of io.jmix.ui.AppUI in project jmix by jmix-framework.

the class TreeImpl method setUiTestId.

protected void setUiTestId(TreeItems<E> items) {
    AppUI ui = AppUI.getCurrent();
    if (ui != null && ui.isTestMode() && getComponent().getJTestId() == null) {
        String testId = uiTestIdsSupport.getInferredTestId(items, "Tree");
        if (testId != null) {
            getComponent().setJTestId(testId);
            componentComposition.setJTestId(testId + "_composition");
        }
    }
}
Also used : AppUI(io.jmix.ui.AppUI)

Example 25 with AppUI

use of io.jmix.ui.AppUI in project jmix by jmix-framework.

the class TimerImpl method attachTimerToUi.

protected void attachTimerToUi(Component ownerComponent) {
    AppUI appUI = (AppUI) ownerComponent.getUI();
    appUI.addTimer(timerImpl);
    log.trace("Timer '{}' registered in UI ", getId());
}
Also used : AppUI(io.jmix.ui.AppUI)

Aggregations

AppUI (io.jmix.ui.AppUI)56 TestIdManager (io.jmix.ui.sys.TestIdManager)8 Component (com.vaadin.ui.Component)5 UiEventsMulticaster (io.jmix.ui.sys.event.UiEventsMulticaster)4 ApplicationListener (org.springframework.context.ApplicationListener)4 SearchFolder (com.haulmont.cuba.security.entity.SearchFolder)3 Notifications (io.jmix.ui.Notifications)3 Folder (com.haulmont.cuba.core.entity.Folder)2 Internal (io.jmix.core.annotation.Internal)2 Screen (io.jmix.ui.screen.Screen)2 StandardCloseAction (io.jmix.ui.screen.StandardCloseAction)2 Subscribe (io.jmix.ui.screen.Subscribe)2 JmixButton (io.jmix.ui.widget.JmixButton)2 Nullable (javax.annotation.Nullable)2 Strings (com.google.common.base.Strings)1 AbstractSearchFolder (com.haulmont.cuba.core.entity.AbstractSearchFolder)1 AppFolder (com.haulmont.cuba.core.entity.AppFolder)1 AppFolderEditWindow (com.haulmont.cuba.web.app.folders.AppFolderEditWindow)1 FolderEditWindow (com.haulmont.cuba.web.app.folders.FolderEditWindow)1 KeyCode (com.vaadin.event.ShortcutAction.KeyCode)1