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;
}
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;
}
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);
}
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;
}
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;
}
Aggregations