本文整理了Java中com.vaadin.ui.UI.setContent()
方法的一些代码示例,展示了UI.setContent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UI.setContent()
方法的具体详情如下:
包路径:com.vaadin.ui.UI
类名称:UI
方法名:setContent
暂无
代码示例来源:origin: com.vaadin/vaadin-server
/**
* Set the content of the window. For a {@link LegacyWindow}, the content
* must be a {@link ComponentContainer}.
*
* @param content
*/
@Override
public void setContent(Component content) {
if (!(content instanceof ComponentContainer)) {
throw new IllegalArgumentException(
"The content of a LegacyWindow must be a ComponentContainer");
}
super.setContent(content);
}
代码示例来源:origin: com.vaadin/vaadin-server
/**
* Creates a new UI with the given component (often a layout) as its
* content.
*
* @param content
* the component to use as this UIs content.
*
* @see #setContent(Component)
*/
public UI(Component content) {
registerRpc(rpc);
registerRpc(debugRpc);
registerRpc(windowOrderRpc);
setSizeFull();
setContent(content);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
protected void redirectAfterLogout(String loggedOutUrl) {
if (!Strings.isNullOrEmpty(loggedOutUrl)) {
AppUI currentUi = AppUI.getCurrent();
// it can be null if we handle request in a custom RequestHandler
if (currentUi != null) {
currentUi.setContent(null);
currentUi.getPage().setLocation(loggedOutUrl);
} else {
VaadinResponse response = VaadinService.getCurrentResponse();
try {
((VaadinServletResponse) response).getHttpServletResponse().
sendRedirect(loggedOutUrl);
} catch (IOException e) {
log.error("Error on send redirect to client", e);
}
}
VaadinSession vaadinSession = VaadinSession.getCurrent();
for (UI ui : vaadinSession.getUIs()) {
if (ui != currentUi) {
ui.access(() -> {
ui.setContent(null);
ui.getPage().setLocation(loggedOutUrl);
});
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!