Search in sources :

Example 1 with TextClickEvent

use of org.kie.workbench.common.stunner.core.client.shape.view.event.TextClickEvent in project kie-wb-common by kiegroup.

the class WiresTextDecorator method registerClickHandler.

private void registerClickHandler() {
    HandlerRegistration registration = text.addNodeMouseClickHandler(event -> {
        if (null != textClickEventViewHandler) {
            eventHandlerManager.get().skipClickHandler();
            final TextClickEvent e = new TextClickEvent(event.getX(), event.getY(), event.getMouseEvent().getClientX(), event.getMouseEvent().getClientY());
            textClickEventViewHandler.handle(e);
            eventHandlerManager.get().restoreClickHandler();
        }
    });
    eventHandlerManager.get().addHandlersRegistration(ViewEventType.TEXT_CLICK, registration);
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) TextClickEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.TextClickEvent)

Aggregations

HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 TextClickEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.TextClickEvent)1