com.sencha.gxt.core.client.util
Class BaseEventPreview

java.lang.Object
  extended by com.sencha.gxt.core.client.util.BaseEventPreview
All Implemented Interfaces:
EventHandler, Event.NativePreviewHandler

public class BaseEventPreview
extends java.lang.Object
implements Event.NativePreviewHandler

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


Constructor Summary
BaseEventPreview()
           
 
Method Summary
 void add()
          Adds this instance to the event preview stack.
 CompositeElement getIgnoreList()
          Returns the ignore list.
static int getLastClientX()
          Returns the last client x value when a base event preview is on top of the preview stack.
static int getLastClientY()
          Returns the last client y value when a base event preview is on top of the preview stack.
static Point getLastXY()
          Returns the last xy value when a base event preview is on top of the preview stack.
 boolean isAutoHide()
          Returns true if auto hide is enabled.
 boolean isAutoHideAllowEvent()
          Returns true if the auto hide event is cancelled.
 void onPreviewNativeEvent(Event.NativePreviewEvent event)
           
 void push()
          Pushes the event preview to the stop of the stack.
 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.
 void setKeyEvent(int type)
          Sets the key event type used to determine key presses for onPreview(Event.NativePreviewEvent).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEventPreview

public BaseEventPreview()
Method Detail

getLastClientX

public static int getLastClientX()
Returns the last client x value when a base event preview is on top of the preview stack.

Returns:
the last client y value

getLastClientY

public static int getLastClientY()
Returns the last client y value when a base event preview is on top of the preview stack.

Returns:
the last client y value

getLastXY

public static Point getLastXY()
Returns the last xy value when a base event preview is on top of the preview stack.

Returns:
the last client x and client y

add

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


getIgnoreList

public CompositeElement getIgnoreList()
Returns the ignore list.

Returns:
this list

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

onPreviewNativeEvent

public void onPreviewNativeEvent(Event.NativePreviewEvent event)
Specified by:
onPreviewNativeEvent in interface Event.NativePreviewHandler

push

public void push()
Pushes the event preview to the stop of the stack.


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

setKeyEvent

public void setKeyEvent(int type)
Sets the key event type used to determine key presses for onPreview(Event.NativePreviewEvent). By default, the key press event is determined using KeyNav.getKeyEvent().

Parameters:
type - the key event type


Copyright © 2012. All Rights Reserved.