use of org.linkki.core.ui.section.DefaultPmoBasedSectionFactory in project linkki by linkki-framework.
the class TestUiUtil method createSectionWith.
public static GridLayout createSectionWith(Object pmo, BindingContext bindingContext) {
PmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
AbstractSection section = sectionFactory.createSection(pmo, bindingContext);
bindingContext.updateUI();
Panel panel = (Panel) section.getComponent(1);
return (GridLayout) panel.getContent();
}
use of org.linkki.core.ui.section.DefaultPmoBasedSectionFactory in project linkki by linkki-framework.
the class PmoNlsServiceSectionTest method setUp.
@Before
public void setUp() {
BindingContext context = TestBindingContext.create();
BaseSection section = new DefaultPmoBasedSectionFactory().createBaseSection(new SamplePmo(), context);
HorizontalLayout header = (HorizontalLayout) section.getComponent(0);
sectionHeader = (Label) header.getComponent(0);
GridLayout sectionContent = (GridLayout) ((Panel) section.getComponent(1)).getContent();
textfieldLabelWithTranslation = (Label) sectionContent.getComponent(0, 0);
textfieldLabelWithoutTranslation = (Label) sectionContent.getComponent(0, 1);
buttonLabelWithTranslation = (Label) sectionContent.getComponent(0, 2);
buttonWithTranslatedCaption = (Button) sectionContent.getComponent(1, 2);
invisibleButtonLabelWithTranslation = (Label) sectionContent.getComponent(0, 3);
buttonWithoutTranslatedCaption = (Button) sectionContent.getComponent(1, 3);
// test setup
PmoNlsService.get();
textfieldLabelTranslation = getLabelTranslation(SamplePmo.PROPERTY_TEXTFIELD);
assertThat(textfieldLabelTranslation, is(not(SamplePmo.PMO_LABEL)));
buttonLabelTranslation = getLabelTranslation(SamplePmo.PROPERTY_MYBUTTON);
assertThat(buttonLabelTranslation, is(not(SamplePmo.PMO_LABEL)));
buttonCaptionTranslation = getCaptionTranslation(SamplePmo.PROPERTY_MYBUTTON);
assertThat(buttonCaptionTranslation, is(not(SamplePmo.PMO_CAPTION)));
assertThat(getLabelTranslation(SamplePmo.PROPERTY_CBFIELD), is(SamplePmo.PMO_LABEL));
assertThat(getLabelTranslation(SamplePmo.PROPERTY_MYBUTTON2), is(buttonLabelTranslation));
assertThat(getCaptionTranslation(SamplePmo.PROPERTY_MYBUTTON2), is(SamplePmo.PMO_CAPTION));
}
use of org.linkki.core.ui.section.DefaultPmoBasedSectionFactory in project linkki by linkki-framework.
the class ContactsTableComponent method createContent.
private void createContent(Consumer<Contact> editAction) {
DefaultPmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
tableSection = sectionFactory.createTableSection(new ContactTablePmo(contactStorage, editAction, contactStorage::remove), context);
noContentLabel = new Label("No contacts available");
}
use of org.linkki.core.ui.section.DefaultPmoBasedSectionFactory in project linkki by linkki-framework.
the class CustomLayoutUI method init.
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("Linkki :: Custom Layout Sample");
BindingContext bindingContext = new BindingContext();
AbstractSection section = new DefaultPmoBasedSectionFactory().createSection(new AddressSectionPmo(), bindingContext);
setContent(section);
}
use of org.linkki.core.ui.section.DefaultPmoBasedSectionFactory in project linkki by linkki-framework.
the class DynamicFieldUI method init.
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("Linkki :: Dynamic Fields Sample");
List<Car> carStorage = getCarStorage();
BindingContext bindingContext = new BindingContext();
TableSection<CarRowPmo> table = new DefaultPmoBasedSectionFactory().createTableSection(new CarTablePmo(carStorage, () -> new NewCarDialog(carStorage, bindingContext::updateUI)), bindingContext);
setContent(table);
}
Aggregations