Search in sources :

Example 1 with WorkbenchProjectMetricsEvent

use of org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method init.

@Before
public void init() throws Exception {
    super.init();
    when(project.getRepository()).thenReturn(repository);
    when(repository.getAlias()).thenReturn("repo");
    when(project.getName()).thenReturn("project1");
    contributorsDataSet = ContributorsData.INSTANCE.toDataSet();
    contributorsDataSet.setUUID(ContributorsDataSets.GIT_CONTRIB);
    clientDataSetManager.registerDataSet(contributorsDataSet);
    displayerCoordinator = new DisplayerCoordinator(rendererManager);
    displayerCoordinator.addListener(displayerListener);
    metricsFactory = new ProjectMetricsFactory(i18n, displayerLocator);
    presenter = new ProjectMetricsScreen(view, i18n, metricsFactory, displayerCoordinator);
    presenter.onStartup(new WorkbenchProjectMetricsEvent(project));
}
Also used : DisplayerCoordinator(org.dashbuilder.displayer.client.DisplayerCoordinator) WorkbenchProjectMetricsEvent(org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent) ProjectMetricsFactory(org.kie.workbench.common.screens.library.client.util.ProjectMetricsFactory) Before(org.junit.Before)

Example 2 with WorkbenchProjectMetricsEvent

use of org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToProjectMetrics.

public void goToProjectMetrics() {
    final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.PROJECT_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    setupLibraryBreadCrumbsForProjectMetrics();
    projectMetricsEvent.fire(new WorkbenchProjectMetricsEvent(projectContext.getActiveWorkspaceProject().orElseThrow(() -> new IllegalStateException("Cannot fire event for project metrics without an active project."))));
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) WorkbenchProjectMetricsEvent(org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Aggregations

WorkbenchProjectMetricsEvent (org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent)2 DisplayerCoordinator (org.dashbuilder.displayer.client.DisplayerCoordinator)1 Before (org.junit.Before)1 ProjectMetricsFactory (org.kie.workbench.common.screens.library.client.util.ProjectMetricsFactory)1 PlaceRequest (org.uberfire.mvp.PlaceRequest)1 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)1 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)1 PartDefinitionImpl (org.uberfire.workbench.model.impl.PartDefinitionImpl)1