From 535fdb21372b0d55ada7331177e0dd72997920d2 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Thu, 14 Jan 2021 13:19:46 +0100 Subject: [PATCH] MPROMEditor now calls its columns "Opcode" and "muPC" --- .../mograsim/plugin/editors/AbstractMemoryEditor.java | 11 ++++++++--- .../src/net/mograsim/plugin/editors/MPROMEditor.java | 5 +++++ .../net/mograsim/plugin/editors/MainMemoryEditor.java | 5 +++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/AbstractMemoryEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/AbstractMemoryEditor.java index e306cff6..03915112 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/AbstractMemoryEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/AbstractMemoryEditor.java @@ -59,6 +59,8 @@ public abstract class AbstractMemoryEditor extends EditorPart private LazyTableViewer viewer; private MemoryTableContentProvider provider; private DisplaySettings displaySettings; + private final String addrColName; + private final String dataColName; private Collection fontDependent = new HashSet<>(); @@ -69,8 +71,11 @@ public abstract class AbstractMemoryEditor extends EditorPart private final static String font = "net.mograsim.plugin.memory.table_font"; private IPropertyChangeListener fontChangeListener; - public AbstractMemoryEditor() + public AbstractMemoryEditor(String addrColName, String dataColName) { + this.addrColName = addrColName; + this.dataColName = dataColName; + memListener = this::cellModified; } @@ -197,10 +202,10 @@ public abstract class AbstractMemoryEditor extends EditorPart private void createColumns() { - TableViewerColumn addrCol = createTableViewerColumn("Address", 100); + TableViewerColumn addrCol = createTableViewerColumn(addrColName, 100); addrCol.setLabelProvider(new AddressLabelProvider()); - TableViewerColumn dataCol = createTableViewerColumn("Data", 100); + TableViewerColumn dataCol = createTableViewerColumn(dataColName, 100); dataCol.setLabelProvider(new NumberColumnLabelProvider(displaySettings) { @Override diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MPROMEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MPROMEditor.java index 9c6ce817..c64bd389 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MPROMEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MPROMEditor.java @@ -6,6 +6,11 @@ import net.mograsim.machine.mi.StandardMPROM; public class MPROMEditor extends AbstractMemoryEditor { + public MPROMEditor() + { + super("Opcode", "\u00b5PC"); // 00b5 = mu / micro symbol + } + @Override protected BitVectorMemory createEmptyMemory(MachineDefinition activeMachineDefinition) { diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MainMemoryEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MainMemoryEditor.java index 6d0d7b52..318ee9d7 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MainMemoryEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MainMemoryEditor.java @@ -6,6 +6,11 @@ import net.mograsim.machine.StandardMainMemory; public class MainMemoryEditor extends AbstractMemoryEditor { + public MainMemoryEditor() + { + super("Address", "Data"); + } + @Override protected BitVectorMemory createEmptyMemory(MachineDefinition activeMachineDefinition) { -- 2.17.1