public abstract class AbstractDisplayer<V extends AbstractDisplayer.View> extends Object implements Displayer
Any derived class must implement:
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractDisplayer.ExpressionEval |
static interface |
AbstractDisplayer.Formatter |
static interface |
AbstractDisplayer.View |
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<org.dashbuilder.dataset.group.Interval>> |
columnSelectionMap |
protected org.dashbuilder.dataset.filter.DataSetFilter |
currentFilter |
protected org.dashbuilder.dataset.DataSet |
dataSet |
protected DataSetHandler |
dataSetHandler |
protected DisplayerConstraints |
displayerConstraints |
protected DisplayerSettings |
displayerSettings |
protected boolean |
drawn |
protected AbstractDisplayer.ExpressionEval |
evaluator |
protected AbstractDisplayer.Formatter |
formatter |
protected Map<String,ValueFormatter> |
formatterMap |
protected List<DisplayerListener> |
listenerList |
protected boolean |
refreshEnabled |
Constructor and Description |
---|
AbstractDisplayer() |
Modifier and Type | Method and Description |
---|---|
void |
addFormatter(String columnId,
ValueFormatter formatter)
Registers a custom formatter for the given column
|
void |
addListener(DisplayerListener... listeners)
Add a listener interested in receive events generated within this displayer component.
|
protected void |
afterClose() |
protected void |
afterDataSetLookup(org.dashbuilder.dataset.DataSet dataSet)
Call back method invoked just after the data set lookup is executed.
|
protected void |
afterDraw() |
protected void |
afterLoad() |
protected void |
afterRedraw() |
com.google.gwt.user.client.ui.Widget |
asWidget() |
protected void |
beforeDataSetLookup()
Call back method invoked just before the data set lookup is executed.
|
protected void |
beforeLoad() |
void |
checkDisplayerSettings(DisplayerSettings displayerSettings) |
void |
close()
Close the displayer
|
abstract DisplayerConstraints |
createDisplayerConstraints()
It initializes the constraints this displayer conforms to
- To be provided by the concrete displayer implementation -
|
protected abstract void |
createVisualization()
The required logic in charge of rendering the visualization
once the data has been retrieved during a call to draw()
- To be provided by the concrete displayer implementation -
|
void |
draw()
Draw the displayer by executing first the lookup call to retrieve the target data set
|
void |
export(ExportFormat format,
int maxRows,
ExportCallback callback)
Export the data being displayed into the specified output format.
|
void |
filterApply(org.dashbuilder.dataset.filter.DataSetFilter filter)
Apply the given filter
|
void |
filterApply(String columnId,
List<org.dashbuilder.dataset.group.Interval> intervalList)
Filter the values of the given column.
|
Set<String> |
filterColumns()
Get the set of columns being filtered.
|
List<Integer> |
filterIndexes(String columnId)
Get the current filter selected interval indexes for the given data set column.
|
org.dashbuilder.dataset.group.Interval |
filterInterval(String columnId,
int idx)
Get the current filter interval matching the specified index
|
List<org.dashbuilder.dataset.group.Interval> |
filterIntervals(String columnId)
Get the current filter intervals for the given data set column.
|
void |
filterReset()
Clear any filter.
|
void |
filterReset(String columnId)
Clear any filter on the given column.
|
void |
filterUpdate(org.dashbuilder.dataset.filter.DataSetFilter filter)
Updates the current filter values for the given data set column.
|
void |
filterUpdate(String columnId,
int row)
Updates the current filter values for the given data set column.
|
void |
filterUpdate(String columnId,
int row,
Integer maxSelections)
Updates the current filter values for the given data set column.
|
protected String |
formatDate(org.dashbuilder.dataset.group.DateIntervalType type,
org.dashbuilder.dataset.group.GroupStrategy strategy,
String date,
String pattern,
String expression) |
protected String |
formatDateDynamic(org.dashbuilder.dataset.group.DateIntervalType type,
String date,
String pattern) |
protected String |
formatDateFixed(org.dashbuilder.dataset.group.DateIntervalType type,
String date) |
String |
formatInterval(org.dashbuilder.dataset.group.Interval interval,
org.dashbuilder.dataset.DataColumn column) |
String |
formatValue(int row,
int column) |
String |
formatValue(Object value,
org.dashbuilder.dataset.DataColumn column) |
DataSetHandler |
getDataSetHandler() |
DisplayerConstraints |
getDisplayerConstraints()
Every Displayer implementation must define the set of features it supports as well as other behavioral settings.
|
String |
getDisplayerId() |
DisplayerSettings |
getDisplayerSettings() |
AbstractDisplayer.ExpressionEval |
getEvaluator() |
AbstractDisplayer.Formatter |
getFormatter() |
ValueFormatter |
getFormatter(String columnId) |
abstract V |
getView()
It returns the actual implementation of the View
- To be provided by the concrete displayer implementation -
|
void |
handleError(ClientRuntimeError error) |
void |
handleError(String message) |
void |
handleError(String message,
Throwable error) |
void |
handleError(Throwable error) |
boolean |
isDrawn()
Check if the displayer is completely drawn.
|
boolean |
isRefreshOn()
Check if the automatic refresh is on.
|
void |
onClose(Displayer displayer)
Invoked just after the displayer has been closed.
|
void |
onDataLoaded(Displayer displayer)
Invoked right after the data lookup finishes and the data set is available,
|
void |
onDataLookup(Displayer displayer)
Invoked just before the data lookup operation has been started,
|
void |
onDraw(Displayer displayer)
Invoked just after the displayer has been drawn.
|
void |
onError(Displayer displayer,
ClientRuntimeError error)
Invoked when some error occurs.
|
void |
onFilterEnabled(Displayer displayer,
org.dashbuilder.dataset.filter.DataSetFilter filter)
Invoked when a filter request is executed on a given Displayer instance.
|
void |
onFilterEnabled(Displayer displayer,
org.dashbuilder.dataset.group.DataSetGroup groupOp)
Invoked when a group interval selection filter request is executed on a given Displayer instance.
|
void |
onFilterReset(Displayer displayer,
org.dashbuilder.dataset.filter.DataSetFilter filter)
Invoked when a filter reset request is executed on a given Displayer instance.
|
void |
onFilterReset(Displayer displayer,
List<org.dashbuilder.dataset.group.DataSetGroup> groupOps)
Invoked when a group interval reset request is executed on a given Displayer instance.
|
void |
onFilterUpdate(Displayer displayer,
org.dashbuilder.dataset.filter.DataSetFilter oldFilter,
org.dashbuilder.dataset.filter.DataSetFilter newFilter)
Invoked when an update filter request is executed on an already filtered Displayer instance.
|
void |
onRedraw(Displayer displayer)
Invoked just after the displayer has been redrawn.
|
protected Date |
parseDynamicGroupDate(org.dashbuilder.dataset.group.DateIntervalType type,
String date) |
void |
redraw()
Just reload the data set and make the current displayer to redraw.
|
void |
setDataSetHandler(DataSetHandler dataSetHandler)
The handler used to fetch and manipulate the data set.
|
void |
setDisplayerSettings(DisplayerSettings displayerSettings)
The data displayer to draw.
|
void |
setEvaluator(AbstractDisplayer.ExpressionEval evaluator) |
void |
setFormatter(AbstractDisplayer.Formatter formatter) |
void |
setRefreshOn(boolean enabled)
Enables or disables the automatic refresh capability (enabled by default).
|
void |
showError(ClientRuntimeError error) |
void |
sortApply(String columnId,
org.dashbuilder.dataset.sort.SortOrder sortOrder)
Set the sort order operation to apply to the data set.
|
protected void |
updateRefreshTimer() |
protected abstract void |
updateVisualization()
The required logic in charge of updating a visualization
once the data has been retrieved during a call to redraw()
- To be provided by the concrete displayer implementation -
|
protected org.dashbuilder.dataset.DataSet dataSet
protected DataSetHandler dataSetHandler
protected DisplayerSettings displayerSettings
protected DisplayerConstraints displayerConstraints
protected List<DisplayerListener> listenerList
protected Map<String,List<org.dashbuilder.dataset.group.Interval>> columnSelectionMap
protected Map<String,ValueFormatter> formatterMap
protected AbstractDisplayer.Formatter formatter
protected AbstractDisplayer.ExpressionEval evaluator
protected org.dashbuilder.dataset.filter.DataSetFilter currentFilter
protected boolean refreshEnabled
protected boolean drawn
public com.google.gwt.user.client.ui.Widget asWidget()
asWidget
in interface com.google.gwt.user.client.ui.IsWidget
public abstract V getView()
- To be provided by the concrete displayer implementation -
public abstract DisplayerConstraints createDisplayerConstraints()
- To be provided by the concrete displayer implementation -
protected abstract void createVisualization()
- To be provided by the concrete displayer implementation -
protected abstract void updateVisualization()
- To be provided by the concrete displayer implementation -
public DisplayerConstraints getDisplayerConstraints()
Displayer
getDisplayerConstraints
in interface Displayer
public DisplayerSettings getDisplayerSettings()
getDisplayerSettings
in interface Displayer
public void setDisplayerSettings(DisplayerSettings displayerSettings)
Displayer
setDisplayerSettings
in interface Displayer
public void checkDisplayerSettings(DisplayerSettings displayerSettings)
public DataSetHandler getDataSetHandler()
getDataSetHandler
in interface Displayer
public void setDataSetHandler(DataSetHandler dataSetHandler)
Displayer
setDataSetHandler
in interface Displayer
public AbstractDisplayer.Formatter getFormatter()
public void setFormatter(AbstractDisplayer.Formatter formatter)
public AbstractDisplayer.ExpressionEval getEvaluator()
public void setEvaluator(AbstractDisplayer.ExpressionEval evaluator)
public void addListener(DisplayerListener... listeners)
Displayer
addListener
in interface Displayer
public String getDisplayerId()
public boolean isDrawn()
Displayer
public void draw()
public void redraw()
public void showError(ClientRuntimeError error)
protected void beforeDataSetLookup()
protected void afterDataSetLookup(org.dashbuilder.dataset.DataSet dataSet)
public void setRefreshOn(boolean enabled)
Displayer
setRefreshOn
in interface Displayer
DisplayerSettings.getRefreshInterval()
public boolean isRefreshOn()
Displayer
isRefreshOn
in interface Displayer
protected void updateRefreshTimer()
protected void beforeLoad()
protected void afterLoad()
protected void afterDraw()
protected void afterRedraw()
protected void afterClose()
public void handleError(String message)
public void handleError(Throwable error)
public void handleError(ClientRuntimeError error)
public void onDataLookup(Displayer displayer)
DisplayerListener
onDataLookup
in interface DisplayerListener
displayer
- The Displayer instance.public void onDataLoaded(Displayer displayer)
DisplayerListener
onDataLoaded
in interface DisplayerListener
displayer
- The Displayer instance.public void onDraw(Displayer displayer)
DisplayerListener
onDraw
in interface DisplayerListener
displayer
- The Displayer instance.public void onRedraw(Displayer displayer)
DisplayerListener
onRedraw
in interface DisplayerListener
displayer
- The Displayer instance.public void onClose(Displayer displayer)
DisplayerListener
onClose
in interface DisplayerListener
displayer
- The Displayer instance.public void onError(Displayer displayer, ClientRuntimeError error)
DisplayerListener
onError
in interface DisplayerListener
displayer
- The Displayer instance event comes from.error
- The error instance.public void onFilterEnabled(Displayer displayer, org.dashbuilder.dataset.group.DataSetGroup groupOp)
DisplayerListener
onFilterEnabled
in interface DisplayerListener
displayer
- The Displayer instance where the interval selection event comes from.groupOp
- The group interval selection operation.public void onFilterEnabled(Displayer displayer, org.dashbuilder.dataset.filter.DataSetFilter filter)
DisplayerListener
onFilterEnabled
in interface DisplayerListener
displayer
- The Displayer instance where the filter request event comes from.filter
- The filter operation.public void onFilterUpdate(Displayer displayer, org.dashbuilder.dataset.filter.DataSetFilter oldFilter, org.dashbuilder.dataset.filter.DataSetFilter newFilter)
DisplayerListener
onFilterUpdate
in interface DisplayerListener
displayer
- The Displayer instance where the filter request event comes from.oldFilter
- The old filter operation.newFilter
- The new filter operation.public void onFilterReset(Displayer displayer, List<org.dashbuilder.dataset.group.DataSetGroup> groupOps)
DisplayerListener
onFilterReset
in interface DisplayerListener
displayer
- The Displayer instance where the interval selection event comes from.groupOps
- The set of group interval selection operations reset.public void onFilterReset(Displayer displayer, org.dashbuilder.dataset.filter.DataSetFilter filter)
DisplayerListener
onFilterReset
in interface DisplayerListener
displayer
- The Displayer instance where the filter event comes from.filter
- The filter operation to reset.public List<org.dashbuilder.dataset.group.Interval> filterIntervals(String columnId)
columnId
- The column identifier.public org.dashbuilder.dataset.group.Interval filterInterval(String columnId, int idx)
columnId
- The column identifier.idx
- The index of the intervalpublic List<Integer> filterIndexes(String columnId)
columnId
- The column identifier.public void filterUpdate(String columnId, int row)
columnId
- The column to filter for.row
- The row selected.public void filterUpdate(String columnId, int row, Integer maxSelections)
columnId
- The column to filter for.row
- The row selected.maxSelections
- The number of different selectable values available.public void filterApply(String columnId, List<org.dashbuilder.dataset.group.Interval> intervalList)
columnId
- The name of the column to filter.intervalList
- A list of interval selections to filter for.public void filterApply(org.dashbuilder.dataset.filter.DataSetFilter filter)
filter
- A filterpublic void filterUpdate(org.dashbuilder.dataset.filter.DataSetFilter filter)
filter
- A filterpublic void filterReset(String columnId)
columnId
- The name of the column to reset.public void filterReset()
public void sortApply(String columnId, org.dashbuilder.dataset.sort.SortOrder sortOrder)
columnId
- The name of the column to sort.sortOrder
- The sort order.public String formatInterval(org.dashbuilder.dataset.group.Interval interval, org.dashbuilder.dataset.DataColumn column)
public void addFormatter(String columnId, ValueFormatter formatter)
Displayer
addFormatter
in interface Displayer
public ValueFormatter getFormatter(String columnId)
public String formatValue(int row, int column)
protected String formatDate(org.dashbuilder.dataset.group.DateIntervalType type, org.dashbuilder.dataset.group.GroupStrategy strategy, String date, String pattern, String expression)
protected String formatDateFixed(org.dashbuilder.dataset.group.DateIntervalType type, String date)
protected String formatDateDynamic(org.dashbuilder.dataset.group.DateIntervalType type, String date, String pattern)
protected Date parseDynamicGroupDate(org.dashbuilder.dataset.group.DateIntervalType type, String date)
public void export(ExportFormat format, int maxRows, ExportCallback callback)
Displayer
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.