use of org.linkki.core.ui.section.AbstractSection 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.AbstractSection in project linkki by linkki-framework.
the class ContactComponent method createContent.
private void createContent() {
AbstractSection contactSection = sectionFactory.createSection(contactPmo, bindingContext);
AddressFields addressFields = new AddressFields();
AddressComponent addressComponent = new AddressComponent(addressFields);
// tag::manual-binding[]
new Binder(addressFields, addressPmo).setupBindings(bindingContext);
// end::manual-binding[]
AbstractSection childrenSection = sectionFactory.createSection(childrenSectionPmo, bindingContext);
AbstractSection buttonsSection = sectionFactory.createSection(buttonsSectionPmo, bindingContext);
setContent(new VerticalLayout(contactSection, addressComponent, childrenSection, buttonsSection));
}
use of org.linkki.core.ui.section.AbstractSection 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.AbstractSection in project linkki by linkki-framework.
the class PmoBasedDialogFactory method newOkCancelDialog.
/**
* Creates a new {@link OkCancelDialog}.
*
* @param title The dialog title.
* @param okHandler The called when OK is clicked.
* @param pmos The presentation model objects providing the data and the layout information.
* @return A dialog with the content defined by the given PMO.
*/
public OkCancelDialog newOkCancelDialog(String title, Handler okHandler, Object... pmos) {
OkCancelDialog dialog = new OkCancelDialog(title, okHandler, ButtonOption.OK_CANCEL);
DialogBindingManager bindingManager = new DialogBindingManager(dialog, validationService, propertyBehaviorProvider);
BindingContext bindingContext = bindingManager.startNewContext(dialog.getClass());
for (Object pmo : pmos) {
AbstractSection content;
if (pmo instanceof ContainerPmo) {
content = pmoBasedSectionFactory.createTableSection((ContainerPmo<?>) pmo, bindingContext);
} else {
content = pmoBasedSectionFactory.createSection(pmo, bindingContext);
}
float expRatio = 0f;
if (pmo == pmos[pmos.length - 1]) {
expRatio = 1f;
}
dialog.addContent(content, expRatio);
}
bindingContext.updateUI();
return dialog;
}
use of org.linkki.core.ui.section.AbstractSection in project linkki by linkki-framework.
the class AbstractPage method addSection.
/**
* Creates a section based on the given PMO and adds it to the page taking 100% of the page
* width. If the PMO is a {@link ContainerPmo} a table section is created.
*
* @return The new section created based on the given PMO.
*/
protected AbstractSection addSection(Object pmo) {
AbstractSection section = sectionFactory.createSection(pmo, getBindingContext());
add(section);
return section;
}
Aggregations