com.vaadin.ui.FormLayout Java Examples

The following examples show how to use com.vaadin.ui.FormLayout. 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: Issue309PojoForm.java    From viritin with 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 #2
Source File: UserHomeSecuritySettingsPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * 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 #3
Source File: InvoicerForm.java    From jpa-invoicer with 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 #4
Source File: UserHomeSecuritySettingsPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * 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 #5
Source File: UserHomeSecuritySettingsPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * 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 #6
Source File: ChartLayout.java    From usergrid with 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 #7
Source File: FormFactoryImpl.java    From cia with 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 #8
Source File: FormFactoryImpl.java    From cia with 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 #9
Source File: SignUpViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
@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 #10
Source File: SubDomainEditorWindow.java    From XACML with 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 #11
Source File: ChartLayout.java    From usergrid with 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 #12
Source File: Login.java    From usergrid with 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 #13
Source File: ProductForm.java    From jpa-invoicer with The Unlicense 5 votes vote down vote up
@Override
protected Component createContent() {
    return new MVerticalLayout(
            getToolbar(),
            new FormLayout(
                    name,
                    price,
                    unit,
                    productState
            )
    );
}
 
Example #14
Source File: ContactForm.java    From jpa-invoicer with 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 #15
Source File: Login.java    From usergrid with 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 #16
Source File: TargetAddUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    setSizeUndefined();
    formLayout = new FormLayout();
    formLayout.addComponent(controllerIDTextField);
    formLayout.addComponent(nameTextField);
    formLayout.addComponent(descTextArea);

    controllerIDTextField.focus();
}
 
Example #17
Source File: DistributionAddUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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 #18
Source File: UserLayout.java    From usergrid with 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 #19
Source File: SoftwareModuleAddUpdateWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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 #20
Source File: UserLayout.java    From usergrid with 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 File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
protected FormLayout getFormLayout() {
    return formLayout;
}
 
Example #22
Source File: PolicyNameEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	
	// textFieldPolicyName
	textFieldPolicyName = new TextField();
	textFieldPolicyName.setCaption("Policy File Name");
	textFieldPolicyName.setImmediate(true);
	textFieldPolicyName.setWidth("-1px");
	textFieldPolicyName.setHeight("-1px");
	textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
	textFieldPolicyName.setRequired(true);
	mainLayout.addComponent(textFieldPolicyName);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription
			.setInputPrompt("Enter a description for the Policy/PolicySet.");
	textAreaDescription.setNullSettingAllowed(true);
	mainLayout.addComponent(textAreaDescription);
	
	// optionPolicySet
	optionPolicySet = new OptionGroup();
	optionPolicySet.setCaption("Policy or PolicySet?");
	optionPolicySet.setImmediate(true);
	optionPolicySet
			.setDescription("Is the root level a Policy or Policy Set.");
	optionPolicySet.setWidth("-1px");
	optionPolicySet.setHeight("-1px");
	optionPolicySet.setRequired(true);
	mainLayout.addComponent(optionPolicySet);
	
	// comboAlgorithms
	comboAlgorithms = new ComboBox();
	comboAlgorithms.setCaption("Combining Algorithm");
	comboAlgorithms.setImmediate(false);
	comboAlgorithms.setDescription("Select the combining algorithm.");
	comboAlgorithms.setWidth("-1px");
	comboAlgorithms.setHeight("-1px");
	comboAlgorithms.setRequired(true);
	mainLayout.addComponent(comboAlgorithms);
	
	// 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 #23
Source File: WinLoadBalancerConfigListener.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@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();
}
 
Example #24
Source File: MainViewRegisterPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@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 #25
Source File: MainViewLoginPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@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 #26
Source File: SearchDocumentPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@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 #27
Source File: AdminApplicationConfigurationPageModContentFactoryImpl.java    From cia with 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);
	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 #28
Source File: EmailPageModContentFactoryImpl.java    From cia with 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 #29
Source File: TargetAddUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
public FormLayout getFormLayout() {
    return formLayout;
}
 
Example #30
Source File: SoftwareModuleAddUpdateWindow.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
public FormLayout getFormLayout() {
    return formLayout;
}