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

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

Introduction

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

Prototype

int FOCUSEVENTS

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

Click Source Link

Document

A bit-mask covering both focus events (focus and blur).

Usage

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

License:Apache License

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

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

License:Apache License

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

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

License:Apache License

public void onBrowserEvent(Event event) {
    /*/*  w w w  . j a v  a2  s.co  m*/
     * Avoid processing the same event twice (issue with the GWT dispatcher). 
     * If you sink events on a child, but do not set a listener (as in the case of UIObjects), 
     * the following will happen:
     *
     * 1) child element's onXXX event handler is invoked
     * 2) $wnd.__dispatchEvent() is called with the event and child element
     * 3) this crawls up the heirarchy until it finds a GWT event listener (i.e. CComposite)
     * 4) CComposite.onBrowserEvent() is called (e.target = child, e.currentTarget = child)
     * 5) the event bubbles up to the parent element
     * 6) parent element's onXXX event handler is invoked
     * 7) $wnd.__dispatchEvent() is called with the event and the parent element
     * 8) CComposite.onBrowserEvent() is called (e.target = child, e.currentTarget = parent)
     * 
     * @see DOMImplStandard#init()
     * @see Tree#onBrowserEvent(Event)
     * 
     * Note: don't test current target when capturing. DOM.eventGetCurrentTarget() returns $wnd 
     * when capturing in Firefox and $wnd.equals() blows up. 
     * @see http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/41f12a9def68f97a
     * 
     * Note: eventGetCurrentTarget(event) is wrong in FocusImplOld (Safari, old Mozilla, Opera)--it returns the 
     * nested INPUT. Focus events don't bubble anyway, so bypass the check in this case. Bleh. 
     */
    if (m_controllers != null) {
        int eventType = DOM.eventGetType(event);
        if (DOM.getCaptureElement() != null || (eventType & Event.FOCUSEVENTS) != 0
                || DOM.eventGetCurrentTarget(event).equals(m_widget.getElement())) {
            for (int i = 0, size = m_controllers.size(); i < size; i++) {
                Controller controller = m_controllers.get(i);
                if ((controller.getEventBits() & eventType) != 0
                        && (m_enabled || !isControllerDisablable(controller.getId()))) {
                    controller.onBrowserEvent(m_widget, event);
                }
            }
        }
    }
}

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

License:Apache License

/**
 * Create a slider bar.//from w ww. ja  va 2  s  .com
 * 
 * @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:bz.davide.dmweb.shared.view.InputView.java

License:Open Source License

public void addFocusHandler(DMFocusHandler focusHandler) {
    this.focusHandlers.add(focusHandler);
    this.addSinkEvents(Event.FOCUSEVENTS);
}

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

License:Apache License

/**
 * Create a slider bar./*from  ww w . j  a va2  s  .  c  om*/
 *
 * @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:com.apress.progwt.client.college.gui.ext.FocusPanelExt.java

License:Apache License

public FocusPanelExt() {
    super(impl.createFocusable());
    sinkEvents(Event.FOCUSEVENTS | Event.KEYEVENTS | Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL
            | Event.ONDBLCLICK);//from  w  ww .  j a v  a 2s.  c o  m

    delayedclickFirer = new Timer() {
        public void run() {
            // Log.debug("DELAYED CLICK FIRE");
            clickListeners.fireClick(FocusPanelExt.this);
        }
    };
}

From source file:com.bearsoft.gwt.ui.widgets.progress.SliderBar.java

License:Apache License

/**
 * Create a slider bar.//from  ww  w. j ava 2  s.c  o m
 *
 * @param aMinValue the minimum value in the range
 * @param aMaxValue the maximum value in the range
 * @param aLabelFormatter the label formatter
 */
public SliderBar(double aMinValue, double aMaxValue, LabelFormatter aLabelFormatter) {
    super();
    minValue = aMinValue;
    maxValue = aMaxValue;
    setLabelFormatter(aLabelFormatter);

    // Create the outer shell
    getElement().getStyle().setDisplay(Style.Display.INLINE_BLOCK);
    getElement().getStyle().setPosition(Style.Position.RELATIVE);
    // default preferred size
    getElement().getStyle().setWidth(150, Style.Unit.PX);
    getElement().getStyle().setHeight(35, Style.Unit.PX);
    setStyleName("gwt-SliderBar-shell");

    // Create the line
    lineElement = DOM.createDiv();
    getElement().appendChild(lineElement);
    lineElement.getStyle().setPosition(Style.Position.ABSOLUTE);
    lineElement.setClassName("gwt-SliderBar-line");
    coverElement = DOM.createDiv();
    lineElement.appendChild(coverElement);
    coverElement.getStyle().setPosition(Style.Position.ABSOLUTE);
    coverElement.getStyle().setLeft(0, Style.Unit.PX);
    coverElement.getStyle().setTop(0, Style.Unit.PX);
    coverElement.getStyle().setBottom(0, Style.Unit.PX);
    coverElement.setClassName("gwt-SliderBar-line-before-knob");

    // Create the knob
    knobElement.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
    knobElement.getStyle().setPosition(Style.Position.ABSOLUTE);
    knobElement.setClassName("gwt-SliderBar-knob");
    knobElement.addClassName("gwt-SliderBar-knob-enabled");
    getElement().appendChild(knobElement);

    sinkEvents(Event.MOUSEEVENTS | Event.KEYEVENTS | Event.FOCUSEVENTS);
    getElement().<XElement>cast().addResizingTransitionEnd(this);
}

From source file:com.cardfight.client.SliderBar.java

License:Apache License

/**
 * Create a slider bar./*from   ww w  .j  a  v  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
    images.slider().applyTo(knobImage);
    Element knobElement = knobImage.getElement();
    DOM.appendChild(getElement(), knobElement);
    DOM.setStyleAttribute(knobElement, "position", "absolute");
    DOM.setElementProperty(knobElement, "className", "gwt-SliderBar-knob");

    // Make this a resizable widget
    ResizableWidgetCollection.get().add(this);
    sinkEvents(Event.MOUSEEVENTS | Event.KEYEVENTS | Event.FOCUSEVENTS);
}

From source file:com.cardfight.client.table.SliderBar.java

License:Apache License

/**
 * Create a slider bar.//w w w . java2s . c om
 * 
 * @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
    images.slider().applyTo(knobImage);
    Element knobElement = knobImage.getElement();
    DOM.appendChild(getElement(), knobElement);
    DOM.setStyleAttribute(knobElement, "position", "absolute");
    DOM.setElementProperty(knobElement, "className", "gwt-SliderBar-knob");

    // Make this a resizable widget
    //ResizableWidgetCollection.get().add(this);
    sinkEvents(Event.MOUSEEVENTS | Event.KEYEVENTS | Event.FOCUSEVENTS);
}