org.eclipse.birt.chart.ui.swt.interfaces
Interface IDataServiceProvider


public interface IDataServiceProvider

Data service provider for chart wizard, to provide all necessary data.


Field Summary
static int COMMAND_EDIT_BINDING
           
static int COMMAND_EDIT_FILTER
           
static int COMMAND_EDIT_PARAMETER
           
static int COMMAND_NEW_DATASET
           
 
Method Summary
 void dispose()
          Disposes all resources.
 java.lang.String[] getAllDataSets()
          Returns all available datasets to choose.
 java.lang.String[] getAllStyleDisplayNames()
          Returns all available style display names.
 java.lang.String[] getAllStyles()
          Returns all available style names.
 java.lang.String getBoundDataSet()
          Returns the bound dataset currently, or null if there's no dataset bound.
 java.lang.String getCurrentStyle()
          Returns the name of current used style.
 java.lang.Object[] getDataForColumns(java.lang.String[] sExpressions, int iMaxRecords, boolean byRow)
          Fetches data from dataset.
 java.util.List getPreviewData()
          Returns the preview data
 java.lang.String[] getPreviewHeader()
          Returns the prevew data header, e.g.
 java.lang.String getReportDataSet()
          Returns the dataset bound by parents, or null if there's no dataset bound there.
 int invoke(int command)
          Invokes specific dialogue.
 boolean isInvokingSupported()
          Returns whether all outside builder invokings are supported
 boolean isLivePreviewEnabled()
          Returns whether live preview is enabled
 void setContext(java.lang.Object context)
          Sets the context object
 void setDataSet(java.lang.String datasetName)
          Binds dataset for chart, and updates related settings, such as column bindings, filters, parameters.
 void setStyle(java.lang.String styleName)
          Sets current used style by specified style name.
 

Field Detail

COMMAND_NEW_DATASET

public static final int COMMAND_NEW_DATASET
See Also:
Constant Field Values

COMMAND_EDIT_FILTER

public static final int COMMAND_EDIT_FILTER
See Also:
Constant Field Values

COMMAND_EDIT_PARAMETER

public static final int COMMAND_EDIT_PARAMETER
See Also:
Constant Field Values

COMMAND_EDIT_BINDING

public static final int COMMAND_EDIT_BINDING
See Also:
Constant Field Values
Method Detail

getAllDataSets

public java.lang.String[] getAllDataSets()
Returns all available datasets to choose.


getBoundDataSet

public java.lang.String getBoundDataSet()
Returns the bound dataset currently, or null if there's no dataset bound.


getReportDataSet

public java.lang.String getReportDataSet()
Returns the dataset bound by parents, or null if there's no dataset bound there.


getAllStyles

public java.lang.String[] getAllStyles()
Returns all available style names.


getAllStyleDisplayNames

public java.lang.String[] getAllStyleDisplayNames()
Returns all available style display names. Note the count should be identical with getAllStyles().

Since:
2.1

getCurrentStyle

public java.lang.String getCurrentStyle()
Returns the name of current used style.


getPreviewHeader

public java.lang.String[] getPreviewHeader()
                                    throws ChartException
Returns the prevew data header, e.g. column display names.

Returns:
Throws:
ChartException

getPreviewData

public java.util.List getPreviewData()
                              throws ChartException
Returns the preview data

Returns:
Throws:
ChartException

setContext

public void setContext(java.lang.Object context)
Sets the context object


setDataSet

public void setDataSet(java.lang.String datasetName)
Binds dataset for chart, and updates related settings, such as column bindings, filters, parameters.

Parameters:
datasetName - Dataset name. Null means inheriting from container.

setStyle

public void setStyle(java.lang.String styleName)
Sets current used style by specified style name.


invoke

public int invoke(int command)
Invokes specific dialogue. The return codes are window-specific, although two standard return codes are predefined: OK and CANCEL.

Parameters:
command - dialogue type, predefined:COMMAND_NEW_DATASET, COMMAND_EDIT_FILTER and COMMAND_EDIT_PARAMETER
Returns:
the return code

getDataForColumns

public java.lang.Object[] getDataForColumns(java.lang.String[] sExpressions,
                                            int iMaxRecords,
                                            boolean byRow)
                                     throws ChartException
Fetches data from dataset.

Parameters:
sExpressions - column expression array in the form of javascript. Null will return all columns of dataset.
iMaxRecords - max row count. -1 returns default count or the preference value.
byRow - true: by row first, false: by column first
Returns:
Data array. if type is by row, array length is row length; if type is by column, array length is column length
Throws:
ChartException

dispose

public void dispose()
Disposes all resources.


isLivePreviewEnabled

public boolean isLivePreviewEnabled()
Returns whether live preview is enabled

Returns:
whether live preview is enabled

isInvokingSupported

public boolean isInvokingSupported()
Returns whether all outside builder invokings are supported

Returns:
whether all invokings are supported
Since:
2.1


Copyright © 2005 Actuate Corp. All rights reserved.