Java Code Examples for com.vaadin.ui.Window#setHeight()

The following examples show how to use com.vaadin.ui.Window#setHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoApplication.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example 2
Source File: InvoiceForm.java    From jpa-invoicer with The Unlicense 5 votes vote down vote up
@Override
public Window openInModalPopup() {
    final Window p = super.openInModalPopup();
    p.setWidth("80%");
    p.setHeight("95%");
    return p;
}
 
Example 3
Source File: InvoicerForm.java    From jpa-invoicer with The Unlicense 5 votes vote down vote up
@Override
public Window openInModalPopup() {
    final Window window = super.openInModalPopup();
    window.setHeight("80%");
    window.setWidth("50%");
    return window;
}
 
Example 4
Source File: JobLogView.java    From chipster with MIT License 5 votes vote down vote up
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);
}
 
Example 5
Source File: SetGoogleAuthenticatorCredentialClickListener.java    From cia with Apache License 2.0 4 votes vote down vote up
@Override
public void buttonClick(final ClickEvent event) {
	final SetGoogleAuthenticatorCredentialResponse response = (SetGoogleAuthenticatorCredentialResponse) getApplicationManager().service(googleAuthRequest);

	if (ServiceResult.SUCCESS == response.getResult()) {

		try {
			final URI keyUri = new URI(response.getOtpAuthTotpURL());
			final QRCode qrCode = new QRCode(QR_CODE, keyUri.toASCIIString());
			qrCode.setHeight(QR_CODE_IMAGE_SIZE);
			qrCode.setWidth(QR_CODE_IMAGE_SIZE);

			final Window mywindow = new Window(GOOGLE_AUTHENTICATOR_QR_CODE);
			mywindow.setHeight(MODAL_WINDOW_SIZE);
			mywindow.setWidth(MODAL_WINDOW_SIZE);

			mywindow.setPositionX(WINDOW_POSITION);
			mywindow.setPositionY(WINDOW_POSITION);

			final VerticalLayout panelContent = new VerticalLayout();

			mywindow.setContent(panelContent);
			panelContent.addComponent(qrCode);

			mywindow.setModal(true);
			UI.getCurrent().addWindow(mywindow);

		} catch (final URISyntaxException e) {
			LOGGER.warn(PROBLEM_DISPLAYING_QR_CODE,e);
			showNotification(PROBLEM_DISPLAYING_QR_CODE,
	                  ERROR_MESSAGE,
	                  Notification.Type.WARNING_MESSAGE);
		}

	} else {
		showNotification(PROBLEM_ENABLE_GOOGLE_AUTHENTICATOR,
                  ERROR_MESSAGE,
                  Notification.Type.WARNING_MESSAGE);
		LOGGER.info(PROBLEM_ENABLE_GOOGLE_AUTHENTICATOR_SESSIONID,googleAuthRequest.getSessionId());
	}
}