Search in sources :

Example 6 with KeyUpHandler

use of com.google.gwt.event.dom.client.KeyUpHandler in project gerrit by GerritCodeReview.

the class ProjectListScreen method initPageHeader.

private void initPageHeader() {
    final HorizontalPanel hp = new HorizontalPanel();
    hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
    final Label filterLabel = new Label(AdminConstants.I.projectFilter());
    filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
    hp.add(filterLabel);
    filterTxt = new NpTextBox();
    filterTxt.setValue(match);
    filterTxt.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            Query q = new Query(filterTxt.getValue()).open(event.getNativeKeyCode() == KeyCodes.KEY_ENTER);
            if (match.equals(q.qMatch)) {
                q.start(start);
            }
            if (q.open || !match.equals(q.qMatch)) {
                if (query == null) {
                    q.run();
                }
                query = q;
            }
        }
    });
    hp.add(filterTxt);
    add(hp);
}
Also used : KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 7 with KeyUpHandler

use of com.google.gwt.event.dom.client.KeyUpHandler in project gerrit by GerritCodeReview.

the class ProjectTagsScreen method initPageHeader.

private void initPageHeader() {
    parseToken();
    HorizontalPanel hp = new HorizontalPanel();
    hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
    Label filterLabel = new Label(AdminConstants.I.projectFilter());
    filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
    hp.add(filterLabel);
    filterTxt = new NpTextBox();
    filterTxt.setValue(match);
    filterTxt.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            Query q = new Query(filterTxt.getValue());
            if (match.equals(q.qMatch)) {
                q.start(start);
            } else {
                if (query == null) {
                    q.run();
                }
                query = q;
            }
        }
    });
    hp.add(filterTxt);
    add(hp);
}
Also used : KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 8 with KeyUpHandler

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

the class FullTextSearchViewImpl method addHandlers.

private void addHandlers() {
    isUseFileMask.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            filesMask.setEnabled(event.getValue());
        }
    });
    isUseDirectory.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            directory.setEnabled(event.getValue());
            selectPathButton.setEnabled(event.getValue());
        }
    });
    text.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            acceptButton.setEnabled(!text.getValue().isEmpty());
        }
    });
    selectPathButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            showSelectPathDialog();
        }
    });
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler)

Example 9 with KeyUpHandler

use of com.google.gwt.event.dom.client.KeyUpHandler in project rstudio by rstudio.

the class DomUtils method addKeyHandlers.

public static void addKeyHandlers(HasAllKeyHandlers widget, final NativeEventHandler handler) {
    widget.addKeyDownHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(final KeyDownEvent event) {
            handler.onNativeEvent(event.getNativeEvent());
        }
    });
    widget.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(final KeyPressEvent event) {
            handler.onNativeEvent(event.getNativeEvent());
        }
    });
    widget.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(final KeyUpEvent event) {
            handler.onNativeEvent(event.getNativeEvent());
        }
    });
}
Also used : KeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler)

Example 10 with KeyUpHandler

use of com.google.gwt.event.dom.client.KeyUpHandler in project rstudio by rstudio.

the class ChooseFolderDialog method createMainWidget.

@Override
public Widget createMainWidget() {
    Widget mainWidget = super.createMainWidget();
    browser_.addKeyUpHandler(new KeyUpHandler() {

        public void onKeyUp(KeyUpEvent event) {
            maybeInvalidateSelection();
        }
    });
    browser_.addKeyPressHandler(new KeyPressHandler() {

        public void onKeyPress(KeyPressEvent event) {
            maybeInvalidateSelection();
        }
    });
    return mainWidget;
}
Also used : KeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) Widget(com.google.gwt.user.client.ui.Widget) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler)

Aggregations

KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)15 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)15 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)5 BlurHandler (com.google.gwt.event.dom.client.BlurHandler)5 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)5 Label (com.google.gwt.user.client.ui.Label)5 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)3 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)3 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)2 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)2 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)2 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)2 PerunError (cz.metacentrum.perun.webgui.model.PerunError)2 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)2 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)2 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)2 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1