use of org.jowidgets.common.widgets.layout.MigLayoutDescriptor 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);
}
}
use of org.jowidgets.common.widgets.layout.MigLayoutDescriptor in project jo-client-platform by jo-source.
the class AttributeFilterDialogBluePrintFactory method createDialogBluePrint.
static IInputDialogBluePrint<IUiConfigurableFilter<? extends Object>> createDialogBluePrint(final IBeanTableModel<?> model, final int columnIndex, final IExecutionContext executionContext, final IFilterType filterType) {
final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
final ICapApiBluePrintFactory capBpf = CapUiToolkit.bluePrintFactory();
final IInputContentCreator<IUiConfigurableFilter<? extends Object>> contentCreator = new IInputContentCreator<IUiConfigurableFilter<? extends Object>>() {
private IAttributeFilterControl filterControl;
@Override
public void setValue(final IUiConfigurableFilter<? extends Object> value) {
filterControl.setValue(value);
}
@Override
public IUiConfigurableFilter<? extends Object> getValue() {
return filterControl.getValue();
}
@Override
public void createContent(final IInputContentContainer container) {
container.setLayout(new MigLayoutDescriptor("[][grow, 0::]", "10[]0"));
final IAttribute<?> attribute = model.getAttribute(columnIndex);
container.add(Toolkit.getBluePrintFactory().textLabel(attribute.getCurrentLabel()).setMarkup(Markup.STRONG));
filterControl = container.add(capBpf.attributeFilterControl(model.getAttributes()), "growx, w 0::");
if (filterType != null) {
filterControl.setAttribute(attribute, filterType);
}
}
};
final IInputDialogBluePrint<IUiConfigurableFilter<? extends Object>> dialogBp = bpf.inputDialog(contentCreator);
dialogBp.setExecutionContext(executionContext);
dialogBp.setMissingInputHint(Messages.getString("AttributeFilterDialogBluePrintFactory.please_edit_the_filter"));
dialogBp.setMinPackSize(new Dimension(600, 170));
dialogBp.setMaxPackSize(new Dimension(1024, 400));
return dialogBp;
}
use of org.jowidgets.common.widgets.layout.MigLayoutDescriptor in project jo-client-platform by jo-source.
the class BeanLinkPanelImpl method createForms.
private void createForms(final IContainer container, final IBeanFormBluePrint<LINK_BEAN_TYPE> linkFormBp, final IBeanFormBluePrint<LINKABLE_BEAN_TYPE> linkableFormBp) {
if (linkFormBp != null && linkableFormBp != null) {
final boolean scrolledContent = linkFormBp.getScrollbarsAllowed() && linkableFormBp.getScrollbarsAllowed();
final IContainer content;
if (scrolledContent) {
container.setLayout(MigLayoutFactory.growingInnerCellLayout());
content = container.add(BPF.scrollComposite(), MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
} else {
content = container;
}
content.setLayout(new MigLayoutDescriptor("0[grow, 0::]0", "0[]0[]0[]0"));
final IBeanFormBluePrint<LINK_BEAN_TYPE> modifiedLinkFormBp = createModifiedFormBp(linkFormBp);
if (scrolledContent) {
modifiedLinkFormBp.setScrollbarsAllowed(false);
}
this.linkForm = content.add(modifiedLinkFormBp, "growx, w 0::, wrap");
content.add(BPF.separator(), "growx, w 0::, wrap");
final IBeanFormBluePrint<LINKABLE_BEAN_TYPE> modifiedLinkableFormBp = createModifiedFormBp(linkableFormBp);
if (scrolledContent) {
modifiedLinkableFormBp.setScrollbarsAllowed(false);
}
this.linkableForm = content.add(modifiedLinkableFormBp, "growx, w 0::");
} else {
container.setLayout(new MigLayoutDescriptor("0[grow, 0::]0", "0[grow, 0::]0"));
if (linkFormBp != null) {
this.linkForm = container.add(createModifiedFormBp(linkFormBp), "growx, w 0::, growy, h 0::");
}
if (linkableFormBp != null) {
this.linkableForm = container.add(createModifiedFormBp(linkableFormBp), "growx, w 0::, growy, h 0::");
}
}
}
use of org.jowidgets.common.widgets.layout.MigLayoutDescriptor in project jo-client-platform by jo-source.
the class DocumentBeanFormPluginImpl method addBrowserAttribute.
private void addBrowserAttribute(final IContainer container, final IAttribute<?> attribute, final IBeanFormControlFactory controlFactory) {
container.setLayout(new MigLayoutDescriptor("wrap", "0[grow, 0::]0", "0[]0[grow, 0::]0"));
final String propertyName = attribute.getPropertyName();
@SuppressWarnings("unchecked") final IInputControl<IDocument> inputField = (IInputControl<IDocument>) container.add(controlFactory.createControl(propertyName), "growx, w 0::");
final IBrowser browser = container.add(BrowserBPF.browser(), MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
container.addShowingStateListener(new IShowingStateListener() {
@Override
public void showingStateChanged(final boolean isShowing) {
if (isShowing) {
setUrl(container, browser, inputField);
}
}
});
inputField.addInputListener(new IInputListener() {
@Override
public void inputChanged() {
setUrl(container, browser, inputField);
}
});
}
use of org.jowidgets.common.widgets.layout.MigLayoutDescriptor in project jo-client-platform by jo-source.
the class BeanGraphAttributeListImpl method buildAttributeList.
public void buildAttributeList(final Map<String, Boolean> filterMap, final FilterType type) {
final ITableLayoutBuilder builder = Toolkit.getLayoutFactoryProvider().tableLayoutBuilder();
builder.columnCount(2);
builder.gap(15);
builder.verticalGap(4);
builder.alignment(1, Alignment.CENTER);
builder.fixedColumnWidth(0, 200);
builder.fixedColumnWidth(1, 50);
this.attributeLayoutManager = builder.build();
attributeLayoutManager.beginLayout();
this.setLayout(new MigLayoutDescriptor("hidemode 2", "[grow, 0::]", "[grow,0::]0[grow,0::]"));
final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
new AttributeHeaderComposite(add(bpf.composite(), "grow, wrap"));
initializeGroups(this, filterMap, bpf, type);
attributeLayoutManager.endLayout();
attributeLayoutManager.validate();
final Dimension prefSize = super.getPreferredSize();
setPreferredSize(new Dimension(prefSize.getWidth(), prefSize.getHeight()));
}
Aggregations