use of com.haulmont.cuba.gui.screen.StandardCloseAction in project cuba by cuba-platform.
the class WebDialogWindow method onCloseShortcutTriggered.
protected void onCloseShortcutTriggered(@SuppressWarnings("unused") Object sender, @SuppressWarnings("unused") Object target) {
if (this.isCloseable()) {
com.vaadin.ui.Component component = getComponent();
CubaUI ui = (CubaUI) component.getUI();
if (!ui.isAccessibleForUser(component)) {
LoggerFactory.getLogger(WebWindow.class).debug("Ignore shortcut action because Window is inaccessible for user");
return;
}
BeforeCloseEvent event = new BeforeCloseEvent(this, CloseOriginType.SHORTCUT);
fireBeforeClose(event);
if (!event.isClosePrevented()) {
getFrameOwner().close(new StandardCloseAction(Window.CLOSE_ACTION_ID));
}
}
}
use of com.haulmont.cuba.gui.screen.StandardCloseAction in project cuba by cuba-platform.
the class WebDialogWindow method onCloseButtonClick.
protected void onCloseButtonClick(CubaWindow.PreCloseEvent preCloseEvent) {
preCloseEvent.setPreventClose(true);
com.vaadin.ui.Component component = getComponent();
CubaUI ui = (CubaUI) component.getUI();
if (!ui.isAccessibleForUser(component)) {
LoggerFactory.getLogger(WebWindow.class).debug("Ignore close button click because Window is inaccessible for user");
return;
}
BeforeCloseEvent event = new BeforeCloseEvent(this, CloseOriginType.CLOSE_BUTTON);
fireBeforeClose(event);
if (!event.isClosePrevented()) {
// user has clicked on X
getFrameOwner().close(new StandardCloseAction(Window.CLOSE_ACTION_ID));
}
}
Aggregations