Search in sources :

Example 1 with IBluePrintFactory

use of org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory in project jo-client-platform by jo-source.

the class BeanSelectionFormFactory method create.

@Override
public IBeanSelectionForm create(final Object parentUiReference, final IBeanSelectionFormBluePrint bluePrint) {
    final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
    final IComposite composite = Toolkit.getWidgetFactory().create(parentUiReference, bpf.composite());
    return new BeanSelectionFormImpl(composite, bluePrint);
}
Also used : IBluePrintFactory(org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory) IComposite(org.jowidgets.api.widgets.IComposite)

Example 2 with IBluePrintFactory

use of org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory 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;
}
Also used : IInputContentCreator(org.jowidgets.api.widgets.content.IInputContentCreator) IInputContentContainer(org.jowidgets.api.widgets.content.IInputContentContainer) IUiConfigurableFilter(org.jowidgets.cap.ui.api.filter.IUiConfigurableFilter) IBluePrintFactory(org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory) ICapApiBluePrintFactory(org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory) IAttributeFilterControl(org.jowidgets.cap.ui.api.widgets.IAttributeFilterControl) Dimension(org.jowidgets.common.types.Dimension) MigLayoutDescriptor(org.jowidgets.common.widgets.layout.MigLayoutDescriptor)

Example 3 with IBluePrintFactory

use of org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory in project jo-client-platform by jo-source.

the class AttributeFilterControlImpl method comboBoxNotBp.

private static IComboBoxSelectionBluePrint<Boolean> comboBoxNotBp() {
    final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
    final IObjectStringConverter<Boolean> converter = new IObjectStringConverter<Boolean>() {

        @Override
        public String convertToString(final Boolean bool) {
            if (bool) {
                return NOT.get();
            } else {
                return "";
            }
        }

        @Override
        public String getDescription(final Boolean bool) {
            if (bool) {
                return NOT.get();
            } else {
                return "";
            }
        }
    };
    final IComboBoxSelectionBluePrint<Boolean> result = bpf.comboBoxSelection(converter);
    result.autoCompletionOff().autoSelectionOn().setElements(Boolean.FALSE, Boolean.TRUE);
    return result;
}
Also used : IObjectStringConverter(org.jowidgets.api.convert.IObjectStringConverter) IBluePrintFactory(org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory)

Example 4 with IBluePrintFactory

use of org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory 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()));
}
Also used : ITableLayoutBuilder(org.jowidgets.api.layout.tablelayout.ITableLayoutBuilder) IBluePrintFactory(org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory) Dimension(org.jowidgets.common.types.Dimension) MigLayoutDescriptor(org.jowidgets.common.widgets.layout.MigLayoutDescriptor)

Example 5 with IBluePrintFactory

use of org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory in project jo-client-platform by jo-source.

the class AttributeFilterControlFactory method create.

@Override
public IAttributeFilterControl create(final Object parentUiReference, final IAttributeFilterControlBluePrint bluePrint) {
    final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
    final IComposite composite = Toolkit.getWidgetFactory().create(parentUiReference, bpf.composite());
    return new AttributeFilterControlImpl(composite, bluePrint);
}
Also used : IBluePrintFactory(org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory) IComposite(org.jowidgets.api.widgets.IComposite)

Aggregations

IBluePrintFactory (org.jowidgets.api.widgets.blueprint.factory.IBluePrintFactory)8 IComposite (org.jowidgets.api.widgets.IComposite)3 IObjectStringConverter (org.jowidgets.api.convert.IObjectStringConverter)2 Dimension (org.jowidgets.common.types.Dimension)2 MigLayoutDescriptor (org.jowidgets.common.widgets.layout.MigLayoutDescriptor)2 ITableLayoutBuilder (org.jowidgets.api.layout.tablelayout.ITableLayoutBuilder)1 IFrame (org.jowidgets.api.widgets.IFrame)1 IDialogBluePrint (org.jowidgets.api.widgets.blueprint.IDialogBluePrint)1 IInputContentContainer (org.jowidgets.api.widgets.content.IInputContentContainer)1 IInputContentCreator (org.jowidgets.api.widgets.content.IInputContentCreator)1 IOperator (org.jowidgets.cap.common.api.filter.IOperator)1 IUiConfigurableFilter (org.jowidgets.cap.ui.api.filter.IUiConfigurableFilter)1 IAttributeFilterControl (org.jowidgets.cap.ui.api.widgets.IAttributeFilterControl)1 ICapApiBluePrintFactory (org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory)1