Added address column to instruction editor
[Mograsim.git] / net.mograsim.plugin.core / src / net / mograsim / plugin / tables / AddressLabelProvider.java
diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/AddressLabelProvider.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/AddressLabelProvider.java
new file mode 100644 (file)
index 0000000..c94e440
--- /dev/null
@@ -0,0 +1,19 @@
+package net.mograsim.plugin.tables;
+
+import java.math.BigInteger;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+
+import net.mograsim.plugin.asm.AsmNumberUtil;
+import net.mograsim.plugin.asm.AsmNumberUtil.NumberType;
+
+public class AddressLabelProvider extends ColumnLabelProvider
+{
+       @Override
+       public String getText(Object element)
+       {
+               @SuppressWarnings("rawtypes")
+               TableRow row = (TableRow) element;
+               return AsmNumberUtil.toString(BigInteger.valueOf(row.address), NumberType.HEXADECIMAL);
+       }
+}