Example usage for com.google.gwt.user.client Event KEYEVENTS

List of usage examples for com.google.gwt.user.client Event KEYEVENTS

Introduction

In this page you can find the example usage for com.google.gwt.user.client Event KEYEVENTS.

Prototype

int KEYEVENTS

To view the source code for com.google.gwt.user.client Event KEYEVENTS.

Click Source Link

Document

A bit-mask covering all keyboard events (down, up, and press).

Usage

From source file:accelerator.client.ui.widget.AbstractButton.java

License:Open Source License

/**
 * 
 */
public AbstractButton() {
    sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.KEYEVENTS);
}

From source file:asquare.gwt.tk.client.ui.behavior.CKeyboardListenerAdaptor.java

License:Apache License

public int getEventBits() {
    return Event.KEYEVENTS;
}

From source file:asquare.gwt.tk.client.ui.behavior.CKeyboardListenerAdaptor.java

License:Apache License

public void onBrowserEvent(Widget widget, Event event) {
    if ((DOM.eventGetType(event) & Event.KEYEVENTS) != 0) {
        fireKeyboardEvent(widget, event);
    }
}

From source file:asquare.gwt.tkdemo.client.FocusCyclePanel.java

License:Apache License

public FocusCyclePanel(String element, String childrenDisplay) {
    super(element, childrenDisplay);
    sinkEvents(Event.KEYEVENTS);

    TabFocusController focusController = (TabFocusController) GWT.create(TabFocusController.class);
    focusController.setModel(m_focusModel);
    addController(focusController);/*from ww w  . jav a 2 s .c o  m*/
}

From source file:at.ac.fhcampuswien.atom.client.gui.attributes.components.slider.SliderBar.java

License:Apache License

/**
 * Create a slider bar./* ww w  .  j  a v a  2  s  .  c  o  m*/
 * 
 * @param minValue the minimum value in the range
 * @param maxValue the maximum value in the range
 * @param labelFormatter the label formatter
 * @param images the images to use for the slider
 */
public SliderBar(double minValue, double maxValue, LabelFormatter labelFormatter, SliderBarImages images) {
    super();
    images.sliderBarCss().ensureInjected();
    this.minValue = minValue;
    this.maxValue = maxValue;
    this.images = images;
    setLabelFormatter(labelFormatter);

    // Create the outer shell
    DOM.setStyleAttribute(getElement(), "position", "relative");
    setStyleName("gwt-SliderBar-shell");

    // Create the line
    lineElement = DOM.createDiv();
    DOM.appendChild(getElement(), lineElement);
    DOM.setStyleAttribute(lineElement, "position", "absolute");
    DOM.setElementProperty(lineElement, "className", "gwt-SliderBar-line");

    // Create the knob
    knobImage.setResource(images.slider());
    Element knobElement = knobImage.getElement();
    DOM.appendChild(getElement(), knobElement);
    DOM.setStyleAttribute(knobElement, "position", "absolute");
    DOM.setElementProperty(knobElement, "className", "gwt-SliderBar-knob");

    sinkEvents(Event.MOUSEEVENTS | Event.KEYEVENTS | Event.FOCUSEVENTS);

    // workaround to render properly when parent Widget does not
    // implement ProvidesResize since DOM doesn't provide element
    // height and width until onModuleLoad() finishes.
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override
        public void execute() {
            onResize();
        }
    });
}

From source file:bufferings.ktr.wjr.client.ui.widget.WjrAbstractButton.java

License:Apache License

/**
 * Constructs the WjrAbstractButton.
 */
public WjrAbstractButton() {
    sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.KEYEVENTS);
}

From source file:bufferings.ktr.wjr.client.ui.widget.WjrListBox.java

License:Apache License

/**
 * Constructs the WjrListBox.//from w w w  .  j a v  a  2s  .  c  om
 */
public WjrListBox() {
    Resources.INSTANCE.css().ensureInjected();
    mainPanel = new FlowPanel();
    focusPanel = new WjrNoBorderFocusPanel(mainPanel);
    initWidget(focusPanel);
    sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS);
}

From source file:bufferings.ktr.wjr.client.ui.widget.WjrTree.java

License:Apache License

/**
 * Constructs the WjrTree./*from www  .j a  va 2 s.c  om*/
 */
public WjrTree() {
    root = new Root();
    focusPanel = new WjrNoBorderFocusPanel(root);
    initWidget(focusPanel);
    sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS);
}

From source file:cc.alcina.framework.gwt.client.widget.complex.SliderBar.java

License:Apache License

/**
 * Create a slider bar./*from w w w.jav  a  2s  .co m*/
 *
 * @param minValue
 *            the minimum value in the range
 * @param maxValue
 *            the maximum value in the range
 * @param labelFormatter
 *            the label formatter
 * @param images
 *            the images to use for the slider
 */
public SliderBar(double minValue, double maxValue, LabelFormatter labelFormatter, SliderBarImages images) {
    super();
    this.minValue = minValue;
    this.maxValue = maxValue;
    this.images = images;
    setLabelFormatter(labelFormatter);
    // Create the outer shell
    DOM.setStyleAttribute(getElement(), "position", "relative");
    setStyleName("gwt-SliderBar-shell");
    // Create the line
    lineElement = DOM.createDiv();
    DOM.appendChild(getElement(), lineElement);
    DOM.setStyleAttribute(lineElement, "position", "absolute");
    DOM.setElementProperty(lineElement, "className", "gwt-SliderBar-line");
    // Create the knob
    AbstractImagePrototype.create(images.slider()).applyTo(knobImage);
    Element knobElement = knobImage.getElement();
    DOM.appendChild(getElement(), knobElement);
    DOM.setStyleAttribute(knobElement, "position", "absolute");
    DOM.setElementProperty(knobElement, "className", "gwt-SliderBar-knob");
    sinkEvents(Event.MOUSEEVENTS | Event.KEYEVENTS | Event.FOCUSEVENTS);
}

From source file:cc.alcina.framework.gwt.client.widget.dialog.GlassDialogBox.java

License:Apache License

@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (event.isFirstHandler()) {
        Event as = Event.as(event.getNativeEvent());
        int typeInt = as.getTypeInt();
        if ((typeInt & Event.KEYEVENTS) > 0) {
            if (as.getCtrlKey() || as.getMetaKey() || as.getAltKey()) {
                event.consume();/*from  w ww. j  av a2s  .  com*/
            }
        }
    }
    super.onPreviewNativeEvent(event);
}