本文整理汇总了Java中com.vaadin.ui.Window.setContent方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setContent方法的具体用法?Java Window.setContent怎么用?Java Window.setContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.setContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showBadgesInBrowser
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public void showBadgesInBrowser(List<Attendee> attendeeList) {
if (attendeeList.size() > 0) {
StreamResource.StreamSource source = handler.getBadgeFormatter(this, attendeeList);
String filename = "testbadge" + System.currentTimeMillis() + ".pdf";
StreamResource resource = new StreamResource(source, filename);
resource.setMIMEType("application/pdf");
resource.getStream().setParameter("Content-Disposition", "attachment; filename="+filename);
Window window = new Window();
window.setWidth(800, Sizeable.Unit.PIXELS);
window.setHeight(600, Sizeable.Unit.PIXELS);
window.setModal(true);
window.center();
BrowserFrame pdf = new BrowserFrame("test", resource);
pdf.setSizeFull();
window.setContent(pdf);
getUI().addWindow(window);
} else {
Notification.show("No attendees selected");
}
}
示例2: getSpellWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void getSpellWindow(Spell spell) {
Messages messages = Messages.getInstance();
Window window = new Window(spell.getName());
window.setModal(true);
window.setWidth("60%");
CollectionToStringConverter converter = new CollectionToStringConverter();
FormLayout layout = new FormLayout();
DSLabel componentType = new DSLabel(messages.getMessage("spellStep.component.label"),
converter.convertToPresentation(spell.getComponentTypes(), new ValueContext()));
DSLabel text = new DSLabel(messages.getMessage("spellStep.description.label"), spell.getDescription());
layout.addComponents(componentType, text);
//TODO : other useful info
window.setContent(layout);
UI.getCurrent().addWindow(window);
}
示例3: createLayout
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void createLayout() {
final HorizontalLayout footer = new HorizontalLayout();
footer.setSizeUndefined();
footer.addStyleName("confirmation-window-footer");
footer.setSpacing(true);
footer.setMargin(false);
footer.addComponents(closeBtn);
footer.setComponentAlignment(closeBtn, Alignment.TOP_CENTER);
final VerticalLayout uploadResultDetails = new VerticalLayout();
uploadResultDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px");
uploadResultDetails.addStyleName("confirmation-popup");
uploadResultDetails.addComponent(uploadResultTable);
uploadResultDetails.setComponentAlignment(uploadResultTable, Alignment.MIDDLE_CENTER);
uploadResultDetails.addComponent(footer);
uploadResultDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
uploadResultsWindow = new Window();
uploadResultsWindow.setContent(uploadResultDetails);
uploadResultsWindow.setResizable(Boolean.FALSE);
uploadResultsWindow.setClosable(Boolean.FALSE);
uploadResultsWindow.setDraggable(Boolean.TRUE);
uploadResultsWindow.setModal(true);
uploadResultsWindow.setCaption(SPUILabelDefinitions.UPLOAD_RESULT);
uploadResultsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}
示例4: buildLayout
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void buildLayout() {
final HorizontalLayout footer = getFooterLayout();
uploadArtifactDetails = new VerticalLayout();
uploadArtifactDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px");
uploadArtifactDetails.addStyleName("confirmation-popup");
uploadArtifactDetails.addComponent(uploadDetailsTable);
uploadArtifactDetails.setComponentAlignment(uploadDetailsTable, Alignment.MIDDLE_CENTER);
uploadArtifactDetails.addComponent(footer);
uploadArtifactDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
window = new Window();
window.setContent(uploadArtifactDetails);
window.setResizable(Boolean.FALSE);
window.setClosable(Boolean.TRUE);
window.setDraggable(Boolean.TRUE);
window.setModal(true);
window.addCloseListener(event -> onPopupClose());
window.setCaption(i18n.getMessage("header.caption.upload.details"));
window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}
示例5: buildWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* 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;
}
示例6: createOldWaySourceWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private Window createOldWaySourceWindow() {
Window sourceWindow = new Window("Example");
VerticalLayout content = new VerticalLayout();
content.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
Label sourceCode = new Label("<pre><code>" + " final TextArea anotherArea = new TextArea();\n"
+ " anotherArea.setId(\"clipboardTarget\");\n"
+ " anotherArea.setValue(\"Another example to copy to clipboard\");\n" + "\n"
+ " ClipboardButton clipboardButton = new ClipboardButton(\"clipboardTarget\");\n"
+ " clipboardButton.addSuccessListener(new ClipboardButton.SuccessListener() {\n" + "\n"
+ " @Override\n" + " public void onSuccess() {\n"
+ " Notification.show(\"Copy to clipboard successful\");\n" + " }\n"
+ " });\n" + " clipboardButton.addErrorListener(new ClipboardButton.ErrorListener() {\n"
+ "\n" + " @Override\n" + " public void onError() {\n"
+ " Notification.show(\"Copy to clipboard unsuccessful\", Notification.Type.ERROR_MESSAGE);\n"
+ " }\n" + " });</code></pre>", ContentMode.HTML);
content.addComponent(new HorizontalLayout(sourceCode));
sourceWindow.setContent(content);
sourceWindow.setHeight("400px");
return sourceWindow;
}
示例7: init
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void init() {
// エラーハンドリング
setErrorHandler(new ErrorHandler(this));
// ログアウト後の画面設定
String logoutUrl;
try {
logoutUrl = new URL(getURL(), "..").toExternalForm();
} catch (MalformedURLException e) {
logoutUrl = "../../../";
}
setLogoutURL(logoutUrl);
Window mainWindow = new Window(ViewProperties.getCaption("window.main"));
mainWindow.setWidth("960px");
mainWindow.setHeight("100%");
setTheme("classy");
setMainWindow(mainWindow);
MainView mainView = new MainView();
mainWindow.setContent(mainView);
}
示例8: attach
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void attach() {
super.attach();
loginWindow = new Window();
// create view bound form
VerticalLayout content = buildMainLayout();
content.setMargin(false);
loginWindow.setContent(content);
loginWindow.center();
loginWindow.setCaption(getI18N().getMessage("com.thingtrack.konekti.view.web.workbench.SecurityAccessView.loginWindow.caption"));
loginWindow.setModal(true);
loginWindow.setResizable(false);
loginWindow.setClosable(false);
User loginUser = new User();
BeanItem<User> userBean = new BeanItem<User>(loginUser);
viewBoundForm.setItemDataSource(userBean);
getWindow().addWindow(loginWindow);
}
示例9: zipProject
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Zips project.
*
* @param projectName the name of the project to be zipped
*/
protected void zipProject() {
try {
File zipFile = File.createTempFile("mideaas-"+project.getName(), ".zip");
zipProjectToFile(zipFile, settings);
FileResource zip = new FileResource(zipFile);
FileDownloader fd = new FileDownloader(zip);
Button downloadButton = new Button("Download project");
fd.extend(downloadButton);
//filedonwnloader can not be connected to menuitem :( So I connected it to popupwindow :)
Window zipButtonWindow = new Window();
zipButtonWindow.setCaption("Zip and download project");
zipButtonWindow.setWidth(200, Unit.PIXELS);
zipButtonWindow.setContent(downloadButton);
UI.getCurrent().addWindow(zipButtonWindow);
} catch (IOException e) {
e.printStackTrace();
Notification.show("Error: " + e.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
示例10: getAddonComponent
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public Component getAddonComponent() {
Window w = new Window("Medium Editor in window");
w.setWidth(500, Unit.PIXELS);
w.setHeight(400, Unit.PIXELS);
Panel p = new Panel();
p.addStyleName(ValoTheme.PANEL_WELL);
p.setSizeFull();
MediumEditor editor = new MediumEditor();
editor.setSizeFull();
editor.setFocusOutlineEnabled(false);
editor.setJsLoggingEnabled(true);
editor.setContent(Lorem.getHtmlParagraphs(3, 5));
editor.configure(
editor.options()
.toolbar()
.buttons(Buttons.BOLD, Buttons.ITALIC,
Buttons.JUSTIFY_CENTER,
Buttons.ANCHOR)
.done()
.autoLink(true)
.imageDragging(false)
.done()
);
editors.add(editor);
p.setContent(editor);
w.setContent(p);
Button b = new Button("Open Window");
b.addClickListener(e -> {
w.setPosition(e.getClientX(), e.getClientY());
UI.getCurrent().addWindow(w);
});
return b;
}
示例11: showItemWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showItemWindow() {
Messages messages = Messages.getInstance();
Window window = new Window(this.item.getEquipment().getName());
window.setModal(true);
window.setWidth("60%");
FormLayout layout = new FormLayout();
DSLabel description = new DSLabel("Description", this.item.getEquipment().getDescription());
layout.addComponents(description);
//TODO : other useful info
window.setContent(layout);
UI.getCurrent().addWindow(window);
}
示例12: showArtifactDetailsWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showArtifactDetailsWindow(final Long itemId, final String nameVersionStr) {
final Window artifactDtlsWindow = new Window();
artifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(nameVersionStr));
artifactDtlsWindow.setCaptionAsHtml(true);
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(itemId, nameVersionStr);
/* Now add table to the window */
artifactDetailsLayout.getArtifactDetailsTable().setWidth(700, Unit.PIXELS);
artifactDetailsLayout.getArtifactDetailsTable().setHeight(500, Unit.PIXELS);
artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
/* Create maximized view of the table */
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());
}
});
/* display the window */
UI.getCurrent().addWindow(artifactDtlsWindow);
}
示例13: showPopup
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showPopup(String eintrag) {
Window modalWin = new Window("E-Mail is being sent...");
modalWin.setContent(new Label("<div style=\"margin: 10px; \">"
+ "<h2>Season's greetings</h2>" + "<p>" + eintrag + "</p>"
+ "</div>", ContentMode.HTML));
modalWin.setModal(true);
modalWin.setWidth("400px");
modalWin.setHeight("250px");
modalWin.center();
UI.getCurrent().addWindow(modalWin);
}
示例14: openTestWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void openTestWindow() {
Window testWindow = new Window();
DemoOverlayTest test = new DemoOverlayTest();
test.setSuggestionProvider(suggestionProvider);
testWindow.setContent(test);
testWindow.setCaption("Window Demo");
testWindow.center();
getUI().addWindow(testWindow);
}
示例15: addWorkbenchContent
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Adds the given component as a tab or window acordingly to current visualizacion settings.
* @param component component to add.
* @param caption Tab or Window caption.
* @param icon Tab or Window icon.
* @param closable true if the user can close the tab or window.
* @param confirmClosing true to show a confirmation dialog before closing the tab or window.
*/
public void addWorkbenchContent(Component component, String caption, Resource icon, boolean closable, boolean confirmClosing) {
component.setSizeFull();
if(windowsMenuItem != null && !windowsMenuItem.isVisible()) {
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(false);
layout.addComponent(component);
Window window = new Window(caption);
window.setIcon(icon);
window.setClosable(closable);
window.setContent(layout);
window.setWidth("80%");
window.setHeight("80%");
window.getContent().setSizeFull();
placeWindow(window);
UI.getCurrent().addWindow(window);
} else {
Tab tab = tabsheet.addTab(component, caption, icon);
tab.setClosable(closable);
tabsheet.setSelectedTab(component);
}
if(confirmClosing) {
confirmClosingComponents.add(component);
}
}