Search in sources :

Example 11 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectLibraryTest.

@Test
public void onSelectLibraryTest() {
    doReturn(libraryPerspective).when(perspectiveManager).getCurrentPerspective();
    final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(libraryBreadcrumbs).setupForSpace(libraryPlaces.getActiveWorkspace().getOrganizationalUnit());
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 12 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectProjectSettingsTest.

@Test
public void onSelectProjectSettingsTest() {
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SETTINGS);
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(libraryPlaces).hideDocks();
    verify(libraryPlaces).setupLibraryBreadCrumbsForAsset(null);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 13 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class TestRunnerReportingScreenTest method doNotCloseWhenThisScreenGainsFocus.

@Test
public void doNotCloseWhenThisScreenGainsFocus() {
    screen.onPlaceGainFocusEvent(new PlaceGainFocusEvent(new DefaultPlaceRequest(TestRunnerReportingScreen.IDENTIFIER)));
    verify(placeManager, never()).closePlace(TestRunnerReportingScreen.IDENTIFIER);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 14 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class TestRunnerReportingScreenTest method nullIdentifier.

@Test
public void nullIdentifier() {
    screen.onPlaceGainFocusEvent(new PlaceGainFocusEvent(new DefaultPlaceRequest()));
    verify(placeManager).closePlace(TestRunnerReportingScreen.IDENTIFIER);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 15 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectPlaceOutsideLibraryTest.

@Test
public void onSelectPlaceOutsideLibraryTest() {
    doReturn(otherPerspective).when(perspectiveManager).getCurrentPerspective();
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(placeGainFocusEvent, never()).getPlace();
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)18 PlaceGainFocusEvent (org.uberfire.client.workbench.events.PlaceGainFocusEvent)18 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)8 ObservablePath (org.uberfire.backend.vfs.ObservablePath)7 PlaceRequest (org.uberfire.mvp.PlaceRequest)5 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)3 ClientResourceType (org.uberfire.client.workbench.type.ClientResourceType)3 OnDiagramFocusEvent (org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent)2 PerspectiveActivity (org.uberfire.client.mvp.PerspectiveActivity)2 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)2 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)1 PlaceHiddenEvent (org.uberfire.client.workbench.events.PlaceHiddenEvent)1