Search in sources :

Example 16 with WebConfig

use of com.haulmont.cuba.web.WebConfig in project cuba by cuba-platform.

the class WebAppWorkArea method isNotCloseable.

public boolean isNotCloseable(Window window) {
    if (!window.isCloseable()) {
        return true;
    }
    Configuration configuration = beanLocator.get(Configuration.NAME);
    WebConfig webConfig = configuration.getConfig(WebConfig.class);
    if (webConfig.getDefaultScreenCanBeClosed()) {
        return false;
    }
    boolean windowIsDefault;
    if (window instanceof Window.Wrapper) {
        windowIsDefault = ((WebWindow) ((Window.Wrapper) window).getWrappedWindow()).isDefaultScreenWindow();
    } else {
        windowIsDefault = ((WebWindow) window).isDefaultScreenWindow();
    }
    return windowIsDefault;
}
Also used : Configuration(com.haulmont.cuba.core.global.Configuration) WebConfig(com.haulmont.cuba.web.WebConfig)

Aggregations

WebConfig (com.haulmont.cuba.web.WebConfig)16 Configuration (com.haulmont.cuba.core.global.Configuration)9 ThemeConstants (com.haulmont.cuba.gui.theme.ThemeConstants)3 VersionedThemeResource (com.haulmont.cuba.web.toolkit.VersionedThemeResource)3 FileResource (com.vaadin.server.FileResource)2 Resource (com.vaadin.server.Resource)2 File (java.io.File)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 AbstractSearchFolder (com.haulmont.cuba.core.entity.AbstractSearchFolder)1 FileStorageException (com.haulmont.cuba.core.global.FileStorageException)1 GlobalConfig (com.haulmont.cuba.core.global.GlobalConfig)1 Messages (com.haulmont.cuba.core.global.Messages)1 ThemeConstantsRepository (com.haulmont.cuba.gui.theme.ThemeConstantsRepository)1 FileUploadingAPI (com.haulmont.cuba.gui.upload.FileUploadingAPI)1 WebWindowManager (com.haulmont.cuba.web.WebWindowManager)1 ManagedMainTabSheetMode (com.haulmont.cuba.web.gui.ManagedMainTabSheetMode)1 HttpRequestFilter (com.haulmont.cuba.web.security.HttpRequestFilter)1 CubaMultiUpload (com.haulmont.cuba.web.toolkit.ui.CubaMultiUpload)1 CubaFileDownloader (com.haulmont.cuba.web.widgets.CubaFileDownloader)1 Action (com.vaadin.event.Action)1