Class DataLabelsSelectionHandler
- java.lang.Object
-
- org.pepstock.charba.client.datalabels.events.AbstractEventHandler
-
- org.pepstock.charba.client.impl.callbacks.DataLabelsPointerHandler
-
- org.pepstock.charba.client.impl.callbacks.DataLabelsSelectionHandler
-
- All Implemented Interfaces:
ClickEventHandler
,EnterEventHandler
,LeaveEventHandler
public final class DataLabelsSelectionHandler extends DataLabelsPointerHandler
DataLabelsPlugin event callbacks to invoke data set selection handlers if there were defined.
This can substitute the event handling at chart level.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
-
Fields inherited from class org.pepstock.charba.client.impl.callbacks.DataLabelsPointerHandler
DEFAULT_CURSOR
-
-
Constructor Summary
Constructors Constructor Description DataLabelsSelectionHandler()
Creates a callback settingCursorType.POINTER
as pointer.DataLabelsSelectionHandler(CursorType cursor)
Creates a callback setting the pointer cursor what is passed as argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDatasetSelectionEventHandler(DatasetSelectionEventHandler handler)
Adds a data set selection handler instance to be invoke at click event.boolean
onClick(DataLabelsContext context, ChartEventContext event)
Invoked to manage CLICK events on labels.boolean
removeDatasetSelectionEventHandler(DatasetSelectionEventHandler handler)
Removes a data set selection handler instance.-
Methods inherited from class org.pepstock.charba.client.impl.callbacks.DataLabelsPointerHandler
getCursor, onEnter, onLeave
-
-
-
-
Constructor Detail
-
DataLabelsSelectionHandler
public DataLabelsSelectionHandler()
Creates a callback settingCursorType.POINTER
as pointer.
-
DataLabelsSelectionHandler
public DataLabelsSelectionHandler(CursorType cursor)
Creates a callback setting the pointer cursor what is passed as argument.- Parameters:
cursor
- the cursor type to use. Ifnull
, usesCursorType.POINTER
as pointer
-
-
Method Detail
-
addDatasetSelectionEventHandler
public void addDatasetSelectionEventHandler(DatasetSelectionEventHandler handler)
Adds a data set selection handler instance to be invoke at click event.- Parameters:
handler
- data set selection handler instance to be invoke at click event
-
removeDatasetSelectionEventHandler
public boolean removeDatasetSelectionEventHandler(DatasetSelectionEventHandler handler)
Removes a data set selection handler instance.- Parameters:
handler
- data set selection handler instance- Returns:
true
if the handler has been removed, otherwisefalse
-
onClick
public boolean onClick(DataLabelsContext context, ChartEventContext event)
Description copied from interface:ClickEventHandler
Invoked to manage CLICK events on labels.- Specified by:
onClick
in interfaceClickEventHandler
- Overrides:
onClick
in classAbstractEventHandler
- Parameters:
context
-DataLabelsPlugin.ID
plugin context instanceevent
- event instance- Returns:
- If the callback explicitly returns
true
, the label is updated with the new context and the chart re-rendered.
-
-