Search in sources :

Example 1 with OnDiagramFocusEvent

use of org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent 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 OnDiagramFocusEvent

use of org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent 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 OnDiagramFocusEvent

use of org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent in project kie-wb-common by kiegroup.

the class StunnerDocksHandlerTest method testOnDiagramFocusEvent.

@Test
public void testOnDiagramFocusEvent() {
    handler.onDiagramFocusEvent(new OnDiagramFocusEvent());
    assertTrue(handler.shouldRefreshDocks());
    assertFalse(handler.shouldDisableDocks());
    verify(command).execute();
}
Also used : OnDiagramFocusEvent(org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 OnDiagramFocusEvent (org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent)3 PlaceGainFocusEvent (org.uberfire.client.workbench.events.PlaceGainFocusEvent)2 PlaceRequest (org.uberfire.mvp.PlaceRequest)1 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)1