use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method onSelectLibraryTest.
@Test
public void onSelectLibraryTest() {
doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
verify(libraryPlaces).hideDocks();
verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method showDocksTest.
@Test
public void showDocksTest() {
libraryPlaces.showDocks();
libraryPlaces.showDocks();
verify(docks, times(1)).setup(LibraryPlaces.LIBRARY_PERSPECTIVE, new DefaultPlaceRequest(LibraryPlaces.PROJECT_EXPLORER));
verify(docks, times(1)).show();
verify(docks, never()).hide();
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method goToProjectSettingsTest.
@Test
public void goToProjectSettingsTest() {
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SETTINGS);
libraryPlaces.goToAsset(null);
verify(placeManager).goTo(placeRequest);
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method goToLibraryWithDefaultOrganizationalUnitTest.
@Test
public void goToLibraryWithDefaultOrganizationalUnitTest() {
when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.empty()).thenReturn(Optional.of(mock(OrganizationalUnit.class)));
doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.empty()).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, times(2)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class SocialHomePagePerspective method buildPerspective.
@Perspective
public PerspectiveDefinition buildPerspective() {
final PerspectiveDefinition p = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
p.setName("Social Home Page Perspective");
final PanelDefinition west = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
west.setWidth(450);
west.setMinWidth(450);
west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest("SocialHomePageSidePresenter")));
p.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("SocialHomePageMainPresenter")));
p.getRoot().insertChild(CompassPosition.WEST, west);
return p;
}
Aggregations