Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-6386: Reg value editor should used fixed-width.

Dan9633a6132c9c
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
index cd93156f71..cc54e35d71 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
@@ -142,8 +142,8 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
protected static final RegisterValueCellRenderer VALUE_RENDERER =
new RegisterValueCellRenderer();
- protected static final HexBigIntegerTableCellEditor VALUE_EDITOR =
- new HexBigIntegerTableCellEditor();
+ protected static final RegisterValueCellEditor VALUE_EDITOR =
+ new RegisterValueCellEditor();
protected static final SettingsDefinition[] VALUE_DEFS =
new SettingsDefinition[] { FormatSettingsDefinition.DEF_HEX, };
protected static final RegisterDataTypeEditor TYPE_EDITOR = new RegisterDataTypeEditor();
@@ -465,6 +465,17 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
}
}
+ static class RegisterValueCellEditor extends HexBigIntegerTableCellEditor {
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
+ int row, int column) {
+ super.getTableCellEditorComponent(table, value, isSelected, row, column);
+ JComponent component = input.getComponent();
+ component.setFont(VALUE_RENDERER.getFixedWidthFont());
+ return component;
+ }
+ }
+
static class RegisterDataTypeEditor extends AbstractDataTypeTableCellEditor {
@Override
protected AllowedDataTypes getAllowed(int row, int column) {
diff --git a/Ghidra/Debug/ProposedUtils/src/main/java/docking/widgets/table/HexBigIntegerTableCellEditor.java b/Ghidra/Debug/ProposedUtils/src/main/java/docking/widgets/table/HexBigIntegerTableCellEditor.java
index e8b5ce3b1f..1abfa51bf9 100644
--- a/Ghidra/Debug/ProposedUtils/src/main/java/docking/widgets/table/HexBigIntegerTableCellEditor.java
+++ b/Ghidra/Debug/ProposedUtils/src/main/java/docking/widgets/table/HexBigIntegerTableCellEditor.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import javax.swing.table.TableCellEditor;
import docking.widgets.textfield.IntegerTextField;
public class HexBigIntegerTableCellEditor extends AbstractCellEditor implements TableCellEditor {
- private IntegerTextField input;
+ protected IntegerTextField input;
@Override
public BigInteger getCellEditorValue() {