Class AbstractDisplayer<V extends AbstractDisplayer.View>

    • Field Detail

      • dataSet

        protected org.dashbuilder.dataset.DataSet dataSet
      • displayerSettings

        protected org.dashbuilder.displayer.DisplayerSettings displayerSettings
      • displayerConstraints

        protected org.dashbuilder.displayer.DisplayerConstraints displayerConstraints
      • columnSelectionMap

        protected Map<String,​List<org.dashbuilder.dataset.group.Interval>> columnSelectionMap
      • currentFilter

        protected org.dashbuilder.dataset.filter.DataSetFilter currentFilter
      • refreshEnabled

        protected boolean refreshEnabled
      • drawn

        protected boolean drawn
    • Constructor Detail

      • AbstractDisplayer

        public AbstractDisplayer()
    • Method Detail

      • asWidget

        public com.google.gwt.user.client.ui.Widget asWidget()
        Specified by:
        asWidget in interface com.google.gwt.user.client.ui.IsWidget
      • getView

        public abstract V getView()
        It returns the actual implementation of the View

        - To be provided by the concrete displayer implementation -

      • createDisplayerConstraints

        public abstract org.dashbuilder.displayer.DisplayerConstraints createDisplayerConstraints()
        It initializes the constraints this displayer conforms to

        - To be provided by the concrete displayer implementation -

      • createVisualization

        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 -

      • updateVisualization

        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 -

      • getDisplayerConstraints

        public org.dashbuilder.displayer.DisplayerConstraints getDisplayerConstraints()
        Description copied from interface: Displayer
        Every Displayer implementation must define the set of features it supports as well as other behavioral settings. These "constrains" are needed for two main reasons:
        • Validation purposes: in order to ensure the DisplayerSettings are valid and ready for rendering.
        • Edition purposes: in order to let the DisplayerEditor know what features/settings/behaviour this Displayer implementation supports.
        Specified by:
        getDisplayerConstraints in interface Displayer
      • getDisplayerSettings

        public org.dashbuilder.displayer.DisplayerSettings getDisplayerSettings()
        Specified by:
        getDisplayerSettings in interface Displayer
      • setDisplayerSettings

        public void setDisplayerSettings​(org.dashbuilder.displayer.DisplayerSettings displayerSettings)
        Description copied from interface: Displayer
        The data displayer to draw.
        Specified by:
        setDisplayerSettings in interface Displayer
      • checkDisplayerSettings

        public void checkDisplayerSettings​(org.dashbuilder.displayer.DisplayerSettings displayerSettings)
      • addListener

        public void addListener​(DisplayerListener... listeners)
        Description copied from interface: Displayer
        Add a listener interested in receive events generated within this displayer component.
        Specified by:
        addListener in interface Displayer
      • getDisplayerId

        public String getDisplayerId()
      • isDrawn

        public boolean isDrawn()
        Description copied from interface: Displayer
        Check if the displayer is completely drawn.
        Specified by:
        isDrawn in interface Displayer
      • draw

        public void draw()
        Draw the displayer by executing first the lookup call to retrieve the target data set
        Specified by:
        draw in interface Displayer
      • redraw

        public void redraw()
        Just reload the data set and make the current displayer to redraw.
        Specified by:
        redraw in interface Displayer
      • showError

        public void showError​(org.dashbuilder.common.client.error.ClientRuntimeError error)
      • close

        public void close()
        Close the displayer
        Specified by:
        close in interface Displayer
      • beforeDataSetLookup

        protected void beforeDataSetLookup()
        Call back method invoked just before the data set lookup is executed.
      • afterDataSetLookup

        protected void afterDataSetLookup​(org.dashbuilder.dataset.DataSet dataSet)
        Call back method invoked just after the data set lookup is executed.
      • setRefreshOn

        public void setRefreshOn​(boolean enabled)
        Description copied from interface: Displayer
        Enables or disables the automatic refresh capability (enabled by default).
        Specified by:
        setRefreshOn in interface Displayer
        See Also:
        DisplayerSettings.getRefreshInterval()
      • isRefreshOn

        public boolean isRefreshOn()
        Description copied from interface: Displayer
        Check if the automatic refresh is on.
        Specified by:
        isRefreshOn in interface Displayer
      • updateRefreshTimer

        protected void updateRefreshTimer()
      • beforeLoad

        protected void beforeLoad()
      • afterLoad

        protected void afterLoad()
      • afterDraw

        protected void afterDraw()
      • afterRedraw

        protected void afterRedraw()
      • afterClose

        protected void afterClose()
      • handleError

        public void handleError​(String message)
      • handleError

        public void handleError​(String message,
                                Throwable error)
      • handleError

        public void handleError​(Throwable error)
      • handleError

        public void handleError​(org.dashbuilder.common.client.error.ClientRuntimeError error)
      • onDataLookup

        public void onDataLookup​(Displayer displayer)
        Description copied from interface: DisplayerListener
        Invoked just before the data lookup operation has been started,
        Specified by:
        onDataLookup in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance.
      • onDataLoaded

        public void onDataLoaded​(Displayer displayer)
        Description copied from interface: DisplayerListener
        Invoked right after the data lookup finishes and the data set is available,
        Specified by:
        onDataLoaded in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance.
      • onDraw

        public void onDraw​(Displayer displayer)
        Description copied from interface: DisplayerListener
        Invoked just after the displayer has been drawn.
        Specified by:
        onDraw in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance.
      • onRedraw

        public void onRedraw​(Displayer displayer)
        Description copied from interface: DisplayerListener
        Invoked just after the displayer has been redrawn.
        Specified by:
        onRedraw in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance.
      • onClose

        public void onClose​(Displayer displayer)
        Description copied from interface: DisplayerListener
        Invoked just after the displayer has been closed.
        Specified by:
        onClose in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance.
      • onError

        public void onError​(Displayer displayer,
                            org.dashbuilder.common.client.error.ClientRuntimeError error)
        Description copied from interface: DisplayerListener
        Invoked when some error occurs.
        Specified by:
        onError in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance event comes from.
        error - The error instance.
      • onFilterEnabled

        public void onFilterEnabled​(Displayer displayer,
                                    org.dashbuilder.dataset.group.DataSetGroup groupOp)
        Description copied from interface: DisplayerListener
        Invoked when a group interval selection filter request is executed on a given Displayer instance.
        Specified by:
        onFilterEnabled in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance where the interval selection event comes from.
        groupOp - The group interval selection operation.
      • onFilterEnabled

        public void onFilterEnabled​(Displayer displayer,
                                    org.dashbuilder.dataset.filter.DataSetFilter filter)
        Description copied from interface: DisplayerListener
        Invoked when a filter request is executed on a given Displayer instance.
        Specified by:
        onFilterEnabled in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance where the filter request event comes from.
        filter - The filter operation.
      • onFilterUpdate

        public void onFilterUpdate​(Displayer displayer,
                                   org.dashbuilder.dataset.filter.DataSetFilter oldFilter,
                                   org.dashbuilder.dataset.filter.DataSetFilter newFilter)
        Description copied from interface: DisplayerListener
        Invoked when an update filter request is executed on an already filtered Displayer instance.
        Specified by:
        onFilterUpdate in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance where the filter request event comes from.
        oldFilter - The old filter operation.
        newFilter - The new filter operation.
      • onFilterReset

        public void onFilterReset​(Displayer displayer,
                                  List<org.dashbuilder.dataset.group.DataSetGroup> groupOps)
        Description copied from interface: DisplayerListener
        Invoked when a group interval reset request is executed on a given Displayer instance.
        Specified by:
        onFilterReset in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance where the interval selection event comes from.
        groupOps - The set of group interval selection operations reset.
      • onFilterReset

        public void onFilterReset​(Displayer displayer,
                                  org.dashbuilder.dataset.filter.DataSetFilter filter)
        Description copied from interface: DisplayerListener
        Invoked when a filter reset request is executed on a given Displayer instance.
        Specified by:
        onFilterReset in interface DisplayerListener
        Parameters:
        displayer - The Displayer instance where the filter event comes from.
        filter - The filter operation to reset.
      • filterColumns

        public Set<String> filterColumns()
        Get the set of columns being filtered.
      • filterIntervals

        public List<org.dashbuilder.dataset.group.Interval> filterIntervals​(String columnId)
        Get the current filter intervals for the given data set column.
        Parameters:
        columnId - The column identifier.
        Returns:
        A list of intervals.
      • filterInterval

        public org.dashbuilder.dataset.group.Interval filterInterval​(String columnId,
                                                                     int idx)
        Get the current filter interval matching the specified index
        Parameters:
        columnId - The column identifier.
        idx - The index of the interval
        Returns:
        The target interval matching the specified parameters or null if it does not exist.
      • filterIndexes

        public List<Integer> filterIndexes​(String columnId)
        Get the current filter selected interval indexes for the given data set column.
        Parameters:
        columnId - The column identifier.
        Returns:
        A list of interval indexes
      • filterUpdate

        public void filterUpdate​(String columnId,
                                 int row)
        Updates the current filter values for the given data set column.
        Parameters:
        columnId - The column to filter for.
        row - The row selected.
      • filterUpdate

        public void filterUpdate​(String columnId,
                                 int row,
                                 Integer maxSelections)
        Updates the current filter values for the given data set column.
        Parameters:
        columnId - The column to filter for.
        row - The row selected.
        maxSelections - The number of different selectable values available.
      • filterApply

        public void filterApply​(String columnId,
                                List<org.dashbuilder.dataset.group.Interval> intervalList)
        Filter the values of the given column.
        Parameters:
        columnId - The name of the column to filter.
        intervalList - A list of interval selections to filter for.
      • filterApply

        public void filterApply​(org.dashbuilder.dataset.filter.DataSetFilter filter)
        Apply the given filter
        Parameters:
        filter - A filter
      • filterUpdate

        public void filterUpdate​(org.dashbuilder.dataset.filter.DataSetFilter filter)
        Updates the current filter values for the given data set column. Any previous filter is reset.
        Parameters:
        filter - A filter
      • filterReset

        public void filterReset​(String columnId)
        Clear any filter on the given column.
        Parameters:
        columnId - The name of the column to reset.
      • filterReset

        public void filterReset()
        Clear any filter.
      • sortApply

        public void sortApply​(String columnId,
                              org.dashbuilder.dataset.sort.SortOrder sortOrder)
        Set the sort order operation to apply to the data set.
        Parameters:
        columnId - The name of the column to sort.
        sortOrder - The sort order.
      • formatInterval

        public String formatInterval​(org.dashbuilder.dataset.group.Interval interval,
                                     org.dashbuilder.dataset.DataColumn column)
      • formatValue

        public String formatValue​(int row,
                                  int column)
      • formatValue

        public String formatValue​(Object value,
                                  org.dashbuilder.dataset.DataColumn column)
      • formatDate

        protected String formatDate​(org.dashbuilder.dataset.group.DateIntervalType type,
                                    org.dashbuilder.dataset.group.GroupStrategy strategy,
                                    String date,
                                    String pattern,
                                    String expression)
      • formatDateFixed

        protected String formatDateFixed​(org.dashbuilder.dataset.group.DateIntervalType type,
                                         String date)
      • formatDateDynamic

        protected String formatDateDynamic​(org.dashbuilder.dataset.group.DateIntervalType type,
                                           String date,
                                           String pattern)
      • parseDynamicGroupDate

        protected Date parseDynamicGroupDate​(org.dashbuilder.dataset.group.DateIntervalType type,
                                             String date)
      • export

        public void export​(ExportFormat format,
                           int maxRows,
                           ExportCallback callback)
        Description copied from interface: Displayer
        Export the data being displayed into the specified output format.
        Specified by:
        export in interface Displayer
        Parameters:
        format - The output format
        maxRows - Max rows to be exported. If lower or equals to 0 then all rows will be exported.
        callback - The callback instance to be notified