mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-10 08:47:47 +08:00
Merge remote-tracking branch 'origin/GP-6480_James_correct_addressrangetable_refresh_v2' into patch
This commit is contained in:
+10
-11
@@ -20,6 +20,7 @@ import java.util.stream.StreamSupport;
|
||||
import docking.widgets.table.AbstractDynamicTableColumn;
|
||||
import docking.widgets.table.TableColumnDescriptor;
|
||||
import ghidra.docking.settings.Settings;
|
||||
import ghidra.framework.options.ToolOptions;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.ServiceProvider;
|
||||
import ghidra.program.model.address.*;
|
||||
@@ -43,20 +44,23 @@ public class AddressRangeTableModel extends GhidraProgramTableModel<AddressRange
|
||||
private static final int MAX_ADDRESS_COLUMN_INDEX = 1;
|
||||
|
||||
private ProgramSelection selection;
|
||||
private int resultsLimit;
|
||||
private long minLength;
|
||||
private PluginTool tool;
|
||||
|
||||
protected AddressRangeTableModel(PluginTool tool, Program program, ProgramSelection selection,
|
||||
int resultsLimit, long minLength) {
|
||||
protected AddressRangeTableModel(PluginTool tool, Program program, ProgramSelection selection) {
|
||||
super("Selected Ranges in " + program.getName(), tool, program, null);
|
||||
this.selection = selection;
|
||||
this.resultsLimit = resultsLimit;
|
||||
this.minLength = minLength;
|
||||
this.tool = tool;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doLoad(Accumulator<AddressRangeInfo> accumulator, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
ToolOptions options = tool.getOptions(CodeBrowserSelectionPlugin.OPTION_CATEGORY_NAME);
|
||||
int resultsLimit = options.getInt(CodeBrowserSelectionPlugin.RANGES_LIMIT_OPTION_NAME,
|
||||
CodeBrowserSelectionPlugin.RANGES_LIMIT_DEFAULT);
|
||||
long minLength = options.getLong(CodeBrowserSelectionPlugin.MIN_RANGE_SIZE_OPTION_NAME,
|
||||
CodeBrowserSelectionPlugin.MIN_RANGE_SIZE_DEFAULT);
|
||||
|
||||
AddressRangeIterator rangeIter = selection.getAddressRanges();
|
||||
ReferenceManager refManager = program.getReferenceManager();
|
||||
while (rangeIter.hasNext()) {
|
||||
@@ -103,11 +107,6 @@ public class AddressRangeTableModel extends GhidraProgramTableModel<AddressRange
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableColumnDescriptor<AddressRangeInfo> createTableColumnDescriptor() {
|
||||
TableColumnDescriptor<AddressRangeInfo> descriptor = new TableColumnDescriptor<>();
|
||||
|
||||
+2
-5
@@ -151,11 +151,8 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
||||
tool.setStatusInfo("Unable to create selected ranges table: no addresses in selection");
|
||||
return;
|
||||
}
|
||||
ToolOptions options = tool.getOptions(OPTION_CATEGORY_NAME);
|
||||
int resultsLimit = options.getInt(RANGES_LIMIT_OPTION_NAME, RANGES_LIMIT_DEFAULT);
|
||||
long minLength = options.getLong(MIN_RANGE_SIZE_OPTION_NAME, MIN_RANGE_SIZE_DEFAULT);
|
||||
AddressRangeTableModel model =
|
||||
new AddressRangeTableModel(tool, program, selection, resultsLimit, minLength);
|
||||
|
||||
AddressRangeTableModel model = new AddressRangeTableModel(tool, program, selection);
|
||||
Icon markerIcon = new GIcon("icon.plugin.codebrowser.cursor.marker");
|
||||
String title = "Selected Ranges in " + program.getName();
|
||||
TableComponentProvider<AddressRangeInfo> tableProvider =
|
||||
|
||||
Reference in New Issue
Block a user