本文整理汇总了Java中com.vaadin.ui.Window.center方法的典型用法代码示例。如果您正苦于以下问题:Java Window.center方法的具体用法?Java Window.center怎么用?Java Window.center使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.center方法的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: buttonClick
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
if (b == btnJobQueueStatus) {
Window subWindow = new Window("Job Manager");
subWindow.setWidth("500px");
subWindow.center();
getApplication().getMainWindow().addWindow(subWindow);
Panel p = new Panel(new JobsStatusViewComponent(getApplication().getURL()));
p.getContent().setWidth("100%");
p.setWidth("100%");
subWindow.addComponent(p);
subWindow.setModal(true);
} else if (b == help) {
String HelpURL = getApplication().getURL().toExternalForm() + "doc";
getApplication().getMainWindow().open(new ExternalResource(HelpURL), "_blank");
} else if (b == restart) {
((ExpressZipWindow) getApplication().getMainWindow()).getApplication().close();
}
}
示例3: 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);
}
示例4: 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);
}
});
}
示例5: 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);
}
示例6: 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);
}
示例7: startProcessor
import com.vaadin.ui.Window; //导入方法依赖的package包/类
protected void startProcessor() {
final ProgressBar progressBar = new ProgressBar();
progressBar.setWidth(400, Unit.PIXELS);
final Window progressWindow = new Window("Progress", progressBar);
progressWindow.setClosable(false);
progressWindow.setResizable(false);
progressWindow.center();
new Thread(new Runnable() {
@Override
public void run() {
new Processor(new ProgressListener() {
@Override
public void onProgress(final long progress) {
UI.getCurrent().access(new Runnable() {
@Override
public void run() {
// 0 .. 1
final float progressBarValue = (float) progress / Processor.MAX_PROGRESS;
progressBar.setValue(progressBarValue);
if (progress == Processor.MAX_PROGRESS) {
UI.getCurrent().setPollInterval(-1);
UI.getCurrent().removeWindow(progressWindow);
}
}
});
}
}).run();
}
}).start();
UI.getCurrent().setPollInterval(250);
UI.getCurrent().addWindow(progressWindow);
}
示例8: init
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public void init(String title, String message){
Label messageLabel=new Label(message);
Window window = new Window(title);
VerticalLayout windowContent = new VerticalLayout();
windowContent.addComponent(messageLabel);
windowContent.setMargin(true);
windowContent.setComponentAlignment(messageLabel, Alignment.MIDDLE_CENTER);
window.setContent(windowContent);
window.setSizeUndefined(); //sets window to be the size of the content
window.center();
UI.getCurrent().addWindow(window);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: 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);
}
示例15: openSendWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@SuppressWarnings("serial")
private void openSendWindow() {
final Window w = new Window("Feedback");
w.setWidth("60%");
w.setHeight("60%");
w.center();
VerticalLayout la = new VerticalLayout();
la.setSizeFull();
la.setMargin(true);
w.setContent(la);
final TextArea area = new TextArea();
Button bu = new Button("Send");
bu.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
String s = area.getValue();
if (s!=null && !s.isEmpty()) {
send(s, w);
}
}
});
area.setSizeFull();
la.addComponent(area);
bu.setWidth("100%");
la.addComponent(bu);
la.setExpandRatio(area, 1);
UI.getCurrent().addWindow(w);
}