本文整理了Java中com.vaadin.ui.Window.setModal()
方法的一些代码示例,展示了Window.setModal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setModal()
方法的具体详情如下:
包路径:com.vaadin.ui.Window
类名称:Window
方法名:setModal
[英]Sets window modality. When a modal window is open, components outside that window cannot be accessed.
Keyboard navigation is restricted by blocking the tab key at the top and bottom of the window by activating the tab stop function internally.
[中]设置窗口模态。模式窗口打开时,无法访问该窗口外的组件。
通过在内部激活tab stop功能,阻止窗口顶部和底部的tab键,从而限制键盘导航。
代码示例来源:origin: KrailOrg/krail
/**
* Switches, if the dialog is shown modal or not.
*
* @param modal If set to <code>true</code>, the dialog is shown modal.
* @return The {@link MessageBox} instance itself
*/
public MessageBox asModal(boolean modal) {
window.setModal(modal);
return this;
}
代码示例来源:origin: org.aperteworkflow/gui-commons
public static Window modalWindow(String title, ComponentContainer content) {
Window window = new Window(title, content);
window.setClosable(false);
window.setModal(true);
window.setSizeUndefined();
return window;
}
代码示例来源:origin: stackoverflow.com
pan[beNumber].addClickListener(new MyCustomListener(beNumber));
class MyCustomListener implements MouseEvents.ClickListener{
final int beNumber;//I guess you use int in your arrays
public MyCustomListener(int beNumber){
this.beNumber = beNumber;
}
@Override
public void click(MouseEvents.ClickEvent event) {
// Create a sub-window and set the content
Window subWindow = new Window("Patient Transfer", new WardMovementView(beNumber));//pass that var to your custom component if you want to use it
subWindow.setCaptionAsHtml(true);
subWindow.setModal(true);
subWindow.setWidth("1200px");
subWindow.setHeight("800px");
UI.getCurrent().addWindow(subWindow);
}
}
代码示例来源:origin: stackoverflow.com
pan[beNumber].addClickListener(new MouseEvents.ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void click(MouseEvents.ClickEvent event) {
// Create a sub-window and set the content
Window subWindow = new PatientTranfserWindow("Patient Transfer", new WardMovementView());
subWindow.setCaptionAsHtml(true);
subWindow.setModal(true);
subWindow.setWidth("1200px");
subWindow.setHeight("800px");
subWindow.setBENumber(beNumber);
UI.getCurrent().addWindow(subWindow);
}
});
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
/**
* Build window based on type.
*
* @return Window
*/
public Window buildWindow() {
final Window window = new Window(caption);
window.setContent(content);
window.setSizeUndefined();
window.setModal(true);
window.setResizable(false);
decorateWindow(window);
if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
window.setClosable(false);
}
return window;
}
}
代码示例来源:origin: viritin/viritin
public Window openInModalPopup() {
popup = new Window(getModalWindowTitle(), this);
popup.setModal(true);
UI.getCurrent().addWindow(popup);
focusFirst();
return popup;
}
代码示例来源:origin: viritin/viritin
public Window openInModalPopup() {
popup = new Window(getModalWindowTitle(), this);
popup.setModal(true);
UI.getCurrent().addWindow(popup);
focusFirst();
return popup;
}
代码示例来源:origin: eclipse/hawkbit
/**
* Build window based on type.
*
* @return Window
*/
public Window buildWindow() {
final Window window = new Window(caption);
window.setContent(content);
window.setSizeUndefined();
window.setModal(true);
window.setResizable(false);
decorateWindow(window);
if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
window.setClosable(false);
}
return window;
}
}
代码示例来源:origin: org.opencms/opencms-core
/**
* @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext)
*/
public void executeAction(final I_CmsDialogContext context) {
CmsUserInfo dialog = new CmsUserInfo(new I_UploadListener() {
public void onUploadFinished(List<String> uploadedFiles) {
handleUpload(uploadedFiles, context);
}
}, context);
Multimap<String, String> params = A_CmsUI.get().getParameters();
int top = 55;
int left = 0;
if (params.containsKey("left")) {
String buttonLeft = params.get("left").iterator().next();
left = Integer.parseInt(buttonLeft) - 290;
}
final Window window = new Window();
window.setModal(false);
window.setClosable(true);
window.setResizable(false);
window.setContent(dialog);
context.setWindow(window);
window.addStyleName(OpenCmsTheme.DROPDOWN);
UI.getCurrent().addWindow(window);
window.setPosition(left, top);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
public Window buildAndOpen() {
Window window = new Window();
window.setCaption(this.title);
window.setContent(this.build());
window.center();
window.setModal(this.modal);
UI.getCurrent().addWindow(window);
return window;
}
}
代码示例来源:origin: org.ikasan/ikasan-dashboard-jar
public void buttonClick(Button.ClickEvent event)
{
ReplayStatusPanel panel = new ReplayStatusPanel(getReplayEvents(), (ReplayService) replayService, platformConfigurationService, topologyService);
Window window = new Window("Replay Events");
window.setHeight("80%");
window.setWidth("80%");
window.setModal(true);
window.setContent(panel);
UI.getCurrent().addWindow(window);
}
});
代码示例来源:origin: org.ikasan/ikasan-dashboard-jar
public void buttonClick(ClickEvent event)
{
UserDirectoryManagementPanel authMethodPanel = new UserDirectoryManagementPanel(authenticationMethod,
securityService, authenticationProviderFactory, ldapService);
Window window = new Window("Configure User Directory");
window.setModal(true);
window.setHeight("90%");
window.setWidth("90%");
window.setContent(authMethodPanel);
window.addCloseListener(new Window.CloseListener()
{
// inline close-listener
public void windowClose(CloseEvent e)
{
populateAll();
}
});
UI.getCurrent().addWindow(window);
}
});
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
public Window build() {
Window dialog = new Window();
dialog.addStyleName("light-box");
dialog.setDraggable(false);
dialog.setResizable(false);
dialog.setModal(true);
dialog.setWidth(95, Sizeable.Unit.PERCENTAGE);
CssLayout contentWrapper = new CssLayout(content);
contentWrapper.setSizeFull();
contentWrapper.setStyleName("light-box-content");
dialog.setContent(contentWrapper);
dialog.center();
return dialog;
}
代码示例来源:origin: org.ikasan/ikasan-dashboard-jar
public void buttonClick(ClickEvent event)
{
final UserDirectoryManagementPanel authMethodPanel = new UserDirectoryManagementPanel(new AuthenticationMethod(),
securityService, authenticationProviderFactory, ldapService);
Window window = new Window("Configure User Directory");
window.setModal(true);
window.setHeight("90%");
window.setWidth("90%");
window.setContent(authMethodPanel);
UI.getCurrent().addWindow(window);
window.addCloseListener(new Window.CloseListener()
{
@Override
public void windowClose(Window.CloseEvent e)
{
populateAll();
}
});
}
});
代码示例来源:origin: OpenNMS/opennms
final Window window = new Window("Preview");
window.setModal(true);
window.setClosable(true);
window.setResizable(false);
代码示例来源:origin: org.opennms.features/vaadin-surveillance-views
final Window window = new Window("Preview");
window.setModal(true);
window.setClosable(true);
window.setResizable(false);
代码示例来源:origin: org.ikasan/ikasan-dashboard-jar
/**
* Helper method to initialise this object.
*
* @param message
*/
protected void init(String text)
{
super.setWidth("50%");
super.setHeight("50%");
super.setModal(true);
super.setResizable(true);
super.center();
TextArea ta = new TextArea();
ta.setSizeFull();
ta.setValue(text);
ta.setWordwrap(false);
HorizontalLayout layout = new HorizontalLayout();
layout.setMargin(true);
layout.addComponent(ta);
layout.setSizeFull();
Panel p = new Panel();
p.setSizeFull();
p.setContent(layout);
super.setContent(p);
}
}
代码示例来源:origin: jreznot/electron-java-app
private void onMenuAbout() {
Window helpWindow = new Window();
helpWindow.setCaption("About");
helpWindow.setModal(true);
helpWindow.setResizable(false);
helpWindow.setSizeUndefined();
VerticalLayout content = new VerticalLayout();
content.setSizeUndefined();
content.setMargin(true);
content.setSpacing(true);
Label aboutLabel = new Label("Electron+Vaadin Demo\nAuthor: Yuriy Artamonov");
aboutLabel.setContentMode(ContentMode.PREFORMATTED);
aboutLabel.setSizeUndefined();
content.addComponent(aboutLabel);
Button okBtn = new Button("Ok", VaadinIcons.CHECK);
okBtn.focus();
okBtn.addClickListener(event -> helpWindow.close());
content.addComponent(okBtn);
content.setComponentAlignment(okBtn, Alignment.MIDDLE_CENTER);
helpWindow.setContent(content);
getUI().addWindow(helpWindow);
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
artifactDtlsWindow.setImmediate(true);
artifactDtlsWindow.setWindowMode(WindowMode.NORMAL);
artifactDtlsWindow.setModal(true);
artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
代码示例来源:origin: eclipse/hawkbit
artifactDtlsWindow.setImmediate(true);
artifactDtlsWindow.setWindowMode(WindowMode.NORMAL);
artifactDtlsWindow.setModal(true);
artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
内容来源于网络,如有侵权,请联系作者删除!