Package com.google.gwt.view.client
Class CellPreviewEvent<T>
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<H>
-
- com.google.gwt.event.shared.GwtEvent<CellPreviewEvent.Handler<T>>
-
- com.google.gwt.view.client.CellPreviewEvent<T>
-
- Type Parameters:
T- the data type of theHasDatasource
public class CellPreviewEvent<T> extends GwtEvent<CellPreviewEvent.Handler<T>>
Allows the previewing of events before they are fired to Cells.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCellPreviewEvent.Handler<T>Handler forCellPreviewEvent.-
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
GwtEvent.Type<H>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCellPreviewEvent(NativeEvent nativeEvent, HasData<T> display, Cell.Context context, T value, boolean isCellEditing, boolean isSelectionHandled)Construct a newCellPreviewEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddispatch(CellPreviewEvent.Handler<T> handler)Should only be called byHandlerManager.static <T> CellPreviewEvent<T>fire(HasCellPreviewHandlers<T> source, NativeEvent nativeEvent, HasData<T> display, Cell.Context context, T value, boolean isCellEditing, boolean isSelectionHandled)Fires a cell preview event on all registered handlers in the handler manager.GwtEvent.Type<CellPreviewEvent.Handler<T>>getAssociatedType()Returns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.intgetColumn()Get the column index of the Cell where the event occurred if the source is a table.Cell.ContextgetContext()Get the cellCell.Context.HasData<T>getDisplay()Get theHasDatasource of the event.intgetIndex()Get the index of the value where the event occurred.NativeEventgetNativeEvent()Get theNativeEventto preview.static GwtEvent.Type<CellPreviewEvent.Handler<?>>getType()Gets the type associated with this event.TgetValue()Get the value where the event occurred.booleanisCanceled()Check if the event has been canceled.booleanisCellEditing()Check whether or not the cell where the event occurred is being edited.booleanisSelectionHandled()Check whether or not selection is being handled by the widget or one of its Cells.voidsetCanceled(boolean cancel)Cancel the event and prevent it from firing to the Cell.-
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, getSource, isLive, kill, revive
-
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
-
-
-
Constructor Detail
-
CellPreviewEvent
protected CellPreviewEvent(NativeEvent nativeEvent, HasData<T> display, Cell.Context context, T value, boolean isCellEditing, boolean isSelectionHandled)
Construct a newCellPreviewEvent.- Parameters:
nativeEvent- the event to previewdisplay- theHasDatasource of the eventcontext- the CellCell.Contextvalue- the value where the event occurredisCellEditing- indicates whether or not the cell is being editedisSelectionHandled- indicates whether or not selection is handled
-
-
Method Detail
-
fire
public static <T> CellPreviewEvent<T> fire(HasCellPreviewHandlers<T> source, NativeEvent nativeEvent, HasData<T> display, Cell.Context context, T value, boolean isCellEditing, boolean isSelectionHandled)
Fires a cell preview event on all registered handlers in the handler manager. If no such handlers exist, this implementation will do nothing. This implementation sets the column to 0.- Type Parameters:
T- the old value type- Parameters:
source- the source of the handlersnativeEvent- the event to previewdisplay- theHasDatasource of the eventcontext- the CellCell.Contextvalue- the value where the event occurredisCellEditing- indicates whether or not the cell is being editedisSelectionHandled- indicates whether or not selection is handled- Returns:
- the
CellPreviewEventthat was fired
-
getType
public static GwtEvent.Type<CellPreviewEvent.Handler<?>> getType()
Gets the type associated with this event.- Returns:
- returns the handler type
-
getAssociatedType
public GwtEvent.Type<CellPreviewEvent.Handler<T>> getAssociatedType()
Description copied from class:EventReturns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.- Specified by:
getAssociatedTypein classGwtEvent<CellPreviewEvent.Handler<T>>- Returns:
- the type
-
getColumn
public int getColumn()
Get the column index of the Cell where the event occurred if the source is a table. If the source is not a table, the column is always 0.- Returns:
- the column index, or 0 if there is only one column
-
getContext
public Cell.Context getContext()
Get the cellCell.Context.- Returns:
- the cell
Cell.Context
-
getIndex
public int getIndex()
Get the index of the value where the event occurred.
-
getNativeEvent
public NativeEvent getNativeEvent()
Get theNativeEventto preview.
-
getValue
public T getValue()
Get the value where the event occurred.
-
isCanceled
public boolean isCanceled()
Check if the event has been canceled.- Returns:
- true if the event has been canceled
- See Also:
setCanceled(boolean)
-
isCellEditing
public boolean isCellEditing()
Check whether or not the cell where the event occurred is being edited.- Returns:
- true if the cell is being edited, false if not
-
isSelectionHandled
public boolean isSelectionHandled()
Check whether or not selection is being handled by the widget or one of its Cells.- Returns:
- true if selection is handled by the widget
-
setCanceled
public void setCanceled(boolean cancel)
Cancel the event and prevent it from firing to the Cell.- Parameters:
cancel- true to cancel the event, false to allow it
-
dispatch
protected void dispatch(CellPreviewEvent.Handler<T> handler)
Description copied from class:GwtEventShould only be called byHandlerManager. In other words, do not use or call.- Specified by:
dispatchin classGwtEvent<CellPreviewEvent.Handler<T>>- Parameters:
handler- handler- See Also:
EventBus.dispatchEvent(Event, Object)
-
-