]>
git.argeo.org Git - gpl/argeo-suite.git/blob - chart/AbstractJsChart.java
1 package org
.argeo
.app
.swt
.chart
;
3 import org
.argeo
.app
.swt
.js
.SwtBrowserJsPart
;
4 import org
.eclipse
.swt
.widgets
.Composite
;
6 /** Base class for charts. */
7 public abstract class AbstractJsChart
extends SwtBrowserJsPart
{
8 private String chartName
;
10 protected abstract String
getJsImplementation();
12 public AbstractJsChart(String chartName
, Composite parent
, int style
) {
13 super(parent
, style
, "/pkg/org.argeo.app.js/chart.html");
14 this.chartName
= chartName
;
18 protected void init() {
20 doExecute(getJsChartVar() + " = new " + getJsImplementation() + "('" + chartName
+ "');");
23 protected String
getJsChartVar() {
24 return getJsVarName(chartName
);
27 protected void executeChartMethod(String methodCall
, Object
... args
) {
28 executeMethod(getJsChartVar(), methodCall
, args
);