private RemoteCallback<Path> successCallback(final String currentVersionRecordUri) { return restored -> { busyIndicatorView.hideBusyIndicator(); restoreEvent.fire(new RestoreEvent(restoreUtil.createObservablePath( restored, currentVersionRecordUri))); }; }
private void onRestore(final @Observes RestoreEvent restore) { if (getCurrentPath() != null && getCurrentPath().equals(restore.getPath()) && saveButton != null) { saveButton.setTextToSave(); } }
private void onRestore(final @Observes RestoreEvent restore) { if (getCurrentPath() != null && getCurrentPath().equals(restore.getPath()) && saveButton != null) { saveButton.setTextToSave(); } }
private RemoteCallback<Path> successCallback(final String currentVersionRecordUri) { return restored -> { busyIndicatorView.hideBusyIndicator(); restoreEvent.fire(new RestoreEvent(restoreUtil.createObservablePath( restored, currentVersionRecordUri))); }; }
void onRestore(final @Observes RestoreEvent restore) { if (versionRecordManager.getCurrentPath() == null || restore == null || restore.getPath() == null) { return; } if (versionRecordManager.getCurrentPath().equals(restore.getPath())) { initialiseEditor(versionRecordManager.getPathToLatest(), editorPlaceRequest); notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored())); } }
@Test public void checkOnRestore() { final ObservablePath dtGraphPath = mock(ObservablePath.class); final PathPlaceRequest dtGraphPlaceRequest = mock(PathPlaceRequest.class); final GuidedDecisionTableEditorGraphContent dtGraphContent = makeDecisionTableGraphContent(); final RestoreEvent event = new RestoreEvent(dtGraphPath); when(dtGraphPath.toURI()).thenReturn("dtGraphPath"); when(dtGraphPath.getFileName()).thenReturn("filename"); when(dtGraphService.loadContent(eq(dtGraphPath))).thenReturn(dtGraphContent); when(versionRecordManager.getCurrentPath()).thenReturn(dtGraphPath); when(versionRecordManager.getPathToLatest()).thenReturn(dtGraphPath); presenter.onStartup(dtGraphPath, dtGraphPlaceRequest); verify(presenter, times(1)).initialiseEditor(eq(dtGraphPath), eq(dtGraphPlaceRequest)); presenter.onRestore(event); verify(presenter, times(2)).initialiseEditor(eq(dtGraphPath), eq(dtGraphPlaceRequest)); verify(notification, times(1)).fire(any(NotificationEvent.class)); }
void onRestore(final @Observes RestoreEvent restore) { if (versionRecordManager.getCurrentPath() == null || restore == null || restore.getPath() == null) { return; } if (versionRecordManager.getCurrentPath().equals(restore.getPath())) { initialiseEditor(versionRecordManager.getPathToLatest(), editorPlaceRequest); notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored())); } }
public void onRestore(@Observes RestoreEvent restore) { if (versionRecordManager.getCurrentPath() == null || restore == null || restore.getPath() == null) { return; } if (versionRecordManager.getCurrentPath().equals(restore.getPath())) { //when a version is restored we don't want to add the concurrency listeners again -> false init(versionRecordManager.getPathToLatest(), place, type, false, displayShowMoreVersions); notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored())); } }
public void onRestore(@Observes RestoreEvent restore) { if (versionRecordManager.getCurrentPath() == null || restore == null || restore.getPath() == null) { return; } if (versionRecordManager.getCurrentPath().equals(restore.getPath())) { //when a version is restored we don't want to add the concurrency listeners again -> false init(versionRecordManager.getPathToLatest(), place, type, false, displayShowMoreVersions); notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored())); } }
@Test public void onRestoreWithNullRestoreEventPathShouldNotInitEditor() throws Exception { when(restoreEvent.getPath()).thenReturn(null); kieEditor.onRestore(restoreEvent); verify(kieEditor).onRestore(restoreEvent); verify(kieEditor.versionRecordManager, never()).getPathToLatest(); }
@Test public void onRestoreWithNullRestoreEventPathShouldNotInitEditor() throws Exception { when(restoreEvent.getPath()).thenReturn(null); kieEditor.onRestore(restoreEvent); verify(kieEditor).onRestore(restoreEvent); verify(kieEditor.versionRecordManager, never()).getPathToLatest(); }
@Test public void onRestoreShouldInitBaseEditorSuccessfully() throws Exception { when(kieEditor.versionRecordManager.getCurrentPath()).thenReturn(observablePath); when(restoreEvent.getPath()).thenReturn(observablePath); kieEditor.onRestore(restoreEvent); verify(kieEditor).onRestore(restoreEvent); verify(kieEditor.versionRecordManager).getPathToLatest(); }
@Test public void onRestoreShouldInitBaseEditorSuccessfully() throws Exception { when(kieEditor.versionRecordManager.getCurrentPath()).thenReturn(observablePath); when(restoreEvent.getPath()).thenReturn(observablePath); kieEditor.onRestore(restoreEvent); verify(kieEditor).onRestore(restoreEvent); verify(kieEditor.versionRecordManager).getPathToLatest(); }
void onRestore(final @Observes RestoreEvent event) { if (event == null || event.getPath() == null) { return; } if (versionRecordManager.getCurrentPath() == null) { return; } if (versionRecordManager.getCurrentPath().equals(event.getPath())) { activeDocument.setVersion(null); activeDocument.setLatestPath(versionRecordManager.getPathToLatest()); activeDocument.setCurrentPath(versionRecordManager.getPathToLatest()); initialiseVersionManager(activeDocument); activeDocument.setReadOnly(false); refreshDocument(activeDocument); notificationEvent.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored())); } }