當前位置: 首頁>>代碼示例>>Java>>正文


Java Window.center方法代碼示例

本文整理匯總了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");
    }
}
 
開發者ID:kumoregdev,項目名稱:kumoreg,代碼行數:24,代碼來源:PrintBadgeWindow.java

示例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();
	}
}
 
開發者ID:lizardtechblog,項目名稱:ExpressZip,代碼行數:22,代碼來源:MapToolbarViewComponent.java

示例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);
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:24,代碼來源:SecurityAccessView.java

示例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);
		}
	});
}
 
開發者ID:ahn,項目名稱:mideaas,代碼行數:17,代碼來源:ShowLogButton.java

示例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);
}
 
開發者ID:akquinet,項目名稱:vaangular,代碼行數:12,代碼來源:VaangularUI.java

示例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);
}
 
開發者ID:maxschuster,項目名稱:Vaadin-AutocompleteTextField,代碼行數:10,代碼來源:DemoUI.java

示例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);
}
 
開發者ID:ahoehma,項目名稱:vaadin-examples,代碼行數:36,代碼來源:ProgressbarDialogDemoUI.java

示例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);
}
 
開發者ID:alternativeTime,項目名稱:GlycanBuilderVaadin7Version,代碼行數:15,代碼來源:MessageDialogBox.java

示例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);
}
 
開發者ID:alternativeTime,項目名稱:GlycanBuilderVaadin7Version,代碼行數:16,代碼來源:VaadinGlycanCanvas.java

示例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);
}
 
開發者ID:rlsutton1,項目名稱:VaadinUtils,代碼行數:28,代碼來源:GridContainerCSVExport.java

示例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);

}
 
開發者ID:rlsutton1,項目名稱:VaadinUtils,代碼行數:29,代碼來源:ContainerCSVExport.java

示例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);
}
 
開發者ID:chipster,項目名稱:chipster,代碼行數:15,代碼來源:JobLogView.java

示例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);

}
 
開發者ID:bsutton,項目名稱:scoutmaster,代碼行數:13,代碼來源:ContactView.java

示例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);

}
 
開發者ID:bsutton,項目名稱:scoutmaster,代碼行數:14,代碼來源:SchoolView.java

示例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);
	
}
 
開發者ID:ahn,項目名稱:mideaas,代碼行數:35,代碼來源:FeedbackPlugin.java


注:本文中的com.vaadin.ui.Window.center方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。