Search in sources :

Example 1 with PlaceHiddenEvent

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

the class AuthoringWorkbenchDocksTest method testCloseComponentPalette.

@Test
public void testCloseComponentPalette() {
    authoringWorkbenchDocks.onLayoutEditorFocus(new LayoutEditorFocusEvent());
    reset(uberfireDocks);
    authoringWorkbenchDocks.onLayoutEditorClose(new PlaceHiddenEvent(new DefaultPlaceRequest("FormEditor")));
    verify(uberfireDocks).remove(authoringWorkbenchDocks.componentPaletteDock);
    assertFalse(authoringWorkbenchDocks.componentPaletteEnabled);
    verify(uberfireDocks, never()).open(any());
}
Also used : PlaceHiddenEvent(org.uberfire.client.workbench.events.PlaceHiddenEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) LayoutEditorFocusEvent(org.kie.workbench.common.workbench.client.events.LayoutEditorFocusEvent) Test(org.junit.Test)

Example 2 with PlaceHiddenEvent

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

the class ProjectDiagramEditorTest method testOnPlaceHiddenEvent.

@Test
public void testOnPlaceHiddenEvent() {
    PlaceHiddenEvent event = new PlaceHiddenEvent(placeRequest);
    tested.hideDiagramEditorDocks(event);
    verify(onDiagramLostFocusEven).fire(any(OnDiagramLoseFocusEvent.class));
}
Also used : OnDiagramLoseFocusEvent(org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent) PlaceHiddenEvent(org.uberfire.client.workbench.events.PlaceHiddenEvent) Test(org.junit.Test)

Example 3 with PlaceHiddenEvent

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

the class ProjectDiagramEditorTest method testNotValidOnPlaceHiddenEvent.

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

Aggregations

Test (org.junit.Test)3 PlaceHiddenEvent (org.uberfire.client.workbench.events.PlaceHiddenEvent)3 OnDiagramLoseFocusEvent (org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent)2 LayoutEditorFocusEvent (org.kie.workbench.common.workbench.client.events.LayoutEditorFocusEvent)1 PlaceRequest (org.uberfire.mvp.PlaceRequest)1 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)1 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)1