Merge remote-tracking branch 'origin/GP-4555_GhidraKraken_DialogNames'

This commit is contained in:
Ryan Kurtz
2025-03-04 12:21:45 -05:00
150 changed files with 1054 additions and 346 deletions
@@ -176,8 +176,9 @@ public class DebuggerBlockChooserDialog extends ReusableDialogComponentProvider
panel.add(new JScrollPane(table));
filterPanel = new GhidraTableFilterPanel<>(table, tableModel);
filterPanel.getAccessibleContext().setAccessibleName("Filter");
panel.add(filterPanel, BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Debugger Block Chooser");
addWorkPanel(panel);
addOKButton();
@@ -84,6 +84,8 @@ public class DebuggerPlaceBreakpointDialog extends DialogComponentProvider {
JLabel labelAddress = new JLabel("Address");
fieldAddress = new JTextField();
labelAddress.getAccessibleContext().setAccessibleName("Address");
fieldAddress.getAccessibleContext().setAccessibleName("Address");
panel.add(labelAddress);
panel.add(fieldAddress);
@@ -112,10 +114,13 @@ public class DebuggerPlaceBreakpointDialog extends DialogComponentProvider {
JLabel labelLength = new JLabel("Length");
fieldLength = new JTextField();
labelLength.getAccessibleContext().setAccessibleName("Length");
fieldLength.getAccessibleContext().setAccessibleName("Length");
panel.add(labelLength);
panel.add(fieldLength);
JLabel labelKinds = new JLabel("Kinds");
labelKinds.getAccessibleContext().setAccessibleName("Kinds");
DefaultComboBoxModel<String> kindModel = new DefaultComboBoxModel<>();
// TODO: Let user select whatever combo?
kindModel.addElement(TraceBreakpointKindSet.encode(Set.of(SW_EXECUTE)));
@@ -125,14 +130,17 @@ public class DebuggerPlaceBreakpointDialog extends DialogComponentProvider {
kindModel.addElement(TraceBreakpointKindSet.encode(Set.of(READ, WRITE)));
fieldKinds = new JComboBox<String>(kindModel);
fieldKinds.setEditable(true);
fieldKinds.getAccessibleContext().setAccessibleName("Kinds");
panel.add(labelKinds);
panel.add(fieldKinds);
JLabel labelName = new JLabel("Name");
fieldName = new JTextField();
labelName.getAccessibleContext().setAccessibleName("Name");
fieldName.getAccessibleContext().setAccessibleName("Name");
panel.add(labelName);
panel.add(fieldName);
panel.getAccessibleContext().setAccessibleName("Place Debugger Breakpoint");
addWorkPanel(panel);
addOKButton();
@@ -322,7 +322,7 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
{
JPanel opts = new JPanel();
opts.setLayout(new BoxLayout(opts, BoxLayout.Y_AXIS));
opts.getAccessibleContext().setAccessibleName("Options");
{
Box progBox = Box.createHorizontalBox();
progBox.setBorder(BorderFactory.createEmptyBorder(GAP, GAP, GAP, GAP));
@@ -336,7 +336,9 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
syncCbRelocateEnabled(getDestination());
reset();
});
comboDestination.getAccessibleContext().setAccessibleName("Combo Destination");
progBox.add(comboDestination);
progBox.getAccessibleContext().setAccessibleName("Program Box");
opts.add(progBox);
}
@@ -344,15 +346,16 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
// Avoid Swing's automatic indentation
JPanel inner = new JPanel(new BorderLayout());
inner.setBorder(BorderFactory.createEmptyBorder(0, GAP, GAP, GAP));
cbCapture =
new JCheckBox("<html>Read live target's memory");
cbCapture = new JCheckBox("<html>Read live target's memory");
cbCapture.addActionListener(e -> {
if (!isVisible()) {
return;
}
reset();
});
cbCapture.getAccessibleContext().setAccessibleName("Read Target Memory");
inner.add(cbCapture);
inner.getAccessibleContext().setAccessibleName("Read Target Memory");
opts.add(inner);
}
@@ -368,7 +371,9 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
}
reset();
});
cbRelocate.getAccessibleContext().setAccessibleName("Relocate via Mappings");
inner.add(cbRelocate);
inner.getAccessibleContext().setAccessibleName("Relocate via Mappings");
opts.add(inner);
}
@@ -383,7 +388,9 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
}
reset();
});
cbUseOverlays.getAccessibleContext().setAccessibleName("Use Overlays");
inner.add(cbUseOverlays);
inner.getAccessibleContext().setAccessibleName("Use Overlays");
opts.add(inner);
}
@@ -391,14 +398,17 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
JPanel panelInclude = new JPanel(new GridLayout(0, 2, GAP, GAP));
panelInclude.setBorder(BorderFactory.createTitledBorder("Include:"));
JButton buttonSelectNone = new JButton("Select None");
buttonSelectNone.getAccessibleContext().setAccessibleName("Select None");
buttonSelectNone.addActionListener(e -> plan.selectNone());
panelInclude.add(buttonSelectNone);
JButton buttonSelectAll = new JButton("Select All");
buttonSelectAll.getAccessibleContext().setAccessibleName("Select All");
buttonSelectAll.addActionListener(e -> plan.selectAll());
panelInclude.add(buttonSelectAll);
for (Copier copier : plan.getAllCopiers()) {
panelInclude.add(plan.getCheckBox(copier));
}
panelInclude.getAccessibleContext().setAccessibleName("Include All or None");
opts.add(panelInclude);
}
panel.add(opts, BorderLayout.NORTH);
@@ -410,11 +420,14 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
tablePanel.add(new JScrollPane(table));
filterPanel = new GhidraTableFilterPanel<>(table, tableModel);
filterPanel.getAccessibleContext().setAccessibleName("Filter");
tablePanel.add(filterPanel, BorderLayout.SOUTH);
tablePanel.getAccessibleContext().setAccessibleName("Filters");
panel.add(tablePanel, BorderLayout.CENTER);
}
panel.setMinimumSize(new Dimension(600, 600));
panel.getAccessibleContext().setAccessibleName("Copy Debugger Into Program");
addWorkPanel(panel);
addOKButton();
@@ -433,6 +446,7 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
resetButton = new JButton("Reset");
resetButton.setMnemonic('R');
resetButton.setName("Reset");
resetButton.getAccessibleContext().setAccessibleName("Reset");
resetButton.addActionListener(e -> resetCallback());
addButton(resetButton);
}
@@ -713,9 +727,9 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
List<RangeEntry> result = new ArrayList<>();
Set<String> taken = new HashSet<>();
collectBlockNames(taken, dest);
Collection<MappedAddressRange> mappedSet = staticMappingService
.getOpenMappedViews(source.getTrace(), set, source.getSnap())
.get(dest);
Collection<MappedAddressRange> mappedSet =
staticMappingService.getOpenMappedViews(source.getTrace(), set, source.getSnap())
.get(dest);
if (mappedSet == null) {
return;
}
@@ -61,20 +61,23 @@ public class DebuggerAddRegionDialog extends ReusableDialogComponentProvider {
panel.add(fieldPath);
panel.add(new JLabel("Range: "));
fieldRange.getAccessibleContext().setAccessibleName("Range");
panel.add(fieldRange);
panel.add(new JLabel("Length: "));
fieldLength.setFont(Font.decode("monospaced"));
fieldLength.getAccessibleContext().setAccessibleName("Length");
panel.add(fieldLength);
panel.add(new JLabel("Lifespan: "));
fieldLifespan.getAccessibleContext().setAccessibleName("Lifespan");
panel.add(fieldLifespan);
MiscellaneousUtils.rigFocusAndEnter(fieldRange, this::rangeChanged);
MiscellaneousUtils.rigFocusAndEnter(fieldLength, this::lengthChanged);
fieldLifespan.setLifespan(Lifespan.nowOn(0));
panel.getAccessibleContext().setAccessibleName("Debugger Region Addition");
addWorkPanel(panel);
addOKButton();
@@ -59,22 +59,28 @@ public class DebuggerAddMappingDialog extends ReusableDialogComponentProvider {
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
panel.add(new JLabel("Program: "));
labelProg.getAccessibleContext().setAccessibleName("Program");
panel.add(labelProg);
panel.add(new JLabel("Static Range: "));
fieldProgRange.getAccessibleContext().setAccessibleName("Program Static Range");
panel.add(fieldProgRange);
panel.add(new JLabel("Trace: "));
labelTrace.getAccessibleContext().setAccessibleName("Trace");
panel.add(labelTrace);
panel.add(new JLabel("Dynamic Range: "));
fieldTraceRange.getAccessibleContext().setAccessibleName("Program Dynamic Range");
panel.add(fieldTraceRange);
panel.add(new JLabel("Length: "));
fieldLength.setFont(Font.decode("monospaced"));
fieldLength.getAccessibleContext().setAccessibleName("Length");
panel.add(fieldLength);
panel.add(new JLabel("Lifespan: "));
fieldSpan.getAccessibleContext().setAccessibleName("Lifespan");
panel.add(fieldSpan);
MiscellaneousUtils.rigFocusAndEnter(fieldProgRange, this::progRangeChanged);
@@ -83,7 +89,7 @@ public class DebuggerAddMappingDialog extends ReusableDialogComponentProvider {
MiscellaneousUtils.rigFocusAndEnter(fieldSpan, this::spanChanged);
fieldSpan.setLifespan(Lifespan.nowOn(0));
panel.getAccessibleContext().setAccessibleName("Debugger Mapping Addition");
addWorkPanel(panel);
addApplyButton();
@@ -215,8 +221,8 @@ public class DebuggerAddMappingDialog extends ReusableDialogComponentProvider {
protected void applyCallback() {
TraceLocation from = new DefaultTraceLocation(trace, null, fieldSpan.getLifespan(),
fieldTraceRange.getRange().getMinAddress());
ProgramLocation to = new ProgramLocation(program,
fieldProgRange.getRange().getMinAddress());
ProgramLocation to =
new ProgramLocation(program, fieldProgRange.getRange().getMinAddress());
try {
mappingService.addMapping(from, to, getLength(), false);
@@ -244,8 +250,8 @@ public class DebuggerAddMappingDialog extends ReusableDialogComponentProvider {
* @param lifespan the lifespan
* @throws AddressOverflowException if the length is too large for either space
*/
public void setValues(Program program, Trace trace, Address progStart,
Address traceStart, long length, Lifespan lifespan) throws AddressOverflowException {
public void setValues(Program program, Trace trace, Address progStart, Address traceStart,
long length, Lifespan lifespan) throws AddressOverflowException {
// NB. This dialog will not validate these. The caller is responsible.
this.program = program;
this.trace = trace;
@@ -183,18 +183,24 @@ public class DebuggerSelectPlatformOfferDialog extends DialogComponentProvider {
offerTable = new GhidraTable(offerTableModel);
offerTableFilterPanel = new GhidraTableFilterPanel<>(offerTable, offerTableModel);
scrollPane.setViewportView(offerTable);
scrollPane.getAccessibleContext().setAccessibleName("Scroll");
offerTableFilterPanel.getAccessibleContext().setAccessibleName("Offer Table Filter");
JPanel descPanel = new JPanel(new BorderLayout());
descPanel.setBorder(BorderFactory.createTitledBorder("Description"));
descLabel.getAccessibleContext().setAccessibleName("Description");
descPanel.add(descLabel, BorderLayout.CENTER);
descPanel.getAccessibleContext().setAccessibleName("Description");
JPanel nested1 = new JPanel(new BorderLayout());
nested1.add(scrollPane, BorderLayout.CENTER);
nested1.add(offerTableFilterPanel, BorderLayout.SOUTH);
nested1.getAccessibleContext().setAccessibleName("Offer Table Filter");
JPanel nested2 = new JPanel(new BorderLayout());
nested2.add(nested1, BorderLayout.CENTER);
nested2.add(descPanel, BorderLayout.SOUTH);
nested2.getAccessibleContext().setAccessibleName("Table Filter and Description");
setLayout(new BorderLayout());
add(nested2, BorderLayout.CENTER);
@@ -209,6 +215,7 @@ public class DebuggerSelectPlatformOfferDialog extends DialogComponentProvider {
overrideCheckBox.addActionListener(evt -> {
setFilterRecommended(overrideCheckBox.isSelected());
});
overrideCheckBox.getAccessibleContext().setAccessibleName("Override Checkbox");
}
public void setPreferredIDs(LanguageID langID, CompilerSpecID csID) {
@@ -276,6 +283,7 @@ public class DebuggerSelectPlatformOfferDialog extends DialogComponentProvider {
super(DebuggerResources.NAME_CHOOSE_PLATFORM, true, false, true, false);
offerPanel = new OfferPanel(tool);
offerPanel.getAccessibleContext().setAccessibleName("Debugger Select Platform Offer");
populateComponents();
}
@@ -346,4 +354,4 @@ public class DebuggerSelectPlatformOfferDialog extends DialogComponentProvider {
}
// Do nothing. Should be disabled anyway
}
}
}
@@ -64,8 +64,7 @@ public class DebuggerAvailableRegistersDialog extends ReusableDialogComponentPro
@SuppressWarnings("unchecked")
<T> AvailableRegisterTableColumns(String header, Class<T> cls,
Function<AvailableRegisterRow, T> getter,
BiConsumer<AvailableRegisterRow, T> setter,
boolean sortable) {
BiConsumer<AvailableRegisterRow, T> setter, boolean sortable) {
this.header = header;
this.cls = cls;
this.getter = getter;
@@ -145,12 +144,14 @@ public class DebuggerAvailableRegistersDialog extends ReusableDialogComponentPro
availableTable = new GTable(availableTableModel);
// Selection is actually via checkboxes
availableTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
availableTable.getAccessibleContext().setAccessibleName("Selection Choices");
panel.add(new JScrollPane(availableTable));
availableTable.setAutoLookupColumn(AvailableRegisterTableColumns.NAME.ordinal());
availableFilterPanel = new GhidraTableFilterPanel<>(availableTable, availableTableModel);
availableFilterPanel.getAccessibleContext().setAccessibleName("Available Filters");
panel.add(availableFilterPanel, BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Available Debugger Registers");
addWorkPanel(panel);
TableColumnModel columnModel = availableTable.getColumnModel();
@@ -71,6 +71,7 @@ public class DebuggerTimeSelectionDialog extends DialogComponentProvider {
hbox.setBorder(BorderFactory.createTitledBorder("Schedule"));
hbox.add(new JLabel("Expression: "));
scheduleText = new JTextField();
scheduleText.getAccessibleContext().setAccessibleName("Schedule");
hbox.add(scheduleText);
hbox.add(new JLabel("Ticks: "));
hbox.add(tickBack = new GButton(DebuggerResources.ICON_STEP_BACK));
@@ -78,6 +79,7 @@ public class DebuggerTimeSelectionDialog extends DialogComponentProvider {
hbox.add(new JLabel("Ops: "));
hbox.add(opBack = new GButton(DebuggerResources.ICON_STEP_BACK));
hbox.add(opStep = new GButton(DebuggerResources.ICON_STEP_INTO));
hbox.getAccessibleContext().setAccessibleName("Schedule");
workPanel.add(hbox, BorderLayout.NORTH);
}
@@ -88,6 +90,7 @@ public class DebuggerTimeSelectionDialog extends DialogComponentProvider {
{
snapshotPanel = new DebuggerSnapshotTablePanel(tool);
snapshotPanel.getAccessibleContext().setAccessibleName("Snapshot");
workPanel.add(snapshotPanel, BorderLayout.CENTER);
}
@@ -118,7 +121,7 @@ public class DebuggerTimeSelectionDialog extends DialogComponentProvider {
scheduleTextChanged();
}
});
workPanel.getAccessibleContext().setAccessibleName("Debugger Time Selection");
addWorkPanel(workPanel);
addOKButton();
addCancelButton();
@@ -43,7 +43,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
}
public MultiChoiceSelectionDialog(String dataTitle, List<T> choices, Set<T> selected,
DataToStringConverter<T> dataConverter) {
DataToStringConverter<T> dataConverter) {
super(dataTitle + " Chooser");
addWorkPanel(buildMainPanel(choices, selected, dataConverter, dataTitle));
addOKButton();
@@ -51,12 +51,13 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
}
private JComponent buildMainPanel(List<T> choices, Set<T> selected,
DataToStringConverter<T> dataConverter, String dataTitle) {
DataToStringConverter<T> dataConverter, String dataTitle) {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
model = new ChoiceTableModel(choices, selected, dataConverter, dataTitle);
filterTable = new GFilterTable<ChoiceRowObject>(model);
panel.add(filterTable);
panel.getAccessibleContext().setAccessibleName("Multi Choice Selection");
return panel;
}
@@ -103,7 +104,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
private String dataColumnTitle;
ChoiceTableModel(List<T> data, Set<T> selected, DataToStringConverter<T> stringConverter,
String dataColumnTitle) {
String dataColumnTitle) {
super(new ServiceProviderStub());
this.stringConverter = stringConverter;
this.dataColumnTitle = dataColumnTitle;
@@ -157,7 +158,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
}
private class SelectedColumn
extends AbstractDynamicTableColumn<ChoiceRowObject, Boolean, Object> {
extends AbstractDynamicTableColumn<ChoiceRowObject, Boolean, Object> {
@Override
public String getColumnName() {
@@ -166,7 +167,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
@Override
public Boolean getValue(ChoiceRowObject rowObject, Settings settings, Object data,
ServiceProvider provider) throws IllegalArgumentException {
ServiceProvider provider) throws IllegalArgumentException {
return rowObject.isSelected();
}
@@ -178,7 +179,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
}
private class DataColumn
extends AbstractDynamicTableColumn<ChoiceRowObject, String, Object> {
extends AbstractDynamicTableColumn<ChoiceRowObject, String, Object> {
@Override
public String getColumnName() {
@@ -187,7 +188,7 @@ public class MultiChoiceSelectionDialog<T> extends DialogComponentProvider {
@Override
public String getValue(ChoiceRowObject rowObject, Settings settings, Object data,
ServiceProvider provider) throws IllegalArgumentException {
ServiceProvider provider) throws IllegalArgumentException {
return stringConverter.getString(rowObject.getData());
}
@@ -86,6 +86,7 @@ public abstract class AbstractBSimSearchDialog extends DialogComponentProvider {
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(buildNorthPanel(), BorderLayout.NORTH);
panel.add(buildCenterPanel(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("BSim Search");
return panel;
}
@@ -93,6 +94,7 @@ public abstract class AbstractBSimSearchDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new VerticalLayout(10));
panel.add(buildServerPanel());
panel.add(createTitledPanel("Options", buildOptionsPanel(), false));
panel.getAccessibleContext().setAccessibleName("Server and Options");
return panel;
}
@@ -104,6 +106,7 @@ public abstract class AbstractBSimSearchDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new PairLayout(10, 10));
panel.add(new JLabel("BSim Server:"));
panel.add(buildServerComponent());
panel.getAccessibleContext().setAccessibleName("Server");
return panel;
}
@@ -129,6 +132,7 @@ public abstract class AbstractBSimSearchDialog extends DialogComponentProvider {
panel.add(similarityField);
panel.add(confidenceLabel);
panel.add(confidenceField);
panel.getAccessibleContext().setAccessibleName("Options");
return panel;
}
@@ -121,19 +121,24 @@ public class CreateBsimServerInfoDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
panel.add(buildTypePanel(), BorderLayout.NORTH);
panel.add(buildCardPanel(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Create Bsim Server Info");
return panel;
}
private Component buildCardPanel() {
postgresPanel = new DbPanel(DBType.postgres);
postgresPanel.getAccessibleContext().setAccessibleName("Postgress");
elasticPanel = new DbPanel(DBType.elastic);
elasticPanel.getAccessibleContext().setAccessibleName("Elastic");
filePanel = new FilePanel();
filePanel.getAccessibleContext().setAccessibleName("File");
cardPanel = new JPanel(new CardLayout());
cardPanel.add(postgresPanel, POSTGRES);
cardPanel.add(elasticPanel, ELASTIC);
cardPanel.add(filePanel, FILE_H2);
activePanel = postgresPanel;
cardPanel.getAccessibleContext().setAccessibleName("Cards");
return cardPanel;
}
@@ -143,8 +148,11 @@ public class CreateBsimServerInfoDialog extends DialogComponentProvider {
JPanel innerPanel = new JPanel(new HorizontalLayout(20));
ButtonGroup group = new ButtonGroup();
postgresButton = new GRadioButton(POSTGRES);
postgresButton.getAccessibleContext().setAccessibleName("Postgress");
elasticButton = new GRadioButton(ELASTIC);
elasticButton.getAccessibleContext().setAccessibleName("Elastic");
fileButton = new GRadioButton(FILE_H2);
fileButton.getAccessibleContext().setAccessibleName("File");
postgresButton.setSelected(true);
@@ -160,8 +168,10 @@ public class CreateBsimServerInfoDialog extends DialogComponentProvider {
innerPanel.add(postgresButton);
innerPanel.add(elasticButton);
innerPanel.add(fileButton);
innerPanel.getAccessibleContext().setAccessibleName("Buttons");
panel.add(innerPanel);
panel.getAccessibleContext().setAccessibleName("Types");
return panel;
}
@@ -76,6 +76,7 @@ public class SelectedFunctionsTableDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(buildFunctionsTable(getProgram(), goToService), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Selected Functions Table");
return panel;
}
@@ -84,6 +85,7 @@ public class SelectedFunctionsTableDialog extends DialogComponentProvider {
GhidraFilterTable<FunctionSymbol> table = new GhidraFilterTable<>(model);
table.setNavigateOnSelectionEnabled(true);
table.installNavigation(goToService);
table.getAccessibleContext().setAccessibleName("Functions");
return table;
}
@@ -57,6 +57,7 @@ public class AnalysisOptionsDialog extends DialogComponentProvider
setHelpLocation(new HelpLocation("AutoAnalysisPlugin", "AnalysisOptions"));
panel = new AnalysisPanel(programs, editorStateFactory, this);
panel.setToLastUsedAnalysisOptionsIfProgramNotAnalyzed();
panel.getAccessibleContext().setAccessibleName("Analysis Options");
addWorkPanel(panel);
addOKButton();
addCancelButton();
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -74,10 +74,11 @@ public class ArchiveDialog extends ReusableDialogComponentProvider {
protected JPanel buildMainPanel() {
GridBagLayout gbl = new GridBagLayout();
JPanel outerPanel = new JPanel(gbl);
outerPanel.getAccessibleContext().setAccessibleName("Archive");
archiveLabel = new GDLabel(" Archive File ");
archiveField = new JTextField();
archiveField.setName("archiveField");
archiveField.getAccessibleContext().setAccessibleName("Archive Field");
archiveField.setColumns(NUM_TEXT_COLUMNS);
archiveBrowse = new JButton(ArchivePlugin.DOT_DOT_DOT);
archiveBrowse.addActionListener(e -> {
@@ -95,6 +96,7 @@ public class ArchiveDialog extends ReusableDialogComponentProvider {
Gui.registerFont(archiveBrowse, Font.BOLD);
archiveBrowse.setName("archiveBrowse");
archiveBrowse.getAccessibleContext().setAccessibleName("Browse Archive");
// Layout the components.
GridBagConstraints gbc = new GridBagConstraints();
@@ -78,12 +78,15 @@ public class RestoreDialog extends ReusableDialogComponentProvider {
// Create the individual components that make up the panel.
archiveLabel = new GDLabel(" Archive File ");
archiveLabel.getAccessibleContext().setAccessibleName("Archive File");
archiveField = new JTextField();
archiveField.setColumns(NUM_TEXT_COLUMNS);
archiveField.setName("archiveField");
archiveField.getAccessibleContext().setAccessibleName("Archive");
archiveBrowse = new JButton(ArchivePlugin.DOT_DOT_DOT);
archiveBrowse.setName("archiveButton");
archiveBrowse.getAccessibleContext().setAccessibleName("Archive");
archiveBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -117,12 +120,15 @@ public class RestoreDialog extends ReusableDialogComponentProvider {
Gui.registerFont(archiveBrowse, Font.BOLD);
restoreLabel = new GDLabel(" Restore Directory ");
restoreLabel.getAccessibleContext().setAccessibleName("Restore Directory");
restoreField = new JTextField();
restoreField.setName("restoreField");
restoreField.getAccessibleContext().setAccessibleName("Restore");
restoreField.setColumns(RestoreDialog.NUM_TEXT_COLUMNS);
restoreBrowse = new JButton(ArchivePlugin.DOT_DOT_DOT);
restoreBrowse.setName("restoreButton");
restoreBrowse.getAccessibleContext().setAccessibleName("Restore Browse");
restoreBrowse.addActionListener(e -> {
String dirPath = chooseDirectory("Choose restore directory",
"Select the directory for restoring the project.");
@@ -134,8 +140,10 @@ public class RestoreDialog extends ReusableDialogComponentProvider {
Gui.registerFont(restoreBrowse, Font.BOLD);
projectNameLabel = new GDLabel(" Project Name ");
projectNameLabel.getAccessibleContext().setAccessibleName("Project Name");
projectNameField = new JTextField();
projectNameField.setName("projectNameField");
projectNameField.getAccessibleContext().setAccessibleName("Project Name");
projectNameField.setColumns(RestoreDialog.NUM_TEXT_COLUMNS);
projectNameField.addActionListener(e -> {
@@ -206,7 +214,7 @@ public class RestoreDialog extends ReusableDialogComponentProvider {
gbc.gridy = 1;
gbl.setConstraints(restoreBrowse, gbc);
outerPanel.add(restoreBrowse);
outerPanel.getAccessibleContext().setAccessibleName("Restore");
return outerPanel;
}
@@ -96,7 +96,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
panel.add(buildIconLabel(), BorderLayout.WEST);
panel.add(buildCentralPanel(), BorderLayout.CENTER);
panel.add(buildCheckboxPanel(), BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Bookmark Creation");
return panel;
}
@@ -106,6 +106,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
panel.add(selectionCB);
panel.getAccessibleContext().setAccessibleName("Selection Ranges");
return panel;
}
@@ -125,7 +126,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
panel.add(new JLabel("Description: ", SwingConstants.RIGHT));
panel.add(descriptionTextField);
panel.getAccessibleContext().setAccessibleName("Bookmark Details");
return panel;
}
@@ -142,6 +143,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
JLabel imageLabel = new GIconLabel(icon);
imageLabel.setPreferredSize(
new Dimension(icon.getIconWidth() + 20, icon.getIconHeight() + 20));
imageLabel.getAccessibleContext().setAccessibleName("Icons");
return imageLabel;
}
@@ -47,6 +47,7 @@ class FilterDialog extends DialogComponentProvider {
private JComponent buildPanel(Program program) {
JPanel p = new JPanel(new VerticalLayout(20));
p.add(getTypesPanel(program));
p.getAccessibleContext().setAccessibleName("Bookmark Filter");
return p;
}
@@ -58,14 +59,18 @@ class FilterDialog extends DialogComponentProvider {
panel.setBorder(BorderFactory.createTitledBorder("Include Bookmark Types"));
for (int i = 0; i < types.length; i++) {
buttons[i] = new GCheckBox();
buttons[i].getAccessibleContext().setAccessibleDescription(types[i].getTypeString());
JPanel p = new JPanel(new BorderLayout());
p.add(buttons[i], BorderLayout.WEST);
buttons[i].setSelected(provider.isShowingType(types[i].getTypeString()));
JLabel l =
new GLabel(types[i].getTypeString(), types[i].getIcon(), SwingConstants.LEFT);
p.add(l, BorderLayout.CENTER);
p.getAccessibleContext()
.setAccessibleName(types[i].getTypeString() + " Button and Label");
panel.add(p);
}
panel.getAccessibleContext().setAccessibleName("Bookmark Inclusion");
return panel;
}
@@ -91,16 +91,20 @@ public class ClearFlowDialog extends DialogComponentProvider {
panel = new JPanel();
panel.setLayout(new BorderLayout(10, 10));
panel.getAccessibleContext().setAccessibleName("Clear Flow Options");
panel.add(new GLabel("Clear Flow Options:"), BorderLayout.NORTH);
JPanel cbPanel = new JPanel();
BoxLayout bl = new BoxLayout(cbPanel, BoxLayout.Y_AXIS);
cbPanel.setLayout(bl);
cbPanel.getAccessibleContext().setAccessibleName("Checkboxes");
symbolsCb = new GCheckBox("Clear Symbols");
symbolsCb.getAccessibleContext().setAccessibleName("Clear Symbols");
dataCb = new GCheckBox("Clear Data");
dataCb.getAccessibleContext().setAccessibleName("Clear Data");
repairCb = new GCheckBox("Repair Flow");
repairCb.getAccessibleContext().setAccessibleName("Repair Flow");
symbolsCb.setSelected(false);
symbolsCb.addKeyListener(listener);
@@ -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,9 +15,6 @@
*/
package ghidra.app.plugin.core.clipboard;
import ghidra.app.util.ClipboardType;
import ghidra.util.HelpLocation;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.util.List;
@@ -28,13 +24,14 @@ import javax.swing.border.TitledBorder;
import docking.DialogComponentProvider;
import docking.widgets.list.ListPanel;
import ghidra.app.util.ClipboardType;
import ghidra.util.HelpLocation;
public class CopyPasteSpecialDialog extends DialogComponentProvider {
private ListPanel listPanel;
private JPanel mainPanel;
private JPanel mainPanel;
private List<?> availableTypes;
private Object selectedType;
@@ -50,7 +47,7 @@ public class CopyPasteSpecialDialog extends DialogComponentProvider {
setHelpLocation(new HelpLocation("ClipboardPlugin", "Copy_Special"));
}
private JPanel createPanel() {
mainPanel = new JPanel(new BorderLayout());
@@ -62,7 +59,7 @@ public class CopyPasteSpecialDialog extends DialogComponentProvider {
list.setSelectedIndex(0);
list.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent evt) {
public void keyPressed(KeyEvent evt) {
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
evt.consume();
okCallback();
@@ -71,34 +68,33 @@ public class CopyPasteSpecialDialog extends DialogComponentProvider {
});
list.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) {
public void mousePressed(MouseEvent evt) {
if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) {
evt.consume();
okCallback();
}
}
});
listPanel.getAccessibleContext().setAccessibleName("Available Types");
mainPanel.add(listPanel, BorderLayout.CENTER);
mainPanel.setBorder(new TitledBorder("Select Format"));
mainPanel.getAccessibleContext().setAccessibleName("Copy Paste Special");
return mainPanel;
}
@Override
protected void okCallback() {
protected void okCallback() {
close();
selectedType = listPanel.getSelectedValue();
}
@Override
protected void cancelCallback() {
protected void cancelCallback() {
close();
}
public ClipboardType getSelectedType() {
return (ClipboardType) selectedType;
return (ClipboardType) selectedType;
}
}
@@ -145,7 +145,6 @@ public class BitFieldEditorDialog extends DialogComponentProvider {
BitFieldEditorPanel.BitFieldEditorContext editorContext =
(BitFieldEditorPanel.BitFieldEditorContext) context;
bitFieldEditorPanel.initAdd(null, editorContext.getAllocationOffset(),
editorContext.getSelectedBitOffset(), true);
setApplyEnabled(true);
@@ -279,6 +278,7 @@ public class BitFieldEditorDialog extends DialogComponentProvider {
else {
initEdit(editOrdinal, false);
}
bitFieldEditorPanel.getAccessibleContext().setAccessibleName("Bit Field Editor");
return bitFieldEditorPanel;
}
@@ -193,18 +193,22 @@ class ParseDialog extends ReusableDialogComponentProvider {
comboBox = new GhidraComboBox<>(comboModel);
comboItemListener = e -> selectionChanged(e);
comboBox.getAccessibleContext().setAccessibleName("Parse Configurations");
comboBox.addItemListener(comboItemListener);
JPanel cPanel = new JPanel(new BorderLayout());
cPanel.setBorder(BorderFactory.createTitledBorder("Parse Configuration"));
cPanel.add(comboBox);
cPanel.getAccessibleContext().setAccessibleName("Configuration");
JPanel comboPanel = new JPanel(new BorderLayout());
comboPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
comboPanel.getAccessibleContext().setAccessibleName("Configurations");
comboPanel.add(cPanel);
// enable edits, add to bottom, ordered
pathPanel = new PathnameTablePanel(null, true, false, true);
pathPanel.setBorder(BorderFactory.createTitledBorder("Source files to parse"));
pathPanel.getAccessibleContext().setAccessibleName("Path");
String importDir = Preferences.getProperty(LAST_IMPORT_C_DIRECTORY);
if (importDir == null) {
importDir = Preferences.getProperty(Preferences.LAST_PATH_DIRECTORY);
@@ -223,6 +227,7 @@ class ParseDialog extends ReusableDialogComponentProvider {
public Component getTableCellRendererComponent(GTableCellRenderingData data) {
JLabel label = (JLabel) super.getTableCellRendererComponent(data);
label.getAccessibleContext().setAccessibleName("Path Data");
Object value = data.getValue();
String pathName = (String) value;
@@ -245,7 +250,6 @@ class ParseDialog extends ReusableDialogComponentProvider {
if (!fileExists) {
label.setForeground(getErrorForegroundColor(data.isSelected()));
}
return label;
}
});
@@ -275,6 +279,7 @@ class ParseDialog extends ReusableDialogComponentProvider {
parsePathTableModel.addTableModelListener(parsePathTableListener);
JPanel optionsPanel = new JPanel(new BorderLayout());
optionsPanel.getAccessibleContext().setAccessibleName("Options");
optionsPanel.setBorder(BorderFactory.createTitledBorder("Parse Options"));
// create options field
@@ -282,10 +287,12 @@ class ParseDialog extends ReusableDialogComponentProvider {
parseOptionsField = new JTextArea(5, 70);
JScrollPane pane = new JScrollPane(parseOptionsField);
pane.getViewport().setPreferredSize(new Dimension(300, 200));
pane.getAccessibleContext().setAccessibleName("Options");
optionsPanel.add(pane, BorderLayout.CENTER);
JPanel archPanel = new JPanel(new BorderLayout());
archPanel.setBorder(BorderFactory.createTitledBorder("Program Architecture:"));
archPanel.getAccessibleContext().setAccessibleName("Program Architecture");
archPanel.add(new GLabel(" ", SwingConstants.RIGHT));
languagePanel = buildLanguagePanel();
archPanel.add(languagePanel);
@@ -295,11 +302,13 @@ class ParseDialog extends ReusableDialogComponentProvider {
parseButton = new JButton("Parse to Program");
parseButton.addActionListener(ev -> doParse(false));
parseButton.setToolTipText("Parse files and add data types to current program");
parseButton.getAccessibleContext().setAccessibleName("Parse to Program");
addButton(parseButton);
parseToFileButton = new JButton("Parse to File...");
parseToFileButton.addActionListener(ev -> doParse(true));
parseToFileButton.setToolTipText("Parse files and output to archive file");
parseToFileButton.getAccessibleContext().setAccessibleName("Parse to File");
addButton(parseToFileButton);
mainPanel.add(comboPanel, BorderLayout.NORTH);
@@ -307,10 +316,12 @@ class ParseDialog extends ReusableDialogComponentProvider {
includePathPanel.setPreferredSize(new Dimension(pathPanel.getPreferredSize().width, 200));
JSplitPane optionsPane =
new JSplitPane(JSplitPane.VERTICAL_SPLIT, includePathPanel, optionsPanel);
optionsPane.getAccessibleContext().setAccessibleName("Include Path and Options");
optionsPane.setResizeWeight(0.50);
pathPanel.setPreferredSize(new Dimension(pathPanel.getPreferredSize().width, 200));
JSplitPane outerPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, pathPanel, optionsPane);
outerPane.getAccessibleContext().setAccessibleName("Path and Options");
outerPane.setResizeWeight(0.50);
mainPanel.add(outerPane, BorderLayout.CENTER);
@@ -322,6 +333,7 @@ class ParseDialog extends ReusableDialogComponentProvider {
loadProfile();
initialBuild = false;
mainPanel.getAccessibleContext().setAccessibleName("Parse");
return mainPanel;
}
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -155,8 +155,7 @@ public abstract class AbstractSettingsDialog extends DialogComponentProvider {
if (settingsDefinition instanceof NumberSettingsDefinition) {
String propertyName = getHexModePropertyName(settingsDefinition);
boolean hexMode = Boolean
.valueOf(
Preferences.getProperty(propertyName, Boolean.FALSE.toString()));
.valueOf(Preferences.getProperty(propertyName, Boolean.FALSE.toString()));
intHexModeMap.put(settingsDefinition.getName(), hexMode);
}
}
@@ -223,7 +222,7 @@ public abstract class AbstractSettingsDialog extends DialogComponentProvider {
if (hasImmutableSettings) {
workPanel.add(new JLabel("* Immutable setting"), BorderLayout.SOUTH);
}
workPanel.getAccessibleContext().setAccessibleName("Settings");
return workPanel;
}
@@ -105,7 +105,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
setStatusJustification(SwingConstants.LEFT);
setCreateStructureByName(true);
mainPanel.getAccessibleContext().setAccessibleName("Create Structure");
return mainPanel;
}
@@ -131,6 +131,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
nameTextField.requestFocus();
}
});
nameTextField.getAccessibleContext().setAccessibleName("Name Text");
namePanel.add(nameTextField);
nameTextField.getDocument().addDocumentListener(new DocumentListener() {
@@ -166,7 +167,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
}
}
});
namePanel.getAccessibleContext().setAccessibleName("Name Text");
return namePanel;
}
@@ -188,13 +189,15 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
};
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.getAccessibleContext().setAccessibleName("Scroll");
structurePanel.add(scrollPane);
structurePanel.add(Box.createVerticalStrut(10));
filterPanel.getAccessibleContext().setAccessibleName("Structure Filter");
structurePanel.add(filterPanel);
structurePanel.add(Box.createVerticalStrut(10));
structurePanel.add(buildMatchingStyelPanel());
structurePanel.add(Box.createVerticalStrut(10));
structurePanel.getAccessibleContext().setAccessibleName("Matching Structure");
return structurePanel;
}
@@ -223,8 +226,9 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
!(sourceListSelectionModel.isSelectionEmpty())) {
// show the user that the structure choice is now
// coming from the list of current structures
Structure structure = ((StructureWrapper) matchingStructuresTable.getValueAt(
matchingStructuresTable.getSelectedRow(), 0)).getStructure();
Structure structure = ((StructureWrapper) matchingStructuresTable
.getValueAt(matchingStructuresTable.getSelectedRow(), 0))
.getStructure();
updateStatusText(false, structure.getName());
setCreateStructureByName(false);
}
@@ -234,7 +238,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
}
}
});
matchingStructuresTable.getAccessibleContext().setAccessibleName("Matching Structures");
return matchingStructuresTable;
}
@@ -246,11 +250,13 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
}
};
matchingStylePanel.setLayout(new BoxLayout(matchingStylePanel, BoxLayout.X_AXIS));
matchingStylePanel.setBorder(
new TitledBorder(BorderFactory.createEmptyBorder(), "Matching: "));
matchingStylePanel
.setBorder(new TitledBorder(BorderFactory.createEmptyBorder(), "Matching: "));
exactMatchButton = new GRadioButton("Exact");
exactMatchButton.getAccessibleContext().setAccessibleName("Exact Match");
sizeMatchButton = new GRadioButton("Size");
sizeMatchButton.getAccessibleContext().setAccessibleName("Size Match");
exactMatchButton.setToolTipText(
"Match structures with the same " + "number and type of data elements");
@@ -269,7 +275,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
matchingStylePanel.add(exactMatchButton);
matchingStylePanel.add(sizeMatchButton);
matchingStylePanel.getAccessibleContext().setAccessibleName("Matching Style");
return matchingStylePanel;
}
@@ -485,8 +491,8 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
}
else {
// get the selected object in the table
currentStructure = ((StructureWrapper) matchingStructuresTable.getValueAt(
matchingStructuresTable.getSelectedRow(), 0)).getStructure();
currentStructure = ((StructureWrapper) matchingStructuresTable
.getValueAt(matchingStructuresTable.getSelectedRow(), 0)).getStructure();
}
close();
@@ -74,6 +74,7 @@ class RenameDataFieldDialog extends DialogComponentProvider {
private JPanel create() {
recentChoices = new GhidraComboBox<>();
recentChoices.getAccessibleContext().setAccessibleName("Recent Choices");
recentChoices.setEditable(true);
JPanel mainPanel = new JPanel(new BorderLayout());
@@ -81,7 +82,7 @@ class RenameDataFieldDialog extends DialogComponentProvider {
Border border = BorderFactory.createTitledBorder("Data Field Name");
topPanel.setBorder(border);
topPanel.getAccessibleContext().setAccessibleName("Recent Choices");
mainPanel.add(topPanel, BorderLayout.NORTH);
topPanel.add(recentChoices, BorderLayout.NORTH);
@@ -93,7 +94,7 @@ class RenameDataFieldDialog extends DialogComponentProvider {
}
});
mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
mainPanel.getAccessibleContext().setAccessibleName("Rename Data Field");
return mainPanel;
}
@@ -52,11 +52,15 @@ public class DataTypeSyncDialog extends DialogComponentProvider implements DataT
this.operationName = operationName;
syncPanel = new DataTypeSyncPanel(list, preselectedInfos, this);
syncPanel.getAccessibleContext().setAccessibleName("Data Sync");
comparePanel = new DataTypeComparePanel(clientName, sourceName);
comparePanel.getAccessibleContext().setAccessibleName("Compare Data");
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, syncPanel, comparePanel);
splitPane.setResizeWeight(0.6);
splitPane.getAccessibleContext().setAccessibleName("Data Sync and Compare");
mainPanel = new JPanel(new BorderLayout());
mainPanel.add(splitPane, BorderLayout.CENTER);
mainPanel.getAccessibleContext().setAccessibleName("Data Type Sync");
addWorkPanel(mainPanel);
initialize();
createActions();
@@ -65,6 +65,8 @@ class DataTypeSyncPanel extends JPanel {
TableModel model = table.getModel();
cb.setEnabled(model.isCellEditable(row, column));
c.getAccessibleContext().setAccessibleName("Sync Boolean Reader");
return c;
}
}
@@ -80,12 +82,15 @@ class DataTypeSyncPanel extends JPanel {
syncTable = new GhidraTable(tableModel);
syncTable.setDefaultRenderer(Boolean.class, new DataTypeSyncBooleanRenderer());
syncTable.getAccessibleContext().setAccessibleName("Sync");
JScrollPane sp = new JScrollPane(syncTable);
sp.getAccessibleContext().setAccessibleName("Sync Scroll");
Dimension d = new Dimension(940, 200);
syncTable.setPreferredScrollableViewportSize(d);
syncTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
tableFilterPanel = new GhidraTableFilterPanel<>(syncTable, tableModel);
tableFilterPanel.getAccessibleContext().setAccessibleName("Table Filter");
add(sp, BorderLayout.CENTER);
add(tableFilterPanel, BorderLayout.SOUTH);
tableModel.fireTableDataChanged();
@@ -69,8 +69,9 @@ class AnnotationHandlerDialog extends DialogComponentProvider {
JPanel create() {
JPanel outerPanel = new JPanel(new BorderLayout());
outerPanel.getAccessibleContext().setAccessibleName("Annotation Handler");
handlerComboBox = new GhidraComboBox<>(handlerList);
handlerComboBox.getAccessibleContext().setAccessibleName("Combo Box");
handlerComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
@@ -110,9 +110,10 @@ public class DataTypeChooserDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
messageLabel = new GLabel("Choose the data type you wish to use.");
messageLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 2));
messageLabel.getAccessibleContext().setAccessibleName("Message");
panel.add(messageLabel, BorderLayout.NORTH);
panel.add(this.tree, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Data Type Chooser");
return panel;
}
@@ -79,20 +79,24 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
protected JPanel buildMainPanel() {
mainPanel = new JPanel(new BorderLayout());
mainPanel.getAccessibleContext().setAccessibleName("Address Table");
// Find Button
searchButton = new JButton("Search");
searchButton.addActionListener(e -> searchSelection());
searchButton.getAccessibleContext().setAccessibleName("Search");
// right panel for populating results and selecting tables to disassemble
JPanel resultsPanel = new JPanel(new BorderLayout());
resultsPanel.setPreferredSize(new Dimension(600, 300));
resultsPanel.setBorder(BorderFactory.createTitledBorder("Possible Address Tables"));
resultsPanel.getAccessibleContext().setAccessibleName("Results");
// create right side query results table with three columns
resultsTablePanel = new GhidraThreadedTablePanel<>(plugin.getModel());
resultsTable = resultsTablePanel.getTable();
resultsTable.installNavigation(plugin.getTool());
resultsTable.getAccessibleContext().setAccessibleName("Results");
ListSelectionModel selModel = resultsTable.getSelectionModel();
selModel.addListSelectionListener(e -> {
@@ -119,31 +123,36 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
// make button panel for right panel
JPanel makeTablePanel = new JPanel(new FlowLayout());
makeTablePanel.getAccessibleContext().setAccessibleName("Make Table");
makeTableButton = new JButton("Make Table");
makeTableButton.setToolTipText("Make a table of addresses at the selected location(s).");
makeTableButton.getAccessibleContext().setAccessibleName("Make Table");
makeTablePanel.add(makeTableButton);
makeTableButton.setEnabled(false);
makeTableButton.addActionListener(e -> plugin.makeTable(resultsTable.getSelectedRows()));
JPanel disassemblePanel = new JPanel(new FlowLayout());
disassemblePanel.getAccessibleContext().setAccessibleName("Disassemble");
disassembleTableButton = new JButton("Disassemble");
disassembleTableButton.setToolTipText(
"Disassemble at all locations pointed to by the selected address table(s) members.");
disassembleTableButton.getAccessibleContext().setAccessibleName("Dissasemble");
disassembleTableButton.setEnabled(false);
disassemblePanel.add(disassembleTableButton);
disassembleTableButton.addActionListener(
e -> plugin.disassembleTable(resultsTable.getSelectedRows()));
disassembleTableButton
.addActionListener(e -> plugin.disassembleTable(resultsTable.getSelectedRows()));
// make bottom of right panel
JPanel myButtonPanel = new JPanel(new FlowLayout());
myButtonPanel.add(makeTablePanel);
myButtonPanel.add(disassemblePanel);
myButtonPanel.getAccessibleContext().setAccessibleName("Buttons");
// search options panel
JPanel searchOptionsPanel = new JPanel(new BorderLayout());
searchOptionsPanel.setBorder(BorderFactory.createTitledBorder("Search Options"));
searchOptionsPanel.getAccessibleContext().setAccessibleName("Search Options");
JLabel minLengthLabel = new GLabel("Minimum Length: ");
minLengthLabel.setToolTipText(
@@ -151,14 +160,17 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
minLengthField = new JTextField(5);
minLengthField.setName("Minimum Length");
minLengthField.setText(Integer.toString(DEFAULT_MINIMUM_TABLE_SIZE));
minLengthField.getAccessibleContext().setAccessibleName("Minimum Length for Table");
JPanel minLengthPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
minLengthPanel.add(minLengthLabel);
minLengthPanel.add(minLengthField);
minLengthPanel.getAccessibleContext().setAccessibleName("Minimum Length");
alignLabel = new GDLabel("Alignment: ");
alignField = new JTextField(5);
alignField.setName("Alignment");
alignField.getAccessibleContext().setAccessibleName("Alignment");
alignLabel.setToolTipText(
"Alignment that address tables and what they are pointing to must satisfy.");
int align = plugin.getProgram().getLanguage().getInstructionAlignment();
@@ -170,29 +182,36 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
skipLabel = new GDLabel("Skip Length: ");
skipField = new JTextField(5);
skipField.setName("Skip");
skipField.getAccessibleContext().setAccessibleName("Skip");
skipLabel.setToolTipText("Number of bytes to skip between found addresses in a table.");
skipField.setText("0");
JPanel alignPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
alignPanel.add(alignLabel);
alignPanel.add(alignField);
alignPanel.getAccessibleContext().setAccessibleName("Alignment");
JPanel skipPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
skipPanel.add(skipLabel);
skipPanel.add(skipField);
skipPanel.getAccessibleContext().setAccessibleName("Skip");
JPanel optPanel = new JPanel(new GridLayout(3, 1));
optPanel.add(minLengthPanel);
optPanel.add(alignPanel);
optPanel.add(skipPanel);
optPanel.getAccessibleContext().setAccessibleName("Options");
selectionButton = new GCheckBox("Search Selection");
selectionButton.setSelected(false);
selectionButton.setToolTipText("If checked, search only the current selection.");
selectionButton.getAccessibleContext().setAccessibleName("Use Selection");
JPanel searchOptionsWestPanel = new JPanel(new GridLayout(2, 1));
searchOptionsWestPanel.getAccessibleContext().setAccessibleDescription("Search Options");
searchOptionsWestPanel.add(selectionButton);
shiftedAddressButton = new GCheckBox("Shifted Addresses");
shiftedAddressButton.getAccessibleContext().setAccessibleName("Shifted Addresses");
boolean allowShiftedAddresses =
plugin.getProgram().getDataTypeManager().getDataOrganization().getPointerShift() != 0;
@@ -214,37 +233,44 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
searchOptionsPanel.add(searchOptionsWestPanel, BorderLayout.WEST);
JPanel findPanel = new JPanel(new FlowLayout());
findPanel.add(searchButton);
findPanel.getAccessibleContext().setAccessibleName("Find");
searchOptionsPanel.add(findPanel, BorderLayout.SOUTH);
JPanel makeOptionsPanel = new JPanel(new BorderLayout());
makeOptionsPanel.setBorder(BorderFactory.createTitledBorder("Make Table Options"));
makeOptionsPanel.getAccessibleContext().setAccessibleName("Make Table Options");
autoLabelCB = new GCheckBox("Auto Label");
autoLabelCB.setSelected(true);
autoLabelCB.setEnabled(false);
autoLabelCB.setToolTipText(
"Label the top of the address table and all members of the table.");
autoLabelCB
.setToolTipText("Label the top of the address table and all members of the table.");
autoLabelCB.getAccessibleContext().setAccessibleName("Auto Label");
offsetLabel = new GDLabel("Offset: ");
offsetLabel.setToolTipText("Offset from the beginning of the selected table(s)");
offsetLabel.setEnabled(false);
offsetLabel.getAccessibleContext().setAccessibleName("Offset");
JLabel viewOffsetLabel = new GDLabel(" ");
viewOffsetLabel.setEnabled(false);
viewOffsetLabel.getAccessibleContext().setAccessibleName("View Offset");
viewOffset = new HintTextField("<table start address>");
viewOffset.setName("viewOffset");
viewOffset.getAccessibleContext().setAccessibleName("View Offset");
viewOffset.setToolTipText("Address of the selected table starting at the given offset");
viewOffset.setColumns(20);
viewOffset.setEnabled(false);
offsetField = new JTextField(2);
offsetField.setName("offset");
offsetField.getAccessibleContext().setAccessibleName("Offset");
offsetField.setToolTipText("Offset from the beginning of the selected table(s)");
offsetField.setText("0");
offsetField.setEnabled(false);
offsetField.addActionListener(
e -> plugin.updateOffsetString(resultsTable.getSelectedRows()));
offsetField
.addActionListener(e -> plugin.updateOffsetString(resultsTable.getSelectedRows()));
offsetField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
@@ -269,6 +295,7 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
offsetPanel.add(offsetField);
offsetPanel.add(viewOffsetLabel);
offsetPanel.add(viewOffset);
offsetPanel.getAccessibleContext().setAccessibleName("Offset");
makeOptionsPanel.add(offsetPanel, BorderLayout.NORTH);
makeOptionsPanel.add(myButtonPanel, BorderLayout.SOUTH);
@@ -278,6 +305,7 @@ public class AddressTableDialog extends ReusableDialogComponentProvider {
optionsPanel.add(searchOptionsPanel);
optionsPanel.add(makeOptionsPanel);
optionsPanel.getAccessibleContext().setAccessibleName("Options");
// put sub-panels onto main panel
mainPanel.add(resultsPanel, BorderLayout.CENTER);
@@ -87,6 +87,7 @@ class SetFlowOverrideDialog extends DialogComponentProvider {
if (instruction != null && instruction.getFlowType().isConditional()) {
mainPanel.add(buildNotePanel("*Conditional flow will be preserved"));
}
mainPanel.getAccessibleContext().setAccessibleName("Set Flow Override");
return mainPanel;
}
@@ -102,7 +103,7 @@ class SetFlowOverrideDialog extends DialogComponentProvider {
panel.add(Box.createGlue());
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.getAccessibleContext().setAccessibleName("Current Flow");
return panel;
}
@@ -114,7 +115,7 @@ class SetFlowOverrideDialog extends DialogComponentProvider {
panel.add(new GLabel(note));
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.getAccessibleContext().setAccessibleName("Note");
return panel;
}
@@ -124,6 +125,7 @@ class SetFlowOverrideDialog extends DialogComponentProvider {
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
flowOverrideComboBox = new GhidraComboBox<>();
flowOverrideComboBox.getAccessibleContext().setAccessibleName("Flow Override");
flowOverrideComboBox.addItem(DEFAULT_CHOICE);
for (FlowOverride element : FlowOverride.values()) {
if (element == FlowOverride.NONE) {
@@ -145,7 +147,7 @@ class SetFlowOverrideDialog extends DialogComponentProvider {
panel.add(Box.createGlue());
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.getAccessibleContext().setAccessibleName("Flow Override");
return panel;
}
@@ -142,6 +142,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
addrField.addActionListener(e -> model.setCurrentFallthrough(addrField.getAddress()));
panel.add(createHomePanel(), BorderLayout.NORTH);
panel.add(createAddressPanel(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Override Fallthrough");
return panel;
}
@@ -151,6 +152,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
panel.add(addrField, BorderLayout.NORTH);
panel.add(createRadioButtonPanel(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Address");
return panel;
}
@@ -168,7 +170,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
homeButton = createButton("Home");
homeButton.addActionListener(e -> plugin.goTo(model.getAddress()));
homeButton.getAccessibleContext().setAccessibleName("Home");
JPanel innerPanel = new JPanel();
BoxLayout bl = new BoxLayout(innerPanel, BoxLayout.X_AXIS);
innerPanel.setLayout(bl);
@@ -180,7 +182,9 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
innerPanel.add(Box.createHorizontalStrut(20));
innerPanel.add(instLabel);
innerPanel.add(Box.createHorizontalStrut(10));
innerPanel.getAccessibleContext().setAccessibleName("Home Content");
panel.add(innerPanel, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Home");
return panel;
}
@@ -194,19 +198,21 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
defaultRB = new GRadioButton("Default", true);
defaultRB.addActionListener(ev -> model.defaultSelected());
defaultRB.setToolTipText("Use default fallthrough address");
defaultRB.getAccessibleContext().setAccessibleName("Default");
userRB = new GRadioButton("User", false);
userRB.addActionListener(ev -> model.userSelected());
userRB.setToolTipText("Override default fallthrough address");
userRB.getAccessibleContext().setAccessibleName("User");
group.add(defaultRB);
group.add(userRB);
panel.add(defaultRB);
panel.add(userRB);
panel.getAccessibleContext().setAccessibleName("Radio Buttons");
JPanel outerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
outerPanel.add(panel);
outerPanel.getAccessibleContext().setAccessibleName("Radio Button");
return outerPanel;
}
@@ -218,6 +224,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
button.setMargin(noInsets);
button.setToolTipText("Go back to home address");
button.getAccessibleContext().setAccessibleName("Home");
return button;
}
@@ -180,6 +180,7 @@ public abstract class AbstractEditFunctionSignatureDialog extends DialogComponen
mainPanel.setBorder(BorderFactory.createEmptyBorder(2, 5, 2, 2));
mainPanel.add(buildSignaturePanel());
mainPanel.add(buildAttributePanel());
mainPanel.getAccessibleContext().setAccessibleName("Edit Function Signature");
if (allowCallFixup) {
JPanel callFixupPanel = buildCallFixupPanel();
mainPanel.add(callFixupPanel != null ? callFixupPanel : buildSpacerPanel());
@@ -198,6 +199,8 @@ public abstract class AbstractEditFunctionSignatureDialog extends DialogComponen
signaturePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
signaturePanel.getAccessibleContext().setAccessibleName("Signature");
return signaturePanel;
}
@@ -224,6 +227,8 @@ public abstract class AbstractEditFunctionSignatureDialog extends DialogComponen
}
attributePanel.add(Box.createGlue());
attributePanel.getAccessibleContext().setAccessibleName("Attribute");
return attributePanel;
}
@@ -394,8 +399,8 @@ public abstract class AbstractEditFunctionSignatureDialog extends DialogComponen
*/
protected final FunctionDefinitionDataType parseSignature() throws CancelledException {
setFunctionInfo(); // needed for testing which never shows dialog
FunctionSignatureParser parser = new FunctionSignatureParser(
getDataTypeManager(), tool.getService(DataTypeManagerService.class));
FunctionSignatureParser parser = new FunctionSignatureParser(getDataTypeManager(),
tool.getService(DataTypeManagerService.class));
try {
return parser.parse(getFunctionSignature(), getSignature());
}
@@ -358,11 +358,12 @@ public class ThunkReferenceAddressDialog extends DialogComponentProvider {
JPanel mainPanel = new JPanel(new PairLayout(5, 5));
refFunctionField = new JTextField(20);
refFunctionField.getAccessibleContext().setAccessibleName("Reference Function");
mainPanel.add(new GLabel("Destination Function/Address:"));
mainPanel.add(refFunctionField);
mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
mainPanel.getAccessibleContext().setAccessibleName("Think Reference Address");
return mainPanel;
}
@@ -217,6 +217,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(buildPreview(), BorderLayout.NORTH);
panel.add(buildCenterPanel(hasOptionalSignatureCommit), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Function Editor");
return panel;
}
@@ -226,6 +227,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
centerPanel.add(buildAttributePanel(), BorderLayout.NORTH);
centerPanel.add(buildTable(), BorderLayout.CENTER);
centerPanel.add(buildBottomPanel(hasOptionalSignatureCommit), BorderLayout.SOUTH);
centerPanel.getAccessibleContext().setAccessibleName("Function Attributes");
return centerPanel;
}
@@ -241,6 +243,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
Function thunkedFunction = model.getFunction().getThunkedFunction(false);
if (thunkedFunction != null) {
JPanel thunkedPanel = createThunkedFunctionTextPanel(thunkedFunction);
thunkedPanel.getAccessibleContext().setAccessibleName("Thunked Function");
thunkedPanel.setBorder(BorderFactory.createTitledBorder(b, "Thunked Function:"));
panel.add(thunkedPanel, BorderLayout.CENTER); // provide as much space as possible
}
@@ -270,6 +273,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
panel.add(commitFullParamDetailsCheckBox, BorderLayout.SOUTH);
}
panel.getAccessibleContext().setAccessibleName("Call Fixup and Thunked Function");
return panel;
}
@@ -290,8 +294,10 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
private JComponent buildPreview() {
previewPanel = new JPanel(new BorderLayout());
JPanel verticalScrollPanel = new VerticalScrollablePanel();
verticalScrollPanel.getAccessibleContext().setAccessibleName("Vertical Scroll");
verticalScrollPanel.add(createSignatureTextPanel());
scroll = new JScrollPane(verticalScrollPanel);
scroll.getAccessibleContext().setAccessibleName("Scroll");
scroll.setBorder(null);
scroll.setOpaque(true);
previewPanel.add(scroll, BorderLayout.CENTER);
@@ -304,13 +310,14 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
signatureTextField.requestFocus();
}
});
previewPanel.getAccessibleContext().setAccessibleName("Preview");
return previewPanel;
}
private JComponent createSignatureTextPanel() {
JPanel panel = new JPanel(new BorderLayout());
signatureTextField = new FunctionSignatureTextField();
signatureTextField.getAccessibleContext().setAccessibleName("Signature");
signatureFieldUndoRedoKeeper = DockingUtils.installUndoRedo(signatureTextField);
panel.add(signatureTextField);
@@ -368,6 +375,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
signatureTextField
.setChangeListener(e -> model.setSignatureFieldText(signatureTextField.getText()));
panel.getAccessibleContext().setAccessibleName("Signature Text");
return panel;
}
@@ -413,9 +421,10 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
leftPanel.add(new GLabel("Calling Convention"));
leftPanel.add(createCallingConventionCombo());
leftPanel.setBorder(BorderFactory.createEmptyBorder(14, 0, 0, 10));
leftPanel.getAccessibleContext().setAccessibleName("Function");
panel.add(leftPanel, BorderLayout.CENTER);
panel.add(buildTogglePanel(), BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("Attributes");
return panel;
}
@@ -423,22 +432,26 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
JPanel panel = new JPanel(new PairLayout());
varArgsCheckBox = new GCheckBox("Varargs");
varArgsCheckBox.addItemListener(e -> model.setHasVarArgs(varArgsCheckBox.isSelected()));
varArgsCheckBox.getAccessibleContext().setAccessibleName("Variable Argument");
panel.add(varArgsCheckBox);
inLineCheckBox = new GCheckBox("In Line");
inLineCheckBox.getAccessibleContext().setAccessibleName("In Line");
panel.add(inLineCheckBox);
inLineCheckBox.addItemListener(e -> model.setIsInLine(inLineCheckBox.isSelected()));
inLineCheckBox.setEnabled(model.isInlineAllowed());
noReturnCheckBox = new GCheckBox("No Return");
noReturnCheckBox.getAccessibleContext().setAccessibleName("No Return");
noReturnCheckBox.addItemListener(e -> model.setNoReturn(noReturnCheckBox.isSelected()));
storageCheckBox = new GCheckBox("Use Custom Storage");
storageCheckBox.getAccessibleContext().setAccessibleName("Custom Storage");
storageCheckBox
.addItemListener(e -> model.setUseCustomizeStorage(storageCheckBox.isSelected()));
panel.add(noReturnCheckBox);
panel.add(storageCheckBox);
panel.setBorder(BorderFactory.createTitledBorder("Function Attributes:"));
panel.getAccessibleContext().setAccessibleName("Toggle");
return panel;
}
@@ -457,6 +470,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
JPanel panel = new JPanel();
callFixupComboBox = new GComboBox<>();
callFixupComboBox.getAccessibleContext().setAccessibleName("Call Fixup");
String[] callFixupNames = model.getCallFixupNames();
callFixupComboBox.addItem(FunctionEditorModel.NONE_CHOICE);
@@ -475,6 +489,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
}
panel.add(callFixupComboBox);
panel.getAccessibleContext().setAccessibleName("Call Fixup");
return panel;
}
@@ -486,10 +501,13 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
paramTableModel = new ParameterTableModel(model);
parameterTable = new ParameterTable(paramTableModel);
selectionListener = e -> model.setSelectedParameterRows(parameterTable.getSelectedRows());
parameterTable.getAccessibleContext().setAccessibleName("Parameter");
JScrollPane tableScroll = new JScrollPane(parameterTable);
tableScroll.getAccessibleContext().setAccessibleName("Scroll");
panel.add(tableScroll, BorderLayout.CENTER);
panel.add(buildButtonPanel(), BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("Function Variables");
return panel;
}
@@ -539,6 +557,7 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
}
};
nameField.getDocument().addDocumentListener(nameFieldDocumentListener);
nameField.getAccessibleContext().setAccessibleName("Name");
return nameField;
}
@@ -125,6 +125,7 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
JPanel panel = new JPanel(new BorderLayout());
panel.add(buildInfoPanel(service), BorderLayout.NORTH);
panel.add(buildTablePanel(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Storage Address Editor");
return panel;
}
@@ -195,9 +196,12 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
final DropDownSelectionTextField<DataType> textField = dataTypeEditor.getTextField();
textField.setBorder((new JTextField()).getBorder()); // restore default border
textField.getAccessibleContext().setAccessibleName("Data Type Editor");
JButton chooserButton = dataTypeEditor.getChooserButton();
chooserButton.getAccessibleContext().setAccessibleName("Choose");
JButton defaultButton = new JButton(); // restore default border/background
defaultButton.getAccessibleContext().setAccessibleName("Default");
chooserButton.setBorder(defaultButton.getBorder());
chooserButton.setBackground(defaultButton.getBackground());
@@ -223,13 +227,15 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
panel.add(dataTypeEditComponent);
panel.add(new GLabel("Datatype Size: "));
sizeLabel = new GDLabel(Integer.toString(size));
sizeLabel.getAccessibleContext().setAccessibleName("Size");
panel.add(sizeLabel);
panel.add(new GLabel("Allocated Size:"));
currentSizeLabel = new GDLabel("");
currentSizeLabel.getAccessibleContext().setAccessibleName("Current Size");
panel.add(currentSizeLabel);
setFocusComponent(textField);
panel.getAccessibleContext().setAccessibleName("Info");
return panel;
}
@@ -238,6 +244,7 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
panel.setBorder(BorderFactory.createTitledBorder("Storage Locations"));
varnodeTableModel = new VarnodeTableModel(model);
varnodeTable = new GTable(varnodeTableModel);
varnodeTable.getAccessibleContext().setAccessibleName("Varnode");
selectionListener = new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
@@ -258,8 +265,10 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
varnodeTable.setSurrendersFocusOnKeystroke(true);
JScrollPane scroll = new JScrollPane(varnodeTable);
scroll.getAccessibleContext().setAccessibleName("Varnode");
panel.add(scroll, BorderLayout.CENTER);
panel.add(buildButtonPanel(), BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("Table");
return panel;
}
@@ -267,9 +276,13 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
JPanel panel = new JPanel(new VerticalLayout(5));
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
addButton = new JButton("Add");
addButton.getAccessibleContext().setAccessibleName("Add");
removeButton = new JButton("Remove");
removeButton.getAccessibleContext().setAccessibleName("Remove");
upButton = new JButton("Up");
upButton.getAccessibleContext().setAccessibleName("Up");
downButton = new JButton("Down");
downButton.getAccessibleContext().setAccessibleName("Down");
addButton.addActionListener(new ActionListener() {
@Override
@@ -301,6 +314,7 @@ public class StorageAddressEditorDialog extends DialogComponentProvider
panel.add(new JSeparator());
panel.add(upButton);
panel.add(downButton);
panel.getAccessibleContext().setAccessibleName("Button");
return panel;
}
@@ -393,12 +393,13 @@ public class InstructionSearchDialog extends ReusableDialogComponentProvider imp
if (controlPanel == null) {
controlPanel = new ControlPanel(plugin, this);
}
controlPanel.getAccessibleContext().setAccessibleName("Control");
messagePanel.getAccessibleContext().setAccessibleName("Message");
lowerPanel.add(controlPanel);
lowerPanel.add(messagePanel);
lowerPanel.getAccessibleContext().setAccessibleName("Control and Message");
mainPanel.add(lowerPanel, BorderLayout.SOUTH);
mainPanel.getAccessibleContext().setAccessibleName("Instruction Search");
return mainPanel;
}
@@ -454,6 +455,7 @@ public class InstructionSearchDialog extends ReusableDialogComponentProvider imp
searchAllButton = new JButton("Search All");
searchAllButton.addActionListener(ev -> searchAllButtonActionPerformed());
searchAllButton.setName("Search All");
searchAllButton.getAccessibleContext().setAccessibleName("Search All");
addButton(searchAllButton);
addCancelButton();
@@ -76,6 +76,7 @@ public class LabelHistoryInputDialog extends DialogComponentProvider {
panel.setBorder(BorderFactory.createTitledBorder("Enter Symbol Name"));
inputField = new JTextField(25);
inputField.getAccessibleContext().setAccessibleName("Input");
setFocusComponent(inputField);
inputField.addActionListener(new ActionListener() {
@Override
@@ -101,9 +102,11 @@ public class LabelHistoryInputDialog extends DialogComponentProvider {
});
panel.add(inputField, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Name Entry");
JPanel outerPanel = new JPanel(new BorderLayout());
outerPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
outerPanel.add(panel, BorderLayout.CENTER);
outerPanel.getAccessibleContext().setAccessibleName("Label History Input");
return outerPanel;
}
@@ -60,15 +60,14 @@ public class OperandLabelDialog extends DialogComponentProvider {
mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
label = new GDLabel("Label: ");
myChoice = new GhidraComboBox<>();
myChoice.setName("MYCHOICE");
myChoice.setEditable(true);
myChoice.addActionListener(ev -> okCallback());
myChoice.getAccessibleContext().setAccessibleName("My Choice");
mainPanel.add(label);
mainPanel.add(myChoice);
mainPanel.getAccessibleContext().setAccessibleName("Operand Label");
return mainPanel;
}
@@ -35,6 +35,7 @@ public class OverviewColorLegendDialog extends DialogComponentProvider {
*/
public OverviewColorLegendDialog(String title, JComponent component, HelpLocation help) {
super(title, false);
component.getAccessibleContext().setAccessibleName("Overview Color Legend");
addWorkPanel(component);
addDismissButton();
setHelpLocation(help);
@@ -76,6 +76,7 @@ public class EntropyOverviewColorService implements OverviewColorService {
@Override
public void setOverviewComponent(OverviewColorComponent component) {
this.overviewComponent = component;
this.overviewComponent.getAccessibleContext().setAccessibleName("Overview Component");
}
@Override
@@ -72,6 +72,7 @@ public class PrintOptionsDialog extends ReusableDialogComponentProvider {
JPanel rangePanel = new JPanel();
rangePanel.setLayout(new BoxLayout(rangePanel, BoxLayout.Y_AXIS));
rangePanel.setBorder(BorderFactory.createTitledBorder("Print Range"));
rangePanel.getAccessibleContext().setAccessibleName("Print Range");
KeyListener key = new KeyAdapter() {
@Override
@@ -87,41 +88,50 @@ public class PrintOptionsDialog extends ReusableDialogComponentProvider {
selection = new GRadioButton("Selected area(s)");
selection.addKeyListener(key);
selection.getAccessibleContext().setAccessibleName("Selected Area");
rangePanel.add(selection);
group.add(selection);
selection.setEnabled(selectionEnabled);
visible = new GRadioButton("Code visible on screen");
visible.addKeyListener(key);
visible.getAccessibleContext().setAccessibleName("Visible Code");
rangePanel.add(visible);
group.add(visible);
view = new GRadioButton("Current view");
view.addKeyListener(key);
view.getAccessibleContext().setAccessibleName("Current View");
rangePanel.add(view);
group.add(view);
JPanel headerPanel = new JPanel();
headerPanel.setLayout(new BoxLayout(headerPanel, BoxLayout.X_AXIS));
headerPanel.setBorder(BorderFactory.createTitledBorder("Header and Footer"));
headerPanel.getAccessibleContext().setAccessibleName("Info");
title = new GCheckBox("Title");
title.setSelected(true);
title.addKeyListener(key);
title.getAccessibleContext().setAccessibleName("Title");
headerPanel.add(title);
date = new GCheckBox("Date/Time");
date.setSelected(true);
date.addKeyListener(key);
date.getAccessibleContext().setAccessibleName("Date/Time");
headerPanel.add(date);
pageNum = new GCheckBox("Page Numbers");
pageNum.setSelected(true);
pageNum.addKeyListener(key);
pageNum.getAccessibleContext().setAccessibleName("Page Numbers");
headerPanel.add(pageNum);
JPanel optionsPanel = new JPanel();
optionsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
optionsPanel.setBorder(BorderFactory.createTitledBorder("Other Print Options"));
optionsPanel.getAccessibleContext().setAccessibleName("Other Options");
monochrome = new GCheckBox("Use Monochrome", true);
monochrome.addKeyListener(key);
monochrome.getAccessibleContext().setAccessibleName("Monochrome");
optionsPanel.add(monochrome);
outerPanel.add(rangePanel, BorderLayout.NORTH);
@@ -129,7 +139,7 @@ public class PrintOptionsDialog extends ReusableDialogComponentProvider {
outerPanel.add(optionsPanel, BorderLayout.SOUTH);
setFocusComponent();
outerPanel.getAccessibleContext().setAccessibleName("Print Options");
return outerPanel;
}
@@ -82,7 +82,7 @@ public class SetLanguageDialog extends DialogComponentProvider {
selectLangPanel.addSelectionListener(listener);
selectLangPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
selectLangPanel.getAccessibleContext().setAccessibleName("Set Language");
addWorkPanel(selectLangPanel);
addOKButton();
addCancelButton();
@@ -141,12 +141,14 @@ public class OffsetTableDialog extends DialogComponentProvider {
comboBox = new GComboBox<>(new String[] { "1", "2", "4", "8" });
int pointerSize = defaultAddress.getPointerSize();
comboBox.setSelectedItem(Integer.toString(pointerSize));
comboBox.getAccessibleContext().setAccessibleName("Address");
panel.add(new GLabel("Select Data Size (Bytes):", SwingConstants.RIGHT));
panel.add(comboBox);
signedCheckBox = new GCheckBox("Signed Data Value(s)", true);
signedCheckBox.getAccessibleContext().setAccessibleName("Signed Data Value");
panel.add(signedCheckBox);
panel.getAccessibleContext().setAccessibleName("Offset Table");
return panel;
}
}
@@ -54,6 +54,7 @@ class EditRegisterValueDialog extends DialogComponentProvider {
JTextField registerField =
new JTextField(register.getName() + " (" + register.getBitLength() + ")");
registerField.getAccessibleContext().setAccessibleName("Register");
registerField.setEditable(false);
Consumer<Address> addressChangeListener = a -> updateOk();
@@ -61,6 +62,7 @@ class EditRegisterValueDialog extends DialogComponentProvider {
endAddrField = new AddressInput(program, addressChangeListener);
registerValueField = new FixedBitSizeValueField(register.getBitLength(), true, false);
registerValueField.getAccessibleContext().setAccessibleName("Register Value");
startAddrField.setAddress(start);
endAddrField.setAddress(end);
registerValueField.setValue(value);
@@ -76,7 +78,7 @@ class EditRegisterValueDialog extends DialogComponentProvider {
panel.add(endAddrField);
panel.add(new GLabel("Value:"));
panel.add(registerValueField);
panel.getAccessibleContext().setAccessibleName("Edit Register Value");
return panel;
}
@@ -112,7 +112,7 @@ public class ScalarSearchDialog extends DialogComponentProvider {
newMainPanel.setLayout(new BorderLayout());
newMainPanel.add(buildSearchLayout(), BorderLayout.NORTH);
newMainPanel.getAccessibleContext().setAccessibleName("Scalar Search");
return newMainPanel;
}
@@ -124,7 +124,7 @@ public class ScalarSearchDialog extends DialogComponentProvider {
finalPanel.add(searchLayout, BorderLayout.NORTH);
finalPanel.add(buildSelectionPanel(), BorderLayout.SOUTH);
finalPanel.getAccessibleContext().setAccessibleName("Search");
return finalPanel;
}
@@ -143,10 +143,11 @@ public class ScalarSearchDialog extends DialogComponentProvider {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setBorder(new TitledBorder("Search Scope"));
panel.getAccessibleContext().setAccessibleName("Search Choice");
searchSelectionRadioButton = new GRadioButton("Search Selection");
searchSelectionRadioButton.getAccessibleContext().setAccessibleName("Search Selection");
searchAllRadioButton = new GRadioButton("Search All");
searchAllRadioButton.getAccessibleContext().setAccessibleName("Search All");
searchSelectionRadioButton.setToolTipText("Search only the current selection");
searchAllRadioButton.setToolTipText("Search the entire program");
@@ -173,7 +174,7 @@ public class ScalarSearchDialog extends DialogComponentProvider {
HelpService helpService = DockingWindowManager.getHelpService();
helpService.registerHelp(selectionPanel,
new HelpLocation(plugin.getName(), "Scalar_Selection_Scope"));
selectionPanel.getAccessibleContext().setAccessibleName("Selection");
return selectionPanel;
}
@@ -182,6 +183,7 @@ public class ScalarSearchDialog extends DialogComponentProvider {
beginSearchButton = new JButton("Search");
beginSearchButton.setMnemonic('B');
beginSearchButton.addActionListener(ev -> searchCallback());
beginSearchButton.getAccessibleContext().setAccessibleName("Begin Search");
this.addButton(beginSearchButton);
}
@@ -260,7 +262,9 @@ public class ScalarSearchDialog extends DialogComponentProvider {
setBorder(new TitledBorder("Search Type"));
searchAllScalars = new GRadioButton("Scalars in Range:");
searchAllScalars.getAccessibleContext().setAccessibleName("Search All Scalars");
searchAScalar = new GRadioButton("Specific Scalar:");
searchAScalar.getAccessibleContext().setAccessibleName("Search Specific Scalar");
searchAllScalars.setToolTipText(
"Search program (or selection) for scalar operands or defined scalar data types with values in the following range:");
@@ -290,17 +294,18 @@ public class ScalarSearchDialog extends DialogComponentProvider {
JPanel allScalarsPanel = new JPanel();
allScalarsPanel.setLayout(new BorderLayout());
allScalarsPanel.add(searchAllScalars, BorderLayout.NORTH);
allScalarsPanel.getAccessibleContext().setAccessibleName("All Scalars");
rangeFilter = new RangeFilter();
rangeFilter.getAccessibleContext().setAccessibleName("All Scalar");
allScalarsPanel.add(Box.createHorizontalStrut(18), BorderLayout.WEST);
allScalarsPanel.add(rangeFilter, BorderLayout.CENTER);
JPanel aScalarPanel = new JPanel();
aScalarPanel.setLayout(new BorderLayout());
aScalarPanel.add(searchAScalar, BorderLayout.NORTH);
aScalarPanel.getAccessibleContext().setAccessibleName("Specifc Scalar");
exactValueField = new IntegerTextField(8);
exactValueField.getComponent().getAccessibleContext().setAccessibleName("Exact Value");
aScalarPanel.add(Box.createHorizontalStrut(18), BorderLayout.WEST);
aScalarPanel.add(exactValueField.getComponent(), BorderLayout.CENTER);
@@ -47,7 +47,7 @@ class KeyBindingInputDialog extends DialogComponentProvider implements KeyEntryL
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(new GLabel(scriptName), BorderLayout.NORTH);
panel.add(kbPanel, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Key Binding Input");
addWorkPanel(panel);
addOKButton();
addCancelButton();
@@ -78,7 +78,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
mainPanel.add(methodPanel(), gbc);
gbc.gridx++;
mainPanel.add(buildBlockPanel(), gbc);
mainPanel.getAccessibleContext().setAccessibleName("Select Block");
return mainPanel;
}
@@ -90,13 +90,16 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
main.add(new GLabel("Ending Address:"));
toAddressField = new JTextField(10);
toAddressField.getAccessibleContext().setAccessibleName("To Address");
main.add(toAddressField);
main.add(new GLabel("Length: "));
numberInputField = new IntegerTextField(10);
numberInputField.getComponent().getAccessibleContext().setAccessibleName("Number Input");
numberInputField.setMaxValue(BigInteger.valueOf(Integer.MAX_VALUE));
numberInputField.setAllowNegativeValues(false);
main.add(numberInputField.getComponent());
main.getAccessibleContext().setAccessibleName("Block");
return main;
}
@@ -111,6 +114,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
forwardButton = new GRadioButton("Select Forward", true);
forwardButton.setName("forwardButton");
forwardButton.getAccessibleContext().setAccessibleName("Forward");
forwardButton.addActionListener(ae -> {
setStatusText("Enter number of bytes to select");
setAddressFieldEnabled(false);
@@ -119,6 +123,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
buttonGroup.add(forwardButton);
backwardButton = new GRadioButton("Select Backward");
backwardButton.setName("backwardButton");
backwardButton.getAccessibleContext().setAccessibleName("Backward");
backwardButton.addActionListener(ae -> {
setStatusText("Enter number of bytes to select");
setAddressFieldEnabled(false);
@@ -127,6 +132,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
buttonGroup.add(backwardButton);
allButton = new GRadioButton("Select All");
allButton.setName("allButton");
allButton.getAccessibleContext().setAccessibleName("All");
allButton.addActionListener(ae -> {
setItemsEnabled(false);
clearStatusText();
@@ -135,6 +141,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
buttonGroup.add(allButton);
toButton = new GRadioButton("To Address");
toButton.setName("toButton");
toButton.getAccessibleContext().setAccessibleName("To Address");
toButton.addActionListener(ae -> {
setStatusText("Enter an Address to go to");
setAddressFieldEnabled(true);
@@ -152,6 +159,7 @@ class SelectBlockDialog extends ReusableDialogComponentProvider {
gbc.gridy++;
main.add(backwardButton, gbc);
setStatusText("Enter number of bytes to select");
main.getAccessibleContext().setAccessibleName("Methods");
return main;
}
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -117,7 +117,7 @@ public class SearchStringDialog extends DialogComponentProvider {
panel.add(buildLeftPanel(), BorderLayout.WEST);
panel.add(Box.createHorizontalStrut(10), BorderLayout.CENTER);
panel.add(buildRightPanel(), BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("Search String");
return panel;
}
@@ -130,7 +130,7 @@ public class SearchStringDialog extends DialogComponentProvider {
panel.add(buildOptionsPanelLeft(), BorderLayout.NORTH);
panel.add(Box.createVerticalStrut(15), BorderLayout.CENTER);
panel.add(buildMemoryBlocksPanel(), BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Memory Block Search");
return panel;
}
@@ -144,7 +144,7 @@ public class SearchStringDialog extends DialogComponentProvider {
panel.add(buildOptionsPanelRight(), BorderLayout.NORTH);
panel.add(Box.createVerticalStrut(15), BorderLayout.CENTER);
panel.add(buildSelectionScopePanel(), BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Selection Scope Search");
return panel;
}
@@ -159,12 +159,14 @@ public class SearchStringDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new GridLayout(3, 1, 10, 14));
nullTerminateCheckbox = new GCheckBox("Require Null Termination");
nullTerminateCheckbox.getAccessibleContext().setAccessibleName("Require Null Termination");
pascalStringsCheckbox = new GCheckBox("Pascal Strings");
pascalStringsCheckbox.getAccessibleContext().setAccessibleName("Pascal Strings");
nullTerminateCheckbox.setSelected(true);
panel.add(nullTerminateCheckbox);
panel.add(pascalStringsCheckbox);
panel.getAccessibleContext().setAccessibleName("Options");
return panel;
}
@@ -181,6 +183,7 @@ public class SearchStringDialog extends DialogComponentProvider {
JLabel minLengthLabel = new GLabel("Minimum Length: ");
minLengthLabel.setName("minLen");
minLengthLabel.getAccessibleContext().setAccessibleName("Minimum Length");
minLengthLabel.setToolTipText("<html>Searches for valid ascii or ascii unicode strings " +
"greater or equal to minimum search length.<br> The null characters are not included " +
"in the minimum string length.");
@@ -188,10 +191,12 @@ public class SearchStringDialog extends DialogComponentProvider {
minLengthField = new IntegerTextField(5, 5L);
minLengthField.getComponent().setName("minDefault");
minLengthField.getComponent().getAccessibleContext().setAccessibleName("Minimum Length");
panel.add(minLengthField.getComponent());
JLabel alignLabel = new GLabel("Alignment: ");
alignLabel.setName("alignment");
alignLabel.getAccessibleContext().setAccessibleName("Alignment");
alignLabel
.setToolTipText("<html>Searches for strings that start on the given alignment<br>" +
"value. The default alignment is processor dependent.");
@@ -199,10 +204,11 @@ public class SearchStringDialog extends DialogComponentProvider {
alignField = new IntegerTextField(5, 1L);
alignField.getComponent().setName("alignDefault");
alignField.getComponent().getAccessibleContext().setAccessibleName("Align");
panel.add(alignField.getComponent());
createModelFieldPanel(panel);
panel.getAccessibleContext().setAccessibleName("Options");
return panel;
}
@@ -265,7 +271,9 @@ public class SearchStringDialog extends DialogComponentProvider {
ButtonGroup memoryBlockGroup = new ButtonGroup();
loadedBlocksRB = new GRadioButton("Loaded Blocks", true);
loadedBlocksRB.getAccessibleContext().setAccessibleName("Loaded Bocks");
allBlocksRB = new GRadioButton("All Blocks", false);
allBlocksRB.getAccessibleContext().setAccessibleName("All Blocks");
memoryBlockGroup.add(loadedBlocksRB);
memoryBlockGroup.add(allBlocksRB);
@@ -278,7 +286,7 @@ public class SearchStringDialog extends DialogComponentProvider {
panel.add(loadedBlocksRB);
panel.add(allBlocksRB);
panel.getAccessibleContext().setAccessibleName("Memory Blocks");
return panel;
}
@@ -294,7 +302,9 @@ public class SearchStringDialog extends DialogComponentProvider {
panel.setBorder(new TitledBorder("Selection Scope"));
searchSelectionRB = new GRadioButton("Search Selection");
searchSelectionRB.getAccessibleContext().setAccessibleName("Search Selection");
searchAllRB = new GRadioButton("Search All");
searchAllRB.getAccessibleContext().setAccessibleName("Search All");
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(searchSelectionRB);
@@ -311,7 +321,7 @@ public class SearchStringDialog extends DialogComponentProvider {
JPanel selectionPanel = new JPanel();
selectionPanel.setLayout(new BorderLayout());
selectionPanel.add(panel, BorderLayout.NORTH);
selectionPanel.getAccessibleContext().setAccessibleName("Selections Scope");
return selectionPanel;
}
@@ -289,6 +289,7 @@ public class EncodedStringsDialog extends DialogComponentProvider {
addWorkPanel(buildWorkPanel());
createButton = new JButton("Create");
createButton.setName("Create");
createButton.getAccessibleContext().setAccessibleName("Create");
createButton.addActionListener(e -> {
if (isSingleStringMode()) {
@@ -308,7 +309,7 @@ public class EncodedStringsDialog extends DialogComponentProvider {
private JComponent buildWorkPanel() {
optionsPanel = new JPanel(new PairLayout(5, 5));
optionsPanel.setBorder(BorderFactory.createTitledBorder("Options"));
optionsPanel.getAccessibleContext().setAccessibleName("Options");
buildCharsetPickerComponents();
buildOptionsButtonComponents();
buildAdvancedOptionsComponents();
@@ -322,7 +323,9 @@ public class EncodedStringsDialog extends DialogComponentProvider {
advancedFailedCountLabel);
GLabel scriptLabel = new GLabel("Script:", SwingConstants.RIGHT);
scriptLabel.getAccessibleContext().setAccessibleName("Script");
GLabel allowAddLabel = new GLabel("Allow Additional:");
allowAddLabel.getAccessibleContext().setAccessibleName("Allow Additional");
scriptRow =
addRow(scriptLabel, requiredUnicodeScript, scriptFailedCountLabel, allowAddLabel,
allowAnyScriptButton, otherScriptsFailedCountLabel, allowLatinScriptButton,
@@ -338,6 +341,7 @@ public class EncodedStringsDialog extends DialogComponentProvider {
else {
GLabel minLenLabel = new GLabel("Min Length:", SwingConstants.RIGHT);
minLenLabel.setToolTipText(minStringLengthSpinner.getSpinner().getToolTipText());
minLenLabel.getAccessibleContext().setAccessibleName("Minimum Length");
advOptsRow2 = addRow(null, minLenLabel, minStringLengthSpinner.getSpinner(),
minLenFailedCountLabel, alignStartOfStringCB, breakOnRefCB);
}
@@ -354,11 +358,12 @@ public class EncodedStringsDialog extends DialogComponentProvider {
JPanel previewTablePanel = new JPanel(new BorderLayout());
previewTablePanel.add(threadedTablePanel, BorderLayout.CENTER);
previewTablePanel.add(filterPanel, BorderLayout.SOUTH);
previewTablePanel.getAccessibleContext().setAccessibleName("Preview Table");
JPanel panel = new JPanel(new BorderLayout());
panel.add(optionsPanel, BorderLayout.NORTH);
panel.add(previewTablePanel, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Encoded Strings");
return panel;
}
@@ -418,21 +423,25 @@ public class EncodedStringsDialog extends DialogComponentProvider {
JPanel emptyTableOverlay = new JPanel(new GridBagLayout());
emptyTableOverlay.add(new GHtmlLabel("<html>No strings matched filter criteria..."),
new GridBagConstraints());
emptyTableOverlay.getAccessibleContext().setAccessibleName("Empty Table Overlay");
threadedTablePanel =
new EncodedStringsThreadedTablePanel<>(tableModel, 1000, emptyTableOverlay);
threadedTablePanel.setBorder(BorderFactory.createTitledBorder("Preview"));
threadedTablePanel.getAccessibleContext().setAccessibleName("Threaded Table");
table = threadedTablePanel.getTable();
table.setName("DataTable");
table.getAccessibleContext().setAccessibleName("Data Table");
table.setPreferredScrollableViewportSize(new Dimension(350, 150));
table.getSelectionModel().addListSelectionListener(e -> selectedRowChange());
table.installNavigation(tool);
filterPanel.getAccessibleContext().setAccessibleName("Filter");
filterPanel = new GhidraTableFilterPanel<>(table, tableModel);
}
private void buildCharsetPickerComponents() {
charsetComboBox = new GhidraComboBox<>();
charsetComboBox.getAccessibleContext().setAccessibleName("Charset Checkboxes");
for (String charsetName : CharsetInfo.getInstance().getCharsetNames()) {
charsetComboBox.addToModel(charsetName);
}
@@ -474,6 +483,7 @@ public class EncodedStringsDialog extends DialogComponentProvider {
private void buildOptionsButtonComponents() {
showAdvancedOptionsButton = new JToggleButton("Advanced...");
showAdvancedOptionsButton.setName("SHOW_ADVANCED_OPTIONS");
showAdvancedOptionsButton.getAccessibleContext().setAccessibleName("Show Advanced Options");
showAdvancedOptionsButton.setToolTipText("Show advanced options.");
showAdvancedOptionsButton.addActionListener(e -> {
setRowVisibility(advOptsRow1, showAdvancedOptionsButton.isSelected());
@@ -488,9 +498,11 @@ public class EncodedStringsDialog extends DialogComponentProvider {
advancedFailedCountLabel.setToolTipText(
"Number of strings excluded due to filtering options in advanced options.");
advancedFailedCountLabel.setVisible(!showAdvancedOptionsButton.isSelected());
advancedFailedCountLabel.getAccessibleContext().setAccessibleName("Advanced Failed Count");
showScriptOptionsButton = new JToggleButton("A-Z,\u6211\u7684,\u062d\u064e\u0648\u0651");
showScriptOptionsButton.setName("SHOW_SCRIPT_OPTIONS");
showScriptOptionsButton.getAccessibleContext().setAccessibleName("Show Script Options");
showScriptOptionsButton.setToolTipText("Filter by character scripts (alphabets).");
showScriptOptionsButton.addActionListener(e -> {
setRowVisibility(scriptRow, showScriptOptionsButton.isSelected());
@@ -499,6 +511,8 @@ public class EncodedStringsDialog extends DialogComponentProvider {
showTranslateOptionsButton = new JToggleButton("Translate");
showTranslateOptionsButton.setName("SHOW_TRANSLATE_OPTIONS");
showTranslateOptionsButton.getAccessibleContext()
.setAccessibleName("Show Translate Options");
showTranslateOptionsButton.setToolTipText("Translate strings after creation.");
showTranslateOptionsButton.addActionListener(e -> {
setRowVisibility(translateRow, showTranslateOptionsButton.isSelected());
@@ -513,10 +527,13 @@ public class EncodedStringsDialog extends DialogComponentProvider {
excludeStringsWithCodecErrorCB.setToolTipText("""
<html>Exclude strings that have charset codec errors.<br>
(bytes/sequences that are invalid for the chosen charset)""");
excludeStringsWithCodecErrorCB.getAccessibleContext()
.setAccessibleName("Exclude Strings With Codec Error");
codecErrorsCountLabel = new GDHtmlLabel();
codecErrorsCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
codecErrorsCountLabel.setToolTipText("Number of strings excluded due to codec errors.");
codecErrorsCountLabel.getAccessibleContext().setAccessibleName("Codec Errors Count");
excludeStringsWithNonStdCtrlCharsCB = new GCheckBox("Exclude non-std ctrl chars");
excludeStringsWithNonStdCtrlCharsCB.setSelected(!singleStringMode);
@@ -524,11 +541,14 @@ public class EncodedStringsDialog extends DialogComponentProvider {
<html>Exclude strings that contain non-standard control characters.<br>
(ASCII 1..31, not including tab, CR, LF)""");
excludeStringsWithNonStdCtrlCharsCB.addItemListener(this::checkboxItemListener);
excludeStringsWithNonStdCtrlCharsCB.getAccessibleContext()
.setAccessibleName("Exclude Strings with Non-Standard Control Characters");
nonStdCtrlCharsErrorsCountLabel = new GDHtmlLabel();
nonStdCtrlCharsErrorsCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
nonStdCtrlCharsErrorsCountLabel.setToolTipText(
"Number of strings excluded due to non-standard control characters.");
nonStdCtrlCharsErrorsCountLabel.getAccessibleContext()
.setAccessibleName("Non-Standard Control Character Error Count");
alignStartOfStringCB = new GCheckBox("Align start of string");
alignStartOfStringCB.setToolTipText("""
@@ -536,12 +556,12 @@ public class EncodedStringsDialog extends DialogComponentProvider {
strings that begin on an aligned boundary.""");
alignStartOfStringCB.setSelected(!singleStringMode);
alignStartOfStringCB.addItemListener(this::checkboxItemListener);
alignStartOfStringCB.getAccessibleContext().setAccessibleName("Align Start of String");
breakOnRefCB = new GCheckBox("Truncate at ref");
breakOnRefCB.setSelected(true);
breakOnRefCB.addItemListener(this::checkboxItemListener);
breakOnRefCB.setToolTipText("Truncate strings at references.");
breakOnRefCB.getAccessibleContext().setAccessibleName("Break on References");
minStringLengthSpinner = new IntegerSpinner(new SpinnerNumberModel( // spinner
Long.valueOf(Math.min(5, selectedAddresses.getNumAddresses())), // initial
Long.valueOf(0), // min
@@ -553,11 +573,14 @@ public class EncodedStringsDialog extends DialogComponentProvider {
"Exclude strings that are shorter (in characters, not bytes) than this minimum");
minStringLengthSpinner.getTextField().setShowNumberMode(false);
minStringLengthSpinner.getSpinner().addChangeListener(e -> updateOptionsAndRefresh());
minStringLengthSpinner.getSpinner()
.getAccessibleContext()
.setAccessibleName("Minimum String Length");
minLenFailedCountLabel = new GDHtmlLabel();
minLenFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
minLenFailedCountLabel.setToolTipText("Number of strings excluded due to length.");
minLenFailedCountLabel.getAccessibleContext()
.setAccessibleName("Minimum Failed Length Count");
stringModelFilenameComboBox = new GhidraComboBox<>();
stringModelFilenameComboBox.setEditable(true);
for (String builtinStringModelFilename : getBuiltinStringModelFilenames()) {
@@ -574,16 +597,19 @@ public class EncodedStringsDialog extends DialogComponentProvider {
Enter the full path to a user-supplied .sng model file,<br>
or<br>
Clear the field for no string model.""");
stringModelFilenameComboBox.getAccessibleContext()
.setAccessibleName("String Model Filename");
requireValidStringCB = new GCheckBox("Exclude invalid strings");
requireValidStringCB.setSelected(false);
requireValidStringCB.setToolTipText("Verify strings against the string model.");
requireValidStringCB.addItemListener(this::checkboxItemListener);
requireValidStringCB.getAccessibleContext().setAccessibleName("Reguire Valid Sring");
stringModelFailedCountLabel = new GDHtmlLabel();
stringModelFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
stringModelFailedCountLabel
.setToolTipText("Number of strings excluded due to failing string model check.");
stringModelFailedCountLabel.getAccessibleContext()
.setAccessibleName("String Model Failed Count");
}
private void buildScriptFilterComponents() {
@@ -600,12 +626,12 @@ public class EncodedStringsDialog extends DialogComponentProvider {
<p>
Note: character scripts that are drawable using the current font will have<br>
some example characters displayed to the right of the name.""");
requiredUnicodeScript.getAccessibleContext().setAccessibleName("Required Unicode Script");
scriptFailedCountLabel = new GDHtmlLabel();
scriptFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
scriptFailedCountLabel
.setToolTipText("Number of strings excluded due to failing script requirements.");
scriptFailedCountLabel.getAccessibleContext().setAccessibleName("Script Failed Count");
allowLatinScriptButton = new JToggleButton("A-Z");
allowLatinScriptButton.setName("ALLOW_LATIN_SCRIPT");
Gui.registerFont(allowLatinScriptButton, BUTTON_FONT_ID);
@@ -614,12 +640,14 @@ public class EncodedStringsDialog extends DialogComponentProvider {
"Allow Latin characters (e.g. A-Z, etc) to also be present in the string.");
allowLatinScriptButton.setSelected(true);
allowLatinScriptButton.addItemListener(this::checkboxItemListener);
allowLatinScriptButton.getAccessibleContext().setAccessibleName("Allow Latin Script");
latinScriptFailedCountLabel = new GDHtmlLabel();
latinScriptFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
latinScriptFailedCountLabel.setToolTipText(
"Number of strings excluded because they contained Latin characters.");
latinScriptFailedCountLabel.getAccessibleContext()
.setAccessibleName("Latin Script Failed Count");
allowCommonScriptButton = new JToggleButton("0-9,!?");
allowCommonScriptButton.setName("ALLOW_COMMON_SCRIPT");
Gui.registerFont(allowCommonScriptButton, BUTTON_FONT_ID);
@@ -627,12 +655,13 @@ public class EncodedStringsDialog extends DialogComponentProvider {
"Allow common characters (e.g. 0-9, space, punctuation, etc) to also be present in the string.");
allowCommonScriptButton.setSelected(true);
allowCommonScriptButton.addItemListener(this::checkboxItemListener);
allowCommonScriptButton.getAccessibleContext().setAccessibleName("Allow Common Script");
commonScriptFailedCountLabel = new GDHtmlLabel();
commonScriptFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
commonScriptFailedCountLabel.setToolTipText(
"Number of strings excluded because they contained Common (0-9, space, punctuation, etc) characters.");
commonScriptFailedCountLabel.getAccessibleContext()
.setAccessibleName("Common Script Failed Count");
allowAnyScriptButton = new JToggleButton("Any");
allowAnyScriptButton.setName("ALLOW_ANY_SCRIPT");
Gui.registerFont(allowAnyScriptButton, BUTTON_FONT_ID);
@@ -640,11 +669,13 @@ public class EncodedStringsDialog extends DialogComponentProvider {
"Allow all other character scripts to also be present in the string.");
allowAnyScriptButton.setSelected(true);
allowAnyScriptButton.addItemListener(this::checkboxItemListener);
allowAnyScriptButton.getAccessibleContext().setAccessibleName("Allow Any Script");
otherScriptsFailedCountLabel = new GDHtmlLabel();
otherScriptsFailedCountLabel.setForeground(GThemeDefaults.Colors.Messages.ERROR);
otherScriptsFailedCountLabel.setToolTipText(
"Number of strings excluded because they contained characters from other scripts (alphabets).");
otherScriptsFailedCountLabel.getAccessibleContext()
.setAccessibleName("Other Scripts Failed Count");
}
private List<String> getBuiltinStringModelFilenames() {
@@ -660,6 +691,7 @@ public class EncodedStringsDialog extends DialogComponentProvider {
List<StringTranslationService> translationServices =
StringTranslationService.getCurrentStringTranslationServices(tool);
translateComboBox = new GhidraComboBox<>(translationServices);
translateComboBox.getAccessibleContext().setAccessibleName("Translate Checkboxes");
StringTranslationService defaultSTS = getDefaultTranslationService(translationServices);
if (defaultSTS != null) {
translateComboBox.setSelectedItem(defaultSTS);
@@ -117,10 +117,11 @@ public class EditExternalLocationDialog extends DialogComponentProvider {
int panelHeight = (externalLocation != null) ? PREFERRED_EDIT_PANEL_HEIGHT
: PREFERRED_CREATE_PANEL_HEIGHT;
extLocPanel.setPreferredSize(new Dimension(PREFERRED_PANEL_WIDTH, panelHeight));
extLocPanel.getAccessibleContext().setAccessibleName("External Location");
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(extLocPanel, BorderLayout.CENTER);
workPanel.getAccessibleContext().setAccessibleName("Edit External Location");
return workPanel;
}

Some files were not shown because too many files have changed in this diff Show More