Search in sources :

Example 21 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToOrgUnitsMetrics.

public void goToOrgUnitsMetrics() {
    final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.ORG_UNITS_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    setupLibraryBreadCrumbsForOrgUnitsMetrics();
}
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) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 22 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToProjectTest.

@Test
public void goToProjectTest() {
    final PlaceRequest projectScreen = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(projectScreen);
    part.setSelectable(false);
    libraryPlaces.goToProject();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(projectContextChangeEvent, never()).fire(any(WorkspaceProjectContextChangeEvent.class));
    verify(libraryPlaces).setupLibraryBreadCrumbs(activeProject);
}
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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) Test(org.junit.Test)

Example 23 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToTrySamplesTest.

@Test
public void goToTrySamplesTest() {
    doReturn(true).when(libraryPlaces).closeAllPlacesOrNothing();
    final PlaceRequest trySamplesScreen = new DefaultPlaceRequest(LibraryPlaces.IMPORT_SAMPLE_PROJECTS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(trySamplesScreen);
    part.setSelectable(false);
    libraryPlaces.goToTrySamples();
    verify(libraryPlaces).closeAllPlacesOrNothing();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).setupLibraryBreadCrumbsForTrySamples();
}
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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 24 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToPreferencesTest.

@Test
public void goToPreferencesTest() {
    final PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo = mock(PreferenceScopeResolutionStrategyInfo.class);
    doReturn(scopeResolutionStrategyInfo).when(projectScopedResolutionStrategySupplier).get();
    final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PreferencesRootScreen.IDENTIFIER);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    libraryPlaces.goToPreferences();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(preferencesCentralInitializationEvent).fire(new PreferencesCentralInitializationEvent("ProjectPreferences", scopeResolutionStrategyInfo, null));
    verify(libraryPlaces).setupLibraryBreadCrumbsForPreferences();
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) PreferenceScopeResolutionStrategyInfo(org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo) PreferencesCentralInitializationEvent(org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 25 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToLibraryWhenGoingBackFromProjectTest.

@Test
public void goToLibraryWhenGoingBackFromProjectTest() {
    doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
    activeProject = new WorkspaceProject(activeOrganizationalUnit, activeRepository, activeBranch, activeModule);
    doReturn(Optional.of(activeProject)).when(projectContext).getActiveWorkspaceProject();
    doReturn(Optional.of(activeModule)).when(projectContext).getActiveModule();
    final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    libraryPlaces.goToLibrary();
    verify(libraryPlaces).closeLibraryPlaces();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
    verify(projectContextChangeEvent, never()).fire(any(WorkspaceProjectContextChangeEvent.class));
}
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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) Test(org.junit.Test)

Aggregations

DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)29 PartDefinitionImpl (org.uberfire.workbench.model.impl.PartDefinitionImpl)29 PanelDefinition (org.uberfire.workbench.model.PanelDefinition)14 PlaceRequest (org.uberfire.mvp.PlaceRequest)12 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)12 Perspective (org.uberfire.client.annotations.Perspective)11 WorkbenchPerspective (org.uberfire.client.annotations.WorkbenchPerspective)11 PerspectiveDefinition (org.uberfire.workbench.model.PerspectiveDefinition)11 PerspectiveDefinitionImpl (org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl)11 Test (org.junit.Test)9 MultiListWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter)8 WorkspaceProjectContextChangeEvent (org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent)7 PanelDefinitionImpl (org.uberfire.workbench.model.impl.PanelDefinitionImpl)7 SimpleWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.SimpleWorkbenchPanelPresenter)3 StaticWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.StaticWorkbenchPanelPresenter)3 WorkbenchProjectMetricsEvent (org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent)2 PreferencesCentralInitializationEvent (org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent)2 PreferenceScopeResolutionStrategyInfo (org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo)2 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)1