Java源码示例:com.vaadin.shared.ui.window.WindowMode
示例1
@RequiredUIAccess
public void show() {
myWindow = Window.createModal(myProject.getName());
com.vaadin.ui.Window vaadinWindow = (com.vaadin.ui.Window)TargetVaddin.to(myWindow);
vaadinWindow.setWindowMode(WindowMode.MAXIMIZED);
myWindow.setResizable(false);
myWindow.addListener(Window.CloseListener.class, () -> {
myWindow.close();
ProjectManager.getInstance().closeAndDisposeAsync(myProject, UIAccess.current());
});
myWindow.setContent(myRootView.getComponent());
myRootView.update();
myWindow.show();
}
示例2
private void showArtifactDetailsWindow(final SoftwareModule softwareModule) {
final Window artifactDtlsWindow = new Window();
artifactDtlsWindow.setId(UIComponentIdProvider.SHOW_ARTIFACT_DETAILS_POPUP_ID);
artifactDtlsWindow.setAssistivePrefix(HawkbitCommonUtil
.getArtifactoryDetailsLabelId(softwareModule.getName(), getI18n()) + " " + "<b>");
artifactDtlsWindow.setCaption(softwareModule.getName() + ":" + softwareModule.getVersion());
artifactDtlsWindow.setAssistivePostfix("</b>");
artifactDtlsWindow.setClosable(true);
artifactDtlsWindow.setResizable(true);
artifactDtlsWindow.setImmediate(true);
artifactDtlsWindow.setWindowMode(WindowMode.NORMAL);
artifactDtlsWindow.setModal(true);
artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
artifactDetailsLayout.setFullWindowMode(false);
artifactDetailsLayout.populateArtifactDetails(softwareModule);
artifactDetailsLayout.getArtifactDetailsTable().setWidth(700, Unit.PIXELS);
artifactDetailsLayout.getArtifactDetailsTable().setHeight(500, Unit.PIXELS);
artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
artifactDtlsWindow.addWindowModeChangeListener(event -> {
if (event.getWindowMode() == WindowMode.MAXIMIZED) {
artifactDtlsWindow.setSizeFull();
artifactDetailsLayout.setFullWindowMode(true);
artifactDetailsLayout.createMaxArtifactDetailsTable();
artifactDetailsLayout.getMaxArtifactDetailsTable().setWidth(100, Unit.PERCENTAGE);
artifactDetailsLayout.getMaxArtifactDetailsTable().setHeight(100, Unit.PERCENTAGE);
artifactDtlsWindow.setContent(artifactDetailsLayout.getMaxArtifactDetailsTable());
} else {
artifactDtlsWindow.setSizeUndefined();
artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
}
});
UI.getCurrent().addWindow(artifactDtlsWindow);
}
示例3
@Override
public boolean isMaximized() {
return window.getWindowMode() == WindowMode.MAXIMIZED;
}
示例4
@Override
public OptionDialogBuilder withMaximized(boolean maximized) {
window.setWindowMode(maximized ? WindowMode.MAXIMIZED : WindowMode.NORMAL);
return this;
}
示例5
@Override
public boolean isMaximized() {
return window.getWindowMode() == WindowMode.MAXIMIZED;
}
示例6
@Override
public MessageDialogBuilder withMaximized(boolean maximized) {
window.setWindowMode(maximized ? WindowMode.MAXIMIZED : WindowMode.NORMAL);
return this;
}
示例7
public void setStackTraceVisible(boolean visible) {
isStackTraceVisible = visible;
ThemeConstants theme = App.getInstance().getThemeConstants();
if (visible) {
if (copyButton != null) {
copyButton.setVisible(true);
}
showStackTraceButton.setCaption(messages.getMainMessage("exceptionDialog.hideStackTrace"));
mainLayout.addComponent(stackTraceTextArea);
mainLayout.setExpandRatio(stackTraceTextArea, 1.0f);
mainLayout.setHeight(100, Unit.PERCENTAGE);
setWidth(theme.get("cuba.web.ExceptionDialog.expanded.width"));
setHeight(theme.get("cuba.web.ExceptionDialog.expanded.height"));
setResizable(true);
center();
stackTraceTextArea.focus();
stackTraceTextArea.setCursorPosition(0);
} else {
if (copyButton != null) {
copyButton.setVisible(false);
}
showStackTraceButton.setCaption(messages.getMainMessage("exceptionDialog.showStackTrace"));
mainLayout.setHeight(-1, Unit.PIXELS);
mainLayout.removeComponent(stackTraceTextArea);
setWidth(theme.get("cuba.web.ExceptionDialog.width"));
setHeight(-1, Unit.PERCENTAGE);
setResizable(false);
center();
setWindowMode(WindowMode.NORMAL);
}
}
示例8
private void closeWindow() {
setWindowMode(WindowMode.NORMAL);
setColumnWidth();
setPopupSizeInMinMode();
this.close();
}