public class BaseEventPreview extends Object
EventPreview
. Provides auto hide support and the
ability to add elements which should be ignored when auto hide is enabled.Constructor and Description |
---|
BaseEventPreview() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected void |
onAdd() |
protected boolean |
onAutoHide(NativePreviewEvent pe)
Called right before event preview will be removed from auto hide.
|
protected boolean |
onAutoHidePreview(NativePreviewEvent pe)
Called when a preview event is received and
autoHide is enabled. |
protected void |
onClick(NativePreviewEvent pe) |
protected boolean |
onPreview(NativePreviewEvent pe)
Called when a preview event is received.
|
protected void |
onPreviewKeyPress(NativePreviewEvent pe)
Called when a preview key press event is received.
|
void |
onPreviewNativeEvent(NativePreviewEvent event) |
protected void |
onRemove() |
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) . |
public static int getLastClientX()
public static int getLastClientY()
public static Point getLastXY()
public void add()
public CompositeElement getIgnoreList()
public boolean isAutoHide()
public boolean isAutoHideAllowEvent()
public void onPreviewNativeEvent(NativePreviewEvent event)
public void push()
public void remove()
public void setAutoHide(boolean autoHide)
autoHide
- the auto hide statepublic void setAutoHideCancelEvent(boolean autoHideAllowEvent)
setAutoHide(boolean)
is true.autoHideAllowEvent
- true to cancel the eventpublic void setIgnoreList(CompositeElement ignoreList)
ignoreList
- the ignore listpublic void setKeyEvent(int type)
#onPreview(Event.NativePreviewEvent)
. By default, the key press
event is determined using KeyNav.getKeyEvent()
.type
- the key event typeprotected void onAdd()
protected boolean onAutoHide(NativePreviewEvent pe)
pe
- the preview eventprotected boolean onAutoHidePreview(NativePreviewEvent pe)
autoHide
is enabled.pe
- the preview eventprotected void onClick(NativePreviewEvent pe)
protected boolean onPreview(NativePreviewEvent pe)
pe
- the preview eventprotected void onPreviewKeyPress(NativePreviewEvent pe)
pe
- the preview eventprotected void onRemove()
Copyright © 2018. All rights reserved.