From fd1283a93a477d9dea769aa19d9791fcb0fa38ee Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Sun, 15 Sep 2019 15:52:29 +0200 Subject: [PATCH] Fixed InstructionView containing every column twice --- .../mograsim/plugin/tables/mi/InstructionView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java index b9627aad..3af070f3 100644 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java +++ b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java @@ -126,18 +126,19 @@ public class InstructionView extends ViewPart implements ContextObserver private void deleteColumns() { for (TableViewerColumn col : columns) - if (col != null) - col.getColumn().dispose(); + col.getColumn().dispose(); } private void createColumns() { + int size = miDef.size(); + columns = new TableViewerColumn[size + 1]; + TableViewerColumn col = createTableViewerColumn("Address", 200); + columns[0] = col; col.setLabelProvider(new AddressLabelProvider()); - int size = miDef.size(); int bit = 0; - columns = new TableViewerColumn[size]; ParameterClassification[] classes = miDef.getParameterClassifications(); for (int i = 0; i < size; i++) @@ -147,7 +148,9 @@ public class InstructionView extends ViewPart implements ContextObserver String name = startBit == endBit ? Integer.toString(startBit) : startBit + "..." + endBit; int bounds = 20 + 20 * classes[i].getExpectedBits(); - createEditingAndLabel(createTableViewerColumn(name, bounds), miDef, i); + col = createTableViewerColumn(name, bounds); + columns[i + 1] = col; + createEditingAndLabel(col, miDef, i); } } -- 2.17.1