Search in sources :

Example 6 with HasProperties

use of org.jboss.errai.databinding.client.HasProperties in project kie-wb-common by kiegroup.

the class BooleanColumnGenerator method getColumn.

@Override
public Column<HasProperties, Boolean> getColumn(final String property) {
    final CheckboxCellImpl checkbox = new CheckboxCellImpl(true);
    final Column<HasProperties, Boolean> column = new Column<HasProperties, Boolean>(checkbox) {

        @Override
        public Boolean getValue(HasProperties object) {
            Object value = object.get(property);
            if (value == null) {
                return Boolean.FALSE;
            }
            return Boolean.TRUE.equals(value);
        }
    };
    return column;
}
Also used : Column(com.google.gwt.user.cellview.client.Column) HasProperties(org.jboss.errai.databinding.client.HasProperties) CheckboxCellImpl(org.uberfire.ext.widgets.table.client.CheckboxCellImpl)

Example 7 with HasProperties

use of org.jboss.errai.databinding.client.HasProperties in project kie-wb-common by kiegroup.

the class FormsCanvasSessionHandler method executeUpdateProperty.

@SuppressWarnings("unchecked")
public boolean executeUpdateProperty(final Element<? extends Definition<?>> element, final String fieldName, final Object value) {
    final Object definition = element.getContent().getDefinition();
    final HasProperties hasProperties = (HasProperties) DataBinder.forModel(definition).getModel();
    final String propertyId = getModifiedPropertyId(hasProperties, fieldName);
    canvasListener.startProcessing();
    final CommandResult result = featuresSessionProvider.getCommandManager(session).execute(getCanvasHandler(), commandFactory.updatePropertyValue(element, propertyId, value));
    canvasListener.endProcessing();
    return !CommandUtils.isError(result);
}
Also used : HasProperties(org.jboss.errai.databinding.client.HasProperties) CommandResult(org.kie.workbench.common.stunner.core.command.CommandResult)

Aggregations

HasProperties (org.jboss.errai.databinding.client.HasProperties)7 Column (com.google.gwt.user.cellview.client.Column)1 AsyncDataProvider (com.google.gwt.view.client.AsyncDataProvider)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 BindableProxy (org.jboss.errai.databinding.client.BindableProxy)1 CrudActionsHelper (org.kie.workbench.common.forms.crud.client.component.CrudActionsHelper)1 IsFormView (org.kie.workbench.common.forms.crud.client.component.formDisplay.IsFormView)1 ColumnGenerator (org.kie.workbench.common.forms.dynamic.client.rendering.renderers.relations.multipleSubform.columns.ColumnGenerator)1 TableColumnMeta (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.TableColumnMeta)1 FormDefinition (org.kie.workbench.common.forms.model.FormDefinition)1 CommandResult (org.kie.workbench.common.stunner.core.command.CommandResult)1 CheckboxCellImpl (org.uberfire.ext.widgets.table.client.CheckboxCellImpl)1 ColumnMeta (org.uberfire.ext.widgets.table.client.ColumnMeta)1