Search in sources :

Example 11 with FormLayout

use of com.vaadin.ui.FormLayout in project cia by Hack23.

the class MainViewLoginPageModContentFactoryImpl method createContent.

@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 = createGridLayout(overviewLayout);
    createRowComponent(grid, loginLayout, 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;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Panel(com.vaadin.ui.Panel) ApplicationLoginListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ApplicationLoginListener) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) LoginRequest(com.hack23.cia.service.api.action.application.LoginRequest) ClickListener(com.vaadin.ui.Button.ClickListener) Secured(org.springframework.security.access.annotation.Secured)

Example 12 with FormLayout

use of com.vaadin.ui.FormLayout in project cia by Hack23.

the class MainViewRegisterPageModContentFactoryImpl method createContent.

@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 = createGridLayout(overviewLayout);
    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;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Panel(com.vaadin.ui.Panel) RegisterUserRequest(com.hack23.cia.service.api.action.application.RegisterUserRequest) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) RegisterUserClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener) ClickListener(com.vaadin.ui.Button.ClickListener) RegisterUserClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener) Secured(org.springframework.security.access.annotation.Secured)

Example 13 with FormLayout

use of com.vaadin.ui.FormLayout in project charts by vaadin.

the class ModifyOnePoint method setup.

@Override
protected void setup() {
    super.setup();
    FormLayout formLayout = new FormLayout();
    formLayout.setCaption("Special point settings, only updated point state is sent to client.");
    formLayout.setMargin(true);
    final Slider sliderX = new Slider();
    sliderX.setMin(3);
    sliderX.setMax(8);
    sliderX.setResolution(1);
    sliderX.setValue(4d);
    sliderX.setCaption("X");
    sliderX.addValueChangeListener(event -> {
        dataSeriesItem.setX(sliderX.getValue());
        series.update(dataSeriesItem);
    });
    sliderX.setWidth("200px");
    formLayout.addComponent(sliderX);
    final Slider sliderY = new Slider();
    sliderY.setMin(0);
    sliderY.setMax(10);
    sliderY.setResolution(1);
    sliderY.setValue(4d);
    sliderY.setCaption("Y");
    sliderY.addValueChangeListener(event -> {
        dataSeriesItem.setY(sliderY.getValue());
        updateItemInChart();
    });
    sliderY.setWidth("200px");
    formLayout.addComponent(sliderY);
    final ColorPicker colorPicker = new ColorPicker();
    colorPicker.setValue(new com.vaadin.shared.ui.colorpicker.Color(255, 0, 0));
    colorPicker.setCaption("Marker color");
    colorPicker.addValueChangeListener(event -> {
        dataSeriesItem.getMarker().setFillColor(new SolidColor(event.getValue().getCSS()));
        updateItemInChart();
    });
    formLayout.addComponent(colorPicker);
    Button c = new Button("Pseudorandom", new Button.ClickListener() {

        Random r = new Random(0);

        @Override
        public void buttonClick(ClickEvent event) {
            sliderX.setValue(r.nextDouble() * 5 + 3);
            sliderY.setValue(r.nextDouble() * 10);
            colorPicker.setValue(new com.vaadin.shared.ui.colorpicker.Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)));
        }
    });
    c.setId("random");
    formLayout.addComponent(c);
    addComponentAsFirst(formLayout);
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Slider(com.vaadin.ui.Slider) ColorPicker(com.vaadin.ui.ColorPicker) ClickEvent(com.vaadin.ui.Button.ClickEvent) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Color(com.vaadin.addon.charts.model.style.Color) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Random(java.util.Random) Button(com.vaadin.ui.Button)

Example 14 with FormLayout

use of com.vaadin.ui.FormLayout in project VaadinUtils by rlsutton1.

the class JasperReportScheduleLayout method buildEditor.

@Override
public TabSheet buildEditor(ValidatingFieldGroup<ReportEmailScheduleEntity> validatingFieldGroup) {
    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();
    VerticalLayout main = new VerticalLayout();
    main.setSpacing(true);
    main.setMargin(true);
    main.setSizeFull();
    tabsheet.addTab(main, "Email");
    main.addComponent(emailTargetLayout);
    FormHelper<ReportEmailScheduleEntity> helper = new FormHelper<ReportEmailScheduleEntity>(main, fieldGroup);
    reportTitle = helper.bindTextField("Report", ReportEmailScheduleEntity_.reportTitle);
    reportTitle.setReadOnly(true);
    sender = helper.bindEntityField("From", ReportEmailScheduleEntity_.sender, ReportEmailSender_.username);
    sender.setReadOnly(true);
    outputFormat = helper.bindEnumField("Output format", ReportEmailScheduleEntity_.outputFormat.getName(), OutputFormat.class);
    outputFormat.removeItem(OutputFormat.HTML);
    helper.bindTextField("Subject", ReportEmailScheduleEntity_.subject);
    CKEditorEmailField message = helper.bindEditorField(ReportEmailScheduleEntity_.message, false);
    helper.bindTextField("Report Log", ReportEmailScheduleEntity_.reportLog.getName()).setReadOnly(true);
    main.setExpandRatio(message, 1);
    TopVerticalLayout scheduleWrapper = new TopVerticalLayout();
    scheduleWrapper.setSizeFull();
    tabsheet.addTab(scheduleWrapper, "Schedule");
    FormLayout scheduleForm = new FormLayout();
    scheduleForm.setSizeFull();
    scheduleForm.setMargin(true);
    scheduleWrapper.addComponent(scheduleForm);
    buildScheduleTab(validatingFieldGroup, scheduleForm, helper);
    VerticalLayout paramWrapper = new VerticalLayout();
    paramWrapper.setSizeFull();
    tabsheet.addTab(paramWrapper, "Parameters");
    paramForm = new VerticalLayout();
    paramForm.setSizeFull();
    paramForm.setMargin(true);
    paramWrapper.addComponent(paramForm);
    return tabsheet;
}
Also used : CKEditorEmailField(au.com.vaadinutils.fields.CKEditorEmailField) FormLayout(com.vaadin.ui.FormLayout) TabSheet(com.vaadin.ui.TabSheet) TopVerticalLayout(au.com.vaadinutils.layout.TopVerticalLayout) ReportEmailScheduleEntity(au.com.vaadinutils.jasper.scheduler.entities.ReportEmailScheduleEntity) OutputFormat(au.com.vaadinutils.jasper.JasperManager.OutputFormat) TopVerticalLayout(au.com.vaadinutils.layout.TopVerticalLayout) VerticalLayout(com.vaadin.ui.VerticalLayout) FormHelper(au.com.vaadinutils.crud.FormHelper)

Example 15 with FormLayout

use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.

the class DefaultVertexInfoPanelItemProvider method createComponent.

private Component createComponent(VertexRef ref) {
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);
    formLayout.setMargin(false);
    formLayout.addComponent(createLabel("Name", ref.getLabel()));
    formLayout.addComponent(createLabel("ID", String.format("%s:%s", ref.getNamespace(), ref.getId())));
    if (ref instanceof AbstractVertex) {
        AbstractVertex vertex = (AbstractVertex) ref;
        formLayout.addComponent(createLabel("Icon Key", vertex.getIconKey()));
        if (vertex.getIpAddress() != null) {
            formLayout.addComponent(createLabel("IP Address", vertex.getIpAddress()));
        }
    }
    return formLayout;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) AbstractVertex(org.opennms.features.topology.api.topo.AbstractVertex)

Aggregations

FormLayout (com.vaadin.ui.FormLayout)20 VerticalLayout (com.vaadin.ui.VerticalLayout)10 Panel (com.vaadin.ui.Panel)8 Secured (org.springframework.security.access.annotation.Secured)6 Button (com.vaadin.ui.Button)5 ClickListener (com.vaadin.ui.Button.ClickListener)4 HorizontalLayout (com.vaadin.ui.HorizontalLayout)4 Label (com.vaadin.ui.Label)4 Status (org.opennms.netmgt.bsm.service.model.Status)3 ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)2 Window (com.vaadin.ui.Window)2 AbstractBusinessServiceVertex (org.opennms.features.topology.plugins.topo.bsm.AbstractBusinessServiceVertex)2 BusinessService (org.opennms.netmgt.bsm.service.model.BusinessService)2 UIHelper.createButton (org.opennms.netmgt.vaadin.core.UIHelper.createButton)2 FormHelper (au.com.vaadinutils.crud.FormHelper)1 CKEditorEmailField (au.com.vaadinutils.fields.CKEditorEmailField)1 OutputFormat (au.com.vaadinutils.jasper.JasperManager.OutputFormat)1 ReportEmailScheduleEntity (au.com.vaadinutils.jasper.scheduler.entities.ReportEmailScheduleEntity)1 TopVerticalLayout (au.com.vaadinutils.layout.TopVerticalLayout)1 Strings (com.google.common.base.Strings)1