Search in sources :

Example 1 with PlaceGainFocusEvent

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

the class ProjectDiagramEditorTest method testOnPlaceGainFocusEvent.

@Test
public void testOnPlaceGainFocusEvent() {
    PlaceGainFocusEvent event = new PlaceGainFocusEvent(placeRequest);
    tested.showDiagramEditorDocks(event);
    verify(onDiagramFocusEvent).fire(any(OnDiagramFocusEvent.class));
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) OnDiagramFocusEvent(org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent) Test(org.junit.Test)

Example 2 with PlaceGainFocusEvent

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

the class ProjectDiagramEditorTest method testNotValidOnPlaceGainFocusEvent.

@Test
public void testNotValidOnPlaceGainFocusEvent() {
    PlaceRequest anotherRequest = mock(PlaceRequest.class);
    when(anotherRequest.getIdentifier()).thenReturn("");
    PlaceGainFocusEvent event = new PlaceGainFocusEvent(anotherRequest);
    tested.showDiagramEditorDocks(event);
    verify(onDiagramFocusEvent, never()).fire(any(OnDiagramFocusEvent.class));
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) OnDiagramFocusEvent(org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent) Test(org.junit.Test)

Example 3 with PlaceGainFocusEvent

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

the class LibraryPlacesTest method onSelectAssetTest.

@Test
public void onSelectAssetTest() {
    doReturn(libraryPerspective).when(perspectiveManager).getCurrentPerspective();
    final ObservablePath path = mock(ObservablePath.class);
    final PathPlaceRequest pathPlaceRequest = mock(PathPlaceRequest.class);
    doReturn(path).when(pathPlaceRequest).getPath();
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    doReturn(pathPlaceRequest).when(placeGainFocusEvent).getPlace();
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(libraryBreadcrumbs).setupForAsset(libraryPlaces.getActiveWorkspace(), path);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) ObservablePath(org.uberfire.backend.vfs.ObservablePath) Test(org.junit.Test)

Example 4 with PlaceGainFocusEvent

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

the class LibraryPlacesTest method onSelectProjectTest.

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

Example 5 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)

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