use of org.guvnor.structure.repositories.RepositoryRemovedEvent in project kie-wb-common by kiegroup.
the class KieMultipleDocumentEditorTest method testOnRepositoryRemoved.
@Test
public void testOnRepositoryRemoved() {
final Repository repository = mock(Repository.class);
when(workbenchContext.getActiveWorkspaceProject()).thenReturn(Optional.of(new WorkspaceProject(mock(OrganizationalUnit.class), repository, mock(Branch.class), mock(Module.class))));
editor.setupMenuBar();
editor.onRepositoryRemoved(new RepositoryRemovedEvent(repository));
verify(editor, times(1)).enableMenus(eq(false));
verify(editor, times(4)).enableMenuItem(eq(false), any(MenuItems.class));
verify(saveMenuItem, times(1)).setEnabled(eq(false));
verify(versionManagerMenuItem, times(1)).setEnabled(eq(false));
}
use of org.guvnor.structure.repositories.RepositoryRemovedEvent in project kie-wb-common by kiegroup.
the class LibraryPlaces method onProjectDeleted.
public void onProjectDeleted(@Observes final RepositoryRemovedEvent repositoryRemovedEvent) {
if (isLibraryPerspectiveOpen() && isRepoForActiveProject(repositoryRemovedEvent)) {
closeAllPlaces();
WorkspaceProjectContextChangeEvent contextChangeEvent = projectContext.getActiveOrganizationalUnit().map(ou -> new WorkspaceProjectContextChangeEvent(ou)).orElseGet(() -> new WorkspaceProjectContextChangeEvent());
projectContextChangeEvent.fire(contextChangeEvent);
goToLibrary();
notificationEvent.fire(new NotificationEvent(ts.getTranslation(LibraryConstants.ProjectDeleted), NotificationEvent.NotificationType.DEFAULT));
}
}
Aggregations