本文整理汇总了Java中com.vaadin.ui.Window.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setHeight方法的具体用法?Java Window.setHeight怎么用?Java Window.setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.setHeight方法的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: 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;
}
示例3: 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);
}
示例4: showModalWin
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public static void showModalWin(final ExtaEditForm<?> editWin) {
final Window window = new Window(editWin.getCaption(), editWin);
window.setClosable(true);
window.setModal(true);
if (editWin.getWinHeight() != Sizeable.SIZE_UNDEFINED)
window.setHeight(editWin.getWinHeight(), editWin.getWinHeightUnit());
if (editWin.getWinWidth() != Sizeable.SIZE_UNDEFINED)
window.setWidth(editWin.getWinWidth(), editWin.getWinWidthUnit());
window.addCloseListener(event -> editWin.fireCloseForm());
editWin.addCloseFormListener(event -> window.close());
if (editWin.getWinHeight() != Sizeable.SIZE_UNDEFINED && editWin.getWinWidth() != Sizeable.SIZE_UNDEFINED)
editWin.addAttachListener(e -> editWin.adjustSize());
else
new WinSizeAdjuster(editWin, window);
UI.getCurrent().addWindow(window);
}
示例5: openLogWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void openLogWindow() {
Window w = new Window("Log");
w.center();
w.setWidth("80%");
w.setHeight("80%");
w.setContent(logView);
logView.setSizeFull();
UI.getCurrent().addWindow(w);
setEnabled(false);
w.addCloseListener(new CloseListener() {
@Override
public void windowClose(CloseEvent e) {
ShowLogButton.this.setEnabled(true);
}
});
}
示例6: 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;
}
示例7: 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);
}
示例8: 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);
}
}
示例9: adjustWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
protected void adjustWindow(final ExtaEditForm<?> editWin, final Window window) {
if (!adjusted) {
if(formHeight != 0 && wndHeight > formHeight || wndHeight >= brwHeight) {
if (wndHeight >= brwHeight)
window.setHeight(100, Sizeable.Unit.PERCENTAGE);
else
window.setHeight(wndHeight, Sizeable.Unit.PIXELS);
editWin.adjustSize();
adjusted = true;
}
}
}
示例10: showMessage
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public void showMessage(String message,String width, String height,String caption){
Label messageLabel=new Label(message);
Window window = new Window(caption);
VerticalLayout windowContent = new VerticalLayout();
windowContent.addComponent(messageLabel);
windowContent.setMargin(true);
windowContent.setComponentAlignment(messageLabel, Alignment.MIDDLE_CENTER);
window.setContent(windowContent);
window.setWidth(width);
window.setHeight(height);
window.center();
UI.getCurrent().addWindow(window);
}
示例11: GridContainerCSVExport
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public GridContainerCSVExport(final String fileName, final Grid grid, final GridHeadingPropertySet<E> headingsSet)
{
this.grid = grid;
this.headingsSet = headingsSet;
final Window window = new Window();
window.setCaption("Download " + fileName + " CSV data");
window.center();
window.setHeight("100");
window.setWidth("300");
window.setResizable(false);
window.setModal(true);
final HorizontalLayout layout = new HorizontalLayout();
layout.setSizeFull();
layout.setMargin(true);
window.setContent(layout);
UI.getCurrent().addWindow(window);
window.setVisible(true);
final Button downloadButton = createDownloadButton(fileName, window);
layout.addComponent(downloadButton);
layout.setComponentAlignment(downloadButton, Alignment.MIDDLE_CENTER);
}
示例12: ContainerCSVExport
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public ContainerCSVExport(final String fileName, final Table table, final HeadingPropertySet headingsSet)
{
this.table = table;
this.headingsSet = headingsSet;
final Window window = new Window();
window.setCaption("Download " + fileName + " CSV data");
window.center();
window.setHeight("100");
window.setWidth("300");
window.setModal(true);
HorizontalLayout layout = new HorizontalLayout();
layout.setMargin(true);
window.setContent(layout);
UI.getCurrent().addWindow(window);
window.setVisible(true);
final Button downloadButton = createDownloadButton(fileName, window);
layout.addComponent(downloadButton);
layout.setComponentAlignment(downloadButton, Alignment.MIDDLE_CENTER);
layout.addComponent(downloadButton);
}
示例13: showTextWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showTextWindow(String caption, String content) {
Label textComponent = new Label(content);
textComponent.setContentMode(ContentMode.PREFORMATTED);
Window subWindow = new Window(caption);
subWindow.setContent(textComponent);
subWindow.setWidth(70, Unit.PERCENTAGE);
subWindow.setHeight(90, Unit.PERCENTAGE);
subWindow.center();
this.getUI().addWindow(subWindow);
}
示例14: showMailForm
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showMailForm(final TextField emailField)
{
final Window mailWindow = new Window("Send Email");
mailWindow.setWidth("80%");
mailWindow.setHeight("80%");
final User sender = (User) getSession().getAttribute("user");
mailWindow.setContent(new EmailForm(mailWindow, sender, getCurrent(), emailField.getValue()));
mailWindow.setVisible(true);
mailWindow.center();
UI.getCurrent().addWindow(mailWindow);
}
示例15: showMailForm
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showMailForm(EmailContact emailContact)
{
final Window mailWindow = new Window("Send Email");
mailWindow.setWidth("80%");
mailWindow.setHeight("80%");
final User sender = (User) getSession().getAttribute("user");
mailWindow.setContent(
new EmailForm(mailWindow, sender, emailContact.getContact(), emailContact.getContact().getEmail()));
mailWindow.setVisible(true);
mailWindow.center();
UI.getCurrent().addWindow(mailWindow);
}