Search in sources :

Example 1 with CanvasElementsClearEvent

use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent in project kie-wb-common by kiegroup.

the class AbstractSelectionAwareSessionCommandTest method testOnCanvasElementsClearEvent.

@Test
public void testOnCanvasElementsClearEvent() {
    CanvasElementsClearEvent event = new CanvasElementsClearEvent(canvasHandler);
    command.onCanvasElementsClearEvent(event);
    verify(command, times(1)).handleCanvasElementsClearEvent(event);
    event = new CanvasElementsClearEvent(anotherCanvasHandler);
    command.onCanvasElementsClearEvent(event);
    verify(command, never()).handleCanvasElementsClearEvent(event);
}
Also used : CanvasElementsClearEvent(org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent) Test(org.junit.Test)

Example 2 with CanvasElementsClearEvent

use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent in project kie-wb-common by kiegroup.

the class BaseSessionCommandKeyboardSelectionAwareTest method testHandleCanvasElementsClearEvent.

@Test
public void testHandleCanvasElementsClearEvent() {
    command.bind(session);
    ((AbstractSelectionAwareSessionCommand) command).handleCanvasElementsClearEvent(new CanvasElementsClearEvent(canvasHandler));
    assertFalse(command.isEnabled());
    verify(statusCallback, times(1)).execute();
}
Also used : CanvasElementsClearEvent(org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent) Test(org.junit.Test)

Example 3 with CanvasElementsClearEvent

use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent in project kie-wb-common by kiegroup.

the class CanvasHandlerImpl method clearCanvas.

@Override
public void clearCanvas() {
    super.clearCanvas();
    canvasElementsClearEvent.fire(new CanvasElementsClearEvent(this));
}
Also used : CanvasElementsClearEvent(org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent)

Aggregations

CanvasElementsClearEvent (org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementsClearEvent)3 Test (org.junit.Test)2