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 data sets.
 java.lang.String[] getAllReportItemReferences()
          Returns all available report item references.
 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.
 DataType getDataType(java.lang.String expression)
          Returns the data type according to the query expression.
 java.util.List getPreviewData()
          Returns the preview data
 java.lang.String[] getPreviewHeader()
          Returns the preview data header, e.g.
 java.lang.String getReportDataSet()
          Returns the dataset bound by parents, or null if there's no dataset bound there.
 java.lang.String getReportItemReference()
          Returns the name of current data item reference, or null if no reference found.
 int invoke(int command)
          Invokes specific dialogue.
 boolean isEclipseModeSupported()
          Returns whether the application is running under Eclipse Mode.
 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 data set for chart, and updates related settings, such as column bindings, filters, parameters.
 void setReportItemReference(java.lang.String referenceName)
          Binds report item reference for chart, and update related settings, such as data set.
 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 data sets.

Returns:
name string array

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.


getAllReportItemReferences

public java.lang.String[] getAllReportItemReferences()
Returns all available report item references.

Returns:
name string array
Since:
2.2.1

getReportItemReference

public java.lang.String getReportItemReference()
Returns the name of current data item reference, or null if no reference found.

Returns:
the name of current data item reference
Since:
2.2.1

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 preview data header, e.g. column display names.

Returns:
meta data in form of string
Throws:
ChartException

getPreviewData

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

Returns:
data list which includes string array as an element
Throws:
ChartException

setContext

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


setDataSet

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

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

setReportItemReference

public void setReportItemReference(java.lang.String referenceName)
Binds report item reference for chart, and update related settings, such as data set.

Parameters:
referenceName - Reference name. Null means no reference or inheriting from container.
Since:
2.2.1

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

isEclipseModeSupported

public boolean isEclipseModeSupported()
Returns whether the application is running under Eclipse Mode.

Since:
2.2

getDataType

public DataType getDataType(java.lang.String expression)
Returns the data type according to the query expression.

Parameters:
expression -
Returns:
2.2


Copyright © 2005-2007 Actuate Corp. All rights reserved.