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())); } }
private void onRestore(final @Observes RestoreEvent restore) { if (getCurrentPath() != null && getCurrentPath().equals(restore.getPath()) && saveButton != null) { saveButton.setTextToSave(); } }
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())); } }
private void onRestore(final @Observes RestoreEvent restore) { if (getCurrentPath() != null && getCurrentPath().equals(restore.getPath()) && saveButton != null) { saveButton.setTextToSave(); } }
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(); }
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())); } }
@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(); }