com.extjs.gxt.ui.client.util
Class BaseEventPreview

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.util.BaseEventPreview
All Implemented Interfaces:
Observable, com.google.gwt.user.client.EventPreview

public class BaseEventPreview
extends BaseObservable
implements com.google.gwt.user.client.EventPreview

Specialized EventPreview. Provides auto hide support and the ability to add elements which should be ignored when auto hide is enabed.

Events:
Add : PreviewEvent(preview, event, target)
Fires after event preview is added.
Remove : PreviewEvent(preview)
Fires after event preview has been remevoed.
KeyPress : PreviewEvent(preview, target, event)
Fires when a key is pressed while event preview is active.


Constructor Summary
BaseEventPreview()
           
 
Method Summary
 void add()
          Adds this instance to the event preview stack.
 CompositeElement getIgnoreList()
          Returns the ignore list.
 boolean isAutoHide()
          Returns true if auto hide is enabled.
 boolean isAutoHideAllowEvent()
          Returns true if the auto hide event is cancelled.
 boolean onEventPreview(com.google.gwt.user.client.Event event)
           
 boolean onPreview(PreviewEvent pe)
          Called when a preview event is received.
 void remove()
          Removes event preview.
 void setAutoHide(boolean autoHide)
          True to remove the event preview when the user clicks on an element not it the ignore list (default to true).
 void setAutoHideCancelEvent(boolean autoHideAllowEvent)
          Sets if the event that removes event preview is cancelled (default to true).
 void setIgnoreList(CompositeElement ignoreList)
          List of elements to be ignored when autoHide is enabled.
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEventPreview

public BaseEventPreview()
Method Detail

add

public void add()
Adds this instance to the event preview stack.


isAutoHide

public boolean isAutoHide()
Returns true if auto hide is enabled.

Returns:
the auto hide state

isAutoHideAllowEvent

public boolean isAutoHideAllowEvent()
Returns true if the auto hide event is cancelled.

Returns:
the auto hide event

onEventPreview

public boolean onEventPreview(com.google.gwt.user.client.Event event)
Specified by:
onEventPreview in interface com.google.gwt.user.client.EventPreview

onPreview

public boolean onPreview(PreviewEvent pe)
Called when a preview event is received.

Parameters:
pe - the component event
Returns:
true to allow the event

remove

public void remove()
Removes event preview.


setAutoHide

public void setAutoHide(boolean autoHide)
True to remove the event preview when the user clicks on an element not it the ignore list (default to true).

Parameters:
autoHide - the auto hide state

setAutoHideCancelEvent

public void setAutoHideCancelEvent(boolean autoHideAllowEvent)
Sets if the event that removes event preview is cancelled (default to true). Only applies when setAutoHide(boolean) is true.

Parameters:
autoHideAllowEvent - true to cancel the event

setIgnoreList

public void setIgnoreList(CompositeElement ignoreList)
List of elements to be ignored when autoHide is enabled. An example of usage would be a menu item that displays a sub menu. When the sub menu is displayed, the menu item is added to the ignore list so that the sub menu will not close when the mousing over the item.

Parameters:
ignoreList - the ignore list

getIgnoreList

public CompositeElement getIgnoreList()
Returns the ignore list.

Returns:
this list