use of org.jboss.errai.common.client.api.RemoteCallback in project drools-wb by kiegroup.
the class GuidedScoreCardEditorPresenter method getModelSuccessCallback.
private RemoteCallback<ScoreCardModelContent> getModelSuccessCallback() {
return new RemoteCallback<ScoreCardModelContent>() {
@Override
public void callback(final ScoreCardModelContent content) {
// Path is set to null when the Editor is closed (which can happen before async calls complete).
if (versionRecordManager.getCurrentPath() == null) {
return;
}
model = content.getModel();
final PackageDataModelOracleBaselinePayload dataModel = content.getDataModel();
oracle = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), model, dataModel);
resetEditorPages(content.getOverview());
addSourcePage();
addImportsTab(importsWidget);
view.setContent(model, oracle);
importsWidget.setContent(oracle, model.getImports(), isReadOnly);
createOriginalHash(model);
view.hideBusyIndicator();
}
};
}
use of org.jboss.errai.common.client.api.RemoteCallback in project drools-wb by kiegroup.
the class BaseGuidedDecisionTableEditorPresenter method onValidate.
@Override
public void onValidate(final GuidedDecisionTableView.Presenter dtPresenter) {
final ObservablePath path = dtPresenter.getCurrentPath();
final GuidedDecisionTable52 model = dtPresenter.getModel();
service.call(new RemoteCallback<List<ValidationMessage>>() {
@Override
public void callback(final List<ValidationMessage> results) {
if (results == null || results.isEmpty()) {
notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemValidatedSuccessfully(), NotificationEvent.NotificationType.SUCCESS));
} else {
showValidationPopup(results);
}
}
}).validate(path, model);
}
use of org.jboss.errai.common.client.api.RemoteCallback in project drools-wb by kiegroup.
the class BaseGuidedDecisionTableEditorPresenter method getRefreshContentSuccessCallback.
private RemoteCallback<GuidedDecisionTableEditorContent> getRefreshContentSuccessCallback(final GuidedDecisionTableView.Presenter dtPresenter) {
final ObservablePath path = dtPresenter.getLatestPath();
final PlaceRequest place = dtPresenter.getPlaceRequest();
final boolean isReadOnly = dtPresenter.isReadOnly();
return (content) -> {
// Refresh Decision Table in modeller
modeller.refreshDecisionTable(dtPresenter, path, place, content, isReadOnly);
activateDocument(dtPresenter);
view.hideBusyIndicator();
};
}
use of org.jboss.errai.common.client.api.RemoteCallback in project drools-wb by kiegroup.
the class GuidedDecisionTreeEditorPresenter method getModelSuccessCallback.
private RemoteCallback<GuidedDecisionTreeEditorContent> getModelSuccessCallback() {
return new RemoteCallback<GuidedDecisionTreeEditorContent>() {
@Override
public void callback(final GuidedDecisionTreeEditorContent content) {
// Path is set to null when the Editor is closed (which can happen before async calls complete).
if (versionRecordManager.getCurrentPath() == null) {
return;
}
GuidedDecisionTreeEditorPresenter.this.content = content;
model = content.getModel();
metadata = content.getOverview().getMetadata();
final PackageDataModelOracleBaselinePayload dataModel = content.getDataModel();
oracle = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), model, dataModel);
resetEditorPages(content.getOverview());
addSourcePage();
addImportsTab(importsWidget);
importsWidget.setContent(oracle, model.getImports(), isReadOnly);
view.setModel(model, isReadOnly);
view.setDataModel(oracle, isReadOnly);
view.hideBusyIndicator();
// If there were any parsing errors give the User the option to remove the broken DRL or ignore it
if (!model.getParserErrors().isEmpty()) {
final ParserMessagesPopup popup = new ParserMessagesPopup(model);
popup.show();
}
createOriginalHash(model);
}
};
}
use of org.jboss.errai.common.client.api.RemoteCallback in project drools-wb by kiegroup.
the class GuidedRuleTemplateEditorPresenter method getModelSuccessCallback.
private RemoteCallback<GuidedTemplateEditorContent> getModelSuccessCallback() {
return new RemoteCallback<GuidedTemplateEditorContent>() {
@Override
public void callback(final GuidedTemplateEditorContent content) {
// Path is set to null when the Editor is closed (which can happen before async calls complete).
if (versionRecordManager.getCurrentPath() == null) {
return;
}
resetEditorPages(content.getOverview());
addSourcePage();
addPage(new PageImpl(dataView, GuidedTemplateEditorConstants.INSTANCE.Data()) {
@Override
public void onFocus() {
dataView.setContent(model, oracle, eventBus, isReadOnly);
}
@Override
public void onLostFocus() {
// Nothing to do here
}
});
addImportsTab(importsWidget);
model = content.getModel();
final PackageDataModelOracleBaselinePayload dataModel = content.getDataModel();
oracle = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), model, dataModel);
view.setContent(model, oracle, ruleNamesService, eventBus, isReadOnly);
importsWidget.setContent(oracle, model.getImports(), isReadOnly);
createOriginalHash(model);
view.hideBusyIndicator();
}
};
}
Aggregations