Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.maryanovsky.gwtutils.client.ui
Class EventCancellingPanel

    java.lang.Object
      com.google.gwt.user.client.ui.UIObject
          com.google.gwt.user.client.ui.Widget
              com.google.gwt.user.client.ui.Panel
                  com.google.gwt.user.client.ui.SimplePanel
                      com.maryanovsky.gwtutils.client.ui.EventCancellingPanel

All Implemented Interfaces:
  HasHandlers, EventListener, HasWidgets, Iterable<Widget>

    public class EventCancellingPanel

extends SimplePanel

A panel which allows cancelling the bubbling of and preventing the default action from occurring on a specified set of events it receives.

Author:
  Maryanovsky Alexander

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
`UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled`

Field Summary

Fields inherited from class com.google.gwt.user.client.ui.UIObject
`DEBUG_ID_PREFIX`

Constructor Summary
`EventCancellingPanel()` Creates a new `EventCancellingPanel`.
`EventCancellingPanel(Widget child, int cancelBubbleEventsMask, int preventDefaultEventsMask)` Creates a new `EventCancellingPanel` with the specified child widget and which will cancel the bubbling of events matching the first specified mask and prevent the default action for events matching the second specified mask.

Method Summary
`int` | `getCancelBubbleEventsMask()` Returns the bitmask of events whose bubbling we are currently cancelling.
`int` | `getPreventDefaultEventsMask()` Returns the bitmask of events for which we prevent the default action.
`protected boolean` | `isCancelBubbling(Event event)` Returns whether we should cancel the bubbling of the the specified event.
`protected boolean` | `isPreventDefault(Event event)` Returns whether we should prevent the default action for the specified event.
`void` | `onBrowserEvent(Event event)` Cancels the bubbling of and/or prevents the default action of the specified event.
`void` | `setCancelBubbleEventsMask(int cancelBubbleEventsMask)` Sets the bitmask of events which to cancel the bubbling of.
`void` | `setPreventDefaultEventsMask(int preventDefaultEventsMask)` Sets the bitmask of events for which we prevent the default action.

Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
`add, getContainerElement, getWidget, iterator, remove, setWidget`

Methods inherited from class com.google.gwt.user.client.ui.Panel
`adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, removeFromParent, setLayoutData, sinkEvents`

Methods inherited from class com.google.gwt.user.client.ui.UIObject
`addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### EventCancellingPanel

    public EventCancellingPanel(Widget child,
                                int cancelBubbleEventsMask,
                                int preventDefaultEventsMask)

  Creates a new `EventCancellingPanel` with the specified child widget and which will cancel the bubbling of events matching the first specified mask and prevent the default action for events matching the second specified mask.

### EventCancellingPanel

    public EventCancellingPanel()

  Creates a new `EventCancellingPanel`.

Method Detail

### setCancelBubbleEventsMask

    public void setCancelBubbleEventsMask(int cancelBubbleEventsMask)

  Sets the bitmask of events which to cancel the bubbling of.

### getCancelBubbleEventsMask

    public int getCancelBubbleEventsMask()

  Returns the bitmask of events whose bubbling we are currently cancelling.

### setPreventDefaultEventsMask

    public void setPreventDefaultEventsMask(int preventDefaultEventsMask)

  Sets the bitmask of events for which we prevent the default action.

### getPreventDefaultEventsMask

    public int getPreventDefaultEventsMask()

  Returns the bitmask of events for which we prevent the default action.

### isCancelBubbling

    protected boolean isCancelBubbling(Event event)

  Returns whether we should cancel the bubbling of the the specified event. By default, this method uses the bitmask to determine whether to cancel bubbling, but you may override it for a more fine-grained control.

### isPreventDefault

    protected boolean isPreventDefault(Event event)

  Returns whether we should prevent the default action for the specified event. By default, this method uses the bitmask to determine whether to prevent the default action, but you may override it for a more fine-grained control.

### onBrowserEvent

    public void onBrowserEvent(Event event)

  Cancels the bubbling of and/or prevents the default action of the specified event.

  Specified by:
    `onBrowserEvent` in interface `EventListener`
  Overrides:
    `onBrowserEvent` in class `Widget`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD