Search in sources :

Example 6 with EventHandler

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

the class NameAndUrlPopoverViewImpl method onClickOkButton.

@EventHandler("okButton")
@SuppressWarnings("unused")
public void onClickOkButton(final ClickEvent clickEvent) {
    final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated();
    if (!Objects.isNull(consumer)) {
        final String description = attachmentNameInput.value;
        final String url = urlInput.value;
        final DMNExternalLink externalLink = new DMNExternalLink(url, description);
        consumer.accept(externalLink);
    }
    hide();
}
Also used : DMNExternalLink(org.kie.workbench.common.dmn.api.property.dmn.DMNExternalLink) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 7 with EventHandler

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

the class GenericErrorPopup method onCopyDetailsClicked.

@EventHandler("copy-details")
public void onCopyDetailsClicked(final ClickEvent event) {
    showErrorDetails(true);
    final boolean copySucceeded = clipboard.copy(errorDetails);
    if (copySucceeded) {
        notificationEvent.fire(new NotificationEvent(DefaultWorkbenchConstants.INSTANCE.ErrorDetailsSuccessfullyCopiedToClipboard(), SUCCESS));
    } else {
        notificationEvent.fire(new NotificationEvent(DefaultWorkbenchConstants.INSTANCE.ErrorDetailsFailedToBeCopiedToClipboard(), WARNING));
    }
    console.error(errorDetails.textContent);
}
Also used : NotificationEvent(org.uberfire.workbench.events.NotificationEvent) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 8 with EventHandler

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

the class GenericErrorPopup method onContinueButtonClicked.

@EventHandler("continue-button")
public void onContinueButtonClicked(final ClickEvent event) {
    console.error(errorDetails.textContent);
    if (doNotShowAgainCheckbox.checked) {
        final TimeAmount duration = TimeAmount.valueOf(timeSelect.value);
        genericErrorTimeController.setTimeout(duration);
    }
    close();
}
Also used : TimeAmount(org.kie.workbench.common.workbench.client.error.TimeAmount) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 9 with EventHandler

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

the class VariableListItemWidgetViewImpl method handleAcceptButton.

@EventHandler("acceptButton")
public void handleAcceptButton(final ClickEvent e) {
    final String tagAdded = tagNamesComboBox.getValue();
    if (!Strings.isNullOrEmpty(tagAdded) && !tagSet.contains(tagAdded)) {
        for (final HTMLAnchorElement closeAnchor : removeButtons.values()) {
            closeAnchor.onclick.onInvoke(new elemental2.dom.Event("DoNotUpdateModel"));
        }
        removeButtons.clear();
        tagSet.add(tagAdded);
        setCustomTags(setToList(tagSet));
        notifyModelChanged();
        if (!VariablesEditorFieldRenderer.getDefaultTagsSet().contains(tagAdded) && getPreviousCustomValue() != null && !tagAdded.equals(getPreviousCustomValue())) {
            // Is custom
            tagSet.remove(getPreviousCustomValue());
        }
        renderTagElementsBadges();
    }
}
Also used : HTMLAnchorElement(elemental2.dom.HTMLAnchorElement) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 10 with EventHandler

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

the class FileUploadPopupView method onFileChangeEvent.

@EventHandler("file")
public void onFileChangeEvent(ChangeEvent event) {
    fileName = file.getValue();
    if (fileName.toLowerCase().startsWith(FAKEPATH)) {
        fileName = fileName.substring(FAKEPATH.length());
    }
    fileText.setValue(fileName);
    JavaScriptObject files = file.getPropertyJSO("files");
    readTextFile(files);
    if (!"".equals(fileText.getValue())) {
        okButton.setEnabled(true);
    }
}
Also used : JavaScriptObject(com.google.gwt.core.client.JavaScriptObject) 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