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;
}
Aggregations