aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferrazzutti2013-11-12 10:24:54 (EST)
committerRoland Grunberg2013-11-27 12:55:46 (EST)
commit031af9262f4616a356467ca2bd8632fb376aa0a6 (patch)
tree8405c60e79537a63eafd7727a115ff8c850d00b3
parentbbf18d37537819d2e66060228db1c975716227a9 (diff)
downloadorg.eclipse.linuxtools-031af9262f4616a356467ca2bd8632fb376aa0a6.zip
org.eclipse.linuxtools-031af9262f4616a356467ca2bd8632fb376aa0a6.tar.gz
org.eclipse.linuxtools-031af9262f4616a356467ca2bd8632fb376aa0a6.tar.bz2
Systemtap: Merge 64bbd52 & 2feae5f from master.refs/changes/31/18931/3
1) When capturing a script's output to display it in a graph, don't attempt to plot null or invalid values so as to avoid causing an error. 2) Add labels on individual pie charts to signify which series each pie represents. Also show a "No data" label when all pie charts are empty. 3) Increase the version number of linuxtools.dataviewers to account for the new public API added by 1) and 2). Also add some public documentation. Change-Id: I326f583ae7924c397e4771f2cc49fb605ff548a8 Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com> Reviewed-on: https://git.eclipse.org/r/18931 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rwxr-xr-xprofiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/dataviewers/charts/provider/ChartFactory.java13
-rwxr-xr-xprofiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java2
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.piechart/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.piechart/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChart.java26
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChartPaintListener.java53
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartBuilder.java15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartWithAxisBuilder.java48
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java56
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/datadisplay/DataGrid.java8
10 files changed, 182 insertions, 43 deletions
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/dataviewers/charts/provider/ChartFactory.java b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/dataviewers/charts/provider/ChartFactory.java
index e1c577b..5bc1fed 100755
--- a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/dataviewers/charts/provider/ChartFactory.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/dataviewers/charts/provider/ChartFactory.java
@@ -60,7 +60,13 @@ public class ChartFactory {
view = (ChartView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.showView(ChartView.VIEW_ID, String.valueOf(ChartView.getSecId()), IWorkbenchPage.VIEW_ACTIVATE);
- PieChart chart = new PieChart(view.getParent(), SWT.NONE);
+
+ String[] pieChartNames = new String [valFields.size()];
+ for (int i = 0; i < valFields.size(); i++) {
+ pieChartNames[i] = valFields.get(i).getColumnHeaderText();
+ }
+
+ PieChart chart = new PieChart(view.getParent(), SWT.NONE, pieChartNames);
chart.setBackground(WHITE);
chart.setBackgroundInPlotArea(GRAD);
@@ -75,11 +81,6 @@ public class ChartFactory {
valueLabels[i] = nameField.getValue(objects[i]);
}
- /*
- * String [] pieChartNames = new String [valFields.size()]; for (int i = 0; i < valFields.size(); i++) {
- * pieChartNames[i] = valFields.get(i).getColumnHeaderText(); }
- */
-
// pie chart data is grouped by columns
// row size is the number of pie charts
// column size is the number of data per pie chart
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java
index c0f8e7f..697701b 100755
--- a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java
@@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Text;
import org.swtchart.Chart;
/**
- * The dialog used to customize the chart before cerating it.
+ * The dialog used to customize the chart before creating it.
*/
public class ChartDialog extends Dialog {
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.piechart/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.dataviewers.piechart/META-INF/MANIFEST.MF
index d0a33a8..0e8fcce 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.piechart/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.dataviewers.piechart/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.dataviewers.piechart
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %bundleProvider
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.piechart/pom.xml b/profiling/org.eclipse.linuxtools.dataviewers.piechart/pom.xml
index 3f575b8..f023bea 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.piechart/pom.xml
+++ b/profiling/org.eclipse.linuxtools.dataviewers.piechart/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.dataviewers.piechart</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools PieChart plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChart.java b/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChart.java
index d9a3a62..5711571 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChart.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChart.java
@@ -26,7 +26,24 @@ public class PieChart extends Chart {
protected List<RGB> colorList = new ArrayList<RGB>();
+ /**
+ * A PieChart with no titles given to its pies.
+ * @param parent
+ * @param style
+ */
public PieChart(Composite parent, int style) {
+ this(parent, style, new String[0]);
+ }
+
+ /**
+ * A PieChart with titles given to each pie it draws.
+ * @param parent The parent composite.
+ * @param style The style of the parent composite.
+ * @param labels The title of each pie chart that is to be drawn.
+ * A null / not present title indicates no title.
+ * @since 1.1
+ */
+ public PieChart(Composite parent, int style, String labels[]) {
super(parent, style);
Control plotArea = null;
for (Control child : getChildren()) {
@@ -37,7 +54,7 @@ public class PieChart extends Chart {
plotArea = child;
}
}
- this.addPaintListener(new PieChartPaintListener(this, plotArea));
+ this.addPaintListener(new PieChartPaintListener(this, plotArea, labels));
}
@Override
@@ -47,9 +64,11 @@ public class PieChart extends Chart {
}
}
- /*
+ /**
* Add data to this Pie Chart. A single pie Chart will be drawn with the data provided.
+ * @deprecated see {@link #addPieChartSeries(String[], double[][])}
*/
+ @Deprecated
public void addPieChartSeries(String labels[], double val[]) {
for (ISeries s : this.getSeriesSet().getSeries()) {
this.getSeriesSet().deleteSeries(s.getId());
@@ -61,11 +80,12 @@ public class PieChart extends Chart {
addPieChartSeries(labels, newVal);
}
- /*
+ /**
* Add data to this Pie Chart. We'll build one pie chart for each value in the array provided. The val matrix must
* have an array of an array of values. Ex. labels = {'a', 'b'} val = {{1,2,3}, {4,5,6}} This will create 3 pie
* charts. For the first one, 'a' will be 1 and 'b' will be 4. For the second chart 'a' will be 2 and 'b' will be 5.
* For the third 'a' will be 3 and 'b' will be 6.
+ * @param labels The titles of each series. (These are not the same as titles given to pies.)
*/
public void addPieChartSeries(String labels[], double val[][]) {
for (ISeries s : this.getSeriesSet().getSeries()) {
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChartPaintListener.java b/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChartPaintListener.java
index 5b6856d..31752f0 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChartPaintListener.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.piechart/src/org/eclipse/linuxtools/dataviewers/piechart/PieChartPaintListener.java
@@ -10,23 +10,48 @@
*******************************************************************************/
package org.eclipse.linuxtools.dataviewers.piechart;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.swtchart.ISeries;
public class PieChartPaintListener implements PaintListener {
private PieChart chart;
private Control plotArea;
+ private String[] seriesNames;
private static final int X_GAP = 10;
+ protected static final Color WHITE = Display.getDefault().getSystemColor(SWT.COLOR_WHITE);
+ protected static final Color BLACK = Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
+
+ /**
+ * Draws pie charts with no titles given to each pie.
+ * @param chart
+ * @param plotArea
+ */
public PieChartPaintListener(PieChart chart, Control plotArea) {
+ this(chart, plotArea, new String[0]);
+ }
+
+ /**
+ * Handles drawing & updating of a PieChart, with titles given to each of its pies.
+ * @param chart The PieChart to draw & update.
+ * @param plotArea The area in which to draw the pies.
+ * @param seriesNames The titles given to individual pies.
+ * @since 1.1
+ */
+ public PieChartPaintListener(PieChart chart, Control plotArea, String[] seriesNames) {
this.chart = chart;
this.plotArea = plotArea;
+ this.seriesNames = seriesNames;
}
@Override
@@ -39,16 +64,28 @@ public class PieChartPaintListener implements PaintListener {
bounds = plotArea.getBounds();
}
double[][] series = this.getPieSeriesArray();
+ if (series.length == 0) {
+ Rectangle allBounds = chart.getBounds();
+ Font font = new Font(Display.getDefault(), "Arial", 15, SWT.BOLD); //$NON-NLS-1$
+ gc.setForeground(BLACK);
+ gc.setFont(font);
+ String text = "No data"; //$NON-NLS-1$
+ Point textSize = e.gc.textExtent(text);
+ gc.drawText(text, (allBounds.width - textSize.x) / 2, (allBounds.height - textSize.y) / 2);
+ font.dispose();
+ return;
+ }
int width = (bounds.width - bounds.x) / series.length;
int x = bounds.x;
- for (double s[] : series) {
- drawPieChart(e, s, new Rectangle(x, bounds.y, width, bounds.height));
+ for (int i = 0; i < series.length; i++) {
+ double[] s = series[i];
+ drawPieChart(e, i, s, new Rectangle(x, bounds.y, width, bounds.height));
x += width;
}
}
- private void drawPieChart(PaintEvent e, double series[], Rectangle bounds) {
+ private void drawPieChart(PaintEvent e, int chartnum, double series[], Rectangle bounds) {
int nelemSeries = series.length;
double sumTotal = 0;
@@ -84,6 +121,16 @@ public class PieChartPaintListener implements PaintListener {
initialAngle += (-sweepAngle);
}
}
+ if (chartnum < seriesNames.length) {
+ Font font = new Font(Display.getDefault(), "Arial", 15, SWT.BOLD); //$NON-NLS-1$
+ gc.setForeground(BLACK);
+ gc.setBackground(WHITE);
+ gc.setFont(font);
+ String text = seriesNames[chartnum];
+ Point textSize = e.gc.textExtent(text);
+ gc.drawText(text, pieX + (pieWidth - textSize.x) / 2, pieY + pieWidth + textSize.y);
+ font.dispose();
+ }
}
private double[][] getPieSeriesArray() {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartBuilder.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartBuilder.java
index 32b20f2..25ee92a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartBuilder.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartBuilder.java
@@ -169,14 +169,21 @@ public abstract class AbstractChartBuilder extends Composite implements IUpdateL
handleUpdateEvent();
}
- protected double getDoubleValue(Object o) {
+ protected Double getDoubleValue(Object o) {
+ if (o == null) {
+ return null;
+ }
if (o instanceof Integer) {
- return ((Integer)o).intValue();
+ return ((Integer)o).doubleValue();
}
if (o instanceof Double) {
- return ((Double)o).doubleValue();
+ return (Double) o;
+ }
+ try {
+ return new Double(o.toString());
+ } catch (NumberFormatException e) {
+ return null;
}
- return new Double(o.toString()).doubleValue();
}
@Override
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartWithAxisBuilder.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartWithAxisBuilder.java
index f5db729..448a120 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartWithAxisBuilder.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/AbstractChartWithAxisBuilder.java
@@ -95,32 +95,56 @@ public abstract class AbstractChartWithAxisBuilder extends AbstractChartBuilder
return;
int totalMaxItems = (int)Math.round(this.maxItems * scale);
- int start = 0, len = Math.min(totalMaxItems, data.length);
+ int start = 0, len = Math.min(totalMaxItems, data.length), leny = data[0].length-1;
if (totalMaxItems < data.length) {
start = data.length - totalMaxItems;
}
- double[] valx = new double[len];
- double[][] valy = new double[data[0].length-1][len];
+ Double[] all_valx = new Double[len];
+ Double[][] all_valy = new Double[leny][len];
ISeries allSeries[] = chart.getSeriesSet().getSeries();
- for (int i = 0; i < valx.length; i++)
- for (int j = 0; j < data[start + i].length; j++) {
- if (j == 0)
- valx[i] = getDoubleValue(data[start + i][j]);
- else
- valy[j-1][i] = getDoubleValue(data[start + i][j]);
+ for (int i = 0; i < len; i++) {
+ for (int j = 0; j < leny + 1; j++) {
+ Double val = getDoubleValue(data[start + i][j]);
+ if (j == 0) {
+ if (val != null) {
+ all_valx[i] = val;
+ } else {
+ break;
+ }
+ } else if (val != null) {
+ all_valy[j-1][i] = val;
+ }
}
+ }
- for (int i = 0; i < valy.length; i++) {
+ for (int i = 0; i < leny; i++) {
ISeries series;
if (i >= allSeries.length) {
series = createChartISeries(i);
} else {
series = chart.getSeriesSet().getSeries()[i];
}
- series.setXSeries(valx);
- series.setYSeries(valy[i]);
+
+ double[] valx = new double[len];
+ double[] valy = new double[len];
+ int len_trim = 0;
+ for (int j = 0; j < len; j++) {
+ if (all_valx[j] != null && all_valy[i][j] != null) {
+ valx[len_trim] = all_valx[j].doubleValue();
+ valy[len_trim] = all_valy[i][j].doubleValue();
+ len_trim++;
+ }
+ }
+ double[] valx_trim = new double[len_trim];
+ double[] valy_trim = new double[len_trim];
+ for (int j = 0; j < len_trim; j++) {
+ valx_trim[j] = valx[j];
+ valy_trim[j] = valy[j];
+ }
+ series.setXSeries(valx_trim);
+ series.setYSeries(valy_trim);
}
chart.getAxisSet().adjustRange();
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java
index c1e6223..c7a1389 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java
@@ -22,13 +22,18 @@ import org.eclipse.swt.widgets.Composite;
public class PieChartBuilder extends AbstractChartWithoutAxisBuilder {
public static final String ID = "org.eclipse.linuxtools.systemtap.graphingapi.ui.charts.piechartbuilder"; //$NON-NLS-1$
- public PieChartBuilder(Composite parent, int style, String title,IAdapter adapter) {
+ public PieChartBuilder(Composite parent, int style, String title, IAdapter adapter) {
super(adapter, parent, style, title);
}
@Override
protected void createChart() {
- this.chart = new PieChart(this, getStyle());
+ String[] allNames = adapter.getLabels();
+ String[] ySeriesNames = new String[allNames.length - 1];
+ for (int i = 0; i < ySeriesNames.length; i++) {
+ ySeriesNames[i] = allNames[i+1];
+ }
+ this.chart = new PieChart(this, getStyle(), ySeriesNames);
}
@Override
@@ -37,23 +42,54 @@ public class PieChartBuilder extends AbstractChartWithoutAxisBuilder {
if (data == null || data.length == 0 || data[0].length == 0)
return;
- int start = 0, len = Math.min(this.maxItems, data.length);
+ int start = 0, len = Math.min(this.maxItems, data.length), leny = data[0].length-1;
if (this.maxItems < data.length) {
start = data.length - this.maxItems;
}
- double[][] values = new double[len][data[0].length-1];
- String[] labels = new String[len];
+ Double[][] all_values = new Double[len][leny];
+ String[] all_labels = new String[len];
- for (int i = 0; i < labels.length; i++) {
+ for (int i = 0; i < all_labels.length; i++) {
if (data[i].length < 2)
return;
- labels[i] = data[start + i][0].toString();
- for (int j = 1; j < data[start + i].length; j++)
- values[i][j-1] = getDoubleValue(data[start + i][j]);
+ Object label = data[start + i][0];
+ if (label != null) {
+ all_labels[i] = data[start + i][0].toString();
+ for (int j = 1; j < data[start + i].length; j++) {
+ Double val = getDoubleValue(data[start + i][j]);
+ if (val != null) {
+ all_values[i][j-1] = val;
+ } else {
+ all_labels[i] = null;
+ break;
+ }
+ }
+ }
+ }
+
+ double[][] values = new double[len][leny];
+ String[] labels = new String[len];
+ int len_trim = 0;
+ for (int i = 0; i < len; i++) {
+ if (all_labels[i] != null) {
+ labels[len_trim] = all_labels[i];
+ for (int j = 0; j < leny; j++) {
+ values[len_trim][j] = all_values[i][j].doubleValue();
+ }
+ len_trim++;
+ }
+ }
+ double[][] values_trim = new double[len_trim][leny];
+ String[] labels_trim = new String[len_trim];
+ for (int i = 0; i < len_trim; i++) {
+ labels_trim[i] = labels[i];
+ for (int j = 0; j < leny; j++) {
+ values_trim[i][j] = values[i][j];
+ }
}
- ((PieChart)this.chart).addPieChartSeries(labels, values);
+ ((PieChart)this.chart).addPieChartSeries(labels_trim, values_trim);
chart.redraw();
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/datadisplay/DataGrid.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/datadisplay/DataGrid.java
index 2f0ddf4..4aef719 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/datadisplay/DataGrid.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/datadisplay/DataGrid.java
@@ -291,8 +291,12 @@ public class DataGrid implements IUpdateListener {
os = filteredDataSet.getRow(i);
item.setText(0, "" + i); //$NON-NLS-1$
- for(j=0; j<os.length; j++)
- item.setText(j+1, columnFormat[j].format(os[j].toString()));
+ for(j=0; j<os.length; j++) {
+ //Ignore null items
+ if (os[j] != null) {
+ item.setText(j+1, columnFormat[j].format(os[j].toString()));
+ }
+ }
}
if(FULL_UPDATE != (style & FULL_UPDATE)) {