mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-4555 set accessible names for components
This commit is contained in:
parent
136a944796
commit
6121818cd3
150 changed files with 1054 additions and 346 deletions
|
@ -16,15 +16,6 @@
|
|||
package ghidra.feature.vt.gui.editors;
|
||||
|
||||
import static ghidra.feature.vt.gui.editors.TagEditorDialog.TagState.Action.*;
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.api.main.VTMatchTag;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.editors.TagEditorDialog.TagState.Action;
|
||||
import ghidra.framework.model.TransactionInfo;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.*;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.event.*;
|
||||
|
@ -37,6 +28,15 @@ import javax.swing.event.ListSelectionListener;
|
|||
import docking.DialogComponentProvider;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.list.ListRendererMouseEventForwarder;
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.api.main.VTMatchTag;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.editors.TagEditorDialog.TagState.Action;
|
||||
import ghidra.framework.model.TransactionInfo;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.*;
|
||||
|
||||
public class TagEditorDialog extends DialogComponentProvider {
|
||||
|
||||
|
@ -60,8 +60,10 @@ public class TagEditorDialog extends DialogComponentProvider {
|
|||
JPanel mainPanel = new JPanel(new BorderLayout());
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane();
|
||||
scrollPane.getAccessibleContext().setAccessibleName("Tag List");
|
||||
listModel = new TagStateListModel(getTags());
|
||||
list = new JList<>(listModel);
|
||||
list.getAccessibleContext().setAccessibleName("Tag");
|
||||
list.setBackground(scrollPane.getBackground());
|
||||
list.setCellRenderer(new TagEditorRenderer(list, listModel));
|
||||
list.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
|
@ -75,6 +77,7 @@ public class TagEditorDialog extends DialogComponentProvider {
|
|||
mainPanel.add(scrollPane, BorderLayout.CENTER);
|
||||
|
||||
JButton addButton = new JButton("Add");
|
||||
addButton.getAccessibleContext().setAccessibleName("Add");
|
||||
addButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -87,9 +90,8 @@ public class TagEditorDialog extends DialogComponentProvider {
|
|||
}
|
||||
|
||||
private TagState createNewTag() {
|
||||
String tagName =
|
||||
OptionDialog.showInputSingleLineDialog(getComponent(), "Create Tag",
|
||||
"Enter tag name: ", "");
|
||||
String tagName = OptionDialog.showInputSingleLineDialog(getComponent(),
|
||||
"Create Tag", "Enter tag name: ", "");
|
||||
if (tagName == null || "".equals(tagName.trim())) {
|
||||
return null;
|
||||
}
|
||||
|
@ -98,6 +100,7 @@ public class TagEditorDialog extends DialogComponentProvider {
|
|||
});
|
||||
|
||||
final JButton deleteButton = new JButton("Delete");
|
||||
deleteButton.getAccessibleContext().setAccessibleName("Delete");
|
||||
deleteButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -136,12 +139,13 @@ public class TagEditorDialog extends DialogComponentProvider {
|
|||
});
|
||||
|
||||
JPanel editPanel = new JPanel();
|
||||
editPanel.getAccessibleContext().setAccessibleName("Edit");
|
||||
editPanel.add(addButton);
|
||||
editPanel.add(Box.createHorizontalStrut(5));
|
||||
editPanel.add(deleteButton);
|
||||
|
||||
mainPanel.add(editPanel, BorderLayout.SOUTH);
|
||||
|
||||
mainPanel.getAccessibleContext().setAccessibleName("Tag Editor");
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,10 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta
|
|||
JPanel mainPanel = new JPanel(new BorderLayout());
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane();
|
||||
scrollPane.getAccessibleContext().setAccessibleName("Tag List");
|
||||
listModel = new TagListModel(allTags, excludedTags);
|
||||
final JList list = new JList(listModel);
|
||||
list.getAccessibleContext().setAccessibleName("Tag");
|
||||
list.setBackground(scrollPane.getBackground());
|
||||
list.setCellRenderer(new TagRenderer());
|
||||
list.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
|
@ -75,6 +77,7 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta
|
|||
mainPanel.add(scrollPane, BorderLayout.CENTER);
|
||||
|
||||
JButton editButton = new JButton("Manage Tags");
|
||||
editButton.getAccessibleContext().setAccessibleName("Edit");
|
||||
editButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -92,10 +95,11 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta
|
|||
});
|
||||
|
||||
JPanel editPanel = new JPanel();
|
||||
editPanel.getAccessibleContext().setAccessibleName("Edit");
|
||||
editPanel.add(editButton);
|
||||
|
||||
mainPanel.add(editPanel, BorderLayout.SOUTH);
|
||||
|
||||
mainPanel.getAccessibleContext().setAccessibleName("Tag Filter Editor");
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,16 +15,16 @@
|
|||
*/
|
||||
package ghidra.feature.vt.gui.provider.markuptable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import ghidra.feature.vt.api.main.VTMarkupItem;
|
||||
import ghidra.feature.vt.gui.filters.AncillaryFilterDialogComponentProvider;
|
||||
import ghidra.feature.vt.gui.filters.FilterDialogModel;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class MarkupItemFilterDialogComponentProvider extends
|
||||
AncillaryFilterDialogComponentProvider<VTMarkupItem> {
|
||||
public class MarkupItemFilterDialogComponentProvider
|
||||
extends AncillaryFilterDialogComponentProvider<VTMarkupItem> {
|
||||
|
||||
MarkupItemFilterDialogComponentProvider(VTController controller,
|
||||
FilterDialogModel<VTMarkupItem> dialogModel) {
|
||||
|
@ -44,18 +43,20 @@ public class MarkupItemFilterDialogComponentProvider extends
|
|||
|
||||
// status filter
|
||||
MarkupStatusFilter statusFilter = new MarkupStatusFilter();
|
||||
statusFilter.getComponent().getAccessibleContext().setAccessibleName("Status");
|
||||
addFilter(statusFilter);
|
||||
rowOnePanel.add(statusFilter.getComponent());
|
||||
|
||||
// markup type
|
||||
MarkupTypeFilter typeFilter = new MarkupTypeFilter();
|
||||
typeFilter.getComponent().getAccessibleContext().setAccessibleName("Markup");
|
||||
addFilter(typeFilter);
|
||||
rowOnePanel.add(typeFilter.getComponent());
|
||||
|
||||
// These are currently handled by the text field filter on the provider
|
||||
// source value
|
||||
// destination value
|
||||
|
||||
rowOnePanel.getAccessibleContext().setAccessibleName("Markup Item Filter");
|
||||
return rowOnePanel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,16 +145,19 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||
private JComponent createComponent() {
|
||||
|
||||
markupPanel = new JPanel(new BorderLayout());
|
||||
markupPanel.getAccessibleContext().setAccessibleName("Markup");
|
||||
markupItemsTable = createMarkupItemTable();
|
||||
markupItemsTablePanel = new JPanel(new BorderLayout());
|
||||
|
||||
markupItemsTablePanel.getAccessibleContext().setAccessibleName("Markup Item Table");
|
||||
JPanel filterAreaPanel = createFilterArea();
|
||||
filterAreaPanel.getAccessibleContext().setAccessibleName("Filter Area");
|
||||
markupItemsTablePanel.add(tablePanel, BorderLayout.CENTER);
|
||||
markupItemsTablePanel.add(filterAreaPanel, BorderLayout.SOUTH);
|
||||
|
||||
functionComparisonPanel = new FunctionComparisonPanel(tool, getOwner());
|
||||
addSpecificCodeComparisonActions();
|
||||
functionComparisonPanel.setCurrentTabbedComponent(ListingCodeComparisonPanel.NAME);
|
||||
functionComparisonPanel.getAccessibleContext().setAccessibleName("Function Comparison");
|
||||
functionComparisonPanel.setTitlePrefixes("Source:", "Destination:");
|
||||
ListingCodeComparisonPanel dualListingPanel = functionComparisonPanel.getDualListingPanel();
|
||||
if (dualListingPanel != null) {
|
||||
|
@ -178,6 +181,7 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, markupItemsTablePanel,
|
||||
functionComparisonPanel);
|
||||
splitPane.setResizeWeight(0.4);
|
||||
splitPane.getAccessibleContext().setAccessibleName("Markup Items and Function Comparison");
|
||||
markupPanel.add(splitPane, BorderLayout.CENTER);
|
||||
|
||||
markupItemsTable.setAccessibleNamePrefix("Markup Items");
|
||||
|
@ -316,10 +320,11 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||
|
||||
// ...account for the scroll bar width
|
||||
JScrollBar scrollBar = new JScrollBar(Adjustable.VERTICAL);
|
||||
scrollBar.getAccessibleContext().setAccessibleName("Markup Item Table");
|
||||
Dimension scrollBarSize = scrollBar.getMinimumSize();
|
||||
size.width = preferredSize.width + scrollBarSize.width;
|
||||
table.setPreferredScrollableViewportSize(size);
|
||||
|
||||
table.getAccessibleContext().setAccessibleName("Markup Item");
|
||||
return table;
|
||||
}
|
||||
|
||||
|
@ -405,9 +410,11 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||
JPanel parentPanel = new JPanel(new BorderLayout());
|
||||
|
||||
JComponent nameFilterPanel = createTextFilterPanel();
|
||||
nameFilterPanel.getAccessibleContext().setAccessibleName("Name Filter");
|
||||
parentPanel.add(nameFilterPanel, BorderLayout.CENTER);
|
||||
|
||||
ancillaryFilterButton = new JButton(FILTER_ICON);
|
||||
ancillaryFilterButton.getAccessibleContext().setAccessibleName("Ancillary");
|
||||
ancillaryFilterButton
|
||||
.addActionListener(e -> tool.showDialog(ancillaryFilterDialog, component));
|
||||
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
||||
|
@ -423,7 +430,7 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||
HelpService helpService = DockingWindowManager.getHelpService();
|
||||
helpService.registerHelp(parentPanel, filterHelpLocation);
|
||||
helpService.registerHelp(ancillaryFilterButton, filterHelpLocation);
|
||||
|
||||
parentPanel.getAccessibleContext().setAccessibleName("Filter Area");
|
||||
return parentPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ import ghidra.util.HelpLocation;
|
|||
import ghidra.util.layout.VariableRowHeightGridLayout;
|
||||
import ghidra.util.layout.VerticalLayout;
|
||||
|
||||
public class MatchesFilterDialogComponentProvider extends
|
||||
AncillaryFilterDialogComponentProvider<VTMatch> {
|
||||
public class MatchesFilterDialogComponentProvider
|
||||
extends AncillaryFilterDialogComponentProvider<VTMatch> {
|
||||
|
||||
protected MatchesFilterDialogComponentProvider(VTController controller,
|
||||
FilterDialogModel<VTMatch> dialogModel) {
|
||||
|
@ -60,6 +60,7 @@ public class MatchesFilterDialogComponentProvider extends
|
|||
AssociationStatusFilter associationStatusFilter = new AssociationStatusFilter();
|
||||
addFilter(associationStatusFilter);
|
||||
rowOnePanel.add(associationStatusFilter.getComponent());
|
||||
rowOnePanel.getAccessibleContext().setAccessibleName("Match Type and Status");
|
||||
|
||||
// Row 2 - Left Component
|
||||
// symbol type filter
|
||||
|
@ -72,6 +73,7 @@ public class MatchesFilterDialogComponentProvider extends
|
|||
AlgorithmFilter algorithmFilter = new AlgorithmFilter();
|
||||
addFilter(algorithmFilter);
|
||||
rowTwoPanel.add(algorithmFilter.getComponent());
|
||||
rowTwoPanel.getAccessibleContext().setAccessibleName("Symbol Type and Algorithm");
|
||||
|
||||
//
|
||||
// row three
|
||||
|
@ -79,6 +81,7 @@ public class MatchesFilterDialogComponentProvider extends
|
|||
|
||||
// address range filter
|
||||
MatchAddressRangeFilter addressRangeFilter = new MatchAddressRangeFilter();
|
||||
addressRangeFilter.getComponent().getAccessibleContext().setAccessibleName("Address Range");
|
||||
addFilter(addressRangeFilter);
|
||||
// added below
|
||||
// addressRangePanel.add( addressRangeFilter.getComponent() );
|
||||
|
@ -88,6 +91,7 @@ public class MatchesFilterDialogComponentProvider extends
|
|||
// row four
|
||||
//
|
||||
TagFilter tagFilter = new TagFilter(controller);
|
||||
tagFilter.getComponent().getAccessibleContext().setAccessibleName("Tag");
|
||||
addFilter(tagFilter);
|
||||
// added below
|
||||
|
||||
|
@ -99,7 +103,7 @@ public class MatchesFilterDialogComponentProvider extends
|
|||
panel.add(rowTwoPanel);
|
||||
panel.add(addressRangeFilter.getComponent());
|
||||
panel.add(tagFilter.getComponent());
|
||||
|
||||
panel.getAccessibleContext().setAccessibleName("Match Filter");
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue