use of org.linkki.core.ui.converters.LinkkiConverterFactory in project linkki by linkki-framework.
the class UIDateFieldIntegrationTest method setUp.
@Override
@Before
public void setUp() {
super.setUp();
VaadinSession vaadinSession = mock(VaadinSession.class);
LinkkiConverterFactory converterFactory = new LinkkiConverterFactory(() -> Arrays.<AutoDiscoveredConverter>asList(new LocalDateToDateConverter(), new JodaLocalDateToDateConverter()));
when(vaadinSession.getConverterFactory()).thenReturn(converterFactory);
VaadinSession.setCurrent(vaadinSession);
}
use of org.linkki.core.ui.converters.LinkkiConverterFactory in project linkki by linkki-framework.
the class ApplicationFrame method init.
/**
* Initializes the layout for the given UI.
* <p>
* Can't be done in a layout's constructor as we need the other beans to be injected and also
* the UI which is still under construction at this point in time.
*/
public void init(UI ui) {
// init converters
VaadinSession vaadinSession = VaadinSession.getCurrent();
if (vaadinSession != null) {
vaadinSession.setConverterFactory(new LinkkiConverterFactory());
}
content = new VerticalLayout();
content.setMargin(false);
content.setSizeFull();
// Header
content.addComponent(header);
header.init();
// Main area
mainArea = new VerticalLayout();
mainArea.setSizeFull();
content.addComponent(mainArea);
content.setExpandRatio(mainArea, 1);
// Footer
content.addComponent(footer);
navigator = createNavigator(ui, mainArea);
navigator.addProvider(getViewProvider());
}
use of org.linkki.core.ui.converters.LinkkiConverterFactory 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));
}
Aggregations