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;
}
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);
}
Aggregations