@Test public void testReopenSession() { final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); tested.reopenSession(projectDiagram); verify(sessionEditorPresenter, times(1)).destroy(); verify(sessionEditorPresenter, times(1)).open(eq(projectDiagram), any(SessionPresenter.SessionPresenterCallback.class)); }
void reopenSession(final ProjectDiagram diagram) { switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); getMenuSessionItems().getCommands().getCommands().clearCommands(); destroySession(); open(diagram, error -> { }); }
CaseManagementDiagramEditor extends AbstractProjectDiagramEditor<CaseManagementDiagramResourceType> { void reopenSession(final ProjectDiagram diagram) { switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); getMenuSessionItems().getCommands().getCommands().clearCommands(); destroySession(); open(diagram, error -> { }); } }
CaseManagementDiagramEditor extends AbstractProjectDiagramEditor<CaseManagementDiagramResourceType> { void reopenSession(final ProjectDiagram diagram) { switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); getMenuSessionItems().getCommands().getCommands().clearCommands(); destroySession(); open(diagram, error -> { }); } @Inject  CaseManagementDiagramEditor(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 CaseManagementDiagramResourceType resourceType,
                                       final CaseManagementProjectEditorMenuSessionItems menuSessionItems,
                                       final ProjectMessagesListener projectMessagesListener,
                                       final ClientTranslationService translationService,
                                       final ClientProjectDiagramService projectDiagramServices,
                                       final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller,
                                       final Caller<CaseManagementSwitchViewService> caseManagementSwitchViewService,
                                       final UberfireDocks uberfireDocks,
                                       final StunnerDocksHandler stunnerDocksHandler); }
CaseManagementDiagramEditor extends AbstractProjectDiagramEditor<CaseManagementDiagramResourceType> { void reopenSession(final ProjectDiagram diagram) { switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); getMenuSessionItems().getCommands().getCommands().clearCommands(); destroySession(); open(diagram, error -> { }); } @Inject  CaseManagementDiagramEditor(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 CaseManagementDiagramResourceType resourceType,
                                       final CaseManagementProjectEditorMenuSessionItems menuSessionItems,
                                       final ProjectMessagesListener projectMessagesListener,
                                       final ClientTranslationService translationService,
                                       final ClientProjectDiagramService projectDiagramServices,
                                       final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller,
                                       final Caller<CaseManagementSwitchViewService> caseManagementSwitchViewService,
                                       final UberfireDocks uberfireDocks,
                                       final StunnerDocksHandler stunnerDocksHandler); @Override void init(); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @Override String getEditorIdentifier(); @OnOpen void onOpen(); @OnClose @Override void onClose(); @OnFocus void onFocus(); @OnLostFocus void onLostFocus(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @WorkbenchPartView IsWidget getWidget(); @OnMayClose boolean onMayClose(); @Override SessionEditorPresenter<EditorSession> newSessionEditorPresenter(); @Override void initialiseKieEditorForSession(ProjectDiagram diagram); }
CaseManagementDiagramEditor extends AbstractProjectDiagramEditor<CaseManagementDiagramResourceType> { void reopenSession(final ProjectDiagram diagram) { switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); getMenuSessionItems().getCommands().getCommands().clearCommands(); destroySession(); open(diagram, error -> { }); } @Inject  CaseManagementDiagramEditor(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 CaseManagementDiagramResourceType resourceType,
                                       final CaseManagementProjectEditorMenuSessionItems menuSessionItems,
                                       final ProjectMessagesListener projectMessagesListener,
                                       final ClientTranslationService translationService,
                                       final ClientProjectDiagramService projectDiagramServices,
                                       final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller,
                                       final Caller<CaseManagementSwitchViewService> caseManagementSwitchViewService,
                                       final UberfireDocks uberfireDocks,
                                       final StunnerDocksHandler stunnerDocksHandler); @Override void init(); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @Override String getEditorIdentifier(); @OnOpen void onOpen(); @OnClose @Override void onClose(); @OnFocus void onFocus(); @OnLostFocus void onLostFocus(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @WorkbenchPartView IsWidget getWidget(); @OnMayClose boolean onMayClose(); @Override SessionEditorPresenter<EditorSession> newSessionEditorPresenter(); @Override void initialiseKieEditorForSession(ProjectDiagram diagram); static final String EDITOR_ID; }