mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/GP-4275_naming_components_for_accessibility--SQUASHED'
This commit is contained in:
commit
c8c4c43794
62 changed files with 565 additions and 202 deletions
|
@ -954,6 +954,10 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
|
||||||
breakpointPanel.add(breakpointFilterPanel, BorderLayout.SOUTH);
|
breakpointPanel.add(breakpointFilterPanel, BorderLayout.SOUTH);
|
||||||
mainPanel.setLeftComponent(breakpointPanel);
|
mainPanel.setLeftComponent(breakpointPanel);
|
||||||
|
|
||||||
|
String namePrefix = "Breakpoints";
|
||||||
|
breakpointTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
breakpointFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
JPanel locationPanel = new JPanel(new BorderLayout());
|
JPanel locationPanel = new JPanel(new BorderLayout());
|
||||||
locationTable = new GhidraTable(locationTableModel);
|
locationTable = new GhidraTable(locationTableModel);
|
||||||
locationTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
locationTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
@ -962,9 +966,12 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
|
||||||
locationFilterPanel.setSecondaryFilter(filterLocationsBySelectedBreakpoints);
|
locationFilterPanel.setSecondaryFilter(filterLocationsBySelectedBreakpoints);
|
||||||
locationPanel.add(locationFilterPanel, BorderLayout.SOUTH);
|
locationPanel.add(locationFilterPanel, BorderLayout.SOUTH);
|
||||||
mainPanel.setRightComponent(locationPanel);
|
mainPanel.setRightComponent(locationPanel);
|
||||||
|
|
||||||
mainPanel.setResizeWeight(0.5);
|
mainPanel.setResizeWeight(0.5);
|
||||||
|
|
||||||
|
String locationsNamePrefix = "Breakpoint Locations";
|
||||||
|
locationTable.setAccessibleNamePrefix(locationsNamePrefix);
|
||||||
|
locationFilterPanel.setAccessibleNamePrefix(locationsNamePrefix);
|
||||||
|
|
||||||
breakpointTable.getSelectionModel().addListSelectionListener(evt -> {
|
breakpointTable.getSelectionModel().addListSelectionListener(evt -> {
|
||||||
List<LogicalBreakpointRow> sel = breakpointFilterPanel.getSelectedItems();
|
List<LogicalBreakpointRow> sel = breakpointFilterPanel.getSelectedItems();
|
||||||
// Do this first to prevent overriding context in event chain
|
// Do this first to prevent overriding context in event chain
|
||||||
|
@ -1096,6 +1103,7 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
locColModel.setVisible(locThreadsCol, false);
|
locColModel.setVisible(locThreadsCol, false);
|
||||||
locColModel.setVisible(locSleighCol, false);
|
locColModel.setVisible(locSleighCol, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void navigateToSelectedBreakpoint() {
|
protected void navigateToSelectedBreakpoint() {
|
||||||
|
|
|
@ -400,9 +400,9 @@ public class DebuggerConsoleProvider extends ComponentProviderAdapter
|
||||||
private final AutoService.Wiring autoServiceWiring;
|
private final AutoService.Wiring autoServiceWiring;
|
||||||
|
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(
|
||||||
name = DebuggerResources.OPTION_NAME_LOG_BUFFER_LIMIT,
|
name = DebuggerResources.OPTION_NAME_LOG_BUFFER_LIMIT,
|
||||||
description = "The maximum number of entries in the console log (0 or less for unlimited)",
|
description = "The maximum number of entries in the console log (0 or less for unlimited)",
|
||||||
help = @HelpInfo(anchor = "buffer_limit"))
|
help = @HelpInfo(anchor = "buffer_limit"))
|
||||||
private int logBufferLimit = DebuggerResources.DEFAULT_LOG_BUFFER_LIMIT;
|
private int logBufferLimit = DebuggerResources.DEFAULT_LOG_BUFFER_LIMIT;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final AutoOptions.Wiring autoOptionsWiring;
|
private final AutoOptions.Wiring autoOptionsWiring;
|
||||||
|
@ -457,6 +457,10 @@ public class DebuggerConsoleProvider extends ComponentProviderAdapter
|
||||||
logFilterPanel = new GhidraTableFilterPanel<>(logTable, logTableModel);
|
logFilterPanel = new GhidraTableFilterPanel<>(logTable, logTableModel);
|
||||||
mainPanel.add(logFilterPanel, BorderLayout.NORTH);
|
mainPanel.add(logFilterPanel, BorderLayout.NORTH);
|
||||||
|
|
||||||
|
String namePrefix = "Debug Console";
|
||||||
|
logTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
logFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
logTable.addMouseListener(new MouseAdapter() {
|
logTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
|
@ -505,9 +509,8 @@ public class DebuggerConsoleProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createActions() {
|
protected void createActions() {
|
||||||
actionClear = ClearAction.builder(plugin)
|
actionClear =
|
||||||
.onAction(this::activatedClear)
|
ClearAction.builder(plugin).onAction(this::activatedClear).buildAndInstallLocal(this);
|
||||||
.buildAndInstallLocal(this);
|
|
||||||
actionSelectNone = SelectNoneAction.builder(plugin)
|
actionSelectNone = SelectNoneAction.builder(plugin)
|
||||||
.popupWhen(ctx -> ctx.getSourceComponent() == logTable)
|
.popupWhen(ctx -> ctx.getSourceComponent() == logTable)
|
||||||
.onAction(this::activatedSelectNone)
|
.onAction(this::activatedSelectNone)
|
||||||
|
@ -665,16 +668,14 @@ public class DebuggerConsoleProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ActionList computeToolbarActions(ActionContext context) {
|
protected ActionList computeToolbarActions(ActionContext context) {
|
||||||
return streamActions(context)
|
return streamActions(context).filter(a -> a.getToolBarData() != null)
|
||||||
.filter(a -> a.getToolBarData() != null)
|
|
||||||
.map(a -> new BoundAction(a, context))
|
.map(a -> new BoundAction(a, context))
|
||||||
.collect(Collectors.toCollection(ActionList::new));
|
.collect(Collectors.toCollection(ActionList::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DockingActionIf> getPopupActions(Tool tool, ActionContext context) {
|
public List<DockingActionIf> getPopupActions(Tool tool, ActionContext context) {
|
||||||
return streamActions(context)
|
return streamActions(context).filter(a -> a.isAddToPopup(context))
|
||||||
.filter(a -> a.isAddToPopup(context))
|
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,12 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
addMouseListener(this);
|
addMouseListener(this);
|
||||||
addMouseMotionListener(this);
|
addMouseMotionListener(this);
|
||||||
ToolTipManager.sharedInstance().registerComponent(this);
|
ToolTipManager.sharedInstance().registerComponent(this);
|
||||||
|
|
||||||
|
// This panel takes focus since it is a custom widget. Focusable components need to
|
||||||
|
// have their accessible name set.
|
||||||
|
String viewName = "Memory View";
|
||||||
|
setName(viewName);
|
||||||
|
getAccessibleContext().setAccessibleName(viewName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,6 +59,10 @@ public class MemviewTable {
|
||||||
component.add(filterPanel, BorderLayout.SOUTH);
|
component.add(filterPanel, BorderLayout.SOUTH);
|
||||||
table.setAutoscrolls(true);
|
table.setAutoscrolls(true);
|
||||||
|
|
||||||
|
String namePrefix = "Memory View";
|
||||||
|
table.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
table.getSelectionModel().addListSelectionListener(e -> {
|
table.getSelectionModel().addListSelectionListener(e -> {
|
||||||
if (e.getValueIsAdjusting()) {
|
if (e.getValueIsAdjusting()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -215,13 +215,16 @@ public class DebuggerStaticMappingProvider extends ComponentProviderAdapter
|
||||||
mainPanel.add(new JScrollPane(mappingTable));
|
mainPanel.add(new JScrollPane(mappingTable));
|
||||||
mappingFilterPanel = new GhidraTableFilterPanel<>(mappingTable, mappingTableModel);
|
mappingFilterPanel = new GhidraTableFilterPanel<>(mappingTable, mappingTableModel);
|
||||||
mainPanel.add(mappingFilterPanel, BorderLayout.SOUTH);
|
mainPanel.add(mappingFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
mappingTable.getSelectionModel().addListSelectionListener(evt -> {
|
mappingTable.getSelectionModel().addListSelectionListener(evt -> {
|
||||||
myActionContext = new DebuggerStaticMappingActionContext(this,
|
myActionContext = new DebuggerStaticMappingActionContext(this,
|
||||||
mappingFilterPanel.getSelectedItems(), mappingTable);
|
mappingFilterPanel.getSelectedItems(), mappingTable);
|
||||||
contextChanged();
|
contextChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
String namePrefix = "Static Mappings";
|
||||||
|
mappingTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
mappingFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
TableColumnModel columnModel = mappingTable.getColumnModel();
|
TableColumnModel columnModel = mappingTable.getColumnModel();
|
||||||
TableColumn dynAddrCol =
|
TableColumn dynAddrCol =
|
||||||
columnModel.getColumn(StaticMappingTableColumns.DYNAMIC_ADDRESS.ordinal());
|
columnModel.getColumn(StaticMappingTableColumns.DYNAMIC_ADDRESS.ordinal());
|
||||||
|
|
|
@ -135,8 +135,8 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
private final AutoService.Wiring autoServiceWiring;
|
private final AutoService.Wiring autoServiceWiring;
|
||||||
|
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(
|
||||||
name = "Default Extended Step",
|
name = "Default Extended Step",
|
||||||
description = "The default string for the extended step command")
|
description = "The default string for the extended step command")
|
||||||
String extendedStep = "";
|
String extendedStep = "";
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -1333,8 +1333,8 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected <T extends TargetObject> void performAction(ActionContext context,
|
protected <T extends TargetObject> void performAction(ActionContext context,
|
||||||
boolean fallbackRoot, Class<T> cls,
|
boolean fallbackRoot, Class<T> cls, Function<T, CompletableFuture<Void>> func,
|
||||||
Function<T, CompletableFuture<Void>> func, String errorMsg) {
|
String errorMsg) {
|
||||||
TargetObject obj = getObjectFromContext(context);
|
TargetObject obj = getObjectFromContext(context);
|
||||||
if (obj == null && fallbackRoot) {
|
if (obj == null && fallbackRoot) {
|
||||||
obj = root.getTargetObject();
|
obj = root.getTargetObject();
|
||||||
|
@ -1485,8 +1485,8 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
ProgramLocation currentLocation = listingService.getCurrentLocation();
|
ProgramLocation currentLocation = listingService.getCurrentLocation();
|
||||||
ProgramSelection currentSelection = listingService.getCurrentSelection();
|
ProgramSelection currentSelection = listingService.getCurrentSelection();
|
||||||
|
|
||||||
GhidraState state = new GhidraState(tool, project, currentProgram,
|
GhidraState state =
|
||||||
currentLocation, currentSelection, null);
|
new GhidraState(tool, project, currentProgram, currentLocation, currentSelection, null);
|
||||||
|
|
||||||
PrintWriter writer = consoleService.getStdOut();
|
PrintWriter writer = consoleService.getStdOut();
|
||||||
TaskMonitor monitor = TaskMonitor.DUMMY;
|
TaskMonitor monitor = TaskMonitor.DUMMY;
|
||||||
|
|
|
@ -570,6 +570,10 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||||
regsFilterPanel = new GhidraTableFilterPanel<>(regsTable, regsTableModel);
|
regsFilterPanel = new GhidraTableFilterPanel<>(regsTable, regsTableModel);
|
||||||
mainPanel.add(regsFilterPanel, BorderLayout.SOUTH);
|
mainPanel.add(regsFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Registers";
|
||||||
|
regsTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
regsFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
regsTable.getSelectionModel().addListSelectionListener(evt -> {
|
regsTable.getSelectionModel().addListSelectionListener(evt -> {
|
||||||
if (evt.getValueIsAdjusting()) {
|
if (evt.getValueIsAdjusting()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.debug.gui.target;
|
package ghidra.app.plugin.core.debug.gui.target;
|
||||||
|
|
||||||
import static ghidra.app.plugin.core.debug.gui.DebuggerResources.showError;
|
import static ghidra.app.plugin.core.debug.gui.DebuggerResources.*;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
|
@ -250,6 +250,8 @@ public class DebuggerTargetsProvider extends ComponentProviderAdapter {
|
||||||
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
||||||
mainPanel.add(tree);
|
mainPanel.add(tree);
|
||||||
|
|
||||||
|
tree.setAccessibleNamePrefix("Debugger Targets");
|
||||||
|
|
||||||
// NB: for both of these, setContext should precede emitEvents
|
// NB: for both of these, setContext should precede emitEvents
|
||||||
tree.getGTSelectionModel().addGTreeSelectionListener(evt -> {
|
tree.getGTSelectionModel().addGTreeSelectionListener(evt -> {
|
||||||
setContext();
|
setContext();
|
||||||
|
|
|
@ -407,6 +407,10 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
|
||||||
watchFilterPanel = new GhidraTableFilterPanel<>(watchTable, watchTableModel);
|
watchFilterPanel = new GhidraTableFilterPanel<>(watchTable, watchTableModel);
|
||||||
mainPanel.add(watchFilterPanel, BorderLayout.SOUTH);
|
mainPanel.add(watchFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Watches";
|
||||||
|
watchTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
watchFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
watchTable.getSelectionModel().addListSelectionListener(evt -> {
|
watchTable.getSelectionModel().addListSelectionListener(evt -> {
|
||||||
if (evt.getValueIsAdjusting()) {
|
if (evt.getValueIsAdjusting()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -67,11 +67,12 @@ public class BookmarkProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
bookmarkTable = threadedTablePanel.getTable();
|
bookmarkTable = threadedTablePanel.getTable();
|
||||||
bookmarkTable.setAutoLookupColumn(BookmarkTableModel.CATEGORY_COL);
|
bookmarkTable.setAutoLookupColumn(BookmarkTableModel.CATEGORY_COL);
|
||||||
|
|
||||||
panel = new JPanel(new BorderLayout());
|
panel = new JPanel(new BorderLayout());
|
||||||
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
panel.add(createFilterFieldPanel(), BorderLayout.SOUTH);
|
panel.add(createFilterFieldPanel(), BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
bookmarkTable.setAccessibleNamePrefix("Bookmarks");
|
||||||
|
|
||||||
adjustTableColumns();
|
adjustTableColumns();
|
||||||
|
|
||||||
listener = e -> {
|
listener = e -> {
|
||||||
|
@ -117,6 +118,8 @@ public class BookmarkProvider extends ComponentProviderAdapter {
|
||||||
tableFilterPanel.setToolTipText(
|
tableFilterPanel.setToolTipText(
|
||||||
"Include bookmarks with Categories or Descriptions containing this text.");
|
"Include bookmarks with Categories or Descriptions containing this text.");
|
||||||
|
|
||||||
|
tableFilterPanel.setAccessibleNamePrefix("Bookmarks");
|
||||||
|
|
||||||
return tableFilterPanel;
|
return tableFilterPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -781,9 +781,9 @@ public class CallTreeProvider extends ComponentProviderAdapter {
|
||||||
GTreeSelectionListener contextSelectionListener = e -> notifyContextChanged();
|
GTreeSelectionListener contextSelectionListener = e -> notifyContextChanged();
|
||||||
incomingTree.addGTreeSelectionListener(contextSelectionListener);
|
incomingTree.addGTreeSelectionListener(contextSelectionListener);
|
||||||
outgoingTree.addGTreeSelectionListener(contextSelectionListener);
|
outgoingTree.addGTreeSelectionListener(contextSelectionListener);
|
||||||
|
|
||||||
splitPane.setLeftComponent(createTreePanel(true, incomingTree));
|
splitPane.setLeftComponent(createTreePanel(true, incomingTree));
|
||||||
splitPane.setRightComponent(createTreePanel(false, outgoingTree));
|
splitPane.setRightComponent(createTreePanel(false, outgoingTree));
|
||||||
|
|
||||||
splitPane.addHierarchyListener(new HierarchyListener() {
|
splitPane.addHierarchyListener(new HierarchyListener() {
|
||||||
@Override
|
@Override
|
||||||
public void hierarchyChanged(HierarchyEvent e) {
|
public void hierarchyChanged(HierarchyEvent e) {
|
||||||
|
@ -802,6 +802,9 @@ public class CallTreeProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
container.add(splitPane, BorderLayout.CENTER);
|
container.add(splitPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
incomingTree.setAccessibleNamePrefix("Incoming Function Calls");
|
||||||
|
outgoingTree.setAccessibleNamePrefix("Outgoing Function Calls");
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,8 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
model = new ChecksumTableModel(tool, checksums);
|
model = new ChecksumTableModel(tool, checksums);
|
||||||
table = new GhidraTable(model);
|
table = new GhidraTable(model);
|
||||||
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
|
||||||
|
table.setAccessibleNamePrefix("Checksum Generator");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFields() {
|
private void updateFields() {
|
||||||
|
|
|
@ -104,7 +104,7 @@ class CommentWindowProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
threadedTablePanel = new GhidraThreadedTablePanel<>(commentModel, 1000);
|
threadedTablePanel = new GhidraThreadedTablePanel<>(commentModel, 1000);
|
||||||
commentTable = threadedTablePanel.getTable();
|
commentTable = threadedTablePanel.getTable();
|
||||||
commentTable.setName("CommentTable");
|
commentTable.getAccessibleContext().setAccessibleName("Comment Table");
|
||||||
commentTable.setAutoLookupColumn(CommentTableModel.TYPE_COL);
|
commentTable.setAutoLookupColumn(CommentTableModel.TYPE_COL);
|
||||||
commentTable.setPreferredScrollableViewportSize(new Dimension(600, 400));
|
commentTable.setPreferredScrollableViewportSize(new Dimension(600, 400));
|
||||||
commentTable.setRowSelectionAllowed(true);
|
commentTable.setRowSelectionAllowed(true);
|
||||||
|
@ -137,6 +137,10 @@ class CommentWindowProvider extends ComponentProviderAdapter {
|
||||||
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
panel.add(filterPanel, BorderLayout.SOUTH);
|
panel.add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Comments";
|
||||||
|
commentTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,7 @@ import ghidra.program.model.symbol.SymbolTable;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
|
|
||||||
public class ConsoleComponentProvider extends ComponentProviderAdapter
|
public class ConsoleComponentProvider extends ComponentProviderAdapter implements ConsoleService {
|
||||||
implements ConsoleService {
|
|
||||||
|
|
||||||
private static final String OLD_NAME = "ConsolePlugin";
|
private static final String OLD_NAME = "ConsolePlugin";
|
||||||
private static final String NAME = "Console";
|
private static final String NAME = "Console";
|
||||||
|
@ -111,9 +110,13 @@ public class ConsoleComponentProvider extends ComponentProviderAdapter
|
||||||
private void build() {
|
private void build() {
|
||||||
|
|
||||||
textPane = new ConsoleTextPane(tool);
|
textPane = new ConsoleTextPane(tool);
|
||||||
textPane.setName("CONSOLE");
|
|
||||||
Gui.registerFont(textPane, DEFAULT_FONT_ID);
|
Gui.registerFont(textPane, DEFAULT_FONT_ID);
|
||||||
textPane.setEditable(false);
|
textPane.setEditable(false);
|
||||||
|
|
||||||
|
String textPaneName = "Console Text Pane";
|
||||||
|
textPane.setName(textPaneName);
|
||||||
|
textPane.getAccessibleContext().setAccessibleName(textPaneName);
|
||||||
|
|
||||||
textPane.addMouseMotionListener(new MouseMotionAdapter() {
|
textPane.addMouseMotionListener(new MouseMotionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseMoved(MouseEvent e) {
|
public void mouseMoved(MouseEvent e) {
|
||||||
|
@ -277,9 +280,8 @@ public class ConsoleComponentProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
scrollAction.setDescription("Scroll Lock");
|
scrollAction.setDescription("Scroll Lock");
|
||||||
scrollAction
|
scrollAction.setToolBarData(
|
||||||
.setToolBarData(
|
new ToolBarData(new GIcon("icon.plugin.console.scroll.lock"), null));
|
||||||
new ToolBarData(new GIcon("icon.plugin.console.scroll.lock"), null));
|
|
||||||
|
|
||||||
scrollAction.setEnabled(true);
|
scrollAction.setEnabled(true);
|
||||||
scrollAction.setSelected(scrollLock);
|
scrollAction.setSelected(scrollLock);
|
||||||
|
|
|
@ -74,6 +74,8 @@ public class DataTypeArchiveGTree extends GTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
addTreeExpansionListener(cleanupListener);
|
addTreeExpansionListener(cleanupListener);
|
||||||
|
|
||||||
|
setAccessibleNamePrefix("Data Type Manager");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getHeight(GTreeNode rootNode, DataTypeTreeRenderer renderer) {
|
private int getHeight(GTreeNode rootNode, DataTypeTreeRenderer renderer) {
|
||||||
|
|
|
@ -117,8 +117,9 @@ public class DataTypePreviewPlugin extends ProgramPlugin {
|
||||||
|
|
||||||
provider = new DTPPComponentProvider();
|
provider = new DTPPComponentProvider();
|
||||||
tool.addComponentProvider(provider, false);
|
tool.addComponentProvider(provider, false);
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
|
|
||||||
|
table.setAccessibleNamePrefix("Data Type Preview");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -109,7 +109,6 @@ class DataWindowProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
threadedTablePanel = new GhidraThreadedTablePanel<>(dataModel, 1000);
|
threadedTablePanel = new GhidraThreadedTablePanel<>(dataModel, 1000);
|
||||||
dataTable = threadedTablePanel.getTable();
|
dataTable = threadedTablePanel.getTable();
|
||||||
dataTable.setName("DataTable");
|
|
||||||
dataTable.setAutoLookupColumn(DataTableModel.DATA_COL);
|
dataTable.setAutoLookupColumn(DataTableModel.DATA_COL);
|
||||||
dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
||||||
dataTable.setPreferredScrollableViewportSize(new Dimension(350, 150));
|
dataTable.setPreferredScrollableViewportSize(new Dimension(350, 150));
|
||||||
|
@ -138,12 +137,15 @@ class DataWindowProvider extends ComponentProviderAdapter {
|
||||||
setDataTableRenderer();
|
setDataTableRenderer();
|
||||||
|
|
||||||
filterPanel = new GhidraTableFilterPanel<>(dataTable, dataModel);
|
filterPanel = new GhidraTableFilterPanel<>(dataTable, dataModel);
|
||||||
dataTable.getModel();
|
|
||||||
|
|
||||||
JPanel panel = new JPanel(new BorderLayout());
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
panel.add(filterPanel, BorderLayout.SOUTH);
|
panel.add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Defined Data";
|
||||||
|
dataTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,12 +160,10 @@ class DataWindowProvider extends ComponentProviderAdapter {
|
||||||
private void setDataTableRenderer() {
|
private void setDataTableRenderer() {
|
||||||
dataTable.getColumnModel()
|
dataTable.getColumnModel()
|
||||||
.getColumn(DataTableModel.LOCATION_COL)
|
.getColumn(DataTableModel.LOCATION_COL)
|
||||||
.setPreferredWidth(
|
.setPreferredWidth(DataTableModel.ADDRESS_COL_WIDTH);
|
||||||
DataTableModel.ADDRESS_COL_WIDTH);
|
|
||||||
dataTable.getColumnModel()
|
dataTable.getColumnModel()
|
||||||
.getColumn(DataTableModel.SIZE_COL)
|
.getColumn(DataTableModel.SIZE_COL)
|
||||||
.setPreferredWidth(
|
.setPreferredWidth(DataTableModel.SIZE_COL_WIDTH);
|
||||||
DataTableModel.SIZE_COL_WIDTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void reload() {
|
void reload() {
|
||||||
|
|
|
@ -385,6 +385,10 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec
|
||||||
|
|
||||||
initializeDisplay();
|
initializeDisplay();
|
||||||
|
|
||||||
|
String viewName = "Disassembled View";
|
||||||
|
contentList.setName(viewName);
|
||||||
|
contentList.getAccessibleContext().setAccessibleName(viewName);
|
||||||
|
|
||||||
// we need to do some custom rendering
|
// we need to do some custom rendering
|
||||||
contentList.setCellRenderer(new GListCellRenderer<DisassembledAddressInfo>() {
|
contentList.setCellRenderer(new GListCellRenderer<DisassembledAddressInfo>() {
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,6 @@ public class EquateTableProvider extends ComponentProviderAdapter {
|
||||||
equatesModel = new EquateTableModel(plugin);
|
equatesModel = new EquateTableModel(plugin);
|
||||||
|
|
||||||
equatesTable = new GhidraTable(equatesModel);
|
equatesTable = new GhidraTable(equatesModel);
|
||||||
|
|
||||||
equatesTable.addKeyListener(new KeyAdapter() {
|
equatesTable.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e) {
|
public void keyPressed(KeyEvent e) {
|
||||||
|
@ -171,7 +170,6 @@ public class EquateTableProvider extends ComponentProviderAdapter {
|
||||||
equatesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
equatesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
|
||||||
equatesFilterPanel = new GhidraTableFilterPanel<>(equatesTable, equatesModel);
|
equatesFilterPanel = new GhidraTableFilterPanel<>(equatesTable, equatesModel);
|
||||||
|
|
||||||
JScrollPane equatesTablePane = new JScrollPane(equatesTable);
|
JScrollPane equatesTablePane = new JScrollPane(equatesTable);
|
||||||
|
|
||||||
JPanel equatesPanel = new JPanel(new BorderLayout());
|
JPanel equatesPanel = new JPanel(new BorderLayout());
|
||||||
|
@ -181,6 +179,10 @@ public class EquateTableProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
referencesModel = new EquateReferenceTableModel(plugin);
|
referencesModel = new EquateReferenceTableModel(plugin);
|
||||||
|
|
||||||
|
String namePrefix = "Equates";
|
||||||
|
equatesTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
equatesFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
referencesTable = new GhidraTable(referencesModel);
|
referencesTable = new GhidraTable(referencesModel);
|
||||||
referencesTable.installNavigation(tool);
|
referencesTable.installNavigation(tool);
|
||||||
referencesTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
referencesTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||||
|
@ -188,6 +190,8 @@ public class EquateTableProvider extends ComponentProviderAdapter {
|
||||||
referencesTable.setRowSelectionAllowed(true);
|
referencesTable.setRowSelectionAllowed(true);
|
||||||
referencesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
referencesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
|
||||||
|
referencesTable.setAccessibleNamePrefix("Equates References");
|
||||||
|
|
||||||
JScrollPane referencesTablePane = new JScrollPane(referencesTable);
|
JScrollPane referencesTablePane = new JScrollPane(referencesTable);
|
||||||
|
|
||||||
JTableHeader referencesHeader = referencesTable.getTableHeader();
|
JTableHeader referencesHeader = referencesTable.getTableHeader();
|
||||||
|
|
|
@ -30,7 +30,7 @@ import ghidra.util.table.*;
|
||||||
* {@link SourceTagsPanel}
|
* {@link SourceTagsPanel}
|
||||||
*/
|
*/
|
||||||
public class AllFunctionsPanel extends JPanel {
|
public class AllFunctionsPanel extends JPanel {
|
||||||
|
private static final String NAME = "Function Tags Applied Functions";
|
||||||
private FunctionTableModel model;
|
private FunctionTableModel model;
|
||||||
private GhidraTable table;
|
private GhidraTable table;
|
||||||
private GhidraTableFilterPanel<Function> filterPanel;
|
private GhidraTableFilterPanel<Function> filterPanel;
|
||||||
|
@ -41,21 +41,21 @@ public class AllFunctionsPanel extends JPanel {
|
||||||
*
|
*
|
||||||
* @param program the current program
|
* @param program the current program
|
||||||
* @param provider the component provider
|
* @param provider the component provider
|
||||||
* @param title the title of the panel
|
|
||||||
*/
|
*/
|
||||||
public AllFunctionsPanel(Program program, ComponentProviderAdapter provider, String title) {
|
public AllFunctionsPanel(Program program, ComponentProviderAdapter provider) {
|
||||||
|
|
||||||
model = new FunctionTableModel(title, provider.getTool(), program, null);
|
model = new FunctionTableModel(NAME, provider.getTool(), program, null);
|
||||||
GhidraThreadedTablePanel<Function> tablePanel =
|
GhidraThreadedTablePanel<Function> tablePanel = new GhidraThreadedTablePanel<>(model);
|
||||||
new GhidraThreadedTablePanel<>(model);
|
|
||||||
|
|
||||||
table = tablePanel.getTable();
|
table = tablePanel.getTable();
|
||||||
filterPanel = new GhidraTableFilterPanel<>(table, model);
|
filterPanel = new GhidraTableFilterPanel<>(table, model);
|
||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
|
titleLabel = new JLabel(NAME);
|
||||||
titleLabel = new JLabel(title);
|
|
||||||
titleLabel.setBorder(BorderFactory.createEmptyBorder(3, 5, 0, 0));
|
titleLabel.setBorder(BorderFactory.createEmptyBorder(3, 5, 0, 0));
|
||||||
|
|
||||||
|
table.setAccessibleNamePrefix(NAME);
|
||||||
|
filterPanel.setAccessibleNamePrefix(NAME);
|
||||||
|
|
||||||
add(titleLabel, BorderLayout.NORTH);
|
add(titleLabel, BorderLayout.NORTH);
|
||||||
add(tablePanel, BorderLayout.CENTER);
|
add(tablePanel, BorderLayout.CENTER);
|
||||||
add(filterPanel, BorderLayout.SOUTH);
|
add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
@ -101,10 +101,8 @@ public class AllFunctionsPanel extends JPanel {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String tagNames = tags.stream()
|
String tagNames =
|
||||||
.map(t -> t.getName())
|
tags.stream().map(t -> t.getName()).collect(Collectors.joining(" or ")).toString();
|
||||||
.collect(Collectors.joining(" or "))
|
|
||||||
.toString();
|
|
||||||
|
|
||||||
titleLabel.setText("Functions With Tag: " + tagNames);
|
titleLabel.setText("Functions With Tag: " + tagNames);
|
||||||
model.setTags(tags);
|
model.setTags(tags);
|
||||||
|
|
|
@ -226,14 +226,13 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
||||||
mainPanel.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
|
mainPanel.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
|
||||||
|
|
||||||
// CENTER PANEL
|
// CENTER PANEL
|
||||||
sourcePanel = new SourceTagsPanel(this, tool, "All Tags");
|
sourcePanel = new SourceTagsPanel(this, tool);
|
||||||
targetPanel = new TargetTagsPanel(this, tool, "Assigned To Function");
|
targetPanel = new TargetTagsPanel(this, tool);
|
||||||
allFunctionsPanel = new AllFunctionsPanel(program, this, "Functions with Selected Tag");
|
allFunctionsPanel = new AllFunctionsPanel(program, this);
|
||||||
buttonPanel = new FunctionTagButtonPanel(sourcePanel, targetPanel);
|
buttonPanel = new FunctionTagButtonPanel(sourcePanel, targetPanel);
|
||||||
sourcePanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
sourcePanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
||||||
targetPanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
targetPanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
||||||
allFunctionsPanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
allFunctionsPanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
|
||||||
|
|
||||||
// If we don't set this, then the splitter won't be able to shrink the
|
// If we don't set this, then the splitter won't be able to shrink the
|
||||||
// target panels below the size required by its header, which can be large
|
// target panels below the size required by its header, which can be large
|
||||||
// because of the amount of text displayed. Keep the minimum size setting on
|
// because of the amount of text displayed. Keep the minimum size setting on
|
||||||
|
@ -480,9 +479,7 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
||||||
private JPanel createInputPanel() {
|
private JPanel createInputPanel() {
|
||||||
|
|
||||||
tagInputField = new HintTextField("tag 1, tag 2, ...");
|
tagInputField = new HintTextField("tag 1, tag 2, ...");
|
||||||
tagInputField.setName("tagInputTF");
|
|
||||||
tagInputField.addActionListener(e -> processCreates());
|
tagInputField.addActionListener(e -> processCreates());
|
||||||
|
|
||||||
inputPanel = new JPanel();
|
inputPanel = new JPanel();
|
||||||
Border outsideBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
|
Border outsideBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
|
||||||
Border insideBorder = BorderFactory.createEmptyBorder(5, 2, 2, 2);
|
Border insideBorder = BorderFactory.createEmptyBorder(5, 2, 2, 2);
|
||||||
|
@ -492,6 +489,10 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
||||||
inputPanel.add(Box.createHorizontalStrut(5));
|
inputPanel.add(Box.createHorizontalStrut(5));
|
||||||
inputPanel.add(tagInputField, BorderLayout.CENTER);
|
inputPanel.add(tagInputField, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
String inputFieldName = "Tag Input Text Field";
|
||||||
|
tagInputField.setName(inputFieldName);
|
||||||
|
tagInputField.getAccessibleContext().setAccessibleName(inputFieldName);
|
||||||
|
|
||||||
return inputPanel;
|
return inputPanel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,9 @@ public class SourceTagsPanel extends TagListPanel {
|
||||||
*
|
*
|
||||||
* @param provider the component provider
|
* @param provider the component provider
|
||||||
* @param tool the plugin tool
|
* @param tool the plugin tool
|
||||||
* @param title the title of the panel
|
|
||||||
*/
|
*/
|
||||||
public SourceTagsPanel(FunctionTagProvider provider, PluginTool tool, String title) {
|
public SourceTagsPanel(FunctionTagProvider provider, PluginTool tool) {
|
||||||
super(provider, tool, title);
|
super(provider, tool, "Function Tags");
|
||||||
|
|
||||||
table.setDisabled(true);
|
table.setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,9 +60,9 @@ public abstract class TagListPanel extends JPanel {
|
||||||
*
|
*
|
||||||
* @param provider the display provider
|
* @param provider the display provider
|
||||||
* @param tool the plugin tool
|
* @param tool the plugin tool
|
||||||
* @param title the title of the panel
|
* @param name the name of the panel
|
||||||
*/
|
*/
|
||||||
public TagListPanel(FunctionTagProvider provider, PluginTool tool, String title) {
|
public TagListPanel(FunctionTagProvider provider, PluginTool tool, String name) {
|
||||||
this.tool = tool;
|
this.tool = tool;
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
|
|
||||||
|
@ -77,13 +77,15 @@ public abstract class TagListPanel extends JPanel {
|
||||||
};
|
};
|
||||||
table = (FunctionTagTable) tablePanel.getTable();
|
table = (FunctionTagTable) tablePanel.getTable();
|
||||||
filterPanel = new GhidraTableFilterPanel<>(table, model);
|
filterPanel = new GhidraTableFilterPanel<>(table, model);
|
||||||
|
titleLabel = new JLabel(name);
|
||||||
titleLabel = new JLabel(title);
|
|
||||||
titleLabel.setBorder(BorderFactory.createEmptyBorder(3, 5, 0, 0));
|
titleLabel.setBorder(BorderFactory.createEmptyBorder(3, 5, 0, 0));
|
||||||
add(titleLabel, BorderLayout.NORTH);
|
add(titleLabel, BorderLayout.NORTH);
|
||||||
add(tablePanel, BorderLayout.CENTER);
|
add(tablePanel, BorderLayout.CENTER);
|
||||||
add(filterPanel, BorderLayout.SOUTH);
|
add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
table.setAccessibleNamePrefix(name);
|
||||||
|
filterPanel.setAccessibleNamePrefix(name);
|
||||||
|
|
||||||
table.addMouseListener(new MouseAdapter() {
|
table.addMouseListener(new MouseAdapter() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -128,9 +130,8 @@ public abstract class TagListPanel extends JPanel {
|
||||||
|
|
||||||
FunctionTagRowObject rowObject = model.getRowObject(row);
|
FunctionTagRowObject rowObject = model.getRowObject(row);
|
||||||
if (rowObject.isImmutable()) {
|
if (rowObject.isImmutable()) {
|
||||||
Msg.showWarn(this, table, "Tag Not Editable",
|
Msg.showWarn(this, table, "Tag Not Editable", "Tag " + "\"" + rowObject.getName() +
|
||||||
"Tag " + "\"" + rowObject.getName() + "\"" +
|
"\"" + " must be added to the program before it can be modified/deleted");
|
||||||
" must be added to the program before it can be modified/deleted");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,8 +173,8 @@ public abstract class TagListPanel extends JPanel {
|
||||||
|
|
||||||
// Only process the name edit if the name actually changed.
|
// Only process the name edit if the name actually changed.
|
||||||
if (!newName.equals(tagName)) {
|
if (!newName.equals(tagName)) {
|
||||||
Command cmd = new ChangeFunctionTagCmd(tagName, newName,
|
Command cmd =
|
||||||
ChangeFunctionTagCmd.TAG_NAME_CHANGED);
|
new ChangeFunctionTagCmd(tagName, newName, ChangeFunctionTagCmd.TAG_NAME_CHANGED);
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,9 @@ public class TargetTagsPanel extends TagListPanel {
|
||||||
*
|
*
|
||||||
* @param provider the component provider
|
* @param provider the component provider
|
||||||
* @param tool the plugin tool
|
* @param tool the plugin tool
|
||||||
* @param title the panel title
|
|
||||||
*/
|
*/
|
||||||
public TargetTagsPanel(FunctionTagProvider provider,
|
public TargetTagsPanel(FunctionTagProvider provider, PluginTool tool) {
|
||||||
PluginTool tool, String title) {
|
super(provider, tool, "Function Tags Assigned");
|
||||||
super(provider, tool, title);
|
|
||||||
|
|
||||||
table.setDisabled(false);
|
table.setDisabled(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,8 +118,6 @@ public class FunctionWindowProvider extends ComponentProviderAdapter {
|
||||||
threadedTablePanel = new GhidraThreadedTablePanel<>(functionModel, 1000);
|
threadedTablePanel = new GhidraThreadedTablePanel<>(functionModel, 1000);
|
||||||
|
|
||||||
functionTable = threadedTablePanel.getTable();
|
functionTable = threadedTablePanel.getTable();
|
||||||
functionTable.setName("FunctionTable");
|
|
||||||
|
|
||||||
functionTable.installNavigation(tool);
|
functionTable.installNavigation(tool);
|
||||||
functionTable.setAutoLookupColumn(FunctionTableModel.NAME_COL);
|
functionTable.setAutoLookupColumn(FunctionTableModel.NAME_COL);
|
||||||
functionTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
functionTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
||||||
|
@ -148,6 +146,10 @@ public class FunctionWindowProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
tableFilterPanel = new GhidraTableFilterPanel<>(functionTable, functionModel);
|
tableFilterPanel = new GhidraTableFilterPanel<>(functionTable, functionModel);
|
||||||
|
|
||||||
|
String namePrefix = "Functions";
|
||||||
|
functionTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
tableFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
JPanel container = new JPanel(new BorderLayout());
|
JPanel container = new JPanel(new BorderLayout());
|
||||||
container.add(threadedTablePanel, BorderLayout.CENTER);
|
container.add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
container.add(tableFilterPanel, BorderLayout.SOUTH);
|
container.add(tableFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
|
@ -135,6 +135,10 @@ class MemoryMapProvider extends ComponentProviderAdapter {
|
||||||
table.installNavigation(tool);
|
table.installNavigation(tool);
|
||||||
table.setAutoCreateColumnsFromModel(false);
|
table.setAutoCreateColumnsFromModel(false);
|
||||||
|
|
||||||
|
String namePrefix = "Memory Map";
|
||||||
|
table.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
GTableCellRenderer monoRenderer = new GTableCellRenderer() {
|
GTableCellRenderer monoRenderer = new GTableCellRenderer() {
|
||||||
@Override
|
@Override
|
||||||
protected Font getDefaultFont() {
|
protected Font getDefaultFont() {
|
||||||
|
|
|
@ -103,7 +103,6 @@ public class BundleStatusComponentProvider extends ComponentProviderAdapter {
|
||||||
panel = new JPanel(new BorderLayout(5, 5));
|
panel = new JPanel(new BorderLayout(5, 5));
|
||||||
|
|
||||||
bundleStatusTable = new GTable(bundleStatusTableModel);
|
bundleStatusTable = new GTable(bundleStatusTableModel);
|
||||||
bundleStatusTable.setName("BUNDLESTATUS_TABLE");
|
|
||||||
bundleStatusTable.setSelectionBackground(new GColor("color.bg.table.selection.bundle"));
|
bundleStatusTable.setSelectionBackground(new GColor("color.bg.table.selection.bundle"));
|
||||||
bundleStatusTable.setSelectionForeground(new GColor("color.fg.table.selection.bundle"));
|
bundleStatusTable.setSelectionForeground(new GColor("color.fg.table.selection.bundle"));
|
||||||
bundleStatusTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
bundleStatusTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
@ -118,14 +117,17 @@ public class BundleStatusComponentProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
// to allow custom cell renderers
|
// to allow custom cell renderers
|
||||||
bundleStatusTable.setAutoCreateColumnsFromModel(false);
|
bundleStatusTable.setAutoCreateColumnsFromModel(false);
|
||||||
|
|
||||||
filterPanel = new GTableFilterPanel<>(bundleStatusTable, bundleStatusTableModel);
|
filterPanel = new GTableFilterPanel<>(bundleStatusTable, bundleStatusTableModel);
|
||||||
|
|
||||||
JScrollPane scrollPane = new JScrollPane(bundleStatusTable);
|
JScrollPane scrollPane = new JScrollPane(bundleStatusTable);
|
||||||
|
|
||||||
panel.add(filterPanel, BorderLayout.SOUTH);
|
panel.add(filterPanel, BorderLayout.SOUTH);
|
||||||
panel.add(scrollPane, BorderLayout.CENTER);
|
panel.add(scrollPane, BorderLayout.CENTER);
|
||||||
panel.setPreferredSize(new Dimension(800, 400));
|
panel.setPreferredSize(new Dimension(800, 400));
|
||||||
|
|
||||||
|
String namePrefix = "Bundle Manager";
|
||||||
|
bundleStatusTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addBundlesAction(String actionName, String description, Icon icon,
|
private void addBundlesAction(String actionName, String description, Icon icon,
|
||||||
|
|
|
@ -74,6 +74,9 @@ public class ProgramDnDTree extends DragNDropTree {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a ProgramDnDTree with the given model.
|
* Construct a ProgramDnDTree with the given model.
|
||||||
|
* @param treeName The name of the tree to show in the tab
|
||||||
|
* @param model the tree model
|
||||||
|
* @param plugin the program tree plugin
|
||||||
*/
|
*/
|
||||||
public ProgramDnDTree(String treeName, DefaultTreeModel model, ProgramTreePlugin plugin) {
|
public ProgramDnDTree(String treeName, DefaultTreeModel model, ProgramTreePlugin plugin) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -86,6 +89,10 @@ public class ProgramDnDTree extends DragNDropTree {
|
||||||
|
|
||||||
mouseListenerDelegate = new JTreeMouseListenerDelegate(this);
|
mouseListenerDelegate = new JTreeMouseListenerDelegate(this);
|
||||||
initializeKeyEvents();
|
initializeKeyEvents();
|
||||||
|
|
||||||
|
treeName += " Program Tree";
|
||||||
|
setName(treeName);
|
||||||
|
getAccessibleContext().setAccessibleName(treeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeKeyEvents() {
|
private void initializeKeyEvents() {
|
||||||
|
@ -316,8 +323,7 @@ public class ProgramDnDTree extends DragNDropTree {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Object data = e.getTransferable()
|
Object data = e.getTransferable()
|
||||||
.getTransferData(
|
.getTransferData(SelectionTransferable.localProgramSelectionFlavor);
|
||||||
SelectionTransferable.localProgramSelectionFlavor);
|
|
||||||
SelectionTransferData transferData = (SelectionTransferData) data;
|
SelectionTransferData transferData = (SelectionTransferData) data;
|
||||||
return program.getDomainFile().getPathname().equals(transferData.getProgramPath());
|
return program.getDomainFile().getPathname().equals(transferData.getProgramPath());
|
||||||
}
|
}
|
||||||
|
@ -1285,6 +1291,10 @@ public class ProgramDnDTree extends DragNDropTree {
|
||||||
|
|
||||||
void setTreeName(String treeName) {
|
void setTreeName(String treeName) {
|
||||||
this.treeName = treeName;
|
this.treeName = treeName;
|
||||||
|
|
||||||
|
treeName += " Program Tree";
|
||||||
|
setName(treeName);
|
||||||
|
getAccessibleContext().setAccessibleName(treeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,36 +84,36 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
private void createActions() {
|
private void createActions() {
|
||||||
new ActionBuilder("Add External Program Name", getOwner())
|
new ActionBuilder("Add External Program Name", getOwner())
|
||||||
.popupMenuPath("Add External Program")
|
.popupMenuPath("Add External Program")
|
||||||
.popupMenuIcon(ADD_ICON)
|
.popupMenuIcon(ADD_ICON)
|
||||||
.toolBarIcon(ADD_ICON)
|
.toolBarIcon(ADD_ICON)
|
||||||
.enabledWhen(ac -> program != null)
|
.enabledWhen(ac -> program != null)
|
||||||
.onAction(ac -> addExternalProgram())
|
.onAction(ac -> addExternalProgram())
|
||||||
.buildAndInstallLocal(this);
|
.buildAndInstallLocal(this);
|
||||||
|
|
||||||
new ActionBuilder("Delete External Program Name", getOwner())
|
new ActionBuilder("Delete External Program Name", getOwner())
|
||||||
.popupMenuPath("Delete External Program")
|
.popupMenuPath("Delete External Program")
|
||||||
.popupMenuIcon(DELETE_ICON)
|
.popupMenuIcon(DELETE_ICON)
|
||||||
.toolBarIcon(DELETE_ICON)
|
.toolBarIcon(DELETE_ICON)
|
||||||
.enabledWhen(ac -> hasSelectedRows())
|
.enabledWhen(ac -> hasSelectedRows())
|
||||||
.onAction(ac -> deleteExternalProgram())
|
.onAction(ac -> deleteExternalProgram())
|
||||||
.buildAndInstallLocal(this);
|
.buildAndInstallLocal(this);
|
||||||
|
|
||||||
new ActionBuilder("Set External Name Association", getOwner())
|
new ActionBuilder("Set External Name Association", getOwner())
|
||||||
.popupMenuPath("Set External Name Association")
|
.popupMenuPath("Set External Name Association")
|
||||||
.popupMenuIcon(EDIT_ICON)
|
.popupMenuIcon(EDIT_ICON)
|
||||||
.toolBarIcon(EDIT_ICON)
|
.toolBarIcon(EDIT_ICON)
|
||||||
.enabledWhen(ac -> isSingleRowSelected())
|
.enabledWhen(ac -> isSingleRowSelected())
|
||||||
.onAction(ac -> setExternalProgramAssociation())
|
.onAction(ac -> setExternalProgramAssociation())
|
||||||
.buildAndInstallLocal(this);
|
.buildAndInstallLocal(this);
|
||||||
|
|
||||||
new ActionBuilder("Clear External Name Association", getOwner())
|
new ActionBuilder("Clear External Name Association", getOwner())
|
||||||
.popupMenuPath("Clear External Name Association")
|
.popupMenuPath("Clear External Name Association")
|
||||||
.popupMenuIcon(CLEAR_ICON)
|
.popupMenuIcon(CLEAR_ICON)
|
||||||
.toolBarIcon(CLEAR_ICON)
|
.toolBarIcon(CLEAR_ICON)
|
||||||
.enabledWhen(ac -> hasSelectedRows())
|
.enabledWhen(ac -> hasSelectedRows())
|
||||||
.onAction(ac -> clearExternalAssociation())
|
.onAction(ac -> clearExternalAssociation())
|
||||||
.buildAndInstallLocal(this);
|
.buildAndInstallLocal(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,9 +161,12 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||||
ToolTipManager.sharedInstance().registerComponent(table);
|
ToolTipManager.sharedInstance().registerComponent(table);
|
||||||
|
|
||||||
panel.add(sp, BorderLayout.CENTER);
|
panel.add(sp, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
String namePrefix = "External Programs";
|
||||||
|
table.setName(namePrefix);
|
||||||
|
table.getAccessibleContext().setAccessibleName(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,8 +193,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
private void addExternalProgram() {
|
private void addExternalProgram() {
|
||||||
InputDialog dialog = new InputDialog("New External Program", "Enter Name");
|
InputDialog dialog = new InputDialog("New External Program", "Enter Name");
|
||||||
dialog.setHelpLocation(
|
dialog.setHelpLocation(new HelpLocation("ReferencesPlugin", "Add_External_Program_Name"));
|
||||||
new HelpLocation("ReferencesPlugin", "Add_External_Program_Name"));
|
|
||||||
getTool().showDialog(dialog, ExternalReferencesProvider.this);
|
getTool().showDialog(dialog, ExternalReferencesProvider.this);
|
||||||
if (dialog.isCanceled()) {
|
if (dialog.isCanceled()) {
|
||||||
return;
|
return;
|
||||||
|
@ -202,8 +204,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
"External program name cannot be empty");
|
"External program name cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AddExternalNameCmd cmd =
|
AddExternalNameCmd cmd = new AddExternalNameCmd(newExternalName, SourceType.USER_DEFINED);
|
||||||
new AddExternalNameCmd(newExternalName, SourceType.USER_DEFINED);
|
|
||||||
getTool().execute(cmd, program);
|
getTool().execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,8 +213,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
CompoundCmd cmd = new CompoundCmd("Delete External Program Name");
|
CompoundCmd cmd = new CompoundCmd("Delete External Program Name");
|
||||||
for (String externalName : getSelectedExternalNames()) {
|
for (String externalName : getSelectedExternalNames()) {
|
||||||
boolean hasLocations =
|
boolean hasLocations = externalManager.getExternalLocations(externalName).hasNext();
|
||||||
externalManager.getExternalLocations(externalName).hasNext();
|
|
||||||
if (hasLocations) {
|
if (hasLocations) {
|
||||||
buf.append("\n ");
|
buf.append("\n ");
|
||||||
buf.append(externalName);
|
buf.append(externalName);
|
||||||
|
@ -248,16 +248,13 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
String pathName = domainFile.toString();
|
String pathName = domainFile.toString();
|
||||||
dialog.close();
|
dialog.close();
|
||||||
ExternalManager externalManager = program.getExternalManager();
|
ExternalManager externalManager = program.getExternalManager();
|
||||||
String externalLibraryPath =
|
String externalLibraryPath = externalManager.getExternalLibraryPath(externalName);
|
||||||
externalManager.getExternalLibraryPath(externalName);
|
|
||||||
if (!pathName.equals(externalLibraryPath)) {
|
if (!pathName.equals(externalLibraryPath)) {
|
||||||
Command cmd =
|
Command cmd = new SetExternalNameCmd(externalName, domainFile.getPathname());
|
||||||
new SetExternalNameCmd(externalName, domainFile.getPathname());
|
|
||||||
getTool().execute(cmd, program);
|
getTool().execute(cmd, program);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.setHelpLocation(
|
dialog.setHelpLocation(new HelpLocation("ReferencesPlugin", "ChooseExternalProgram"));
|
||||||
new HelpLocation("ReferencesPlugin", "ChooseExternalProgram"));
|
|
||||||
getTool().showDialog(dialog);
|
getTool().showDialog(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,9 +341,8 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalNamesRow path =
|
ExternalNamesRow path = new ExternalNamesRow(programName,
|
||||||
new ExternalNamesRow(programName,
|
extMgr.getExternalLibraryPath(programName));
|
||||||
extMgr.getExternalLibraryPath(programName));
|
|
||||||
paths.add(path);
|
paths.add(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,7 +449,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
// there are lots of empty path values.
|
// there are lots of empty path values.
|
||||||
Comparator<ExternalNamesRow> c1 =
|
Comparator<ExternalNamesRow> c1 =
|
||||||
(r1, r2) -> Objects.requireNonNullElse(r1.getPath(), "")
|
(r1, r2) -> Objects.requireNonNullElse(r1.getPath(), "")
|
||||||
.compareTo(Objects.requireNonNullElse(r2.getPath(), ""));
|
.compareTo(Objects.requireNonNullElse(r2.getPath(), ""));
|
||||||
return c1.thenComparing((r1, r2) -> r1.getName().compareTo(r2.getName()));
|
return c1.thenComparing((r1, r2) -> r1.getName().compareTo(r2.getName()));
|
||||||
}
|
}
|
||||||
return super.createSortComparator(columnIndex);
|
return super.createSortComparator(columnIndex);
|
||||||
|
|
|
@ -35,6 +35,7 @@ import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.lang.Register;
|
import ghidra.program.model.lang.Register;
|
||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
|
import ghidra.util.table.GhidraTable;
|
||||||
import ghidra.util.task.SwingUpdateManager;
|
import ghidra.util.task.SwingUpdateManager;
|
||||||
import resources.Icons;
|
import resources.Icons;
|
||||||
|
|
||||||
|
@ -84,13 +85,17 @@ public class RegisterManagerProvider extends ComponentProviderAdapter {
|
||||||
splitPane.setDividerLocation(0.3);
|
splitPane.setDividerLocation(0.3);
|
||||||
|
|
||||||
tree.addGTreeSelectionListener(e -> showRegister());
|
tree.addGTreeSelectionListener(e -> showRegister());
|
||||||
|
|
||||||
values.getTable().getSelectionModel().addListSelectionListener(e -> {
|
values.getTable().getSelectionModel().addListSelectionListener(e -> {
|
||||||
JTable table = values.getTable();
|
JTable table = values.getTable();
|
||||||
deleteRegisterValuesAction.setEnabled(table.getSelectedRowCount() > 0);
|
deleteRegisterValuesAction.setEnabled(table.getSelectedRowCount() > 0);
|
||||||
selectRegisterValuesAction.setEnabled(table.getSelectedRowCount() > 0);
|
selectRegisterValuesAction.setEnabled(table.getSelectedRowCount() > 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tree.setAccessibleNamePrefix("Register Manager");
|
||||||
|
|
||||||
|
GhidraTable table = values.getTable();
|
||||||
|
String namePrefix = "Register Manager Values";
|
||||||
|
table.setAccessibleNamePrefix(namePrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void createActions() {
|
void createActions() {
|
||||||
|
|
|
@ -79,7 +79,6 @@ class RelocationProvider extends ComponentProviderAdapter {
|
||||||
table.setPreferredScrollableViewportSize(new Dimension(300, 200));
|
table.setPreferredScrollableViewportSize(new Dimension(300, 200));
|
||||||
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
|
table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
|
||||||
|
|
||||||
table.getSelectionModel().addListSelectionListener(e -> contextChanged());
|
table.getSelectionModel().addListSelectionListener(e -> contextChanged());
|
||||||
|
|
||||||
ToolTipManager.sharedInstance().registerComponent(table);
|
ToolTipManager.sharedInstance().registerComponent(table);
|
||||||
|
@ -89,6 +88,10 @@ class RelocationProvider extends ComponentProviderAdapter {
|
||||||
tableFilterPanel = new GhidraTableFilterPanel<>(table, tableModel);
|
tableFilterPanel = new GhidraTableFilterPanel<>(table, tableModel);
|
||||||
panel.add(tableFilterPanel, BorderLayout.SOUTH);
|
panel.add(tableFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Relocations";
|
||||||
|
table.setAccessibleNamePrefix(namePrefix);
|
||||||
|
tableFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,6 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
scriptRoot = new RootNode();
|
scriptRoot = new RootNode();
|
||||||
|
|
||||||
scriptCategoryTree = new GTree(scriptRoot);
|
scriptCategoryTree = new GTree(scriptRoot);
|
||||||
scriptCategoryTree.setName("CATEGORY_TREE");
|
|
||||||
scriptCategoryTree.addMouseListener(new MouseAdapter() {
|
scriptCategoryTree.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
|
@ -177,6 +176,8 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
scriptCategoryTree.getSelectionModel()
|
scriptCategoryTree.getSelectionModel()
|
||||||
.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
||||||
|
|
||||||
|
scriptCategoryTree.setAccessibleNamePrefix("Script Category");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void build() {
|
private void build() {
|
||||||
|
@ -185,7 +186,6 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
tableModel = new GhidraScriptTableModel(this, infoManager);
|
tableModel = new GhidraScriptTableModel(this, infoManager);
|
||||||
|
|
||||||
scriptTable = new DraggableScriptTable(this, tableModel);
|
scriptTable = new DraggableScriptTable(this, tableModel);
|
||||||
scriptTable.setName("SCRIPT_TABLE");
|
|
||||||
scriptTable.setAutoLookupColumn(tableModel.getNameColumnIndex());
|
scriptTable.setAutoLookupColumn(tableModel.getNameColumnIndex());
|
||||||
scriptTable.setRowSelectionAllowed(true);
|
scriptTable.setRowSelectionAllowed(true);
|
||||||
scriptTable.setAutoCreateColumnsFromModel(false);
|
scriptTable.setAutoCreateColumnsFromModel(false);
|
||||||
|
@ -214,6 +214,8 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
scriptTable.setAccessibleNamePrefix("Script");
|
||||||
|
|
||||||
TableColumnModel columnModel = scriptTable.getColumnModel();
|
TableColumnModel columnModel = scriptTable.getColumnModel();
|
||||||
// Set default column sizes
|
// Set default column sizes
|
||||||
for (int i = 0; i < columnModel.getColumnCount(); i++) {
|
for (int i = 0; i < columnModel.getColumnCount(); i++) {
|
||||||
|
@ -1015,12 +1017,16 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
tableFilterPanel.setToolTipText("<html>Include scripts with <b>Names</b> or " +
|
tableFilterPanel.setToolTipText("<html>Include scripts with <b>Names</b> or " +
|
||||||
"<b>Descriptions</b> containing this text.");
|
"<b>Descriptions</b> containing this text.");
|
||||||
tableFilterPanel.setFocusComponent(scriptCategoryTree);
|
tableFilterPanel.setFocusComponent(scriptCategoryTree);
|
||||||
|
|
||||||
|
tableFilterPanel.setAccessibleNamePrefix("Script");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JComponent buildDescriptionComponent() {
|
private JComponent buildDescriptionComponent() {
|
||||||
descriptionTextPane = new JTextPane();
|
descriptionTextPane = new JTextPane();
|
||||||
descriptionTextPane.setEditable(false);
|
descriptionTextPane.setEditable(false);
|
||||||
descriptionTextPane.setEditorKit(new HTMLEditorKit());
|
descriptionTextPane.setEditorKit(new HTMLEditorKit());
|
||||||
|
descriptionTextPane.setName("Script Description");
|
||||||
JPanel descriptionPanel = new JPanel(new BorderLayout());
|
JPanel descriptionPanel = new JPanel(new BorderLayout());
|
||||||
descriptionPanel.add(descriptionTextPane);
|
descriptionPanel.add(descriptionTextPane);
|
||||||
JScrollPane scrollPane = new JScrollPane(descriptionPanel);
|
JScrollPane scrollPane = new JScrollPane(descriptionPanel);
|
||||||
|
@ -1038,9 +1044,9 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
||||||
private void updateDescriptionPanel() {
|
private void updateDescriptionPanel() {
|
||||||
ResourceFile script = getSelectedScript();
|
ResourceFile script = getSelectedScript();
|
||||||
ScriptInfo info = infoManager.getExistingScriptInfo(script); // null script is ok
|
ScriptInfo info = infoManager.getExistingScriptInfo(script); // null script is ok
|
||||||
String text = script != null
|
String text =
|
||||||
? (info != null ? info.getToolTipText() : "Error! no script info!")
|
script != null ? (info != null ? info.getToolTipText() : "Error! no script info!")
|
||||||
: null; // no selected script
|
: null; // no selected script
|
||||||
|
|
||||||
// have to do an invokeLater here, since the DefaultCaret class runs in an invokeLater,
|
// have to do an invokeLater here, since the DefaultCaret class runs in an invokeLater,
|
||||||
// which will overwrite our location setting
|
// which will overwrite our location setting
|
||||||
|
|
|
@ -112,7 +112,6 @@ public class ViewStringsProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
threadedTablePanel = new GhidraThreadedTablePanel<>(stringModel, 1000);
|
threadedTablePanel = new GhidraThreadedTablePanel<>(stringModel, 1000);
|
||||||
table = threadedTablePanel.getTable();
|
table = threadedTablePanel.getTable();
|
||||||
table.setName("DataTable");
|
|
||||||
table.setPreferredScrollableViewportSize(new Dimension(350, 150));
|
table.setPreferredScrollableViewportSize(new Dimension(350, 150));
|
||||||
table.getSelectionModel().addListSelectionListener(e -> notifyContextChanged());
|
table.getSelectionModel().addListSelectionListener(e -> notifyContextChanged());
|
||||||
|
|
||||||
|
@ -150,19 +149,21 @@ public class ViewStringsProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
TableColumn stringRepCol = table.getColumnModel()
|
TableColumn stringRepCol = table.getColumnModel()
|
||||||
.getColumn(
|
.getColumn(ViewStringsTableModel.COLUMNS.STRING_REP_COL.ordinal());
|
||||||
ViewStringsTableModel.COLUMNS.STRING_REP_COL.ordinal());
|
|
||||||
|
|
||||||
stringRepCol.setCellEditor(new StringRepCellEditor());
|
stringRepCol.setCellEditor(new StringRepCellEditor());
|
||||||
|
|
||||||
table.installNavigation(tool);
|
table.installNavigation(tool);
|
||||||
|
|
||||||
filterPanel = new GhidraTableFilterPanel<>(table, stringModel);
|
filterPanel = new GhidraTableFilterPanel<>(table, stringModel);
|
||||||
|
|
||||||
JPanel panel = new JPanel(new BorderLayout());
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
panel.add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
panel.add(filterPanel, BorderLayout.SOUTH);
|
panel.add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Defined Strings";
|
||||||
|
table.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +238,6 @@ public class ViewStringsProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Program getProgram() {
|
public Program getProgram() {
|
||||||
return currentProgram;
|
return currentProgram;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ public class SymbolGTree extends GTree {
|
||||||
setCellRenderer(new SymbolTreeCellRenderer());
|
setCellRenderer(new SymbolTreeCellRenderer());
|
||||||
|
|
||||||
setDragNDropHandler(new SymbolGTreeDragNDropHandler(plugin));
|
setDragNDropHandler(new SymbolGTreeDragNDropHandler(plugin));
|
||||||
|
|
||||||
|
setAccessibleNamePrefix("Symbol");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -219,7 +219,8 @@ public class SymbolTreeProvider extends ComponentProviderAdapter {
|
||||||
SymbolNode node = (SymbolNode) object;
|
SymbolNode node = (SymbolNode) object;
|
||||||
Symbol symbol = node.getSymbol();
|
Symbol symbol = node.getSymbol();
|
||||||
SymbolType type = symbol.getSymbolType();
|
SymbolType type = symbol.getSymbolType();
|
||||||
if (!type.isNamespace() || type == SymbolType.FUNCTION) {
|
if (!type.isNamespace() ||
|
||||||
|
type == SymbolType.FUNCTION) {
|
||||||
plugin.goTo(symbol);
|
plugin.goTo(symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +247,8 @@ public class SymbolTreeProvider extends ComponentProviderAdapter {
|
||||||
deleteAction.setEnabled(false);
|
deleteAction.setEnabled(false);
|
||||||
|
|
||||||
DockingAction referencesAction =
|
DockingAction referencesAction =
|
||||||
new ShowSymbolReferencesAction(plugin.getTool(), plugin.getName());
|
new ShowSymbolReferencesAction(plugin.getTool(),
|
||||||
|
plugin.getName());
|
||||||
|
|
||||||
DockingAction selectionAction = new SelectionAction(plugin);
|
DockingAction selectionAction = new SelectionAction(plugin);
|
||||||
selectionAction.setEnabled(false);
|
selectionAction.setEnabled(false);
|
||||||
|
@ -369,11 +371,14 @@ public class SymbolTreeProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
sb.append("Parent namespace " + namespace.getName() +
|
sb.append("Parent namespace " + namespace.getName() +
|
||||||
" contains namespace named " + symbol.getName() + "\n");
|
" contains namespace named " + symbol.getName() +
|
||||||
|
"\n");
|
||||||
}
|
}
|
||||||
catch (InvalidInputException | CircularDependencyException e) {
|
catch (InvalidInputException | CircularDependencyException e) {
|
||||||
sb.append("Could not change parent namespace for " + symbol.getName() + ": " +
|
sb.append("Could not change parent namespace for " + symbol.getName() +
|
||||||
e.getMessage() + "\n");
|
": " +
|
||||||
|
e.getMessage() +
|
||||||
|
"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,7 +405,8 @@ public class SymbolTreeProvider extends ComponentProviderAdapter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// the symbol to move does not allow dups, so make sure all existing symbols do allow dups.
|
// the symbol to move does not allow dups, so make sure all existing symbols do allow dups.
|
||||||
List<Symbol> symbols = symbolTable.getSymbols(symbol.getName(), destinationNamespace);
|
List<Symbol> symbols = symbolTable.getSymbols(symbol.getName(),
|
||||||
|
destinationNamespace);
|
||||||
for (Symbol s : symbols) {
|
for (Symbol s : symbols) {
|
||||||
if (!s.getSymbolType().allowsDuplicates()) {
|
if (!s.getSymbolType().allowsDuplicates()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -659,7 +665,8 @@ public class SymbolTreeProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getClass().getSimpleName() + " " + symbol;
|
return getClass().getSimpleName() +
|
||||||
|
" " + symbol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,6 @@ import ghidra.program.model.symbol.Reference;
|
||||||
import ghidra.util.table.GhidraTable;
|
import ghidra.util.table.GhidraTable;
|
||||||
import ghidra.util.table.GhidraThreadedTablePanel;
|
import ghidra.util.table.GhidraThreadedTablePanel;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class ReferencePanel extends JPanel {
|
class ReferencePanel extends JPanel {
|
||||||
|
|
||||||
private ReferenceProvider referenceProvider;
|
private ReferenceProvider referenceProvider;
|
||||||
|
@ -50,7 +46,6 @@ class ReferencePanel extends JPanel {
|
||||||
|
|
||||||
refTable = threadedTablePanel.getTable();
|
refTable = threadedTablePanel.getTable();
|
||||||
refTable.setAutoLookupColumn(SymbolReferenceModel.LABEL_COL);
|
refTable.setAutoLookupColumn(SymbolReferenceModel.LABEL_COL);
|
||||||
refTable.setName("ReferenceTable");//used by JUnit...
|
|
||||||
refTable.setPreferredScrollableViewportSize(new Dimension(250, 200));
|
refTable.setPreferredScrollableViewportSize(new Dimension(250, 200));
|
||||||
refTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
refTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
refTable.installNavigation(provider.getTool());
|
refTable.installNavigation(provider.getTool());
|
||||||
|
@ -66,6 +61,9 @@ class ReferencePanel extends JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
add(threadedTablePanel, BorderLayout.CENTER);
|
add(threadedTablePanel, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
String namePrefix = "Reference";
|
||||||
|
refTable.setAccessibleNamePrefix(namePrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
GhidraTable getTable() {
|
GhidraTable getTable() {
|
||||||
|
|
|
@ -62,7 +62,6 @@ class SymbolPanel extends JPanel {
|
||||||
|
|
||||||
symTable = threadedTablePanel.getTable();
|
symTable = threadedTablePanel.getTable();
|
||||||
symTable.setAutoLookupColumn(SymbolTableModel.LABEL_COL);
|
symTable.setAutoLookupColumn(SymbolTableModel.LABEL_COL);
|
||||||
symTable.setName("SymbolTable");//used by JUnit...
|
|
||||||
symTable.setRowSelectionAllowed(true);
|
symTable.setRowSelectionAllowed(true);
|
||||||
symTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
symTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
symTable.getModel().addTableModelListener(listener);
|
symTable.getModel().addTableModelListener(listener);
|
||||||
|
@ -73,6 +72,8 @@ class SymbolPanel extends JPanel {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
symTable.setAccessibleNamePrefix("Symbol");
|
||||||
|
|
||||||
symTable.installNavigation(tool);
|
symTable.installNavigation(tool);
|
||||||
|
|
||||||
for (int i = 0; i < symTable.getColumnCount(); i++) {
|
for (int i = 0; i < symTable.getColumnCount(); i++) {
|
||||||
|
@ -102,8 +103,8 @@ class SymbolPanel extends JPanel {
|
||||||
"<html><b>Selected</b> causes filter to only consider the symbol's name.");
|
"<html><b>Selected</b> causes filter to only consider the symbol's name.");
|
||||||
nameColumnOnlyCheckbox.setFocusable(false);
|
nameColumnOnlyCheckbox.setFocusable(false);
|
||||||
nameColumnOnlyCheckbox.setSelected(FILTER_NAME_ONLY_DEFAULT);
|
nameColumnOnlyCheckbox.setSelected(FILTER_NAME_ONLY_DEFAULT);
|
||||||
tableFilterPanel.setFilterRowTransformer(
|
tableFilterPanel
|
||||||
updateRowDataTransformer(FILTER_NAME_ONLY_DEFAULT));
|
.setFilterRowTransformer(updateRowDataTransformer(FILTER_NAME_ONLY_DEFAULT));
|
||||||
nameColumnOnlyCheckbox.addItemListener(e -> {
|
nameColumnOnlyCheckbox.addItemListener(e -> {
|
||||||
boolean nameOnly = nameColumnOnlyCheckbox.isSelected();
|
boolean nameOnly = nameColumnOnlyCheckbox.isSelected();
|
||||||
tableFilterPanel.setFilterRowTransformer(updateRowDataTransformer(nameOnly));
|
tableFilterPanel.setFilterRowTransformer(updateRowDataTransformer(nameOnly));
|
||||||
|
@ -111,6 +112,7 @@ class SymbolPanel extends JPanel {
|
||||||
|
|
||||||
tableFilterPanel.add(nameColumnOnlyCheckbox);
|
tableFilterPanel.add(nameColumnOnlyCheckbox);
|
||||||
|
|
||||||
|
tableFilterPanel.setAccessibleNamePrefix("Symbol");
|
||||||
return tableFilterPanel;
|
return tableFilterPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,11 +183,9 @@ public class GoToAddressLabelDialog extends ReusableDialogComponentProvider
|
||||||
gbc.weightx = 1;
|
gbc.weightx = 1;
|
||||||
gbc.gridwidth = 2;
|
gbc.gridwidth = 2;
|
||||||
gbc.insets = new Insets(5, 5, 5, 5);
|
gbc.insets = new Insets(5, 5, 5, 5);
|
||||||
|
|
||||||
hyperlink = new HyperlinkComponent("<html>Enter an address, label, <a href=\"" +
|
hyperlink = new HyperlinkComponent("<html>Enter an address, label, <a href=\"" +
|
||||||
EXPRESSION_ANCHOR_NAME + "\">expression</a>, or " + "<a href=\"" +
|
EXPRESSION_ANCHOR_NAME + "\">expression</a>, or " + "<a href=\"" +
|
||||||
FILE_OFFSET_ANCHOR_NAME + "\">file offset</a>:");
|
FILE_OFFSET_ANCHOR_NAME + "\">file offset</a>:");
|
||||||
|
|
||||||
HyperlinkListener hyperlinkListener = evt -> {
|
HyperlinkListener hyperlinkListener = evt -> {
|
||||||
if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
|
if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
|
||||||
HelpLocation loc = new HelpLocation(HelpTopics.NAVIGATION, evt.getDescription());
|
HelpLocation loc = new HelpLocation(HelpTopics.NAVIGATION, evt.getDescription());
|
||||||
|
@ -196,12 +194,14 @@ public class GoToAddressLabelDialog extends ReusableDialogComponentProvider
|
||||||
};
|
};
|
||||||
hyperlink.addHyperlinkListener(EXPRESSION_ANCHOR_NAME, hyperlinkListener);
|
hyperlink.addHyperlinkListener(EXPRESSION_ANCHOR_NAME, hyperlinkListener);
|
||||||
hyperlink.addHyperlinkListener(FILE_OFFSET_ANCHOR_NAME, hyperlinkListener);
|
hyperlink.addHyperlinkListener(FILE_OFFSET_ANCHOR_NAME, hyperlinkListener);
|
||||||
|
|
||||||
inner.add(hyperlink, gbc);
|
inner.add(hyperlink, gbc);
|
||||||
|
|
||||||
comboBox = new GhidraComboBox<>();
|
comboBox = new GhidraComboBox<>();
|
||||||
comboBox.setEditable(true);
|
comboBox.setEditable(true);
|
||||||
comboBox.addActionListener(evt -> okCallback());
|
comboBox.addActionListener(evt -> okCallback());
|
||||||
|
String comboName = "Go To Address or Lable Text Field / Combobox";
|
||||||
|
comboBox.setName(comboName);
|
||||||
|
comboBox.getAccessibleContext().setAccessibleName(comboName);
|
||||||
|
|
||||||
gbc.insets = new Insets(2, 5, 2, 0);
|
gbc.insets = new Insets(2, 5, 2, 0);
|
||||||
gbc.gridx = 0;
|
gbc.gridx = 0;
|
||||||
|
@ -212,12 +212,18 @@ public class GoToAddressLabelDialog extends ReusableDialogComponentProvider
|
||||||
caseSensitiveBox = new GCheckBox("Case sensitive", false);
|
caseSensitiveBox = new GCheckBox("Case sensitive", false);
|
||||||
gbc.gridy = 2;
|
gbc.gridy = 2;
|
||||||
gbc.gridwidth = 1;
|
gbc.gridwidth = 1;
|
||||||
|
String caseSensitiveCheckBoxName = "Case Sensitive Checkbox";
|
||||||
|
caseSensitiveBox.setName(caseSensitiveCheckBoxName);
|
||||||
|
caseSensitiveBox.getAccessibleContext().setAccessibleName(caseSensitiveCheckBoxName);
|
||||||
inner.add(caseSensitiveBox, gbc);
|
inner.add(caseSensitiveBox, gbc);
|
||||||
|
|
||||||
includeDynamicBox = new GCheckBox("Dynamic labels", true);
|
includeDynamicBox = new GCheckBox("Dynamic labels", true);
|
||||||
includeDynamicBox.setToolTipText("Include dynamic lables in the search (slower)");
|
includeDynamicBox.setToolTipText("Include dynamic lables in the search (slower)");
|
||||||
gbc.gridx = 1;
|
gbc.gridx = 1;
|
||||||
inner.add(includeDynamicBox, gbc);
|
inner.add(includeDynamicBox, gbc);
|
||||||
|
String dynamicCheckBoxName = "Dynamic Checkbox";
|
||||||
|
includeDynamicBox.setName(dynamicCheckBoxName);
|
||||||
|
includeDynamicBox.getAccessibleContext().setAccessibleName(dynamicCheckBoxName);
|
||||||
|
|
||||||
mainPanel = new JPanel(new BorderLayout());
|
mainPanel = new JPanel(new BorderLayout());
|
||||||
Border emptyBorder = BorderFactory.createEmptyBorder(5, 5, 0, 5);
|
Border emptyBorder = BorderFactory.createEmptyBorder(5, 5, 0, 5);
|
||||||
|
|
|
@ -32,6 +32,6 @@ public class ListingFieldDescriptionProvider implements FieldDescriptionProvider
|
||||||
String addressString = address.toString(address.getAddressSpace().showSpaceName(), 1);
|
String addressString = address.toString(address.getAddressSpace().showSpaceName(), 1);
|
||||||
return fieldFactory.getFieldName() + " Field at Address " + addressString;
|
return fieldFactory.getFieldName() + " Field at Address " + addressString;
|
||||||
}
|
}
|
||||||
return "Unknown Field";
|
return "No program open";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,10 @@ public class ListingPanel extends JPanel implements FieldMouseListener, FieldLoc
|
||||||
validate();
|
validate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
String viewName = "Assembly Listing View";
|
||||||
|
fieldPanel.setName(viewName);
|
||||||
|
fieldPanel.getAccessibleContext().setAccessibleName(viewName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,4 +40,5 @@ public class GhidraTableFilterPanel<ROW_OBJECT> extends GTableFilterPanel<ROW_OB
|
||||||
String filterLabel) {
|
String filterLabel) {
|
||||||
super(table, tableModel, filterLabel);
|
super(table, tableModel, filterLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,8 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
||||||
this.fm = fm;
|
this.fm = fm;
|
||||||
this.layoutModel = layoutModel;
|
this.layoutModel = layoutModel;
|
||||||
|
|
||||||
setName(model.getName());
|
setName("Byte Viewer");
|
||||||
|
getAccessibleContext().setAccessibleName("ByteViewer");
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
// specialized line coloring
|
// specialized line coloring
|
||||||
|
|
|
@ -37,8 +37,7 @@ public class InteractivePanelManager {
|
||||||
|
|
||||||
public InteractivePanelManager() {
|
public InteractivePanelManager() {
|
||||||
JTable table = new JTable();
|
JTable table = new JTable();
|
||||||
header = new JTableHeader();
|
header = table.getTableHeader();
|
||||||
table.setTableHeader(header);
|
|
||||||
columnModel = header.getColumnModel();
|
columnModel = header.getColumnModel();
|
||||||
separatorWidth = (new JSeparator(SwingConstants.VERTICAL)).getPreferredSize().width;
|
separatorWidth = (new JSeparator(SwingConstants.VERTICAL)).getPreferredSize().width;
|
||||||
mainPanel = new JPanel(new HeaderLayoutManager());
|
mainPanel = new JPanel(new HeaderLayoutManager());
|
||||||
|
@ -296,6 +295,7 @@ public class InteractivePanelManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
record ComponentData(String name, JComponent component) {
|
record ComponentData(String name, JComponent component) {
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,9 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
|
||||||
fieldPanel.addFieldLocationListener(this);
|
fieldPanel.addFieldLocationListener(this);
|
||||||
fieldPanel.addLayoutListener(this);
|
fieldPanel.addLayoutListener(this);
|
||||||
|
|
||||||
|
fieldPanel.setName("Decompiler View");
|
||||||
|
fieldPanel.getAccessibleContext().setAccessibleName("Decompiler View");
|
||||||
|
|
||||||
fieldPanel.addComponentListener(new ComponentAdapter() {
|
fieldPanel.addComponentListener(new ComponentAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void componentResized(ComponentEvent e) {
|
public void componentResized(ComponentEvent e) {
|
||||||
|
|
|
@ -522,16 +522,15 @@ public class FcgProvider
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
resetGraphAction.setToolBarData(new ToolBarData(Icons.REFRESH_ICON));
|
resetGraphAction.setToolBarData(new ToolBarData(Icons.REFRESH_ICON));
|
||||||
resetGraphAction.setDescription(
|
resetGraphAction
|
||||||
"<html>Resets the graph--All positioning will be <b>lost</b>");
|
.setDescription("<html>Resets the graph--All positioning will be <b>lost</b>");
|
||||||
resetGraphAction.setHelpLocation(
|
resetGraphAction
|
||||||
new HelpLocation("FunctionCallGraphPlugin", "Relayout_Graph"));
|
.setHelpLocation(new HelpLocation("FunctionCallGraphPlugin", "Relayout_Graph"));
|
||||||
|
|
||||||
addLocalAction(resetGraphAction);
|
addLocalAction(resetGraphAction);
|
||||||
|
|
||||||
MultiStateDockingAction<LayoutProvider<FcgVertex, FcgEdge, FunctionCallGraph>> layoutAction =
|
MultiStateDockingAction<LayoutProvider<FcgVertex, FcgEdge, FunctionCallGraph>> layoutAction =
|
||||||
new MultiStateDockingAction<>(
|
new MultiStateDockingAction<>(RELAYOUT_GRAPH_ACTION_NAME, plugin.getName()) {
|
||||||
RELAYOUT_GRAPH_ACTION_NAME, plugin.getName()) {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionContext context) {
|
public void actionPerformed(ActionContext context) {
|
||||||
|
@ -971,8 +970,11 @@ public class FcgProvider
|
||||||
BowTieExpandVerticesJob job = new BowTieExpandVerticesJob(viewer, collection, true);
|
BowTieExpandVerticesJob job = new BowTieExpandVerticesJob(viewer, collection, true);
|
||||||
VisualGraphViewUpdater<FcgVertex, FcgEdge> updater = view.getViewUpdater();
|
VisualGraphViewUpdater<FcgVertex, FcgEdge> updater = view.getViewUpdater();
|
||||||
updater.scheduleViewChangeJob(job);
|
updater.scheduleViewChangeJob(job);
|
||||||
|
|
||||||
updateTitle();
|
updateTitle();
|
||||||
|
|
||||||
|
String viewName = "Function Call Graph";
|
||||||
|
viewer.setName(viewName);
|
||||||
|
viewer.getAccessibleContext().setAccessibleName(viewName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void highlightExistingEdges(FcgExpandingVertexCollection collection) {
|
private void highlightExistingEdges(FcgExpandingVertexCollection collection) {
|
||||||
|
|
|
@ -446,7 +446,6 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
new VTFunctionAssociationTableModel(tool, controller, sourceProgram, true);
|
new VTFunctionAssociationTableModel(tool, controller, sourceProgram, true);
|
||||||
sourceThreadedTablePanel = new GhidraThreadedTablePanel<>(sourceFunctionsModel, 1000);
|
sourceThreadedTablePanel = new GhidraThreadedTablePanel<>(sourceFunctionsModel, 1000);
|
||||||
sourceFunctionsTable = sourceThreadedTablePanel.getTable();
|
sourceFunctionsTable = sourceThreadedTablePanel.getTable();
|
||||||
sourceFunctionsTable.setName("SourceFunctionTable");
|
|
||||||
sourceFunctionsTable
|
sourceFunctionsTable
|
||||||
.setPreferenceKey("VTFunctionAssociationTableModel - Source Function Table");
|
.setPreferenceKey("VTFunctionAssociationTableModel - Source Function Table");
|
||||||
sourceFunctionsTable.installNavigation(tool);
|
sourceFunctionsTable.installNavigation(tool);
|
||||||
|
@ -474,7 +473,6 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
sourceTableFilterPanel =
|
sourceTableFilterPanel =
|
||||||
new GhidraTableFilterPanel<>(sourceFunctionsTable, sourceFunctionsModel);
|
new GhidraTableFilterPanel<>(sourceFunctionsTable, sourceFunctionsModel);
|
||||||
|
|
||||||
JPanel sourceFunctionPanel = new JPanel(new BorderLayout());
|
JPanel sourceFunctionPanel = new JPanel(new BorderLayout());
|
||||||
String sourceString =
|
String sourceString =
|
||||||
(sourceProgram != null) ? sourceProgram.getDomainFile().toString() : NO_SESSION;
|
(sourceProgram != null) ? sourceProgram.getDomainFile().toString() : NO_SESSION;
|
||||||
|
@ -484,6 +482,11 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
sourceFunctionPanel.add(sourceSessionLabel, BorderLayout.NORTH);
|
sourceFunctionPanel.add(sourceSessionLabel, BorderLayout.NORTH);
|
||||||
sourceFunctionPanel.add(sourceThreadedTablePanel, BorderLayout.CENTER);
|
sourceFunctionPanel.add(sourceThreadedTablePanel, BorderLayout.CENTER);
|
||||||
sourceFunctionPanel.add(sourceTableFilterPanel, BorderLayout.SOUTH);
|
sourceFunctionPanel.add(sourceTableFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Source Functions";
|
||||||
|
sourceFunctionsTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
sourceTableFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return sourceFunctionPanel;
|
return sourceFunctionPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,7 +498,6 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
destinationThreadedTablePanel =
|
destinationThreadedTablePanel =
|
||||||
new GhidraThreadedTablePanel<>(destinationFunctionsModel, 1000);
|
new GhidraThreadedTablePanel<>(destinationFunctionsModel, 1000);
|
||||||
destinationFunctionsTable = destinationThreadedTablePanel.getTable();
|
destinationFunctionsTable = destinationThreadedTablePanel.getTable();
|
||||||
destinationFunctionsTable.setName("DestinationFunctionTable");
|
|
||||||
destinationFunctionsTable.setPreferenceKey(
|
destinationFunctionsTable.setPreferenceKey(
|
||||||
"VTFunctionAssociationTableModel - " + "Destination Function Table");
|
"VTFunctionAssociationTableModel - " + "Destination Function Table");
|
||||||
destinationFunctionsTable.installNavigation(tool);
|
destinationFunctionsTable.installNavigation(tool);
|
||||||
|
@ -526,7 +528,6 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
destinationTableFilterPanel =
|
destinationTableFilterPanel =
|
||||||
new GhidraTableFilterPanel<>(destinationFunctionsTable, destinationFunctionsModel);
|
new GhidraTableFilterPanel<>(destinationFunctionsTable, destinationFunctionsModel);
|
||||||
|
|
||||||
JPanel destinationFunctionPanel = new JPanel(new BorderLayout());
|
JPanel destinationFunctionPanel = new JPanel(new BorderLayout());
|
||||||
String destinationString =
|
String destinationString =
|
||||||
(destinationProgram != null) ? destinationProgram.getDomainFile().toString()
|
(destinationProgram != null) ? destinationProgram.getDomainFile().toString()
|
||||||
|
@ -537,6 +538,11 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
|
||||||
destinationFunctionPanel.add(destinationSessionLabel, BorderLayout.NORTH);
|
destinationFunctionPanel.add(destinationSessionLabel, BorderLayout.NORTH);
|
||||||
destinationFunctionPanel.add(destinationThreadedTablePanel, BorderLayout.CENTER);
|
destinationFunctionPanel.add(destinationThreadedTablePanel, BorderLayout.CENTER);
|
||||||
destinationFunctionPanel.add(destinationTableFilterPanel, BorderLayout.SOUTH);
|
destinationFunctionPanel.add(destinationTableFilterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Destination Functions";
|
||||||
|
destinationFunctionsTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
destinationTableFilterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return destinationFunctionPanel;
|
return destinationFunctionPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,11 @@ public class VTImpliedMatchesTableProvider extends ComponentProviderAdapter
|
||||||
filterPanel = new GhidraTableFilterPanel<>(impliedMatchesTable, impliedMatchTableModel);
|
filterPanel = new GhidraTableFilterPanel<>(impliedMatchesTable, impliedMatchTableModel);
|
||||||
panel.add(tablePanel, BorderLayout.CENTER);
|
panel.add(tablePanel, BorderLayout.CENTER);
|
||||||
panel.add(filterPanel, BorderLayout.SOUTH);
|
panel.add(filterPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
String namePrefix = "Implied Matches";
|
||||||
|
impliedMatchesTable.setAccessibleNamePrefix(namePrefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +255,6 @@ public class VTImpliedMatchesTableProvider extends ComponentProviderAdapter
|
||||||
new GhidraThreadedTablePanel<>(impliedMatchTableModel);
|
new GhidraThreadedTablePanel<>(impliedMatchTableModel);
|
||||||
|
|
||||||
impliedMatchesTable = impliedMatchTablePanel.getTable();
|
impliedMatchesTable = impliedMatchTablePanel.getTable();
|
||||||
|
|
||||||
impliedSelectionListener = e -> {
|
impliedSelectionListener = e -> {
|
||||||
if (e.getValueIsAdjusting()) {
|
if (e.getValueIsAdjusting()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -175,6 +175,9 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
||||||
functionComparisonPanel);
|
functionComparisonPanel);
|
||||||
splitPane.setResizeWeight(0.4);
|
splitPane.setResizeWeight(0.4);
|
||||||
markupPanel.add(splitPane, BorderLayout.CENTER);
|
markupPanel.add(splitPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
markupItemsTable.setAccessibleNamePrefix("Markup Items");
|
||||||
|
|
||||||
return markupPanel;
|
return markupPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,6 +408,10 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
||||||
.addActionListener(e -> tool.showDialog(ancillaryFilterDialog, component));
|
.addActionListener(e -> tool.showDialog(ancillaryFilterDialog, component));
|
||||||
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
||||||
|
|
||||||
|
String buttonNamePrefix = "Markup Items Table Filter";
|
||||||
|
ancillaryFilterButton.setName(buttonNamePrefix + " Button");
|
||||||
|
ancillaryFilterButton.getAccessibleContext().setAccessibleName(buttonNamePrefix);
|
||||||
|
|
||||||
parentPanel.add(ancillaryFilterButton, BorderLayout.EAST);
|
parentPanel.add(ancillaryFilterButton, BorderLayout.EAST);
|
||||||
|
|
||||||
HelpLocation filterHelpLocation =
|
HelpLocation filterHelpLocation =
|
||||||
|
|
|
@ -98,7 +98,6 @@ public class VTMatchTableProvider extends ComponentProviderAdapter
|
||||||
setIcon(VersionTrackingPluginPackage.ICON);
|
setIcon(VersionTrackingPluginPackage.ICON);
|
||||||
setDefaultWindowPosition(WindowPosition.TOP);
|
setDefaultWindowPosition(WindowPosition.TOP);
|
||||||
createActions();
|
createActions();
|
||||||
|
|
||||||
component = createComponent();
|
component = createComponent();
|
||||||
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
@ -219,14 +218,14 @@ public class VTMatchTableProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
matchesTable = createMatchesTable();
|
matchesTable = createMatchesTable();
|
||||||
JPanel matchesTablePanel = new JPanel(new BorderLayout());
|
JPanel matchesTablePanel = new JPanel(new BorderLayout());
|
||||||
|
|
||||||
JPanel filterAreaPanel = createFilterArea();
|
JPanel filterAreaPanel = createFilterArea();
|
||||||
matchesTablePanel.add(tablePanel, BorderLayout.CENTER);
|
matchesTablePanel.add(tablePanel, BorderLayout.CENTER);
|
||||||
matchesTablePanel.add(filterAreaPanel, BorderLayout.SOUTH);
|
matchesTablePanel.add(filterAreaPanel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
JPanel parentPanel = new JPanel(new BorderLayout());
|
JPanel parentPanel = new JPanel(new BorderLayout());
|
||||||
parentPanel.add(matchesTablePanel);
|
parentPanel.add(matchesTablePanel);
|
||||||
|
|
||||||
|
matchesTable.setAccessibleNamePrefix("Matches");
|
||||||
|
|
||||||
return parentPanel;
|
return parentPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ public abstract class AbstractTextFilter<T> extends Filter<T> {
|
||||||
textField.disableFocusEventProcessing();
|
textField.disableFocusEventProcessing();
|
||||||
|
|
||||||
JLabel label = new GDLabel(filterName + ": ");
|
JLabel label = new GDLabel(filterName + ": ");
|
||||||
|
label.setLabelFor(textField);
|
||||||
panel.add(label, BorderLayout.WEST);
|
panel.add(label, BorderLayout.WEST);
|
||||||
panel.add(textField, BorderLayout.CENTER);
|
panel.add(textField, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
|
|
@ -76,13 +76,11 @@ class ComponentNode extends Node {
|
||||||
String owner = e.getAttributeValue("OWNER");
|
String owner = e.getAttributeValue("OWNER");
|
||||||
String title = e.getAttributeValue("TITLE");
|
String title = e.getAttributeValue("TITLE");
|
||||||
String group = e.getAttributeValue("GROUP");
|
String group = e.getAttributeValue("GROUP");
|
||||||
if (group == null || group.trim()
|
if (group == null || group.trim().isEmpty()) {
|
||||||
.isEmpty()) {
|
|
||||||
group = ComponentProvider.DEFAULT_WINDOW_GROUP;
|
group = ComponentProvider.DEFAULT_WINDOW_GROUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isActive = Boolean.valueOf(e.getAttributeValue("ACTIVE"))
|
boolean isActive = Boolean.valueOf(e.getAttributeValue("ACTIVE")).booleanValue();
|
||||||
.booleanValue();
|
|
||||||
|
|
||||||
long uniqueID = getUniqueID(e, 0);
|
long uniqueID = getUniqueID(e, 0);
|
||||||
|
|
||||||
|
@ -131,14 +129,10 @@ class ComponentNode extends Node {
|
||||||
String name = placeholder.getName();
|
String name = placeholder.getName();
|
||||||
String title = placeholder.getTitle();
|
String title = placeholder.getTitle();
|
||||||
for (ComponentPlaceholder existingPlaceholder : windowPlaceholders) {
|
for (ComponentPlaceholder existingPlaceholder : windowPlaceholders) {
|
||||||
if (existingPlaceholder.getOwner()
|
if (existingPlaceholder.getOwner().equals(owner) &&
|
||||||
.equals(owner) &&
|
existingPlaceholder.getName().equals(name) &&
|
||||||
existingPlaceholder.getName()
|
existingPlaceholder.getGroup().equals(group) &&
|
||||||
.equals(name) &&
|
existingPlaceholder.getTitle().equals(title)) {
|
||||||
existingPlaceholder.getGroup()
|
|
||||||
.equals(group) &&
|
|
||||||
existingPlaceholder.getTitle()
|
|
||||||
.equals(title)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import java.math.BigInteger;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.accessibility.*;
|
import javax.accessibility.*;
|
||||||
import javax.swing.JComponent;
|
|
||||||
|
|
||||||
import docking.widgets.EventTrigger;
|
import docking.widgets.EventTrigger;
|
||||||
import docking.widgets.fieldpanel.field.Field;
|
import docking.widgets.fieldpanel.field.Field;
|
||||||
|
@ -58,7 +57,7 @@ public class AccessibleFieldPanelDelegate {
|
||||||
private List<AccessibleLayout> accessibleLayouts;
|
private List<AccessibleLayout> accessibleLayouts;
|
||||||
private int totalFieldCount;
|
private int totalFieldCount;
|
||||||
private AccessibleField[] fieldsCache;
|
private AccessibleField[] fieldsCache;
|
||||||
private JComponent panel;
|
private FieldPanel panel;
|
||||||
|
|
||||||
// caret position tracking
|
// caret position tracking
|
||||||
private FieldLocation cursorLoc;
|
private FieldLocation cursorLoc;
|
||||||
|
@ -71,7 +70,7 @@ public class AccessibleFieldPanelDelegate {
|
||||||
private FieldSelection currentSelection;
|
private FieldSelection currentSelection;
|
||||||
|
|
||||||
public AccessibleFieldPanelDelegate(List<AnchoredLayout> layouts, AccessibleContext context,
|
public AccessibleFieldPanelDelegate(List<AnchoredLayout> layouts, AccessibleContext context,
|
||||||
JComponent panel) {
|
FieldPanel panel) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.panel = panel;
|
this.panel = panel;
|
||||||
setLayouts(layouts);
|
setLayouts(layouts);
|
||||||
|
@ -84,6 +83,7 @@ public class AccessibleFieldPanelDelegate {
|
||||||
*/
|
*/
|
||||||
public void setLayouts(List<AnchoredLayout> layouts) {
|
public void setLayouts(List<AnchoredLayout> layouts) {
|
||||||
totalFieldCount = 0;
|
totalFieldCount = 0;
|
||||||
|
cursorField = null;
|
||||||
accessibleLayouts = new ArrayList<>(layouts.size());
|
accessibleLayouts = new ArrayList<>(layouts.size());
|
||||||
for (AnchoredLayout layout : layouts) {
|
for (AnchoredLayout layout : layouts) {
|
||||||
AccessibleLayout accessibleLayout = new AccessibleLayout(layout, totalFieldCount);
|
AccessibleLayout accessibleLayout = new AccessibleLayout(layout, totalFieldCount);
|
||||||
|
@ -92,6 +92,9 @@ public class AccessibleFieldPanelDelegate {
|
||||||
}
|
}
|
||||||
fieldsCache = new AccessibleField[totalFieldCount];
|
fieldsCache = new AccessibleField[totalFieldCount];
|
||||||
context.firePropertyChange(ACCESSIBLE_INVALIDATE_CHILDREN, null, panel);
|
context.firePropertyChange(ACCESSIBLE_INVALIDATE_CHILDREN, null, panel);
|
||||||
|
if (cursorLoc != null) {
|
||||||
|
setCaret(cursorLoc, EventTrigger.GUI_ACTION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,6 +111,7 @@ public class AccessibleFieldPanelDelegate {
|
||||||
AccessibleTextSequence newSequence = getAccessibleTextSequence(cursorField);
|
AccessibleTextSequence newSequence = getAccessibleTextSequence(cursorField);
|
||||||
String oldDescription = description;
|
String oldDescription = description;
|
||||||
description = generateDescription();
|
description = generateDescription();
|
||||||
|
|
||||||
if (trigger == EventTrigger.GUI_ACTION) {
|
if (trigger == EventTrigger.GUI_ACTION) {
|
||||||
context.firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, oldSequence, newSequence);
|
context.firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, oldSequence, newSequence);
|
||||||
context.firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY, oldDescription,
|
context.firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY, oldDescription,
|
||||||
|
@ -212,15 +216,33 @@ public class AccessibleFieldPanelDelegate {
|
||||||
* @return the AccessibleField associated with the given field location
|
* @return the AccessibleField associated with the given field location
|
||||||
*/
|
*/
|
||||||
public AccessibleField getAccessibleField(FieldLocation loc) {
|
public AccessibleField getAccessibleField(FieldLocation loc) {
|
||||||
int result = Collections.binarySearch(accessibleLayouts, loc.getIndex(),
|
AccessibleLayout accessibleLayout = getAccessibleLayout(loc.getIndex());
|
||||||
|
if (accessibleLayout != null) {
|
||||||
|
return getAccessibleField(accessibleLayout.getStartingFieldNum() + loc.getFieldNum());
|
||||||
|
}
|
||||||
|
|
||||||
|
LayoutModel layoutModel = panel.getLayoutModel();
|
||||||
|
Layout layout = layoutModel.getLayout(loc.getIndex());
|
||||||
|
if (layout == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Field field = layout.getField(loc.getFieldNum());
|
||||||
|
return new AccessibleField(field, panel, loc.getFieldNum(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AccessibleLayout getAccessibleLayout(BigInteger index) {
|
||||||
|
if (accessibleLayouts == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int result = Collections.binarySearch(accessibleLayouts, index,
|
||||||
Comparator.comparing(
|
Comparator.comparing(
|
||||||
o -> o instanceof AccessibleLayout lh ? lh.getIndex() : (BigInteger) o,
|
o -> o instanceof AccessibleLayout lh ? lh.getIndex() : (BigInteger) o,
|
||||||
BigInteger::compareTo));
|
BigInteger::compareTo));
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
AccessibleLayout layout = accessibleLayouts.get(result);
|
return accessibleLayouts.get(result);
|
||||||
return getAccessibleField(layout.getStartingFieldNum() + loc.getFieldNum());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AccessibleField createAccessibleField(int fieldNum) {
|
private AccessibleField createAccessibleField(int fieldNum) {
|
||||||
|
@ -321,7 +343,7 @@ public class AccessibleFieldPanelDelegate {
|
||||||
*/
|
*/
|
||||||
public Accessible getAccessibleAt(Point p) {
|
public Accessible getAccessibleAt(Point p) {
|
||||||
int result = Collections.binarySearch(accessibleLayouts, p.y, Comparator
|
int result = Collections.binarySearch(accessibleLayouts, p.y, Comparator
|
||||||
.comparingInt(o -> o instanceof AccessibleLayout lh ? lh.getYpos() : (Integer) o));
|
.comparingInt(o -> o instanceof AccessibleLayout lh ? lh.getYpos() : (Integer) o));
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
result = -result - 2;
|
result = -result - 2;
|
||||||
|
|
|
@ -2195,6 +2195,7 @@ public class FieldPanel extends JPanel
|
||||||
// Make sure the position is valid
|
// Make sure the position is valid
|
||||||
if ((index.compareTo(BigInteger.ZERO) < 0) ||
|
if ((index.compareTo(BigInteger.ZERO) < 0) ||
|
||||||
(index.compareTo(model.getNumIndexes()) >= 0)) {
|
(index.compareTo(model.getNumIndexes()) >= 0)) {
|
||||||
|
notifyCursorChanged(trigger);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -464,4 +464,16 @@ public class FilterTextField extends JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the accessible name prefix for for the focusable components in the filter panel.
|
||||||
|
* @param prefix the base name for these components. A suffix will be added to further
|
||||||
|
* describe the sub component.
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String prefix) {
|
||||||
|
String name = prefix + " filter text field";
|
||||||
|
textField.setName(name);
|
||||||
|
textField.getAccessibleContext().setAccessibleName(name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,15 @@ public class GFilterTable<ROW_OBJECT> extends JPanel {
|
||||||
filterPanel.dispose();
|
filterPanel.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the accessible name prefix for both the table and the filter panel
|
||||||
|
* @param prefix the name prefix
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String prefix) {
|
||||||
|
table.setAccessibleNamePrefix(prefix);
|
||||||
|
filterPanel.setAccessibleNamePrefix(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
private void buildTable() {
|
private void buildTable() {
|
||||||
if (model instanceof ThreadedTableModel) {
|
if (model instanceof ThreadedTableModel) {
|
||||||
buildThreadedTable();
|
buildThreadedTable();
|
||||||
|
|
|
@ -409,6 +409,24 @@ public class GTable extends JTable {
|
||||||
return enableActionKeyBindings;
|
return enableActionKeyBindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets an accessible name on the GTable such that screen readers will properly describe them.
|
||||||
|
* <P>
|
||||||
|
* This prefix should be the base name that describes the type of items in the table.
|
||||||
|
* This method will then append the necessary information to property name the table.
|
||||||
|
*
|
||||||
|
* @param namePrefix the accessible name prefix to assign to the filter component. For
|
||||||
|
* example if the table contains fruits, then "Fruits" would be an appropriate prefix name.
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String namePrefix) {
|
||||||
|
// set the component name as general good practice
|
||||||
|
setName(namePrefix + " Table");
|
||||||
|
|
||||||
|
// screen reader reads the accessible name followed by the role ("table" in this case)
|
||||||
|
// so don't append "Table" to the accessible name
|
||||||
|
getAccessibleContext().setAccessibleName(namePrefix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables or disables auto-edit. When enabled, the user can start typing to trigger an
|
* Enables or disables auto-edit. When enabled, the user can start typing to trigger an
|
||||||
* edit of an editable table cell.
|
* edit of an editable table cell.
|
||||||
|
|
|
@ -201,6 +201,33 @@ public class GTableFilterPanel<ROW_OBJECT> extends JPanel {
|
||||||
this(table, tableModel, " Filter: ");
|
this(table, tableModel, " Filter: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets an accessible name on the filter component. This prefix will be used to assign
|
||||||
|
* meaningful accessible names to the filter text field and the filter options button such
|
||||||
|
* that screen readers will properly describe them.
|
||||||
|
* <P>
|
||||||
|
* This prefix should be the base name that describes the type of items in the table. For
|
||||||
|
* example if the table contains fruits, then "Fruits" would be an appropriate prefix name.
|
||||||
|
* This method will then append the necessary information to name the text field and the button.
|
||||||
|
*
|
||||||
|
* @param namePrefix the accessible name prefix to assign to the filter component.
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String namePrefix) {
|
||||||
|
filterField.setAccessibleNamePrefix(namePrefix);
|
||||||
|
String filterOptionsPrefix = namePrefix + " Filter Options";
|
||||||
|
filterStateButton.setName(filterOptionsPrefix + " Button");
|
||||||
|
|
||||||
|
// screen reader reads the accessible name followed by the role ("button" in this case)
|
||||||
|
// so don't append "button" to the accessible name
|
||||||
|
filterStateButton.getAccessibleContext().setAccessibleName(filterOptionsPrefix);
|
||||||
|
|
||||||
|
// Setting the accessible description to empty string prevents it from reading any tooltips
|
||||||
|
// on the button when the button gets focus. These buttons tend to have particularly large
|
||||||
|
// tooltips which seem excessive to read to the user every time they get focus. We may need
|
||||||
|
// to revisit this decision.
|
||||||
|
filterStateButton.getAccessibleContext().setAccessibleDescription("");
|
||||||
|
}
|
||||||
|
|
||||||
public GTableFilterPanel(JTable table, RowObjectTableModel<ROW_OBJECT> tableModel,
|
public GTableFilterPanel(JTable table, RowObjectTableModel<ROW_OBJECT> tableModel,
|
||||||
String filterLabel) {
|
String filterLabel) {
|
||||||
this.table = table;
|
this.table = table;
|
||||||
|
|
|
@ -17,6 +17,7 @@ package docking.widgets.tree;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
|
||||||
|
import javax.accessibility.AccessibleContext;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.BevelBorder;
|
import javax.swing.border.BevelBorder;
|
||||||
|
|
||||||
|
@ -72,6 +73,26 @@ public class DefaultGTreeFilterProvider implements GTreeFilterProvider {
|
||||||
filterField.setEnabled(enabled);
|
filterField.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAccessibleNamePrefix(String namePrefix) {
|
||||||
|
filterField.setAccessibleNamePrefix(namePrefix);
|
||||||
|
|
||||||
|
String buttonNamePrefix = namePrefix + " Filter Options";
|
||||||
|
filterStateButton.setName(buttonNamePrefix + " Button");
|
||||||
|
AccessibleContext context = filterStateButton.getAccessibleContext();
|
||||||
|
|
||||||
|
// Don't add "Button" to prefix because screen readers reads the name followed by the role,
|
||||||
|
// which in this case, is "button"
|
||||||
|
context.setAccessibleName(buttonNamePrefix);
|
||||||
|
|
||||||
|
// Setting the accessible description to empty string prevents it from reading any tooltips
|
||||||
|
// on the button when the button gets focus. These buttons tend to have particularly large
|
||||||
|
// tooltips which seem excessive to read to the user every time they get focus. We may need
|
||||||
|
// to revisit this decision.
|
||||||
|
context.setAccessibleDescription("");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void updateModelFilter() {
|
private void updateModelFilter() {
|
||||||
gTree.filterChanged();
|
gTree.filterChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,6 +248,24 @@ public class GTree extends JPanel implements BusyListener {
|
||||||
add(filterProvider.getFilterComponent(), BorderLayout.SOUTH);
|
add(filterProvider.getFilterComponent(), BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets an accessible name on the GTree. This prefix will be used to assign
|
||||||
|
* meaningful accessible names to the tree, filter text field and the filter options button such
|
||||||
|
* that screen readers will properly describe them.
|
||||||
|
* <P>
|
||||||
|
* This prefix should be the base name that describes the type of items in the tree.
|
||||||
|
* This method will then append the necessary information to name the text field and the button.
|
||||||
|
*
|
||||||
|
* @param namePrefix the accessible name prefix to assign to the filter component. For
|
||||||
|
* example if the tree contains fruits, then "Fruits" would be an appropriate prefix name.
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String namePrefix) {
|
||||||
|
tree.setName(namePrefix + " Tree");
|
||||||
|
tree.getAccessibleContext().setAccessibleName(namePrefix);
|
||||||
|
tree.getAccessibleContext().setAccessibleDescription("");
|
||||||
|
filterProvider.setAccessibleNamePrefix(namePrefix);
|
||||||
|
}
|
||||||
|
|
||||||
public void setCellRenderer(GTreeRenderer renderer) {
|
public void setCellRenderer(GTreeRenderer renderer) {
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
tree.setCellRenderer(renderer);
|
tree.setCellRenderer(renderer);
|
||||||
|
@ -1094,17 +1112,17 @@ public class GTree extends JPanel implements BusyListener {
|
||||||
Consumer<GTreeNode> consumer) {
|
Consumer<GTreeNode> consumer) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
If the GTree were to use Java's CompletableStage API, then the code below
|
If the GTree were to use Java's CompletableStage API, then the code below
|
||||||
could be written thusly:
|
could be written thusly:
|
||||||
|
|
||||||
tree.getNewNode(modelParent, newName)
|
tree.getNewNode(modelParent, newName)
|
||||||
.thenCompose(newModelChild -> {
|
.thenCompose(newModelChild -> {
|
||||||
tree.ignoreFilter(newModelChild);
|
tree.ignoreFilter(newModelChild);
|
||||||
return tree.getNewNode(viewParent, newName);
|
return tree.getNewNode(viewParent, newName);
|
||||||
))
|
))
|
||||||
.thenAccept(consumer);
|
.thenAccept(consumer);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ensure we operate on the model node which will always have the given child not the view
|
// ensure we operate on the model node which will always have the given child not the view
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -16,26 +15,71 @@
|
||||||
*/
|
*/
|
||||||
package docking.widgets.tree;
|
package docking.widgets.tree;
|
||||||
|
|
||||||
import ghidra.util.FilterTransformer;
|
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
import docking.widgets.tree.support.GTreeFilter;
|
import docking.widgets.tree.support.GTreeFilter;
|
||||||
|
import ghidra.util.FilterTransformer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for providing a filter for GTrees.
|
||||||
|
*/
|
||||||
public interface GTreeFilterProvider {
|
public interface GTreeFilterProvider {
|
||||||
|
/**
|
||||||
|
* Returns the component to place at the bottom of a GTree to provider filtering capabilites.
|
||||||
|
* @return the filter component
|
||||||
|
*/
|
||||||
public JComponent getFilterComponent();
|
public JComponent getFilterComponent();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the {@link GTreeFilter} object to apply to the GTree whenever the filter component
|
||||||
|
* is manipulated
|
||||||
|
* @return the GTreeFilter to apply to the tree
|
||||||
|
*/
|
||||||
public GTreeFilter getFilter();
|
public GTreeFilter getFilter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the active state for the filter component.
|
||||||
|
* @param enabled true, the filter component is enabled
|
||||||
|
*/
|
||||||
public void setEnabled(boolean enabled);
|
public void setEnabled(boolean enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the filter text for the filter.
|
||||||
|
* @param text the text to filter on
|
||||||
|
*/
|
||||||
public void setFilterText(String text);
|
public void setFilterText(String text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current filter text.
|
||||||
|
* @return the current filter text
|
||||||
|
*/
|
||||||
public String getFilterText();
|
public String getFilterText();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a {@link FilterTransformer} for preparing tree data to be filtered.
|
||||||
|
* @param transformer the transform for preparing tree data to be filtered
|
||||||
|
*/
|
||||||
public void setDataTransformer(FilterTransformer<GTreeNode> transformer);
|
public void setDataTransformer(FilterTransformer<GTreeNode> transformer);
|
||||||
|
|
||||||
public void loadFilterPreference(DockingWindowManager windowManager, String uniquePreferenceKey);
|
/**
|
||||||
|
* Loads any filter preferences that have been saved.
|
||||||
|
* @param windowManager the {@link DockingWindowManager} to load preferences from
|
||||||
|
* @param uniquePreferenceKey the preference key
|
||||||
|
*/
|
||||||
|
public void loadFilterPreference(DockingWindowManager windowManager,
|
||||||
|
String uniquePreferenceKey);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets an accessible name on the filter component. This prefix will be used to assign
|
||||||
|
* meaningful accessible names to the filter text field and the filter options button such
|
||||||
|
* that screen readers will properly describe them.
|
||||||
|
* <P>
|
||||||
|
* This prefix should be the base name that describes the type of items in the tree.
|
||||||
|
* This method will then append the necessary information to name the text field and the button.
|
||||||
|
*
|
||||||
|
* @param namePrefix the accessible name prefix to assign to the filter component. For
|
||||||
|
* example if the tree contains fruits, then "Fruits" would be an appropriate prefix name.
|
||||||
|
*/
|
||||||
|
public void setAccessibleNamePrefix(String namePrefix);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.beans.PropertyChangeListener;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.accessibility.AccessibleContext;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.*;
|
import docking.*;
|
||||||
|
@ -64,6 +65,8 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
private EventDisplayPanel eventDisplay;
|
private EventDisplayPanel eventDisplay;
|
||||||
private JSplitPane splitPane;
|
private JSplitPane splitPane;
|
||||||
private ToggleDockingAction eventAction;
|
private ToggleDockingAction eventAction;
|
||||||
|
private ToggleDockingAction toggleFollowFocusAction;
|
||||||
|
private boolean updateOnFocusChange = true;
|
||||||
|
|
||||||
public ComponentInfoDialog() {
|
public ComponentInfoDialog() {
|
||||||
super("Component Inspector", false);
|
super("Component Inspector", false);
|
||||||
|
@ -71,7 +74,8 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
addWorkPanel(buildMainPanel());
|
addWorkPanel(buildMainPanel());
|
||||||
addDismissButton();
|
addDismissButton();
|
||||||
addOKButton();
|
addOKButton();
|
||||||
setOkButtonText("Arm");
|
setOkButtonText("Reset");
|
||||||
|
setOkToolTip("Clears component table and will re-populate on next focussed component");
|
||||||
|
|
||||||
setPreferredSize(1200, 600);
|
setPreferredSize(1200, 600);
|
||||||
eventDisplay = new EventDisplayPanel();
|
eventDisplay = new EventDisplayPanel();
|
||||||
|
@ -79,7 +83,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
|
|
||||||
KeyboardFocusManager km = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
KeyboardFocusManager km = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||||
km.addPropertyChangeListener("permanentFocusOwner", this);
|
km.addPropertyChangeListener("permanentFocusOwner", this);
|
||||||
arm();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createActions() {
|
private void createActions() {
|
||||||
|
@ -106,6 +110,19 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
.onAction(c -> toggleShowEvents())
|
.onAction(c -> toggleShowEvents())
|
||||||
.build();
|
.build();
|
||||||
addAction(eventAction);
|
addAction(eventAction);
|
||||||
|
|
||||||
|
toggleFollowFocusAction = new ToggleActionBuilder("Follow Focus", ACTION_OWNER)
|
||||||
|
.toolBarIcon(Icons.NAVIGATE_ON_INCOMING_EVENT_ICON)
|
||||||
|
.description("On causes component table to constant repopulate as focus changes")
|
||||||
|
.onAction(c -> toggleFollowFocus())
|
||||||
|
.selected(true)
|
||||||
|
.build();
|
||||||
|
addAction(toggleFollowFocusAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleFollowFocus() {
|
||||||
|
updateOnFocusChange = toggleFollowFocusAction.isSelected();
|
||||||
|
setOkEnabled(!updateOnFocusChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleShowEvents() {
|
private void toggleShowEvents() {
|
||||||
|
@ -125,11 +142,11 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void okCallback() {
|
protected void okCallback() {
|
||||||
arm();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear the current table data. The next component to get focus will repopulate the table data.
|
// clear the current table data. The next component to get focus will repopulate the table data.
|
||||||
private void arm() {
|
private void reset() {
|
||||||
setRootContainer(null);
|
setRootContainer(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +171,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
private JComponent buildTablePanel() {
|
private JComponent buildTablePanel() {
|
||||||
model = new ComponentTableModel();
|
model = new ComponentTableModel();
|
||||||
filterTable = new GFilterTable<ComponentInfo>(model);
|
filterTable = new GFilterTable<ComponentInfo>(model);
|
||||||
|
filterTable.setAccessibleNamePrefix("Component Info");
|
||||||
return filterTable;
|
return filterTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +262,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectFocusedComponentInTable(Component newFocusComponent) {
|
private void selectFocusedComponentInTable(Component newFocusComponent) {
|
||||||
if (infos.isEmpty()) {
|
if (infos.isEmpty() || updateOnFocusChange) {
|
||||||
if (newFocusComponent == null) {
|
if (newFocusComponent == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -255,6 +273,9 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRootContainer(Container container) {
|
void setRootContainer(Container container) {
|
||||||
|
if (rootComponentForTable == container) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
rootComponentForTable = container;
|
rootComponentForTable = container;
|
||||||
buildComponentModel();
|
buildComponentModel();
|
||||||
}
|
}
|
||||||
|
@ -383,6 +404,8 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
descriptor.addVisibleColumn(new ComponentNameColumn());
|
descriptor.addVisibleColumn(new ComponentNameColumn());
|
||||||
descriptor.addVisibleColumn(new ComponentClassColumn());
|
descriptor.addVisibleColumn(new ComponentClassColumn());
|
||||||
descriptor.addVisibleColumn(new ToolTipColumn());
|
descriptor.addVisibleColumn(new ToolTipColumn());
|
||||||
|
descriptor.addVisibleColumn(new AccessibleNameColumn());
|
||||||
|
descriptor.addVisibleColumn(new AccessibleDescriptionColumn());
|
||||||
descriptor.addHiddenColumn(new FocusableColumn());
|
descriptor.addHiddenColumn(new FocusableColumn());
|
||||||
descriptor.addHiddenColumn(new IsFocusCycleRootColumn());
|
descriptor.addHiddenColumn(new IsFocusCycleRootColumn());
|
||||||
descriptor.addHiddenColumn(new focusCycleRootColumn());
|
descriptor.addHiddenColumn(new focusCycleRootColumn());
|
||||||
|
@ -435,6 +458,54 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class AccessibleNameColumn
|
||||||
|
extends AbstractDynamicTableColumn<ComponentInfo, String, Object> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getColumnName() {
|
||||||
|
return "Accessible Name";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getValue(ComponentInfo info, Settings settings, Object data,
|
||||||
|
ServiceProvider provider) throws IllegalArgumentException {
|
||||||
|
AccessibleContext context = info.getComponent().getAccessibleContext();
|
||||||
|
if (context != null) {
|
||||||
|
return context.getAccessibleName();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColumnPreferredWidth() {
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class AccessibleDescriptionColumn
|
||||||
|
extends AbstractDynamicTableColumn<ComponentInfo, String, Object> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getColumnName() {
|
||||||
|
return "Accessible Description";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getValue(ComponentInfo info, Settings settings, Object data,
|
||||||
|
ServiceProvider provider) throws IllegalArgumentException {
|
||||||
|
AccessibleContext context = info.getComponent().getAccessibleContext();
|
||||||
|
if (context != null) {
|
||||||
|
return context.getAccessibleDescription();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColumnPreferredWidth() {
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class ComponentClassColumn
|
private class ComponentClassColumn
|
||||||
extends AbstractDynamicTableColumn<ComponentInfo, String, Object> {
|
extends AbstractDynamicTableColumn<ComponentInfo, String, Object> {
|
||||||
|
|
||||||
|
@ -510,7 +581,8 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
|
||||||
public String getValue(ComponentInfo info, Settings settings, Object data,
|
public String getValue(ComponentInfo info, Settings settings, Object data,
|
||||||
ServiceProvider provider) throws IllegalArgumentException {
|
ServiceProvider provider) throws IllegalArgumentException {
|
||||||
Set<AWTKeyStroke> keys = info.getComponent()
|
Set<AWTKeyStroke> keys = info.getComponent()
|
||||||
.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
|
.getFocusTraversalKeys(
|
||||||
|
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
|
||||||
return keys == null ? "" : keys.toString();
|
return keys == null ? "" : keys.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,13 @@ import java.util.Locale;
|
||||||
|
|
||||||
import javax.accessibility.*;
|
import javax.accessibility.*;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import docking.widgets.EventTrigger;
|
import docking.widgets.EventTrigger;
|
||||||
import docking.widgets.fieldpanel.field.*;
|
import docking.widgets.fieldpanel.field.*;
|
||||||
|
import docking.widgets.fieldpanel.internal.EmptyBigLayoutModel;
|
||||||
import docking.widgets.fieldpanel.support.*;
|
import docking.widgets.fieldpanel.support.*;
|
||||||
|
|
||||||
public class AccessibleFieldPanelDelegateTest {
|
public class AccessibleFieldPanelDelegateTest {
|
||||||
|
@ -42,7 +42,7 @@ public class AccessibleFieldPanelDelegateTest {
|
||||||
private static FontMetrics fontMetrics =
|
private static FontMetrics fontMetrics =
|
||||||
new JLabel("Dummy").getFontMetrics(new Font("Monospaced", Font.PLAIN, 12));
|
new JLabel("Dummy").getFontMetrics(new Font("Monospaced", Font.PLAIN, 12));
|
||||||
private List<AnchoredLayout> layouts;
|
private List<AnchoredLayout> layouts;
|
||||||
private JPanel panel = new JPanel();
|
private FieldPanel panel = new FieldPanel(new EmptyBigLayoutModel());
|
||||||
private TestAccessibleContext testContext = new TestAccessibleContext();
|
private TestAccessibleContext testContext = new TestAccessibleContext();
|
||||||
private int fieldLineHeight = fontMetrics.getHeight() + 1;
|
private int fieldLineHeight = fontMetrics.getHeight() + 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue