Search in sources :

Example 1 with EventHandler

use of org.jboss.errai.ui.shared.api.annotations.EventHandler in project drools by kiegroup.

the class FEELShowcase method onTextChange.

@EventHandler("text")
public void onTextChange(final KeyUpEvent e) {
    final FEEL_1_1Parser parser = FEELParser.parse(null, text.getValue(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyList(), Collections.emptyList(), null);
    final ParseTree tree = parser.expression();
    final ASTBuilderVisitor astBuilderVisitor = new ASTBuilderVisitor(emptyMap(), null);
    final BaseNode baseNode = astBuilderVisitor.visit(tree);
    nodes.setValue(getNodesString(baseNode));
    evaluation.setValue(getEvaluation(baseNode));
}
Also used : ASTBuilderVisitor(org.kie.dmn.feel.parser.feel11.ASTBuilderVisitor) BaseNode(org.kie.dmn.feel.lang.ast.BaseNode) FEEL_1_1Parser(org.kie.dmn.feel.parser.feel11.FEEL_1_1Parser) ParseTree(org.antlr.v4.runtime.tree.ParseTree) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 2 with EventHandler

use of org.jboss.errai.ui.shared.api.annotations.EventHandler in project kie-wb-common by kiegroup.

the class DecisionComponentsItemView method decisionComponentItemMouseDown.

@EventHandler("decision-component-item")
public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) {
    final DRGElement drgElement = presenter.getDrgElement();
    final ShapeFactory factory = dmnShapeSet.getShapeFactory();
    final Glyph glyph = factory.getGlyph(drgElement.getClass().getName());
    final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph);
    final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory);
    shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy);
}
Also used : Callback(org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandler.Callback) Glyph(org.kie.workbench.common.stunner.core.definition.shape.Glyph) ShapeGlyphDragHandler(org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandler) ShapeFactory(org.kie.workbench.common.stunner.core.client.shape.factory.ShapeFactory) DRGElement(org.kie.workbench.common.dmn.api.definition.model.DRGElement) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 3 with EventHandler

use of org.jboss.errai.ui.shared.api.annotations.EventHandler in project kie-wb-common by kiegroup.

the class DRDNameChangerView method onClickReturnToDRG.

@EventHandler("returnToDRG")
void onClickReturnToDRG(final ClickEvent event) {
    hideDRDNameChanger();
    selectedEvent.fire(new DMNDiagramSelected(dmnDiagramsSession.getDRGDiagramElement()));
}
Also used : DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 4 with EventHandler

use of org.jboss.errai.ui.shared.api.annotations.EventHandler in project kie-wb-common by kiegroup.

the class ValueAndDataTypePopoverViewImpl method onValueEditorKeyDown.

@SuppressWarnings("unused")
@EventHandler("valueEditor")
public void onValueEditorKeyDown(final KeyDownEvent event) {
    if (isEnter(event)) {
        hide(true);
        onClosedByKeyboard();
    } else if (isEsc(event)) {
        reset();
        hide(false);
        onClosedByKeyboard();
    } else if (event.isShiftKeyDown() && isTab(event)) {
        final Button typeSelectorButton = getTypeSelectorButton();
        typeSelectorButton.focus();
        event.preventDefault();
    }
}
Also used : Button(org.jboss.errai.common.client.dom.Button) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 5 with EventHandler

use of org.jboss.errai.ui.shared.api.annotations.EventHandler in project kie-wb-common by kiegroup.

the class DataTypeSelectView method onTypeTextClick.

@EventHandler("type-text")
public void onTypeTextClick(final ClickEvent event) {
    final String type = presenter.getDataType().getType();
    final HTMLElement element = getElement();
    if (!isBuiltInType(type)) {
        structureTypesTooltip.show(element, type);
    }
    skipClickListeners(event);
}
Also used : HTMLElement(elemental2.dom.HTMLElement) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Aggregations

EventHandler (org.jboss.errai.ui.shared.api.annotations.EventHandler)10 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 HTMLAnchorElement (elemental2.dom.HTMLAnchorElement)1 HTMLElement (elemental2.dom.HTMLElement)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 Button (org.jboss.errai.common.client.dom.Button)1 BaseNode (org.kie.dmn.feel.lang.ast.BaseNode)1 ASTBuilderVisitor (org.kie.dmn.feel.parser.feel11.ASTBuilderVisitor)1 FEEL_1_1Parser (org.kie.dmn.feel.parser.feel11.FEEL_1_1Parser)1 DRGElement (org.kie.workbench.common.dmn.api.definition.model.DRGElement)1 DMNExternalLink (org.kie.workbench.common.dmn.api.property.dmn.DMNExternalLink)1 DMNDiagramSelected (org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected)1 ShapeGlyphDragHandler (org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandler)1 Callback (org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandler.Callback)1 ShapeFactory (org.kie.workbench.common.stunner.core.client.shape.factory.ShapeFactory)1 Glyph (org.kie.workbench.common.stunner.core.definition.shape.Glyph)1 TimeAmount (org.kie.workbench.common.workbench.client.error.TimeAmount)1 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)1