Search in sources :

Example 1 with IControl

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);
    }
}
Also used : IControl(org.jowidgets.api.widgets.IControl) ICustomWidgetCreator(org.jowidgets.common.widgets.factory.ICustomWidgetCreator) IComposite(org.jowidgets.api.widgets.IComposite) IContainer(org.jowidgets.api.widgets.IContainer) MigLayoutDescriptor(org.jowidgets.common.widgets.layout.MigLayoutDescriptor)

Aggregations

IComposite (org.jowidgets.api.widgets.IComposite)1 IContainer (org.jowidgets.api.widgets.IContainer)1 IControl (org.jowidgets.api.widgets.IControl)1 ICustomWidgetCreator (org.jowidgets.common.widgets.factory.ICustomWidgetCreator)1 MigLayoutDescriptor (org.jowidgets.common.widgets.layout.MigLayoutDescriptor)1