use of org.jboss.errai.bus.client.api.BusErrorCallback in project kie-wb-common by kiegroup.
the class AssignmentsEditorWidget method getDataTypes.
protected void getDataTypes() {
final String simpleDataTypes = "Boolean:Boolean,Float:Float,Integer:Integer,Object:Object,String:String";
MessageBuilder.createCall(new RemoteCallback<List<String>>() {
public void callback(List<String> dataTypes) {
String formattedDataTypes = formatDataTypes(dataTypes);
String allDataTypes = simpleDataTypes + "," + formattedDataTypes;
showDataIOEditor(allDataTypes.toString());
}
}, new BusErrorCallback() {
public boolean error(Message message, Throwable t) {
notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), NotificationEvent.NotificationType.ERROR));
showDataIOEditor(simpleDataTypes);
return false;
}
}, DataTypesService.class).getDataTypeNames();
}
use of org.jboss.errai.bus.client.api.BusErrorCallback in project kie-wb-common by kiegroup.
the class VariablesEditorWidgetViewImpl method getDataTypes.
protected void getDataTypes(final String value, final boolean fireEvents) {
final List<String> simpleDataTypes = new ArrayList<String>(Arrays.asList("Boolean", "Float", "Integer", "Object", "String"));
final List<String> simpleDataTypeDisplayNames = new ArrayList<String>(Arrays.asList("Boolean", "Float", "Integer", "Object", "String"));
MessageBuilder.createCall(new RemoteCallback<List<String>>() {
public void callback(final List<String> serverDataTypes) {
List<List<String>> mergedDataTypes = mergeDataTypes(simpleDataTypes, simpleDataTypeDisplayNames, serverDataTypes);
setDataTypes(mergedDataTypes.get(0), mergedDataTypes.get(1));
doSetValue(value, fireEvents, true);
}
}, new BusErrorCallback() {
public boolean error(final Message message, final Throwable t) {
notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), NotificationEvent.NotificationType.ERROR));
setDataTypes(simpleDataTypes, simpleDataTypeDisplayNames);
doSetValue(value, fireEvents, true);
return false;
}
}, DataTypesService.class).getDataTypeNames();
}
Aggregations