Search in sources :

Example 1 with PageImpl

use of org.uberfire.client.views.pfly.multipage.PageImpl 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();
        }
    };
}
Also used : PageImpl(org.uberfire.client.views.pfly.multipage.PageImpl) GuidedTemplateEditorContent(org.drools.workbench.screens.guided.template.model.GuidedTemplateEditorContent) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Aggregations

GuidedTemplateEditorContent (org.drools.workbench.screens.guided.template.model.GuidedTemplateEditorContent)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)1 PageImpl (org.uberfire.client.views.pfly.multipage.PageImpl)1