@Test @SuppressWarnings("unchecked") public void testAddDocumentationPage() { when(documentationView.isEnabled()).thenReturn(Boolean.TRUE); when(translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION)).thenReturn(DOC_LABEL); when(documentationView.initialize(diagram)).thenReturn(documentationView); presenter.addDocumentationPage(diagram); verify(translationService).getValue(StunnerProjectClientConstants.DOCUMENTATION); verify(kieView).addPage(documentationPageCaptor.capture()); final DocumentationPage documentationPage = documentationPageCaptor.getValue(); assertEquals(documentationPage.getDocumentationView(), documentationView); assertEquals(documentationPage.getLabel(), DOC_LABEL); }
@SuppressWarnings("unchecked") public void addDocumentationPage(final ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); }
AbstractProjectDiagramEditor extends KieEditor<ProjectDiagramResource> implements DiagramEditorCore<ProjectMetadata, ProjectDiagram> { @SuppressWarnings("unchecked") public void addDocumentationPage(final ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); } }
AbstractProjectDiagramEditor extends KieEditor<ProjectDiagramResource> implements DiagramEditorCore<ProjectMetadata, ProjectDiagram> { @SuppressWarnings("unchecked") public void addDocumentationPage(final ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); } AbstractProjectDiagramEditor(final AbstractProjectDiagramEditor.View view,
                                        final TextEditorView xmlEditorView,
                                        final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                        final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                        final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                        final Event<OnDiagramLoseFocusEvent> onDiagramLostFocusEvent,
                                        final Event<NotificationEvent> notificationEvent,
                                        final ErrorPopupPresenter errorPopupPresenter,
                                        final DiagramClientErrorHandler diagramClientErrorHandler,
                                        final DocumentationView documentationView,
                                        final R resourceType,
                                        final AbstractDiagramEditorMenuSessionItems<?> menuSessionItems,
                                        final ProjectMessagesListener projectMessagesListener,
                                        final ClientTranslationService translationService,
                                        final ClientProjectDiagramService projectDiagramServices,
                                        final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller); }
AbstractProjectDiagramEditor extends KieEditor<ProjectDiagramResource> implements DiagramEditorCore<ProjectMetadata, ProjectDiagram> { @SuppressWarnings("unchecked") public void addDocumentationPage(final ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); } AbstractProjectDiagramEditor(final AbstractProjectDiagramEditor.View view,
                                        final TextEditorView xmlEditorView,
                                        final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                        final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                        final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                        final Event<OnDiagramLoseFocusEvent> onDiagramLostFocusEvent,
                                        final Event<NotificationEvent> notificationEvent,
                                        final ErrorPopupPresenter errorPopupPresenter,
                                        final DiagramClientErrorHandler diagramClientErrorHandler,
                                        final DocumentationView documentationView,
                                        final R resourceType,
                                        final AbstractDiagramEditorMenuSessionItems<?> menuSessionItems,
                                        final ProjectMessagesListener projectMessagesListener,
                                        final ClientTranslationService translationService,
                                        final ClientProjectDiagramService projectDiagramServices,
                                        final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller); @PostConstruct @SuppressWarnings("unchecked") void init(); @Override RemoteCallback<Path> getSaveSuccessCallback(final int newHash); @Override void hideDocks(); @Override void showDocks(); @Override //Override visibility from KieEditor to allow inner class ProjectDiagramEditorCore access abstract String getEditorIdentifier(); @Override String getTitleText(); @Override void open(final ProjectDiagram diagram,
                     final Viewer.Callback callback); @Override Annotation[] getDockQualifiers(); @Override void initialiseKieEditorForSession(final ProjectDiagram diagram); @SuppressWarnings("unchecked") void addDocumentationPage(final ProjectDiagram diagram); @Override SessionEditorPresenter<EditorSession> newSessionEditorPresenter(); @Override SessionViewerPresenter<ViewerSession> newSessionViewerPresenter(); @Override int getCurrentDiagramHash(); @Override CanvasHandler getCanvasHandler(); @Override void onSaveError(final ClientRuntimeError error); @Override SessionPresenter<? extends ClientSession, ?, Diagram> getSessionPresenter(); @Override void doFocus(); @Override void doLostFocus(); AbstractDiagramEditorMenuSessionItems getMenuSessionItems(); }
AbstractProjectDiagramEditor extends KieEditor<ProjectDiagramResource> implements DiagramEditorCore<ProjectMetadata, ProjectDiagram> { @SuppressWarnings("unchecked") public void addDocumentationPage(final ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); } AbstractProjectDiagramEditor(final AbstractProjectDiagramEditor.View view,
                                        final TextEditorView xmlEditorView,
                                        final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                        final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                        final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                        final Event<OnDiagramLoseFocusEvent> onDiagramLostFocusEvent,
                                        final Event<NotificationEvent> notificationEvent,
                                        final ErrorPopupPresenter errorPopupPresenter,
                                        final DiagramClientErrorHandler diagramClientErrorHandler,
                                        final DocumentationView documentationView,
                                        final R resourceType,
                                        final AbstractDiagramEditorMenuSessionItems<?> menuSessionItems,
                                        final ProjectMessagesListener projectMessagesListener,
                                        final ClientTranslationService translationService,
                                        final ClientProjectDiagramService projectDiagramServices,
                                        final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller); @PostConstruct @SuppressWarnings("unchecked") void init(); @Override RemoteCallback<Path> getSaveSuccessCallback(final int newHash); @Override void hideDocks(); @Override void showDocks(); @Override //Override visibility from KieEditor to allow inner class ProjectDiagramEditorCore access abstract String getEditorIdentifier(); @Override String getTitleText(); @Override void open(final ProjectDiagram diagram,
                     final Viewer.Callback callback); @Override Annotation[] getDockQualifiers(); @Override void initialiseKieEditorForSession(final ProjectDiagram diagram); @SuppressWarnings("unchecked") void addDocumentationPage(final ProjectDiagram diagram); @Override SessionEditorPresenter<EditorSession> newSessionEditorPresenter(); @Override SessionViewerPresenter<ViewerSession> newSessionViewerPresenter(); @Override int getCurrentDiagramHash(); @Override CanvasHandler getCanvasHandler(); @Override void onSaveError(final ClientRuntimeError error); @Override SessionPresenter<? extends ClientSession, ?, Diagram> getSessionPresenter(); @Override void doFocus(); @Override void doLostFocus(); AbstractDiagramEditorMenuSessionItems getMenuSessionItems();  }