Search in sources :

Example 1 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project che by eclipse.

the class EditDebugConfigurationsViewImpl method createButtons.

private void createButtons() {
    saveButton = createButton(coreLocale.save(), "window-edit-debug-configurations-save", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onSaveClicked();
        }
    });
    saveButton.addStyleName(Window.resources.windowCss().primaryButton());
    overFooter.add(saveButton);
    cancelButton = createButton(coreLocale.cancel(), "window-edit-debug-configurations-cancel", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onCancelClicked();
        }
    });
    overFooter.add(cancelButton);
    debugButton = createButton(coreLocale.debug(), "window-edit-debug-configurations-debug", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onDebugClicked();
        }
    });
    overFooter.add(debugButton);
    closeButton = createButton(coreLocale.close(), "window-edit-debug-configurations-close", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onCloseClicked();
        }
    });
    closeButton.addDomHandler(new BlurHandler() {

        @Override
        public void onBlur(BlurEvent blurEvent) {
            //set default focus
            selectText(filterInputField.getElement());
        }
    }, BlurEvent.getType());
    addButtonToFooter(closeButton);
    Element dummyFocusElement = DOM.createSpan();
    dummyFocusElement.setTabIndex(0);
    getFooter().getElement().appendChild(dummyFocusElement);
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) SpanElement(com.google.gwt.dom.client.SpanElement) Element(com.google.gwt.dom.client.Element) BlurEvent(com.google.gwt.event.dom.client.BlurEvent)

Example 2 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project che by eclipse.

the class EditCommandsViewImpl method createButtons.

private void createButtons() {
    saveButton = createButton(coreLocale.save(), "window-edit-commands-save", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onSaveClicked();
        }
    });
    saveButton.addStyleName(Window.resources.windowCss().primaryButton());
    buttonsPanel.add(saveButton);
    cancelButton = createButton(coreLocale.cancel(), "window-edit-commands-cancel", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onCancelClicked();
        }
    });
    buttonsPanel.add(cancelButton);
    closeButton = createButton(coreLocale.close(), "window-edit-commands-close", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onCloseClicked();
        }
    });
    closeButton.addDomHandler(new BlurHandler() {

        @Override
        public void onBlur(BlurEvent blurEvent) {
            //set default focus
            selectText(filterInputField.getElement());
        }
    }, BlurEvent.getType());
    addButtonToFooter(closeButton);
    Element dummyFocusElement = DOM.createSpan();
    dummyFocusElement.setTabIndex(0);
    getFooter().getElement().appendChild(dummyFocusElement);
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) SpanElement(com.google.gwt.dom.client.SpanElement) Element(com.google.gwt.dom.client.Element) BlurEvent(com.google.gwt.event.dom.client.BlurEvent)

Example 3 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project drools-wb by kiegroup.

the class ActionSetFieldsPageViewImpl method initialiseValueList.

private void initialiseValueList() {
    // Copy value back to model
    txtValueList.addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(final ValueChangeEvent<String> event) {
            final String valueList = txtValueList.getText();
            chosenFieldsSelection.setValueList(valueList);
        // ValueList is optional, no need to advise of state change
        }
    });
    // Update Default Value widget if necessary
    txtValueList.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(final BlurEvent event) {
            presenter.assertDefaultValue(availablePatternsSelection, chosenFieldsSelection);
            makeDefaultValueWidget();
        }
    });
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) BlurEvent(com.google.gwt.event.dom.client.BlurEvent)

Example 4 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project kie-wb-common by kiegroup.

the class AssignmentListItemWidgetViewImpl method init.

@PostConstruct
public void init() {
    // Configure dataType and customDataType controls
    dataTypeComboBox.init(this, false, dataType, customDataType, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT);
    // Configure processVar and constant controls
    processVarComboBox.init(this, false, processVar, constant, true, true, CONSTANT_PROMPT, ENTER_CONSTANT_PROMPT);
    name.setRegExp("^[a-zA-Z0-9\\-\\.\\_]*$", StunnerFormsClientFieldsConstants.INSTANCE.Removed_invalid_characters_from_name(), StunnerFormsClientFieldsConstants.INSTANCE.Invalid_character_in_name());
    customDataType.addKeyDownHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(KeyDownEvent event) {
            int iChar = event.getNativeKeyCode();
            if (iChar == ' ') {
                event.preventDefault();
            }
        }
    });
    name.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(BlurEvent event) {
            if (!allowDuplicateNames) {
                String value = name.getText();
                if (isDuplicateName(value)) {
                    notification.fire(new NotificationEvent(duplicateNameErrorMessage, NotificationEvent.NotificationType.ERROR));
                    name.setValue("");
                    ValueChangeEvent.fire(name, "");
                }
            }
        }
    });
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) BlurEvent(com.google.gwt.event.dom.client.BlurEvent) PostConstruct(javax.annotation.PostConstruct)

Example 5 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project kie-wb-common by kiegroup.

the class VariableListItemWidgetViewImpl method init.

@PostConstruct
public void init() {
    // Configure dataType and customDataType controls
    dataTypeComboBox.init(this, true, dataType, customDataType, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT);
    name.setRegExp("^[a-zA-Z0-9\\-\\.\\_]*$", "Removed invalid characters from name", "Invalid character in name");
    customDataType.addKeyDownHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(final KeyDownEvent event) {
            int iChar = event.getNativeKeyCode();
            if (iChar == ' ') {
                event.preventDefault();
            }
        }
    });
    name.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(final BlurEvent event) {
            if (!allowDuplicateNames) {
                String value = name.getText();
                if (isDuplicateName(value)) {
                    notification.fire(new NotificationEvent(duplicateNameErrorMessage, NotificationEvent.NotificationType.ERROR));
                    name.setValue("");
                    ValueChangeEvent.fire(name, "");
                }
            }
            notifyModelChanged();
        }
    });
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) BlurEvent(com.google.gwt.event.dom.client.BlurEvent) PostConstruct(javax.annotation.PostConstruct)

Aggregations

BlurHandler (com.google.gwt.event.dom.client.BlurHandler)21 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)20 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)4 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)4 Test (org.junit.Test)4 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)4 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)3 Element (com.google.gwt.dom.client.Element)2 SpanElement (com.google.gwt.dom.client.SpanElement)2 FocusEvent (com.google.gwt.event.dom.client.FocusEvent)2 FocusHandler (com.google.gwt.event.dom.client.FocusHandler)2 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)2 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)2 PostConstruct (javax.annotation.PostConstruct)2 TextBox (org.gwtbootstrap3.client.ui.TextBox)2 Transform (com.ait.lienzo.client.core.types.Transform)1 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1