| Summary: | Improve usability of Chart Scripting editor | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | David Michonneau <dmichonneau> |
| Component: | BIRT | Assignee: | Zhiqiang Qian <zqian> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 2.1.0 | ||
| Target Milestone: | 2.2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 179300, 188862, 196257 | ||
| Bug Blocks: | |||
|
Description
David Michonneau
Consider to support this as part of java script editor enhancment. This depends on the integration of Aptana's JS editor. That integration can be done in M6, we can't finish this in M6 too. Please specify what you require from the chart side to integrate the chart script editing in this new JS editor (bug 132031) UI implementation tasks: Use the new API from Model (bug179300) Implement mockup of bug132031 Provide Palette provider interface so extended item can hide/show contents in Palette. Investigate auto-completion support for extended items I suggest we add the drop down box without the integration with model/engine API this week, and hooked up the API calls later, Added a combo box on JS editor. We have added the combo box Thanks Implemented the dropdown logic to create new functions, hooked new API calls to retrieve signatures, save and load script contents from extended items. Reassigning to UI team for further enhancements such as auto-completion and possible polishing of the dropdown functionalities (pending on SWT enhancements on dropdown capabilities, currently it's not possible to format one item in a dropdown independently of others). For the auto completion open issue, it is a key usability issue for chart scripting that we want to solve in BIRT 2.2. I think we can continue to use KEY word based auto completion that we have implemented for other report item's scripts. For built-in report items, we use the context object name as the key, which is valid for the entire script. For example, if you write script for a Label.onPrepare, the key word "this"/"reportContext" will be used to refer to a ILabel object. This information is defined in ROM through the Label's onPrepare method definition:
<Element canExtend="true" displayNameID="Element.Label" extends="ReportItem" isAbstract="false" javaClass="org.eclipse.birt.report.model.elements.Label" name="Label" selector="label" since="1.0" xmlName="label">
..
<Method context="startup" displayNameID="Element.Label.onPrepare" name="onPrepare" since="2.0" toolTipID="Element.Label.onPrepare.toolTip">
<Argument name="this" tagID="Element.Label.onPrepare.this" type="org.eclipse.birt.report.engine.api.script.element.ILabel"/>
<Argument name="reportContext" tagID="Element.Label.onPrepare.reportContext" type="org.eclipse.birt.report.engine.api.script.IReportContext"/>
</Method>
...
</element>
Similarly, chart should also define methods and sub methods as following in chart extension plugin.xml:
onRender:
<Method context="presentation" displayNameID="Element.Label.onRender" name="onRender" since="1.0" toolTipID="Element.Label.onRender.toolTip">
</Method>
All sub methods should use the same context "onPrepare"
<Method context="onPrepare" displayNameID="Chart.beforeDataSetFilled" name="beforeDataSetFilled( series, dataSetProcessor, context )" since="2.1" toolTipID="Chart.beforeDataSetFilled">
<Argument name="series" tagID="Chart.beforeDataSetFilled.series" type="org.eclipse.birt.chart..../Series"/>
<Argument name="dataSetProcessor" tagID="Chart.beforeDataSetFilled.dataSetProcessor" type="org.eclipse.birt.chart.. DataSetProcessor"/>
<Argument name="context" tagID="Chart.beforeDataSetFilled.context" type="org.eclipse.birt.chart..IChartScriptContext"/>
</Method>
With this information, GUI can use key word "series", "datasetProcessor", and "context" as the key word for auto completion. Also these three key words are valid only within the beforeDataSetFilled() function. So to make the auto completion to be more intelligent, JS editor need to parse the script, and it is whether the key word is within the defined function. Fortunately, Rhnio has provided a script parser that can serve this purpose. I have sent the instruction to Qiangsheng. This should be not be a problem.
Added support for chart script auto-completion and lower the priority for other future enhancement, e.g. dropdown poslishing, function jump, etc. please verify the main enhancements and log another enh bug for further UI improvements. further UI improvements logged in bug198530 |