@Test public void testSetContentFailure() { final String path = "path"; editor.setContent(path, CONTENT); verify(clientDiagramService).transform(eq(path), eq(CONTENT), serviceCallbackArgumentCaptor.capture()); final ServiceCallback<Diagram> serviceCallback = serviceCallbackArgumentCaptor.getValue(); assertThat(serviceCallback).isNotNull(); serviceCallback.onError(clientRuntimeError); verify(feelInitializer, never()).initializeFEELEditor(); verify(diagramClientErrorHandler).handleError(eq(clientRuntimeError), any()); }
@Override @SetContent public Promise setContent(final String path, final String value) { Promise promise = promises.create((success, failure) -> { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram, new Viewer.Callback() { @Override public void onSuccess() { success.onInvoke((Object) null); } @Override public void onError(ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); }); return promise; }
AbstractDMNDiagramEditor extends AbstractDiagramEditor { @Override @SetContent public Promise setContent(final String path, final String value) { Promise promise = promises.create((success, failure) -> { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram, new Viewer.Callback() { @Override public void onSuccess() { success.onInvoke((Object) null); } @Override public void onError(ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); }); return promise; } }
AbstractDMNDiagramEditor extends AbstractDiagramEditor { @Override @SetContent public Promise setContent(final String path, final String value) { Promise promise = promises.create((success, failure) -> { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram, new Viewer.Callback() { @Override public void onSuccess() { success.onInvoke((Object) null); } @Override public void onError(ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); }); return promise; } AbstractDMNDiagramEditor(final View view,
                                    final FileMenuBuilder fileMenuBuilder,
                                    final PlaceManager placeManager,
                                    final MultiPageEditorContainerView multiPageEditorContainerView,
                                    final Event<ChangeTitleWidgetEvent> changeTitleNotificationEvent,
                                    final Event<NotificationEvent> notificationEvent,
                                    final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                    final TextEditorView xmlEditorView,
                                    final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                    final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                    final DMNEditorMenuSessionItems menuSessionItems,
                                    final ErrorPopupPresenter errorPopupPresenter,
                                    final DiagramClientErrorHandler diagramClientErrorHandler,
                                    final ClientTranslationService translationService,
                                    final DocumentationView<Diagram> documentationView,
                                    final DMNEditorSearchIndex editorSearchIndex,
                                    final SearchBarComponent<DMNSearchableElement> searchBarComponent,
                                    final SessionManager sessionManager,
                                    final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                    final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                    final DecisionNavigatorDock decisionNavigatorDock,
                                    final DiagramEditorPropertiesDock diagramPropertiesDock,
                                    final PreviewDiagramDock diagramPreviewAndExplorerDock,
                                    final LayoutHelper layoutHelper,
                                    final OpenDiagramLayoutExecutor openDiagramLayoutExecutor,
                                    final DataTypesPage dataTypesPage,
                                    final KogitoClientDiagramService diagramServices,
                                    final MonacoFEELInitializer feelInitializer,
                                    final CanvasFileExport canvasFileExport,
                                    final Promises promises,
                                    final IncludedModelsPage includedModelsPage,
                                    final EditorContextProvider contextProvider,
                                    final GuidedTourBridgeInitializer guidedTourBridgeInitializer,
                                    final DRDNameChanger drdNameChanger); }
AbstractDMNDiagramEditor extends AbstractDiagramEditor { @Override @SetContent public Promise setContent(final String path, final String value) { Promise promise = promises.create((success, failure) -> { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram, new Viewer.Callback() { @Override public void onSuccess() { success.onInvoke((Object) null); } @Override public void onError(ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); }); return promise; } AbstractDMNDiagramEditor(final View view,
                                    final FileMenuBuilder fileMenuBuilder,
                                    final PlaceManager placeManager,
                                    final MultiPageEditorContainerView multiPageEditorContainerView,
                                    final Event<ChangeTitleWidgetEvent> changeTitleNotificationEvent,
                                    final Event<NotificationEvent> notificationEvent,
                                    final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                    final TextEditorView xmlEditorView,
                                    final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                    final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                    final DMNEditorMenuSessionItems menuSessionItems,
                                    final ErrorPopupPresenter errorPopupPresenter,
                                    final DiagramClientErrorHandler diagramClientErrorHandler,
                                    final ClientTranslationService translationService,
                                    final DocumentationView<Diagram> documentationView,
                                    final DMNEditorSearchIndex editorSearchIndex,
                                    final SearchBarComponent<DMNSearchableElement> searchBarComponent,
                                    final SessionManager sessionManager,
                                    final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                    final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                    final DecisionNavigatorDock decisionNavigatorDock,
                                    final DiagramEditorPropertiesDock diagramPropertiesDock,
                                    final PreviewDiagramDock diagramPreviewAndExplorerDock,
                                    final LayoutHelper layoutHelper,
                                    final OpenDiagramLayoutExecutor openDiagramLayoutExecutor,
                                    final DataTypesPage dataTypesPage,
                                    final KogitoClientDiagramService diagramServices,
                                    final MonacoFEELInitializer feelInitializer,
                                    final CanvasFileExport canvasFileExport,
                                    final Promises promises,
                                    final IncludedModelsPage includedModelsPage,
                                    final EditorContextProvider contextProvider,
                                    final GuidedTourBridgeInitializer guidedTourBridgeInitializer,
                                    final DRDNameChanger drdNameChanger); @OnStartup @SuppressWarnings("unused") void onStartup(final PlaceRequest place); @Override void initialiseKieEditorForSession(final Diagram diagram); @SuppressWarnings("unused") void onDataTypePageNavTabActiveEvent(final DataTypePageTabActiveEvent event); @Override void open(final Diagram diagram,
                     final Viewer.Callback callback); @OnOpen @SuppressWarnings("unused") void onOpen(); @OnClose @SuppressWarnings("unused") void onClose(); @OnFocus @SuppressWarnings("unused") void onFocus(); @OnLostFocus @SuppressWarnings("unused") void onLostFocus(); @Override @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override @WorkbenchPartView IsWidget asWidget(); @OnMayClose @SuppressWarnings("unused") boolean onMayClose(); @Override String getEditorIdentifier(); void onDataTypeEditModeToggle(final DataTypeEditModeToggleEvent event); @Override @GetContent Promise getContent(); @Override @IsDirty boolean isDirty(); @Override @SetContent Promise setContent(final String path,
                              final String value); @Override void resetContentHash(); @GetPreview Promise getPreview(); }
AbstractDMNDiagramEditor extends AbstractDiagramEditor { @Override @SetContent public Promise setContent(final String path, final String value) { Promise promise = promises.create((success, failure) -> { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram, new Viewer.Callback() { @Override public void onSuccess() { success.onInvoke((Object) null); } @Override public void onError(ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); failure.onInvoke(error); } }); }); return promise; } AbstractDMNDiagramEditor(final View view,
                                    final FileMenuBuilder fileMenuBuilder,
                                    final PlaceManager placeManager,
                                    final MultiPageEditorContainerView multiPageEditorContainerView,
                                    final Event<ChangeTitleWidgetEvent> changeTitleNotificationEvent,
                                    final Event<NotificationEvent> notificationEvent,
                                    final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                    final TextEditorView xmlEditorView,
                                    final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                    final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                    final DMNEditorMenuSessionItems menuSessionItems,
                                    final ErrorPopupPresenter errorPopupPresenter,
                                    final DiagramClientErrorHandler diagramClientErrorHandler,
                                    final ClientTranslationService translationService,
                                    final DocumentationView<Diagram> documentationView,
                                    final DMNEditorSearchIndex editorSearchIndex,
                                    final SearchBarComponent<DMNSearchableElement> searchBarComponent,
                                    final SessionManager sessionManager,
                                    final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                    final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                    final DecisionNavigatorDock decisionNavigatorDock,
                                    final DiagramEditorPropertiesDock diagramPropertiesDock,
                                    final PreviewDiagramDock diagramPreviewAndExplorerDock,
                                    final LayoutHelper layoutHelper,
                                    final OpenDiagramLayoutExecutor openDiagramLayoutExecutor,
                                    final DataTypesPage dataTypesPage,
                                    final KogitoClientDiagramService diagramServices,
                                    final MonacoFEELInitializer feelInitializer,
                                    final CanvasFileExport canvasFileExport,
                                    final Promises promises,
                                    final IncludedModelsPage includedModelsPage,
                                    final EditorContextProvider contextProvider,
                                    final GuidedTourBridgeInitializer guidedTourBridgeInitializer,
                                    final DRDNameChanger drdNameChanger); @OnStartup @SuppressWarnings("unused") void onStartup(final PlaceRequest place); @Override void initialiseKieEditorForSession(final Diagram diagram); @SuppressWarnings("unused") void onDataTypePageNavTabActiveEvent(final DataTypePageTabActiveEvent event); @Override void open(final Diagram diagram,
                     final Viewer.Callback callback); @OnOpen @SuppressWarnings("unused") void onOpen(); @OnClose @SuppressWarnings("unused") void onClose(); @OnFocus @SuppressWarnings("unused") void onFocus(); @OnLostFocus @SuppressWarnings("unused") void onLostFocus(); @Override @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override @WorkbenchPartView IsWidget asWidget(); @OnMayClose @SuppressWarnings("unused") boolean onMayClose(); @Override String getEditorIdentifier(); void onDataTypeEditModeToggle(final DataTypeEditModeToggleEvent event); @Override @GetContent Promise getContent(); @Override @IsDirty boolean isDirty(); @Override @SetContent Promise setContent(final String path,
                              final String value); @Override void resetContentHash(); @GetPreview Promise getPreview(); static final String PERSPECTIVE_ID; static final String EDITOR_ID; static final int DATA_TYPES_PAGE_INDEX; }