use of org.jowidgets.api.widgets.IControl in project jo-client-platform by jo-source.
the class BeanFormContentLayouter method layout.
@Override
public void layout(final IContainer container, final IBeanFormControlFactory controlFactory) {
final Collection<ICustomWidgetCreator<? extends IControl>> buttons = controlFactory.createButtons();
if (!buttons.isEmpty()) {
container.setLayout(new MigLayoutDescriptor("0[grow, 0::]0", "0[0::]15[]0"));
// add the form
final IContainer formContainer = container.add(BPF.composite(), "growx, w 0::, wrap");
layoutForm(formContainer, controlFactory);
// add the button bar
final IComposite buttonBar = container.add(BPF.composite(), "alignx r");
buttonBar.setLayout(getButtonBarLayout(buttons));
for (final ICustomWidgetCreator<? extends IControl> button : buttons) {
buttonBar.add(button, "sg bg");
}
} else {
layoutForm(container, controlFactory);
}
}
Aggregations