本文整理了Java中com.vaadin.ui.Window.isModal()
方法的一些代码示例,展示了Window.isModal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.isModal()
方法的具体详情如下:
包路径:com.vaadin.ui.Window
类名称:Window
方法名:isModal
暂无
代码示例来源:origin: com.vaadin/vaadin-server
/**
* If there are currently several windows visible, calling this method makes
* this window topmost.
* <p>
* This method can only be called if this window connected a UI. Else an
* illegal state exception is thrown. Also if there are modal windows and
* this window is not modal, and illegal state exception is thrown.
* <p>
*/
public void bringToFront() {
UI uI = getUI();
if (uI == null) {
throw new IllegalStateException(
"Window must be attached to parent before calling bringToFront method.");
}
int maxBringToFront = -1;
for (Window w : uI.getWindows()) {
if (!isModal() && w.isModal()) {
throw new IllegalStateException(
"The UI contains modal windows, non-modal window cannot be brought to front.");
}
if (w.bringToFront != null) {
maxBringToFront = Math.max(maxBringToFront,
w.bringToFront.intValue());
}
}
bringToFront = Integer.valueOf(maxBringToFront + 1);
markAsDirty();
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets
Window currentWindow = (Window) windowOrUI;
if (!currentWindow.isModal()) {
代码示例来源:origin: com.haulmont.cuba/cuba-web
@Override
public void show() {
if (throwable == null) {
throw new IllegalStateException("throwable should not be null");
}
Throwable rootCause = ExceptionUtils.getRootCause(throwable);
if (rootCause == null) {
rootCause = throwable;
}
ExceptionDialog dialog = new ExceptionDialog(rootCause, caption, message);
for (com.vaadin.ui.Window window : ui.getWindows()) {
if (window.isModal()) {
dialog.setModal(true);
break;
}
}
ui.addWindow(dialog);
dialog.focus();
}
}
代码示例来源:origin: com.haulmont.reports/reports-web
@Override
protected void doHandle(App app, String className, String message, @Nullable Throwable throwable) {
Messages messages = AppBeans.get(Messages.class);
if (FailedToConnectToOpenOfficeException.class.getName().equals(className)) {
String msg = messages.getMessage(getClass(), "reportException.failedConnectToOffice");
app.getWindowManager().showNotification(msg, Frame.NotificationType.ERROR);
} else if (NoOpenOfficeFreePortsException.class.getName().equals(className)) {
String msg = messages.getMessage(getClass(), "reportException.noOpenOfficeFreePorts");
app.getWindowManager().showNotification(msg, Frame.NotificationType.ERROR);
} else if (ValidationException.class.getName().equals(className)) {
app.getWindowManager().showNotification(message, Frame.NotificationType.ERROR);
} else {
ExceptionDialog dialog = new ExceptionDialog(
throwable,
messages.getMessage(getClass(), "reportException.message"),
message
);
for (Window window : AppUI.getCurrent().getWindows()) {
if (window.isModal()) {
dialog.setModal(true);
break;
}
}
app.getAppUI().addWindow(dialog);
dialog.focus();
}
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
protected void showDialog(App app, Throwable exception) {
Throwable rootCause = ExceptionUtils.getRootCause(exception);
if (rootCause == null) {
rootCause = exception;
}
ExceptionDialog dialog = new ExceptionDialog(rootCause);
AppUI ui = app.getAppUI();
for (Window window : ui.getWindows()) {
if (window.isModal()) {
dialog.setModal(true);
break;
}
}
ui.addWindow(dialog);
dialog.focus();
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
@Override
public void show() {
initShortcuts();
if (ui.isTestMode()) {
window.setCubaId("messageDialog");
messageLabel.setCubaId("messageDialogLabel");
okButton.setCubaId("messageDialogOk");
}
if (ui.isPerformanceTestMode()) {
window.setId(ui.getTestIdManager().getTestId("messageDialog"));
}
if (!window.isModal()) {
for (com.vaadin.ui.Window w : ui.getWindows()) {
if (w.isModal()) {
window.setModal(true);
break;
}
}
}
ui.addWindow(window);
window.center();
window.bringToFront();
okButton.focus();
}
内容来源于网络,如有侵权,请联系作者删除!