Java Code Examples for com.vaadin.ui.FormLayout

The following examples show how to use com.vaadin.ui.FormLayout. These examples are extracted from open source projects. 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 Project: jpa-invoicer   Source File: InvoicerForm.java    License: The Unlicense 6 votes vote down vote up
@Override
protected Component createContent() {

    return new MVerticalLayout(
            getToolbar(),
            new FormLayout(
                    name,
                    address,
                    phone,
                    email,
                    bankAccount,
                    nextInvoiceNumber,
                    template,
                    administrators
            )
    );
}
 
Example 2
/**
 * Creates the change password button.
 *
 * @return the vertical layout
 */
private VerticalLayout createChangePasswordButton() {

	final VerticalLayout formLayout = new VerticalLayout();
	formLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	formLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final ChangePasswordRequest request = new ChangePasswordRequest();
	request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	request.setCurrentPassword("");
	request.setNewPassword("");
	request.setRepeatNewPassword("");
	
	final ClickListener listener = new ChangePasswordClickListener(request);
	getFormFactory().addRequestInputFormFields(formContent, request,
			ChangePasswordRequest.class, Arrays.asList("currentPassword","newPassword","repeatNewPassword"), "Change password", listener);

	return formLayout;
}
 
Example 3
/**
 * Creates the disable google auth button.
 *
 * @return the vertical layout
 */
private VerticalLayout createDisableGoogleAuthButton() {

	final VerticalLayout formLayout = new VerticalLayout();
	formLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	formLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final DisableGoogleAuthenticatorCredentialRequest request = new DisableGoogleAuthenticatorCredentialRequest();
	request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	request.setUserpassword("");
	final ClickListener listener = new DisableGoogleAuthenticatorCredentialClickListener(request);
	getFormFactory().addRequestInputFormFields(formContent, request,
			DisableGoogleAuthenticatorCredentialRequest.class, AS_LIST, DISABLE_GOOGLE_AUTHENTICATOR, listener);

	return formLayout;
}
 
Example 4
/**
 * Creates the enable google auth button.
 *
 * @return the vertical layout
 */
private VerticalLayout createEnableGoogleAuthButton() {
	final VerticalLayout formLayout = new VerticalLayout();
	formLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	formLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final SetGoogleAuthenticatorCredentialRequest request = new SetGoogleAuthenticatorCredentialRequest();
	request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	request.setUserpassword("");
	final ClickListener listener = new SetGoogleAuthenticatorCredentialClickListener(request);
	getFormFactory().addRequestInputFormFields(formContent, request, SetGoogleAuthenticatorCredentialRequest.class,
			AS_LIST, ENABLE_GOOGLE_AUTHENTICATOR, listener);

	return formLayout;
}
 
Example 5
Source Project: viritin   Source File: Issue309PojoForm.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    AbstractForm<Pojo> form = new AbstractForm<Pojo>(Pojo.class) {

        private static final long serialVersionUID = 1251886098275380006L;
        IntegerField myInteger = new IntegerField("My Integer");

        @Override
        protected Component createContent() {
            FormLayout layout = new FormLayout(myInteger, getToolbar());
            return layout;
        }
    };

    form.setResetHandler((Pojo entity) -> {
        form.setEntity(null);
    });

    form.setEntity(new Pojo());
    setContent(form);
}
 
Example 6
private CommonDialogWindow createWindow() {
    final Label madatoryStarLabel = new Label("*");
    madatoryStarLabel.setStyleName("v-caption v-required-field-indicator");
    madatoryStarLabel.setWidth(null);
    addStyleName("lay-color");
    setSizeUndefined();

    formLayout = new FormLayout();
    formLayout.setCaption(null);
    if (editSwModule) {
        formLayout.addComponent(softwareModuleType);
    } else {
        formLayout.addComponent(typeComboBox);
        typeComboBox.focus();
    }

    formLayout.addComponent(nameTextField);
    formLayout.addComponent(versionTextField);
    formLayout.addComponent(vendorTextField);
    formLayout.addComponent(descTextArea);

    setCompositionRoot(formLayout);

    final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
            .caption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.software.module")))
            .id(UIComponentIdProvider.SW_MODULE_CREATE_DIALOG).content(this).layout(formLayout).i18n(i18n)
            .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow();
    nameTextField.setEnabled(!editSwModule);
    versionTextField.setEnabled(!editSwModule);

    return window;
}
 
Example 7
private void buildLayout() {
    addStyleName("lay-color");
    setSizeUndefined();

    formLayout = new FormLayout();
    formLayout.addComponent(distsetTypeNameComboBox);
    formLayout.addComponent(distNameTextField);
    formLayout.addComponent(distVersionTextField);
    formLayout.addComponent(descTextArea);
    formLayout.addComponent(reqMigStepCheckbox);

    setCompositionRoot(formLayout);
    distNameTextField.focus();
}
 
Example 8
private void buildLayout() {
    setSizeUndefined();
    formLayout = new FormLayout();
    formLayout.addComponent(controllerIDTextField);
    formLayout.addComponent(nameTextField);
    formLayout.addComponent(descTextArea);

    controllerIDTextField.focus();
}
 
Example 9
Source Project: jpa-invoicer   Source File: ContactForm.java    License: The Unlicense 5 votes vote down vote up
@Override
protected Component createContent() {
    return new MVerticalLayout(
            new FormLayout(
                    name,
                    address1,
                    address2,
                    address3,
                    phone,
                    email
            ),
            getToolbar()
    );
}
 
Example 10
Source Project: jpa-invoicer   Source File: ProductForm.java    License: The Unlicense 5 votes vote down vote up
@Override
protected Component createContent() {
    return new MVerticalLayout(
            getToolbar(),
            new FormLayout(
                    name,
                    price,
                    unit,
                    productState
            )
    );
}
 
Example 11
Source Project: cia   Source File: FormFactoryImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <T extends Serializable> void addFormPanelTextFields(final AbstractOrderedLayout panelContent, final T item,
		final Class<T> beanType, final List<String> displayProperties) {


	final Panel formPanel = new Panel();
	formPanel.setSizeFull();


	panelContent.addComponent(formPanel);
	if (displayProperties.size() > SIZE_FOR_GRID) {
		panelContent.setExpandRatio(formPanel, ContentRatio.GRID);
	}
	else {
		panelContent.setExpandRatio(formPanel, ContentRatio.SMALL_GRID);
	}


	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);
	formContent.setWidth(ContentSize.FULL_SIZE);

	final Binder<T> binder = new Binder<>(beanType);
	binder.setBean(item);
	binder.setReadOnly(true);

	PropertyDescriptor[] propertyDescriptors=null;
	try {
		final BeanInfo info = Introspector.getBeanInfo(item.getClass());
		propertyDescriptors = info.getPropertyDescriptors();
	} catch (final IntrospectionException exception) {
		LOGGER.error("No able to getfieldtypes for type:+ item.getClass()", exception);
	}

	createDisplayPropertyConverters(displayProperties, formContent, binder, propertyDescriptors);
}
 
Example 12
Source Project: cia   Source File: FormFactoryImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <T extends Serializable> void addRequestInputFormFields(final FormLayout panelContent, final T item,
		final Class<T> beanType, final List<String> displayProperties,final String buttonLabel,final ClickListener buttonListener) {
	final BeanValidationBinder<T> binder = new BeanValidationBinder<>(beanType);
	binder.setBean(item);
	binder.setReadOnly(true);

	for (final String property : displayProperties) {

		final AbstractField buildAndBind = createField(property);
		binder.bind(buildAndBind,property);
		buildAndBind.setCaption(property);
		buildAndBind.setId(MessageFormat.format("{0}.{1}", buttonLabel, property));
		buildAndBind.setReadOnly(false);
		buildAndBind.setWidth(ContentSize.HALF_SIZE);

		panelContent.addComponent(buildAndBind);
	}

	final VerticalLayout verticalLayout = new VerticalLayout();
	verticalLayout.setWidth("50%");

	final Button button = new Button(buttonLabel,new CommitFormWrapperClickListener(binder,buttonListener));
	button.setId(buttonLabel);
	button.setWidth("25%");
	button.setIcon(VaadinIcons.BULLSEYE);
	button.setEnabled(false);
	binder.addStatusChangeListener(event -> button.setEnabled(event.getBinder().isValid()));
	
	
	verticalLayout.addComponent(button);
	verticalLayout.setComponentAlignment(button, Alignment.MIDDLE_RIGHT);

	panelContent.addComponent(verticalLayout);
}
 
Example 13
@Override
public void postConstruct() {
	super.postConstruct();		
	setSizeFull();
	
	layout = new VerticalLayout();
	layout.setSizeFull();
	layout.setSpacing(true);
	setCompositionRoot(layout);
	
	infoLabel = new Label("Vaadin4Spring Security Demo - SignUp");
	infoLabel.addStyleName(ValoTheme.LABEL_H2);
	infoLabel.setSizeUndefined();
	layout.addComponent(infoLabel);
	layout.setComponentAlignment(infoLabel, Alignment.MIDDLE_CENTER);
	
	container = new VerticalLayout();
	container.setSizeUndefined();
	container.setSpacing(true);
	layout.addComponent(container);
	layout.setComponentAlignment(container, Alignment.MIDDLE_CENTER);
	layout.setExpandRatio(container, 1);
					
	form = new FormLayout();
	form.setWidth("400px");
	form.setSpacing(true);
	container.addComponent(form);
	buildForm();
				
	btnSignUp = new Button("Signup", FontAwesome.FLOPPY_O);
	btnSignUp.addStyleName(ValoTheme.BUTTON_FRIENDLY);
	btnSignUp.addClickListener(this);
	container.addComponent(btnSignUp);
	container.setComponentAlignment(btnSignUp, Alignment.MIDDLE_CENTER);

}
 
Example 14
Source Project: XACML   Source File: SubDomainEditorWindow.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldSubdomain
	textFieldSubdomain = new TextField();
	textFieldSubdomain.setCaption("Enter Sub Domain");
	textFieldSubdomain.setImmediate(false);
	textFieldSubdomain
			.setDescription("You can enter sub domain name - do not use spaces or wildcard characters.");
	textFieldSubdomain.setWidth("-1px");
	textFieldSubdomain.setHeight("-1px");
	textFieldSubdomain.setInvalidAllowed(false);
	textFieldSubdomain
			.setInputPrompt("Examples: sales hr business marketing.");
	mainLayout.addComponent(textFieldSubdomain);
	mainLayout.setExpandRatio(textFieldSubdomain, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 15
Source Project: usergrid   Source File: ChartLayout.java    License: Apache License 2.0 5 votes vote down vote up
protected void addParamsItems() {

        testNameCombo = UIUtil.createCombo( "Test Name:", null );
        testNameCombo.setWidth( "155px" );

        metricCombo = UIUtil.createCombo( "Metric:", Metric.values() );
        metricCombo.setWidth( "155px" );

        percentileCombo = UIUtil.createCombo( "Percentile:",
                new String[] { "100", "90", "80", "70", "60", "50", "40", "30", "20", "10" } );
        percentileCombo.setWidth( "155px" );

        failureCombo = UIUtil.createCombo( "Points to Plot:", FailureType.values() );
        failureCombo.setWidth( "155px" );

        Button submitButton = new Button("Submit");
        submitButton.addClickListener(new Button.ClickListener() {
            public void buttonClick(Button.ClickEvent event) {
                loadChart();
            }
        });

        FormLayout formLayout = addFormLayout();
        formLayout.addComponent( testNameCombo );
        formLayout.addComponent( metricCombo );
        formLayout.addComponent( percentileCombo );
        formLayout.addComponent( failureCombo );
        formLayout.addComponent( submitButton );
    }
 
Example 16
Source Project: usergrid   Source File: ChartLayout.java    License: Apache License 2.0 5 votes vote down vote up
private FormLayout addFormLayout() {

        FormLayout formLayout = new FormLayout();
        formLayout.setWidth( "250px" );
        formLayout.setHeight( "250px" );
        formLayout.addStyleName( "outlined" );
        formLayout.setSpacing( true );

        addComponent( formLayout, "left: 10px; top: 10px;" );

        return formLayout;
    }
 
Example 17
Source Project: usergrid   Source File: Login.java    License: Apache License 2.0 5 votes vote down vote up
private void addItems() {
    // Set default values
    FormLayout formLayout = addFormLayout();
    formLayout.addComponent( title );
    formLayout.addComponent( usernameField );
    formLayout.addComponent( passwordField );
    formLayout.addComponent( loginButton );
    formLayout.addComponent( addButtonLayout() );
}
 
Example 18
Source Project: usergrid   Source File: Login.java    License: Apache License 2.0 5 votes vote down vote up
private FormLayout addFormLayout() {

        FormLayout formLayout = new FormLayout();
        formLayout.setWidth( "300px" );
        formLayout.setHeight( "200px" );
        formLayout.addStyleName( "outlined" );
        formLayout.setSpacing( true );
        mainLayout.addComponent( formLayout );
        mainLayout.setComponentAlignment( formLayout, Alignment.MIDDLE_CENTER );
        return formLayout;
    }
 
Example 19
Source Project: usergrid   Source File: UserLayout.java    License: Apache License 2.0 5 votes vote down vote up
private void addItems() {

        FormLayout formLayout = addFormLayout( 300, 350);
        formLayout.addComponent( formTitle );
        formLayout.addComponent( usernameField );
        formLayout.addComponent( passwordField );
        formLayout.addComponent( accessKeyField );
        formLayout.addComponent( imageField );
        formLayout.addComponent( instanceTypeField );
        formLayout.addComponent( secretKeyField );
        formLayout.addComponent( keyPairNameField );
        formLayout.addComponent( addButtonLayout() );

        addComponent( keyListLayout, "left: 650px; top: 50px;" );
    }
 
Example 20
Source Project: usergrid   Source File: UserLayout.java    License: Apache License 2.0 5 votes vote down vote up
private FormLayout addFormLayout( int x, int y ) {

        FormLayout formLayout = new FormLayout();
        formLayout.setWidth( String.format( "%spx", x ) );
        formLayout.setHeight( String.format( "%spx", y ) );
        formLayout.addStyleName( "outlined" );
        formLayout.setSpacing( true );

        addComponent( formLayout, "left: 350px; top: 50px;" );

        return formLayout;
    }
 
Example 21
Source Project: cuba   Source File: DefaultFormLayoutDropHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Class<FormLayout> getTargetLayoutType() {
    return FormLayout.class;
}
 
Example 22
Source Project: hawkbit   Source File: AbstractTagLayout.java    License: Eclipse Public License 1.0 4 votes vote down vote up
protected FormLayout getFormLayout() {
    return formLayout;
}
 
Example 23
public FormLayout getFormLayout() {
    return formLayout;
}
 
Example 24
public FormLayout getFormLayout() {
    return formLayout;
}
 
Example 25
Source Project: cia   Source File: EmailPageModContentFactoryImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();

	final String pageId = getPageId(parameters);

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content, ADMIN_EMAIL);

	final VerticalLayout emailLayout = new VerticalLayout();
	emailLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	emailLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final SendEmailRequest sendEmailRequest = new SendEmailRequest();
	sendEmailRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	sendEmailRequest.setEmail("");
	sendEmailRequest.setSubject("");
	sendEmailRequest.setContent("");
	final ClickListener sendEmailListener = new SendEmailClickListener(sendEmailRequest);
	getFormFactory().addRequestInputFormFields(formContent, sendEmailRequest,
			SendEmailRequest.class, SEND_EMAIL_REQUEST_FORM_FIELDS, EMAIL,
			sendEmailListener);

	content.addComponent(emailLayout);
	content.setExpandRatio(emailLayout, ContentRatio.LARGE_FORM);

	panel.setCaption(NAME + "::" + ADMIN_EMAIL);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_EMAIL_VIEW, ApplicationEventGroup.ADMIN, NAME,
			null, pageId);

	return content;

}
 
Example 26
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();

	final String pageId = getPageId(parameters);
	final int pageNr= getPageNr(parameters);


	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content,ADMIN_APPLICATION_CONFIGURATION);

	final DataContainer<ApplicationConfiguration, Long> dataContainer = getApplicationManager()
			.getDataContainer(ApplicationConfiguration.class);

	final List<ApplicationConfiguration> pageOrderBy = dataContainer.getPageOrderBy(pageNr,DEFAULT_RESULTS_PER_PAGE, ApplicationConfiguration_.configurationGroup);

	getPagingUtil().createPagingControls(content,NAME,pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);

	getGridFactory().createBasicBeanItemGrid(content,ApplicationConfiguration.class,
			pageOrderBy,
			APPLICATION_CONFIGURATION,
			COLUMN_ORDER, HIDE_COLUMNS,
			new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "hjid"), null, null);

	if (pageId != null && !pageId.isEmpty()) {

		final ApplicationConfiguration applicationConfiguration = dataContainer.load(Long.valueOf(pageId));

		if (applicationConfiguration != null) {

			final VerticalLayout leftLayout = new VerticalLayout();
			leftLayout.setSizeFull();
			final VerticalLayout rightLayout = new VerticalLayout();
			rightLayout.setSizeFull();
			final HorizontalLayout horizontalLayout = new HorizontalLayout();
			horizontalLayout.setWidth(ContentSize.FULL_SIZE);
			content.addComponent(horizontalLayout);
			horizontalLayout.addComponent(leftLayout);
			horizontalLayout.addComponent(rightLayout);


			getFormFactory().addFormPanelTextFields(leftLayout, applicationConfiguration,
					ApplicationConfiguration.class,
					AS_LIST);

			final UpdateApplicationConfigurationRequest request = new UpdateApplicationConfigurationRequest();
			request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
			request.setApplicationConfigurationId(applicationConfiguration.getHjid());

			request.setConfigTitle(applicationConfiguration.getConfigTitle());
			request.setConfigDescription(applicationConfiguration.getConfigDescription());

			request.setComponentTitle(applicationConfiguration.getConfigTitle());
			request.setComponentDescription(applicationConfiguration.getComponentDescription());

			request.setPropertyValue(applicationConfiguration.getPropertyValue());

			final ClickListener buttonListener = new UpdateApplicationConfigurationClickListener(request);

			final Panel updateFormPanel = new Panel();
			updateFormPanel.setSizeFull();

			rightLayout.addComponent(updateFormPanel);

			final FormLayout updateFormContent = new FormLayout();
			updateFormPanel.setContent(updateFormContent);

			getFormFactory().addRequestInputFormFields(updateFormContent, request,
					UpdateApplicationConfigurationRequest.class, AS_LIST2,
					UPDATE_CONFIGURATION, buttonListener);

		}
	}

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_CONFIGURATION_VIEW,
			ApplicationEventGroup.ADMIN, NAME, null, pageId);

	return content;
}
 
Example 27
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	documentMenuItemFactory.createDocumentsMenuBar(menuBar);


	final VerticalLayout searchLayout = new VerticalLayout();
	searchLayout.setSizeFull();
	panelContent.addComponent(searchLayout);

	final VerticalLayout searchresultLayout = new VerticalLayout();
	searchresultLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	searchresultLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	panelContent.addComponent(searchresultLayout);
	panelContent.setExpandRatio(searchresultLayout, ContentRatio.LARGE);

	final SearchDocumentRequest searchRequest = new SearchDocumentRequest();
	searchRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	searchRequest.setMaxResults(MAX_RESULT_SIZE);
	searchRequest.setSearchExpression("");
	getFormFactory().addRequestInputFormFields(formContent, searchRequest,
			SearchDocumentRequest.class, AS_LIST, SEARCH,
			new SearchDocumentClickListener(searchRequest, new SearchDocumentResponseHandlerImpl(getGridFactory(), formPanel,
					searchresultLayout)));

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);

	return panelContent;

}
 
Example 28
@Secured({ "ROLE_ANONYMOUS" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();
	final String pageId = getPageId(parameters);

	panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	final VerticalLayout loginLayout = new VerticalLayout();
	loginLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	loginLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formContent.setIcon(VaadinIcons.SIGN_IN);
	formPanel.setContent(formContent);

	final LoginRequest loginRequest = new LoginRequest();
	loginRequest.setOtpCode("");
	loginRequest.setEmail("");
	loginRequest.setUserpassword("");
	
	loginRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	final ClickListener loginListener = new ApplicationLoginListener(loginRequest);
	getFormFactory().addRequestInputFormFields(formContent, loginRequest,
			LoginRequest.class,
			AS_LIST, LOGIN,
			loginListener);

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	content.addComponent(overviewLayout);
	content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);		
	RowUtil.createRowComponent(grid,loginLayout,LOGIN_USER);
	
	panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER,
			CommonsViews.MAIN_VIEW_NAME, parameters, pageId);


	return content;

}
 
Example 29
@Secured({ "ROLE_ANONYMOUS" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();
	final String pageId = getPageId(parameters);


	getMenuItemFactory().createMainPageMenuBar(menuBar);

	final VerticalLayout registerLayout = new VerticalLayout();
	registerLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	registerLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final RegisterUserRequest reqisterRequest = new RegisterUserRequest();
	reqisterRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	reqisterRequest.setUsername("");
	reqisterRequest.setEmail("");
	reqisterRequest.setCountry("");
	reqisterRequest.setUserpassword("");
	final ClickListener reqisterListener = new RegisterUserClickListener(reqisterRequest);
	getFormFactory().addRequestInputFormFields(formContent, reqisterRequest,
			RegisterUserRequest.class,
			AS_LIST, REGISTER,
			reqisterListener);

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	content.addComponent(overviewLayout);
	content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);		
	RowUtil.createRowComponent(grid,registerLayout,"Register a new user");

	panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER,
			CommonsViews.MAIN_VIEW_NAME, parameters, pageId);

	return content;

}
 
Example 30
@Override
public void attach() {
    // メインフォーム
    Form mainForm = new Form();
    Layout mainLayout = mainForm.getLayout();
    addComponent(mainForm);

    // ロードバランサ名
    nameField = new TextField(ViewProperties.getCaption("field.loadBalancerName"));
    nameField.setReadOnly(true);
    mainLayout.addComponent(nameField);

    // サービス名
    serviceField = new TextField(ViewProperties.getCaption("field.loadBalancerService"));
    serviceField.setReadOnly(true);
    mainLayout.addComponent(serviceField);

    // ロードバランサ設定パネル
    Panel panel = new Panel(ViewProperties.getCaption("field.loadBalancerConfig"));
    ((Layout) panel.getContent()).setMargin(false, false, false, true);
    mainLayout.addComponent(panel);

    // サブフォーム
    subForm = new Form();
    FormLayout sublayout = (FormLayout) this.subForm.getLayout();
    sublayout.setMargin(false);
    sublayout.setSpacing(false);
    panel.getContent().addComponent(subForm);
    subForm.setHeight("200px");

    // ロードバランサポート
    loadBalancerPortField = new TextField(ViewProperties.getCaption("field.loadBalancerPort"));
    loadBalancerPortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(loadBalancerPortField);

    // サービスポート
    servicePortField = new TextField(ViewProperties.getCaption("field.loadBalancerServicePort"));
    servicePortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(servicePortField);

    // プロトコル
    protocolSelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerProtocol"));
    protocolSelect.setWidth(TEXT_WIDTH);
    protocolSelect.setImmediate(true);
    sublayout.addComponent(protocolSelect);
    protocolSelect.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            protocolValueChange(event);
        }
    });

    // SSLキー
    sslKeySelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerSSLKey"));
    sslKeySelect.setWidth(TEXT_WIDTH);
    sslKeySelect.addContainerProperty(SSLKEY_CAPTION_ID, String.class, null);
    sslKeySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    sslKeySelect.setItemCaptionPropertyId(SSLKEY_CAPTION_ID);
    sublayout.addComponent(sslKeySelect);

    initValidation();
}