Search in sources :

Example 6 with AbstractSection

use of org.linkki.core.ui.section.AbstractSection in project linkki by linkki-framework.

the class MessageUI method init.

@Override
protected void init(VaadinRequest request) {
    Page.getCurrent().setTitle("linkki Samples :: Validation Messages");
    VaadinSession.getCurrent().setConverterFactory(new LinkkiConverterFactory());
    MessagesPanel messagesPanel = new MessagesPanel();
    messagesPanel.setVisible(false);
    User user = new User();
    RegistrationSectionPmo registrationPmo = new RegistrationSectionPmo(user, u -> handleRegistration(messagesPanel, u));
    // tag::validation-service[]
    validationService = new RegistrationValidationService(registrationPmo);
    bindingManager = new RegistrationBindingManager(validationService, ml -> messagesPanel.updateMessages(ml));
    // end::validation-service[]
    DefaultPmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
    AbstractSection section = sectionFactory.createSection(registrationPmo, bindingManager.getExistingContextOrStartNewOne(getClass()));
    setContent(new VerticalLayout(messagesPanel, section));
}
Also used : MessagesPanel(org.linkki.samples.messages.components.MessagesPanel) ValoTheme(com.vaadin.ui.themes.ValoTheme) RegistrationSectionPmo(org.linkki.samples.messages.pmo.RegistrationSectionPmo) AbstractSection(org.linkki.core.ui.section.AbstractSection) ValidationMode(org.linkki.samples.messages.pmo.RegistrationValidationService.ValidationMode) VerticalLayout(com.vaadin.ui.VerticalLayout) DefaultPmoBasedSectionFactory(org.linkki.core.ui.section.DefaultPmoBasedSectionFactory) UI(com.vaadin.ui.UI) VaadinRequest(com.vaadin.server.VaadinRequest) BindingManager(org.linkki.core.binding.BindingManager) Theme(com.vaadin.annotations.Theme) MessagesPanel(org.linkki.samples.messages.components.MessagesPanel) User(org.linkki.samples.messages.model.User) VaadinSession(com.vaadin.server.VaadinSession) Notification(com.vaadin.ui.Notification) LinkkiConverterFactory(org.linkki.core.ui.converters.LinkkiConverterFactory) Page(com.vaadin.server.Page) RegistrationValidationService(org.linkki.samples.messages.pmo.RegistrationValidationService) RegistrationBindingManager(org.linkki.samples.messages.binding.RegistrationBindingManager) User(org.linkki.samples.messages.model.User) DefaultPmoBasedSectionFactory(org.linkki.core.ui.section.DefaultPmoBasedSectionFactory) RegistrationSectionPmo(org.linkki.samples.messages.pmo.RegistrationSectionPmo) LinkkiConverterFactory(org.linkki.core.ui.converters.LinkkiConverterFactory) AbstractSection(org.linkki.core.ui.section.AbstractSection) VerticalLayout(com.vaadin.ui.VerticalLayout) RegistrationBindingManager(org.linkki.samples.messages.binding.RegistrationBindingManager) RegistrationValidationService(org.linkki.samples.messages.pmo.RegistrationValidationService)

Example 7 with AbstractSection

use of org.linkki.core.ui.section.AbstractSection in project linkki by linkki-framework.

the class GettingStartedUI method init.

@Override
protected void init(VaadinRequest request) {
    Page.getCurrent().setTitle("Linkki :: Getting Started");
    DefaultPmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
    AbstractSection section = sectionFactory.createSection(new ReportSectionPmo(new Report()), new BindingContext("report-context", PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER, Handler.NOP_HANDLER));
    setContent(section);
}
Also used : ReportSectionPmo(org.linkki.samples.gettingstarted.pmo.ReportSectionPmo) DefaultPmoBasedSectionFactory(org.linkki.core.ui.section.DefaultPmoBasedSectionFactory) Report(org.linkki.samples.gettingstarted.model.Report) AbstractSection(org.linkki.core.ui.section.AbstractSection) BindingContext(org.linkki.core.binding.BindingContext)

Aggregations

AbstractSection (org.linkki.core.ui.section.AbstractSection)7 DefaultPmoBasedSectionFactory (org.linkki.core.ui.section.DefaultPmoBasedSectionFactory)4 BindingContext (org.linkki.core.binding.BindingContext)3 VerticalLayout (com.vaadin.ui.VerticalLayout)2 Theme (com.vaadin.annotations.Theme)1 Page (com.vaadin.server.Page)1 VaadinRequest (com.vaadin.server.VaadinRequest)1 VaadinSession (com.vaadin.server.VaadinSession)1 GridLayout (com.vaadin.ui.GridLayout)1 Notification (com.vaadin.ui.Notification)1 Panel (com.vaadin.ui.Panel)1 UI (com.vaadin.ui.UI)1 ValoTheme (com.vaadin.ui.themes.ValoTheme)1 PresentationModelObject (org.linkki.core.PresentationModelObject)1 Binder (org.linkki.core.binding.Binder)1 BindingManager (org.linkki.core.binding.BindingManager)1 LinkkiConverterFactory (org.linkki.core.ui.converters.LinkkiConverterFactory)1 PmoBasedSectionFactory (org.linkki.core.ui.section.PmoBasedSectionFactory)1 ContainerPmo (org.linkki.core.ui.table.ContainerPmo)1 AddressSectionPmo (org.linkki.samples.customlayout.pmo.AddressSectionPmo)1