GP-4555 set accessible names for components

This commit is contained in:
GhidraKraken 2024-04-30 15:54:58 -04:00 committed by ghidragon
parent 136a944796
commit 6121818cd3
150 changed files with 1054 additions and 346 deletions

View file

@ -488,6 +488,7 @@ public class DialogComponentProvider
okButton = new JButton("OK");
okButton.setMnemonic('K');
okButton.setName("OK");
okButton.getAccessibleContext().setAccessibleName("OK");
okButton.addActionListener(e -> okCallback());
addButton(okButton);
}
@ -500,6 +501,7 @@ public class DialogComponentProvider
cancelButton = new JButton("Cancel");
cancelButton.setMnemonic('C');
cancelButton.setName("Cancel");
cancelButton.getAccessibleContext().setAccessibleName("Cancel");
cancelButton.addActionListener(e -> cancelCallback());
addButton(cancelButton);
}
@ -512,6 +514,7 @@ public class DialogComponentProvider
dismissButton = new JButton("Dismiss");
dismissButton.setMnemonic('D');
dismissButton.setName("Dismiss");
dismissButton.getAccessibleContext().setAccessibleName("Dismiss");
dismissButton.addActionListener(e -> dismissCallback());
addButton(dismissButton);
}
@ -524,6 +527,7 @@ public class DialogComponentProvider
applyButton = new JButton("Apply");
applyButton.setMnemonic('A');
applyButton.setName("Apply");
applyButton.getAccessibleContext().setAccessibleName("Apply");
applyButton.addActionListener(e -> applyCallback());
addButton(applyButton);
}

View file

@ -89,6 +89,7 @@ public class DialogComponentProviderPopupActionManager {
// Popup menu if items are available
JPopupMenu popupMenu = menuMgr.getPopupMenu();
popupMenu.getAccessibleContext().setAccessibleName("Popup");
Component c = (Component) e.getSource();
popupMenu.addPopupMenuListener(popupMenuHandler);
popupMenu.show(c, e.getX(), e.getY());

View file

@ -101,14 +101,16 @@ public class MultiActionDialog extends DialogComponentProvider {
labelPanel.add(new GLabel("Multiple actions have been mapped to " + keystrokeName));
labelPanel.add(new GLabel("Actions that can be enabled at the same"));
labelPanel.add(new GLabel("time should be mapped to different keys"));
labelPanel.getAccessibleContext().setAccessibleName("Label");
innerPanel.setBorder(BorderFactory.createTitledBorder("Actions"));
innerPanel.getAccessibleContext().setAccessibleName("Actions");
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
Icon icon = UIManager.getIcon("OptionPane.warningIcon");
panel.add(new GIconLabel(icon));
panel.add(labelPanel);
panel.getAccessibleContext().setAccessibleName("Icon");
listModel = new DefaultListModel<>();
actionList = new JList<>(listModel);
@ -137,12 +139,14 @@ public class MultiActionDialog extends DialogComponentProvider {
actionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
actionList.setVisibleRowCount(5);
actionList.getAccessibleContext().setAccessibleName("Action");
JScrollPane listScrollPane = new JScrollPane(actionList);
listScrollPane.getAccessibleContext().setAccessibleName("Action List");
innerPanel.add(listScrollPane, BorderLayout.CENTER);
mainPanel.add(panel, BorderLayout.NORTH);
mainPanel.add(innerPanel, BorderLayout.CENTER);
mainPanel.getAccessibleContext().setAccessibleName("Multi Action");
return mainPanel;
}

View file

@ -73,9 +73,11 @@ public class KeyEntryDialog extends DialogComponentProvider {
defaultPanel = new JPanel(new BorderLayout());
defaultPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5));
defaultPanel.getAccessibleContext().setAccessibleName("Default");
JLabel imageLabel = new GIconLabel(Icons.INFO_ICON);
bgColor = imageLabel.getBackground();
imageLabel.getAccessibleContext().setAccessibleName("Image");
JTextPane pane = new JTextPane();
pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 2, 5));
pane.setBackground(bgColor);
@ -92,6 +94,7 @@ public class KeyEntryDialog extends DialogComponentProvider {
JPanel labelPanel = new JPanel();
labelPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
labelPanel.getAccessibleContext().setAccessibleName("Label");
BoxLayout bl = new BoxLayout(labelPanel, BoxLayout.X_AXIS);
labelPanel.setLayout(bl);
labelPanel.add(Box.createHorizontalStrut(5));
@ -110,6 +113,7 @@ public class KeyEntryDialog extends DialogComponentProvider {
JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER));
p.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
p.add(keyEntryPanel);
p.getAccessibleContext().setAccessibleName("Key Entry");
KeyStroke keyBinding = action.getKeyBinding();
if (keyBinding != null) {
keyEntryPanel.setKeyStroke(keyBinding);
@ -120,6 +124,7 @@ public class KeyEntryDialog extends DialogComponentProvider {
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(defaultPanel, BorderLayout.NORTH);
mainPanel.add(createCollisionPanel(), BorderLayout.CENTER);
mainPanel.getAccessibleContext().setAccessibleName("Key Entry");
return mainPanel;
}
@ -133,9 +138,11 @@ public class KeyEntryDialog extends DialogComponentProvider {
doc = collisionPane.getStyledDocument();
noWrapPanel.add(collisionPane, BorderLayout.CENTER);
JScrollPane sp = new JScrollPane(noWrapPanel);
sp.getAccessibleContext().setAccessibleName("Scroll");
Dimension d = defaultPanel.getPreferredSize();
sp.setPreferredSize(new Dimension(sp.getPreferredSize().width, d.height));
parent.add(sp, BorderLayout.CENTER);
parent.getAccessibleContext().setAccessibleName("Collision");
return parent;
}

View file

@ -60,6 +60,7 @@ public class AboutDialog extends DialogComponentProvider {
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.setBorder(BorderFactory.createRaisedBevelBorder());
mainPanel.setBackground(Colors.BACKGROUND);
mainPanel.getAccessibleContext().setAccessibleName("About");
mainPanel.add(createInfoComponent(), BorderLayout.CENTER);
return mainPanel;
}

View file

@ -46,6 +46,7 @@ public class ColorEditor extends PropertyEditorSupport {
previewLabel.setOpaque(true);
previewLabel.setPreferredSize(new Dimension(100, 20));
previewLabel.setHorizontalAlignment(SwingConstants.CENTER);
previewLabel.getAccessibleContext().setAccessibleName("Preview");
previewLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent evt) {
@ -64,6 +65,7 @@ public class ColorEditor extends PropertyEditorSupport {
JPanel dialogPanel = new JPanel();
dialogPanel.setLayout(new BorderLayout());
dialogPanel.add(new ColorEditorPanel(), BorderLayout.CENTER);
dialogPanel.getAccessibleContext().setAccessibleName(parentComponent.getName());
EditorProvider provider = new EditorProvider(dialogPanel);
DockingWindowManager.showDialog(previewLabel, provider);
}

View file

@ -36,6 +36,7 @@ public class FontEditor extends PropertyEditorSupport {
public FontEditor() {
previewButton = new JButton(FontPropertyEditor.SAMPLE_STRING);
previewButton.getAccessibleContext().setAccessibleName("Preview");
previewButton.addActionListener(e -> buttonPushed());
fontPropertyEditor = new FontPropertyEditor();
fontPropertyEditor.addPropertyChangeListener(ev -> fontChanged());
@ -94,6 +95,7 @@ public class FontEditor extends PropertyEditorSupport {
private JComponent buildWorkPanel() {
JPanel panel = new JPanel(new BorderLayout());
panel.add(fontPropertyEditor.getCustomEditor());
panel.getAccessibleContext().setAccessibleName("Font Editor");
return panel;
}

View file

@ -118,6 +118,7 @@ public class FontPropertyEditor extends PropertyEditorSupport {
panel.add(buildFontNamePanel());
panel.add(buildSizePanel());
panel.add(buildStylePanel());
panel.getAccessibleContext().setAccessibleName("Font Name Size Style");
return panel;
}
@ -127,6 +128,7 @@ public class FontPropertyEditor extends PropertyEditorSupport {
previewLabel.setHorizontalAlignment(SwingConstants.CENTER);
previewLabel.setVerticalAlignment(SwingConstants.CENTER);
previewLabel.setMinimumSize(new Dimension(300, 50));
previewLabel.getAccessibleContext().setAccessibleName("Preview");
return previewLabel;
}
@ -134,6 +136,7 @@ public class FontPropertyEditor extends PropertyEditorSupport {
JPanel panel = new JPanel(new GridLayout(2, 1));
GDLabel styleLabel = new GDLabel("Styles");
styleLabel.getAccessibleContext().setAccessibleName("Styles");
Gui.registerFont(styleLabel, Font.BOLD);
styleLabel.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(styleLabel);
@ -142,8 +145,9 @@ public class FontPropertyEditor extends PropertyEditorSupport {
new GComboBox<>(new String[] { "PLAIN", "BOLD", "ITALIC", "BOLD & ITALIC" });
styleCombo.setMaximumRowCount(9);
styleCombo.addActionListener(actionListener);
styleCombo.getAccessibleContext().setAccessibleName("Style");
panel.add(styleCombo);
panel.getAccessibleContext().setAccessibleName("Style");
return panel;
}
@ -151,6 +155,7 @@ public class FontPropertyEditor extends PropertyEditorSupport {
JPanel panel = new JPanel(new GridLayout(2, 1));
GDLabel sizeLabel = new GDLabel("Sizes");
sizeLabel.getAccessibleContext().setAccessibleName("Sizes");
Gui.registerFont(sizeLabel, Font.BOLD);
sizeLabel.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(sizeLabel);
@ -159,8 +164,9 @@ public class FontPropertyEditor extends PropertyEditorSupport {
new GComboBox<>(IntStream.rangeClosed(1, 72).boxed().toArray(Integer[]::new));
sizeCombo.setMaximumRowCount(9);
sizeCombo.addActionListener(actionListener);
sizeCombo.getAccessibleContext().setAccessibleName("Size");
panel.add(sizeCombo);
panel.getAccessibleContext().setAccessibleName("Size");
return panel;
}
@ -168,6 +174,7 @@ public class FontPropertyEditor extends PropertyEditorSupport {
JPanel panel = new JPanel(new GridLayout(2, 1));
GDLabel fontLabel = new GDLabel("Fonts");
fontLabel.getAccessibleContext().setAccessibleName("Fonts");
Gui.registerFont(fontLabel, Font.BOLD);
fontLabel.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(fontLabel);
@ -176,8 +183,9 @@ public class FontPropertyEditor extends PropertyEditorSupport {
fontCombo = new GComboBox<>(systemFontNames.toArray(new FontWrapper[0]));
fontCombo.setMaximumRowCount(9);
fontCombo.addActionListener(actionListener);
fontCombo.getAccessibleContext().setAccessibleName("Font");
panel.add(fontCombo);
panel.getAccessibleContext().setAccessibleName("Font");
return panel;
}

View file

@ -54,7 +54,7 @@ public class OptionsDialog extends ReusableDialogComponentProvider {
new OptionsPropertyChangeListener());
setTitle(title);
panel.getAccessibleContext().setAccessibleName("Options");
addWorkPanel(panel);
addOKButton();
addCancelButton();

View file

@ -111,18 +111,21 @@ public class ExportThemeDialog extends DialogComponentProvider {
panel.add(buildFilePanel());
panel.add(new GLabel("Include Defaults:", SwingConstants.RIGHT));
panel.add(buildIncludeDefaultsCheckbox());
panel.getAccessibleContext().setAccessibleName("Export Theme");
return panel;
}
private Component buildNameField() {
nameField = new JTextField(25);
nameField.setText(themeManager.getActiveTheme().getName());
nameField.getAccessibleContext().setAccessibleName("Name");
return nameField;
}
private Component buildIncludeDefaultsCheckbox() {
includeDefaultsCheckbox = new GCheckBox();
includeDefaultsCheckbox.setSelected(true);
includeDefaultsCheckbox.getAccessibleContext().setAccessibleName("Include Defaults");
return includeDefaultsCheckbox;
}
@ -138,18 +141,22 @@ public class ExportThemeDialog extends DialogComponentProvider {
fileTextField.setText(file.getAbsolutePath());
fileTextField.setEditable(false);
fileTextField.setFocusable(false);
fileTextField.getAccessibleContext().setAccessibleName("File");
JButton folderButton = new BrowseButton();
folderButton.addActionListener(e -> chooseFile());
folderButton.getAccessibleContext().setAccessibleName("Folder");
JPanel panel = new JPanel(new BorderLayout());
panel.add(fileTextField, BorderLayout.CENTER);
panel.add(folderButton, BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("File");
return panel;
}
private void chooseFile() {
GhidraFileChooser chooser = new GhidraFileChooser(getComponent());
chooser.setTitle("Choose Theme File");
chooser.getComponent().getAccessibleContext().setAccessibleName("File Theme");
chooser.setApproveButtonToolTipText("Select File");
chooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);
chooser.setSelectedFileFilter(GhidraFileFilter.ALL);

View file

@ -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.
@ -257,6 +257,7 @@ public class ThemeEditorDialog extends DialogComponentProvider {
panel.setLayout(new BorderLayout());
panel.add(buildControlPanel(), BorderLayout.NORTH);
panel.add(buildTabedTables());
panel.getAccessibleContext().setAccessibleName("Theme Editor");
return panel;
}
@ -265,6 +266,7 @@ public class ThemeEditorDialog extends DialogComponentProvider {
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(buildThemeCombo(), BorderLayout.WEST);
panel.setName("gthemePanel");
panel.getAccessibleContext().setAccessibleName("Theme");
return panel;
}
@ -278,6 +280,7 @@ public class ThemeEditorDialog extends DialogComponentProvider {
panel.add(new JLabel("Look And Feel: "), BorderLayout.WEST);
panel.add(combo);
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
panel.getAccessibleContext().setAccessibleName("Themes");
return panel;
}
@ -294,17 +297,22 @@ public class ThemeEditorDialog extends DialogComponentProvider {
valuesCache = new GThemeValuesCache(themeManager);
colorTable = new ThemeColorTable(themeManager, valuesCache);
colorTable.getAccessibleContext().setAccessibleName("Colors");
iconTable = new ThemeIconTable(themeManager, valuesCache);
iconTable.getAccessibleContext().setAccessibleName("Icons");
fontTable = new ThemeFontTable(themeManager, valuesCache);
fontTable.getAccessibleContext().setAccessibleName("Fonts");
colorTree = new ThemeColorTree(themeManager);
colorTree.getAccessibleContext().setAccessibleName("Color");
paletteTable = new ThemeColorPaletteTable(themeManager, valuesCache);
paletteTable.getAccessibleContext().setAccessibleName("Color Palette");
tabbedPane.add("Colors", colorTable);
tabbedPane.add("Fonts", fontTable);
tabbedPane.add("Icons", iconTable);
tabbedPane.add("Color Tree", colorTree);
tabbedPane.add("Palette", paletteTable);
tabbedPane.getAccessibleContext().setAccessibleName("Theme Details");
return tabbedPane;
}
@ -312,6 +320,7 @@ public class ThemeEditorDialog extends DialogComponentProvider {
saveButton = new JButton("Save");
saveButton.setMnemonic('S');
saveButton.setName("Save");
saveButton.getAccessibleContext().setAccessibleName("Save");
saveButton.addActionListener(e -> saveCallback());
saveButton.setToolTipText("Saves changed values to a new Theme");
return saveButton;

View file

@ -65,12 +65,14 @@ public class FindDialog extends ReusableDialogComponentProvider {
private void buildButtons() {
nextButton = new JButton("Next");
nextButton.setMnemonic('N');
nextButton.getAccessibleContext().setAccessibleName("Next");
nextButton.addActionListener(ev -> doSearch(true));
addButton(nextButton);
setDefaultButton(nextButton);
previousButton = new JButton("Previous");
previousButton.setMnemonic('P');
previousButton.getAccessibleContext().setAccessibleName("Previous");
previousButton.addActionListener(ev -> doSearch(false));
addButton(previousButton);
@ -81,14 +83,16 @@ public class FindDialog extends ReusableDialogComponentProvider {
ButtonGroup formatGroup = new ButtonGroup();
stringRadioButton = new GRadioButton("String", true);
stringRadioButton.getAccessibleContext().setAccessibleName("String");
regexRadioButton = new GRadioButton("Regular Expression", false);
regexRadioButton.getAccessibleContext().setAccessibleName("Regular Expresion");
formatGroup.add(stringRadioButton);
formatGroup.add(regexRadioButton);
comboBox = new GhidraComboBox<>();
comboBox.setEditable(true);
comboBox.addActionListener(e -> doSearch(true));
comboBox.getAccessibleContext().setAccessibleName("Checkboxes");
comboBox.setColumns(20);
comboBox.addDocumentListener(new DocumentListener() {
@Override
@ -113,19 +117,20 @@ public class FindDialog extends ReusableDialogComponentProvider {
});
JLabel findLabel = new GLabel("Find: ");
findLabel.getAccessibleContext().setAccessibleName("Find");
// associate this label with a mnemonic key that activates the text field
findLabel.setDisplayedMnemonic(KeyEvent.VK_N);
comboBox.associateLabel(findLabel);
JPanel mainPanel = new JPanel(new BorderLayout());
JPanel textPanel = new JPanel();
textPanel.getAccessibleContext().setAccessibleName("Find Label and Checkboxes");
textPanel.add(findLabel);
textPanel.add(comboBox);
mainPanel.add(textPanel, BorderLayout.NORTH);
mainPanel.add(buildFormatPanel(), BorderLayout.SOUTH);
mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
mainPanel.getAccessibleContext().setAccessibleName("Find");
return mainPanel;
}
@ -140,6 +145,7 @@ public class FindDialog extends ReusableDialogComponentProvider {
formatPanel.setLayout(new BoxLayout(formatPanel, BoxLayout.Y_AXIS));
formatPanel.add(stringRadioButton);
formatPanel.add(regexRadioButton);
formatPanel.getAccessibleContext().setAccessibleName("Format");
return formatPanel;
}

View file

@ -134,12 +134,15 @@ public class ListSelectionDialog<T> extends DialogComponentProvider {
JLabel jLabel = new GLabel(label);
jLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
jLabel.getAccessibleContext().setAccessibleName(label);
panel.add(jLabel, BorderLayout.WEST);
panel.add(field, BorderLayout.CENTER);
JButton browseButton = new BrowseButton();
browseButton.addActionListener(e -> browse());
browseButton.getAccessibleContext().setAccessibleName("Browse");
panel.add(browseButton, BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("List Selection");
return panel;
}

View file

@ -80,9 +80,12 @@ public class ListSelectionTableDialog<T> extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
gTable = new GTable();
gTable.getAccessibleContext().setAccessibleName("List Selection");
gTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane(gTable);
scroll.getAccessibleContext().setAccessibleName("List Selection");
filterPanel = new GTableFilterPanel<>(gTable, model);
filterPanel.getAccessibleContext().setAccessibleName("Filter");
panel.add(scroll, BorderLayout.CENTER);
panel.add(filterPanel, BorderLayout.SOUTH);
gTable.addKeyListener(new KeyAdapter() {
@ -103,6 +106,7 @@ public class ListSelectionTableDialog<T> extends DialogComponentProvider {
}
}
});
panel.getAccessibleContext().setAccessibleName("List Selection Table");
return panel;
}

View file

@ -53,17 +53,20 @@ public class PasswordChangeDialog extends DialogComponentProvider {
wp.add(new GLabel("User ID:"));
JLabel nameLabel = new GLabel(userID);
nameLabel.setName("NAME-COMPONENT");
nameLabel.getAccessibleContext().setAccessibleName("Name");
wp.add(nameLabel);
}
wp.add(new GLabel("New Password:"));
passwordField1 = new JPasswordField(16);
passwordField1.setName("PASSWORD-ENTRY1-COMPONENT");
passwordField1.getAccessibleContext().setAccessibleName("Password Entry 1");
wp.add(passwordField1);
wp.add(new GLabel("Repeat Password:"));
passwordField2 = new JPasswordField(16);
passwordField2.setName("PASSWORD-ENTRY2-COMPONENT");
passwordField2.getAccessibleContext().setAccessibleName("Password Entry 2");
passwordField2.addActionListener(e -> okCallback());
wp.add(passwordField2);
@ -104,7 +107,7 @@ public class PasswordChangeDialog extends DialogComponentProvider {
};
passwordField1.addKeyListener(keyListener);
passwordField2.addKeyListener(keyListener);
wp.getAccessibleContext().setAccessibleName("Password Change");
addWorkPanel(wp);
addOKButton();
addCancelButton();

View file

@ -184,18 +184,21 @@ public class PasswordDialog extends DialogComponentProvider {
workPanel.add(new GLabel(userIdPrompt));
nameField = new JTextField(defaultUserId, 16);
nameField.setName("NAME-ENTRY-COMPONENT");
nameField.getAccessibleContext().setAccessibleName("Name");
workPanel.add(nameField);
}
else if (defaultUserId != null) {
workPanel.add(new GLabel(userIdPrompt));
JLabel nameLabel = new GLabel(defaultUserId);
nameLabel.setName("NAME-COMPONENT");
nameLabel.getAccessibleContext().setAccessibleName("Name");
workPanel.add(nameLabel);
}
workPanel.add(new GLabel(passPrompt));
passwordField = new JPasswordField(16);
passwordField.setName("PASSWORD-ENTRY-COMPONENT");
passwordField.getAccessibleContext().setAccessibleName("Password Entry");
workPanel.add(passwordField);
passwordField.addKeyListener(new KeyListener() {
@ -235,7 +238,7 @@ public class PasswordDialog extends DialogComponentProvider {
}
}
});
workPanel.getAccessibleContext().setAccessibleName("Password");
addWorkPanel(workPanel);
addOKButton();
addCancelButton();

View file

@ -122,11 +122,13 @@ public class SelectFromListDialog<T> extends DialogComponentProvider {
listPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listPanel.setSelectedIndex(0);
listPanel.setDoubleClickActionListener(e -> okCallback());
listPanel.getAccessibleContext().setAccessibleName("List");
JPanel workPanel = new JPanel(new BorderLayout());
MultiLineLabel mll = new MultiLineLabel("\n" + prompt + ":");
workPanel.add(mll, BorderLayout.NORTH);
workPanel.add(listPanel, BorderLayout.CENTER);
workPanel.getAccessibleContext().setAccessibleName("Select From List");
return workPanel;
}
}

View file

@ -195,6 +195,7 @@ public class InputDialog extends DialogComponentProvider {
panel.add(textFields[i]);
}
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.getAccessibleContext().setAccessibleName("Input");
this.addWorkPanel(panel);
}

View file

@ -110,11 +110,14 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
// COMBO BOX PANEL
JLabel messageLabel = new GHtmlLabel(labelText);
messageLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
messageLabel.getAccessibleContext().setAccessibleName("Message");
combo = createComboBox(optionValues, initialValue);
combo.getAccessibleContext().setAccessibleName("Options");
JPanel dataPanel = new JPanel(new BorderLayout());
dataPanel.add(messageLabel, BorderLayout.NORTH);
dataPanel.add(combo, BorderLayout.SOUTH);
dataPanel.getAccessibleContext().setAccessibleName("Data");
workPanel.add(dataPanel, BorderLayout.CENTER);
@ -123,17 +126,20 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
JLabel iconLabel = new GDLabel();
iconLabel.setIcon(messageIcon);
iconLabel.setVerticalAlignment(SwingConstants.TOP);
iconLabel.getAccessibleContext().setAccessibleName("Icon");
JPanel separatorPanel = new JPanel();
separatorPanel.setPreferredSize(new Dimension(15, 1));
separatorPanel.getAccessibleContext().setAccessibleName("Separator");
JPanel iconPanel = new JPanel(new BorderLayout());
iconPanel.add(iconLabel, BorderLayout.CENTER);
iconPanel.add(separatorPanel, BorderLayout.EAST);
iconPanel.getAccessibleContext().setAccessibleName("Icon");
workPanel.add(iconPanel, BorderLayout.WEST);
}
workPanel.getAccessibleContext().setAccessibleName("Input With Choices");
addWorkPanel(workPanel);
}
@ -145,7 +151,7 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
if (initialValue != null) {
newComboBox.setSelectedItem(initialValue);
}
newComboBox.getAccessibleContext().setAccessibleName("Options");
return newComboBox;
}

View file

@ -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.
@ -57,6 +57,7 @@ public class MultiLineInputDialog extends DialogComponentProvider {
JPanel dataPanel = new JPanel(new BorderLayout());
inputTextArea = new JTextArea(10, 50);
inputTextArea.getAccessibleContext().setAccessibleName("Text Input");
DockingUtils.installUndoRedo(inputTextArea);
@ -80,6 +81,7 @@ public class MultiLineInputDialog extends DialogComponentProvider {
JLabel messageLabel = new GDLabel();
messageLabel.setText(messageText);
messageLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
messageLabel.getAccessibleContext().setAccessibleName("Message");
String metaKeyText = "Control";
OperatingSystem OS = Platform.CURRENT_PLATFORM.getOperatingSystem();
@ -90,6 +92,7 @@ public class MultiLineInputDialog extends DialogComponentProvider {
hintLabel.setHorizontalAlignment(SwingConstants.CENTER);
Gui.registerFont(hintLabel, FONT_ID);
hintLabel.setForeground(Messages.HINT);
hintLabel.getAccessibleContext().setAccessibleName("Hint");
dataPanel.add(messageLabel, BorderLayout.NORTH);
dataPanel.add(new JScrollPane(inputTextArea), BorderLayout.CENTER);
@ -98,19 +101,21 @@ public class MultiLineInputDialog extends DialogComponentProvider {
JLabel iconLabel = new GDLabel();
iconLabel.setIcon(icon);
iconLabel.setVerticalAlignment(SwingConstants.TOP);
iconLabel.getAccessibleContext().setAccessibleName("Icon");
JPanel separatorPanel = new JPanel();
separatorPanel.setPreferredSize(new Dimension(15, 1));
separatorPanel.getAccessibleContext().setAccessibleName("Separator");
JPanel iconPanel = new JPanel(new BorderLayout());
iconPanel.add(iconLabel, BorderLayout.CENTER);
iconPanel.add(separatorPanel, BorderLayout.EAST);
iconPanel.getAccessibleContext().setAccessibleName("Icon");
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
workPanel.add(iconPanel, BorderLayout.WEST);
workPanel.add(dataPanel, BorderLayout.CENTER);
workPanel.getAccessibleContext().setAccessibleName("Muliti Line Input");
return workPanel;
}

View file

@ -72,9 +72,8 @@ public class MultiLineMessageDialog extends DialogComponentProvider {
public static void showMessageDialog(Component parent, String title, String shortMessage,
String detailedMessage, int messageType) {
Swing.runNow(() -> {
MultiLineMessageDialog dialog =
new MultiLineMessageDialog(title, shortMessage, detailedMessage, messageType,
false);
MultiLineMessageDialog dialog = new MultiLineMessageDialog(title, shortMessage,
detailedMessage, messageType, false);
DockingWindowManager.showDialog(parent, dialog);
});
}
@ -93,10 +92,11 @@ public class MultiLineMessageDialog extends DialogComponentProvider {
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
workPanel.getAccessibleContext().setAccessibleName("Multi Line Message");
if (!StringUtils.isBlank(shortMessage)) {
JLabel shortMessageLabel = new GLabel(shortMessage);
shortMessageLabel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 10));
shortMessageLabel.getAccessibleContext().setAccessibleName("Short Message");
workPanel.add(shortMessageLabel, BorderLayout.NORTH);
}
@ -111,6 +111,7 @@ public class MultiLineMessageDialog extends DialogComponentProvider {
// to get us back to the same font the rest of the GUI is using.
JTextPane textPane = new JTextPane();
textPane.getAccessibleContext().setAccessibleName("Detailed Message");
String fontfamily = textPane.getFont().getFamily();
detailedMessage = "<html><body style=\"font-family: " + fontfamily + "\">" +
detailedMessage.substring(6);
@ -125,6 +126,7 @@ public class MultiLineMessageDialog extends DialogComponentProvider {
DockingUtils.setTransparent(textPane);
JScrollPane scrollPane = new JScrollPane(textPane);
scrollPane.getAccessibleContext().setAccessibleName("Detailed Mesage");
DockingUtils.setTransparent(scrollPane);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
workPanel.add(scrollPane, BorderLayout.CENTER);
@ -136,9 +138,10 @@ public class MultiLineMessageDialog extends DialogComponentProvider {
else {
JTextArea textArea = new JTextArea(detailedMessage);
textArea.setEditable(false);
textArea.getAccessibleContext().setAccessibleName("Detailed Message");
DockingUtils.setTransparent(textArea);
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane.getAccessibleContext().setAccessibleName("Detailed Message");
DockingUtils.setTransparent(scrollPane);
workPanel.add(scrollPane, BorderLayout.CENTER);

View file

@ -49,8 +49,7 @@ public class NumberRangeInputDialog extends DialogComponentProvider {
private KeyListener keyListener;
public NumberRangeInputDialog(String title, String label) {
super(title, true, true/* status */, true /* buttons */,
false /* no tasks */);
super(title, true, true/* status */, true /* buttons */, false /* no tasks */);
keyListener = new KeyAdapter() {
@Override
@ -95,10 +94,12 @@ public class NumberRangeInputDialog extends DialogComponentProvider {
textField.setText(initialValue);
textField.addKeyListener(keyListener);
textField.setName("number.range.input.dialog.text.field");
textField.getAccessibleContext().setAccessibleName("Number Range Input");
panel.add(new GLabel(inputLabel, SwingConstants.RIGHT));
panel.add(textField);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.getAccessibleContext().setAccessibleName("Number Range Input");
this.addWorkPanel(panel);
}

View file

@ -70,7 +70,7 @@ public class ObjectChooserDialog<T> extends DialogComponentProvider {
table.addSelectionListener(t -> objectSelected(t));
table.setItemPickListener(t -> objectPicked(t));
table.getAccessibleContext().setAccessibleName("Object Chooser");
return table;
}

View file

@ -73,12 +73,15 @@ public class ReadTextDialog extends DialogComponentProvider {
textArea = new JTextArea(10, 80);
textArea.setText(text);
textArea.setEditable(false);
textArea.getAccessibleContext().setAccessibleName("Text");
textArea.setMargin(new Insets(5, 5, 5, 5));
// textArea.setFont(font);
DockingUtils.setTransparent(textArea);
textArea.setCaretPosition(0);
JScrollPane scrolledDetails = new JScrollPane(textArea);
scrolledDetails.getAccessibleContext().setAccessibleName("Details");
workPanel.add(scrolledDetails, BorderLayout.CENTER);
workPanel.getAccessibleContext().setAccessibleName("Read Text");
return workPanel;
}
}

View file

@ -86,6 +86,7 @@ public class SettingsDialog extends DialogComponentProvider {
settingsTableModel = new SettingsTableModel();
settingsTable = new GTable(settingsTableModel);
settingsTable.getAccessibleContext().setAccessibleName("Settings");
settingsTable.setAutoscrolls(true);
settingsTable.setRowSelectionAllowed(false);
settingsTable.setColumnSelectionAllowed(false);
@ -99,10 +100,11 @@ public class SettingsDialog extends DialogComponentProvider {
settingsTable.setDefaultEditor(Settings.class, new SettingsEditor());
JScrollPane scrollpane = new JScrollPane(settingsTable);
scrollpane.getAccessibleContext().setAccessibleName("Settings Table");
scrollpane.setPreferredSize(new Dimension(WIDTH, HEIGHT));
workPanel.add(scrollpane, BorderLayout.CENTER);
workPanel.getAccessibleContext().setAccessibleName("Settings");
return workPanel;
}

View file

@ -128,6 +128,7 @@ public class TableChooserDialog<T> extends DialogComponentProvider {
}
});
setOkEnabled(false);
gFilterTable.getAccessibleContext().setAccessibleName("Table Chooser");
return gFilterTable;
}

View file

@ -121,6 +121,7 @@ public class TableSelectionDialog<T> extends DialogComponentProvider {
}
});
setOkEnabled(false);
gFilterTable.getAccessibleContext().setAccessibleName("Table Selection");
return gFilterTable;
}

View file

@ -48,15 +48,17 @@ class GFileChooserOptionsDialog extends ReusableDialogComponentProvider {
JPanel panel = new JPanel(new PairLayout());
showDotFilesCheckBox = new GCheckBox();
showDotFilesCheckBox.getAccessibleContext().setAccessibleName("Show Dot Files");
showDotFilesCheckBox.setSelected(true);
JLabel label = new GLabel("Show '.' files");
label.getAccessibleContext().setAccessibleName("Show Files");
label.setToolTipText("When toggled on the file chooser will show files " +
"with names that begin with a '.' character");
panel.add(showDotFilesCheckBox);
panel.add(label);
panel.getAccessibleContext().setAccessibleName("GFile Chooser Options");
return panel;
}

View file

@ -270,9 +270,9 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
JScrollPane directoryListScroll = buildDirectoryList();
card = new CardLayout();
cardPanel = new JPanel(card);
cardPanel.setName("CARD_PANEL");
cardPanel.getAccessibleContext().setAccessibleName("Card");
cardPanel.add(directoryTableScroll, CARD_TABLE);
cardPanel.add(directoryListScroll, CARD_LIST);
cardPanel.add(waitPanel, CARD_WAIT);
@ -285,12 +285,12 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
JPanel directoryPanel = new JPanel(new BorderLayout(PAD, PAD));
directoryPanel.add(cardPanel, BorderLayout.CENTER);
directoryPanel.add(filenamePanel, BorderLayout.SOUTH);
directoryPanel.getAccessibleContext().setAccessibleName("Directory");
JPanel main = new JPanel(new BorderLayout(PAD, PAD));
main.add(currentPathPanel, BorderLayout.NORTH);
main.add(shortCutPanel, BorderLayout.WEST);
main.add(directoryPanel, BorderLayout.CENTER);
main.getAccessibleContext().setAccessibleName("Ghidra File Chooser");
return main;
}
@ -302,6 +302,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
}
};
myComputerButton.setName("MY_COMPUTER_BUTTON");
myComputerButton.getAccessibleContext().setAccessibleName("My Computer");
myComputerButton.setIcon(ICON_MY_COMPUTER);
myComputerButton.addActionListener(e -> updateMyComputer());
myComputerButton.setForeground(FOREROUND_COLOR);
@ -313,6 +314,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
}
};
desktopButton.setName("DESKTOP_BUTTON");
desktopButton.getAccessibleContext().setAccessibleName("Desktop");
desktopButton.setIcon(ICON_DESKTOP);
desktopButton.addActionListener(e -> updateDesktop());
desktopButton.setForeground(FOREROUND_COLOR);
@ -325,6 +327,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
}
};
homeButton.setName("HOME_BUTTON");
homeButton.getAccessibleContext().setAccessibleName("Home");
homeButton.setIcon(ICON_HOME);
homeButton.addActionListener(e -> updateHome());
homeButton.setForeground(FOREROUND_COLOR);
@ -347,6 +350,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
}
};
recentButton.setName("RECENT_BUTTON");
recentButton.getAccessibleContext().setAccessibleName("Recent");
recentButton.setIcon(ICON_RECENT);
recentButton.addActionListener(e -> updateRecent());
recentButton.setForeground(FOREROUND_COLOR);
@ -359,6 +363,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
shortCutButtonGroup.add(recentButton);
JPanel shortCutPanel = new JPanel(new GridLayout(0, 1));
shortCutPanel.getAccessibleContext().setAccessibleName("Short Cut");
DockingUtils.setTransparent(shortCutPanel);
shortCutPanel.add(myComputerButton);
shortCutPanel.add(desktopButton);
@ -370,6 +375,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
panel.setBorder(BorderFactory.createLoweredBevelBorder());
panel.setBackground(SHORTCUT_BACKGROUND_COLOR);
panel.add(shortCutPanel, BorderLayout.NORTH);
panel.getAccessibleContext().setAccessibleName("Short Cut");
return panel;
}
@ -378,6 +384,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
FileDropDownSelectionDataModel model = new FileDropDownSelectionDataModel(this);
filenameTextField = new DropDownSelectionTextField<>(model);
filenameTextField.setMatchingWindowHeight(200);
filenameTextField.getAccessibleContext().setAccessibleName("Filename");
filenameTextField.addCellEditorListener(new CellEditorListener() {
@Override
@ -411,9 +418,11 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
filenameTextField.setName("filenameTextField");
JLabel filterLabel = new GLabel("Type:");
filterLabel.getAccessibleContext().setAccessibleName("Filter");
filterCombo = new GComboBox<>();
filterCombo.setRenderer(GListCellRenderer.createDefaultTextRenderer(
fileFilter -> fileFilter != null ? fileFilter.getDescription() : ""));
filterCombo.getAccessibleContext().setAccessibleName("Filter");
filterModel = (DefaultComboBoxModel<GhidraFileFilter>) filterCombo.getModel();
addFileFilter(GhidraFileFilter.ALL);
filterCombo.addItemListener(e -> rescanCurrentDirectory());
@ -424,6 +433,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
filenamePanel.add(filenameTextField);
filenamePanel.add(filterLabel);
filenamePanel.add(filterCombo);
filenamePanel.getAccessibleContext().setAccessibleName("Filename");
return filenamePanel;
}
@ -465,8 +475,9 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
currentPathTextField = buildPathTextField();
currentPathTextField.getAccessibleContext().setAccessibleName("Path");
headerPanel.add(currentPathTextField, gbc);
headerPanel.getAccessibleContext().setAccessibleName("Path Navigation");
return headerPanel;
}
@ -566,6 +577,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
private void buildWaitPanel() {
waitPanel = new JPanel(new BorderLayout());
waitPanel.getAccessibleContext().setAccessibleName("Wait");
waitPanel.setBorder(BorderFactory.createLoweredBevelBorder());
waitPanel.setBackground(BACKGROUND_COLOR);
waitPanel.addMouseListener(new MouseAdapter() {
@ -618,16 +630,19 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
newFolderButton = new EmptyBorderButton(ICON_NEW_FOLDER);
newFolderButton.setName("NEW_BUTTON");
newFolderButton.getAccessibleContext().setAccessibleName("New Folder");
newFolderButton.setToolTipText("Create new folder");
newFolderButton.addActionListener(e -> createNewFolder());
refreshButton = new EmptyBorderButton(Icons.REFRESH_ICON);
refreshButton.setName("REFRESH_BUTTON");
refreshButton.getAccessibleContext().setAccessibleName("Refresh");
refreshButton.setToolTipText("Rescan current directory");
refreshButton.addActionListener(e -> rescanCurrentDirectory());
detailsButton = new EmptyBorderToggleButton(ICON_DETAILS);
detailsButton.setName("DETAILS_BUTTON");
detailsButton.getAccessibleContext().setAccessibleName("Details");
detailsButton.setToolTipText("Show details");
detailsButton.addActionListener(e -> {
cancelEdits();
@ -636,6 +651,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
optionsButton = new EmptyBorderButton(ICON_OPTIONS);
optionsButton.setName("OPTIONS_BUTTON");
optionsButton.getAccessibleContext().setAccessibleName("Options");
optionsButton.setToolTipText("File Chooser Options");
optionsButton.addActionListener(e -> {
DockingWindowManager.showDialog(parent, optionsDialog);
@ -671,6 +687,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
directoryListModel = new DirectoryListModel();
directoryList = new DirectoryList(this, directoryListModel);
directoryList.setName("LIST");
directoryList.getAccessibleContext().setAccessibleName("Directory");
directoryList.setBackground(BACKGROUND_COLOR);
directoryList.addFocusListener(new FocusAdapter() {
@ -694,7 +711,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
directoryList.setVisibleRowCount(nRows - 1);
}
});
directoryScroll.getAccessibleContext().setAccessibleName("Directory");
return directoryScroll;
}
@ -1626,6 +1643,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
directoryTableModel = new DirectoryTableModel(this);
directoryTable = new DirectoryTable(this, directoryTableModel);
directoryTable.setName("TABLE");
directoryTable.getAccessibleContext().setAccessibleName("Directory");
directoryTable.setBackground(BACKGROUND_COLOR);
directoryTable.addFocusListener(new FocusAdapter() {
@ -1637,6 +1655,7 @@ public class GhidraFileChooser extends ReusableDialogComponentProvider implement
JScrollPane scrollPane = new JScrollPane(directoryTable);
scrollPane.getViewport().setBackground(BACKGROUND_COLOR);
scrollPane.getAccessibleContext().setAccessibleName("Directory");
return scrollPane;
}

View file

@ -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.
@ -24,6 +24,7 @@ public abstract class AbstractPathsDialog extends DialogComponentProvider {
protected AbstractPathsDialog(String title) {
super(title);
tablePanel = newPathnameTablePanel();
tablePanel.getAccessibleContext().setAccessibleName("Edit Paths");
addWorkPanel(tablePanel);
addOKButton();
addCancelButton();

View file

@ -62,6 +62,7 @@ public class ChooseColumnsDialog extends DialogComponentProvider {
ghidraTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
ghidraTable.setAutoLookupColumn(1);
ghidraTable.getAccessibleContext().setAccessibleName("Columns");
TableColumn enabledColumn = ghidraTable.getColumnModel().getColumn(0);
int enabledColumnWidth = 50;
enabledColumn.setPreferredWidth(enabledColumnWidth);//visible column
@ -75,7 +76,9 @@ public class ChooseColumnsDialog extends DialogComponentProvider {
setRememberSize(true);
JPanel buttonPanel = new JPanel();
buttonPanel.getAccessibleContext().setAccessibleName("Buttons");
JButton selectAllButton = new JButton("Select All");
selectAllButton.getAccessibleContext().setAccessibleName("Select All");
selectAllButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -84,6 +87,7 @@ public class ChooseColumnsDialog extends DialogComponentProvider {
});
JButton deselectAllButton = new JButton("Deselect All");
deselectAllButton.getAccessibleContext().setAccessibleName("Deselect All");
deselectAllButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -96,6 +100,8 @@ public class ChooseColumnsDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
JScrollPane scrollPane = new JScrollPane(ghidraTable);
panel.getAccessibleContext().setAccessibleName("Select Columns");
scrollPane.getAccessibleContext().setAccessibleName("Scroll");
panel.add(scrollPane);
panel.add(buttonPanel, BorderLayout.SOUTH);
addWorkPanel(panel);
@ -190,13 +196,11 @@ public class ChooseColumnsDialog extends DialogComponentProvider {
JComponent renderer = null;
if (column == 0) {
TableCellRenderer booleanRenderer = table.getDefaultRenderer(Boolean.class);
renderer =
(JComponent) booleanRenderer.getTableCellRendererComponent(table, value,
isSelected, hasFocus, row, column);
renderer = (JComponent) booleanRenderer.getTableCellRendererComponent(table, value,
isSelected, hasFocus, row, column);
}
else {
renderer =
(JComponent) super.getTableCellRendererComponent(data);
renderer = (JComponent) super.getTableCellRendererComponent(data);
}
if (isSelected) {

View file

@ -63,18 +63,20 @@ public class SelectColumnsDialog extends DialogComponentProvider {
for (int i = 1; i < ghidraTable.getColumnCount(); i++) {
ghidraTable.getColumnModel()
.getColumn(i)
.setCellRenderer(
new ColumnSelectorStringRenderer());
.setCellRenderer(new ColumnSelectorStringRenderer());
}
ghidraTable.setBorder(BorderFactory.createEtchedBorder());
ghidraTable.getAccessibleContext().setAccessibleName("Table");
Dimension size = new Dimension(400, 500);
setPreferredSize(size.width, size.height);
setRememberSize(true);
JPanel panel = new JPanel(new BorderLayout());
JScrollPane scrollPane = new JScrollPane(ghidraTable);
scrollPane.getAccessibleContext().setAccessibleName("Table");
panel.add(scrollPane);
panel.getAccessibleContext().setAccessibleName("Select Columns");
addWorkPanel(panel);
addOKButton();
addCancelButton();

View file

@ -79,13 +79,13 @@ public class ColumnFilterArchiveDialog<R> extends DialogComponentProvider {
JComponent component = buildFilterTable();
component.setPreferredSize(new Dimension(100, 200));
JSplitPane splitter =
new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, component, buildPreviewPanel());
splitter.setResizeWeight(.25);
splitter.getAccessibleContext().setAccessibleDescription("Filters and Preview");
JPanel panel = new JPanel(new BorderLayout());
panel.add(splitter, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleDescription("Column Filter Archive");
return panel;
}
@ -108,6 +108,7 @@ public class ColumnFilterArchiveDialog<R> extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
panel.add(buildFilterList(), BorderLayout.CENTER);
panel.add(buildActionPanel(), BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Filter Table");
return panel;
}
@ -128,8 +129,9 @@ public class ColumnFilterArchiveDialog<R> extends DialogComponentProvider {
}
});
updateList();
jList.getAccessibleContext().setAccessibleDescription("Filters");
panel.add(new JScrollPane(jList));
panel.getAccessibleContext().setAccessibleName("Filters");
return panel;
}
@ -139,10 +141,12 @@ public class ColumnFilterArchiveDialog<R> extends DialogComponentProvider {
removeSelectedFiltersButton = new JButton("Remove", icon);
removeSelectedFiltersButton.setEnabled(false);
removeSelectedFiltersButton.addActionListener(e -> removeSelectedFilter());
removeSelectedFiltersButton.getAccessibleContext()
.setAccessibleDescription("Remove Selections");
JPanel panel = new JPanel(new BorderLayout());
panel.add(removeSelectedFiltersButton, BorderLayout.EAST);
panel.getAccessibleContext().setAccessibleName("Actions");
return panel;
}
@ -154,6 +158,7 @@ public class ColumnFilterArchiveDialog<R> extends DialogComponentProvider {
previewLabel = new GDHtmlLabel();
previewLabel.setVerticalAlignment(SwingConstants.TOP);
panel.add(new JScrollPane(previewLabel));
panel.getAccessibleContext().setAccessibleName("Preview");
return panel;
}

View file

@ -105,6 +105,7 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
JButton button = new JButton("Clear Filter");
button.addActionListener(e -> clearFilter());
button.setToolTipText("Clears any applied column filter and clears the dialog.");
button.getAccessibleContext().setAccessibleName("Clear Filter");
addButton(button);
}
@ -201,6 +202,7 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
private JComponent buildMainPanel() {
JPanel panel = new JPanel(new BorderLayout());
panel.add(buildFilterPanelContainer(), BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Column Filter");
return panel;
}
@ -208,12 +210,13 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
filterPanelContainer = new JPanel(new VerticalLayout(4));
filterPanelContainer.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
filterPanelContainer.getAccessibleContext().setAccessibleName("Filter Container");
JScrollPane jScrollPane = new JScrollPane(filterPanelContainer);
jScrollPane.setColumnHeaderView(buildHeaderPanel());
loadFilterRows();
jScrollPane.getAccessibleContext().setAccessibleName("Filter Scroll");
return jScrollPane;
}
@ -225,19 +228,21 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
JButton addAndConditionButton = new JButton("Add AND condition", Icons.ADD_ICON);
addAndConditionButton.addActionListener(e -> addFilterCondition(LogicOperation.AND));
addAndConditionButton.getAccessibleContext().setAccessibleName("Add AND Condition");
addAndConditionButton.setEnabled(true);
JButton addOrConditionButton = new JButton("Add OR condition", Icons.ADD_ICON);
addOrConditionButton.setHorizontalAlignment(SwingConstants.LEFT);
addOrConditionButton.addActionListener(e -> addFilterCondition(LogicOperation.OR));
addOrConditionButton.getAccessibleContext().setAccessibleName("Add OR Condition");
addOrConditionButton.setEnabled(true);
innerPanel.add(addAndConditionButton);
innerPanel.add(addOrConditionButton);
bottomPanel.add(innerPanel, BorderLayout.EAST);
}
bottomPanel.getAccessibleContext().setAccessibleName("Conditions");
return bottomPanel;
}
@ -387,6 +392,7 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
headerPanel.setBorder(
new CompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.BORDER),
BorderFactory.createEmptyBorder(4, 0, 4, 0)));
headerPanel.getAccessibleContext().setAccessibleName("Headers");
return headerPanel;
}

View file

@ -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.
@ -141,6 +141,7 @@ public class ValuesMapDialog extends DialogComponentProvider {
private JPanel buildValuesPanel() {
JPanel panel = new JPanel(new PairLayout(4, 10));
panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
panel.getAccessibleContext().setAccessibleName("Values");
return panel;
}
@ -149,7 +150,6 @@ public class ValuesMapDialog extends DialogComponentProvider {
if (message != null) {
String literalHTML = HTMLUtilities.toLiteralHTML(message, MAX_MESSAGE_LINE_WIDTH);
GHtmlLabel label = new GHtmlLabel(literalHTML);
label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panel.add(label, BorderLayout.NORTH);
}
@ -157,6 +157,7 @@ public class ValuesMapDialog extends DialogComponentProvider {
JScrollPane scroll = new JScrollPane(valuesPanel);
scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
panel.add(scroll, BorderLayout.CENTER);
panel.getAccessibleContext().setAccessibleName("Values Map");
return panel;
}

View file

@ -88,27 +88,27 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
private void createActions() {
// we don't automatically refresh the list of components in a window if it changes
DockingAction refreshAction = new ActionBuilder("Refresh", ACTION_OWNER)
.toolBarIcon(Icons.REFRESH_ICON)
.onAction(c -> refreshModelData())
.build();
DockingAction refreshAction =
new ActionBuilder("Refresh", ACTION_OWNER).toolBarIcon(Icons.REFRESH_ICON)
.onAction(c -> refreshModelData())
.build();
addAction(refreshAction);
// this action also just calls the refreshModelData() method, but since it is a toggle
// action, the refresh model data will rebuild with the filter option toggled.
filterAction = new ToggleActionBuilder("Filter", ACTION_OWNER)
.toolBarIcon(Icons.CONFIGURE_FILTER_ICON)
.description("Filters out most non-focusable components")
.onAction(c -> refreshModelData())
.selected(true)
.build();
filterAction =
new ToggleActionBuilder("Filter", ACTION_OWNER).toolBarIcon(Icons.CONFIGURE_FILTER_ICON)
.description("Filters out most non-focusable components")
.onAction(c -> refreshModelData())
.selected(true)
.build();
addAction(filterAction);
eventAction = new ToggleActionBuilder("Show Events", ACTION_OWNER)
.toolBarIcon(Icons.INFO_ICON)
.description("Shows focus events")
.onAction(c -> toggleShowEvents())
.build();
eventAction =
new ToggleActionBuilder("Show Events", ACTION_OWNER).toolBarIcon(Icons.INFO_ICON)
.description("Shows focus events")
.onAction(c -> toggleShowEvents())
.build();
addAction(eventAction);
toggleFollowFocusAction = new ToggleActionBuilder("Follow Focus", ACTION_OWNER)
@ -158,6 +158,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
JPanel panel = new JPanel(new BorderLayout());
panel.add(buildCenterPanel(), BorderLayout.CENTER);
panel.add(buildInfoPanel(), BorderLayout.SOUTH);
panel.getAccessibleContext().setAccessibleName("Component Info");
return panel;
}
@ -165,6 +166,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
private JComponent buildCenterPanel() {
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(buildTablePanel());
splitPane.getAccessibleContext().setAccessibleName("Filter");
return splitPane;
}
@ -172,6 +174,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
model = new ComponentTableModel();
filterTable = new GFilterTable<ComponentInfo>(model);
filterTable.setAccessibleNamePrefix("Component Info");
filterTable.getAccessibleContext().setAccessibleName("Filter");
return filterTable;
}
@ -196,6 +199,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
panel.add(buildTextPair(newProviderTextField, oldProviderTextField));
panel.add(new JLabel("Focused Component (new/old): ", SwingConstants.RIGHT));
panel.add(buildTextPair(newComponentTextField, oldComponentTextField));
panel.getAccessibleContext().setAccessibleName("Info Previews");
return panel;
}
@ -203,6 +207,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
JPanel panel = new JPanel(new GridLayout(1, 2, 10, 10));
panel.add(comp1);
panel.add(comp2);
panel.getAccessibleContext().setAccessibleName("Filter Comparison");
return panel;
}
@ -238,8 +243,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
newComponentTextField.setText(getName(currentComponent));
oldProviderTextField.setText(newProviderTextField.getText());
currentProvider = DockingWindowManager.getActiveInstance()
.getProvider(newFocusComponent);
currentProvider = DockingWindowManager.getActiveInstance().getProvider(newFocusComponent);
newProviderTextField.setText(currentProvider == null ? "" : currentProvider.getName());
oldWindowTextField.setText(newWindowTextField.getText());
@ -255,8 +259,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
String name = comp.getName();
StringBuilder buf = new StringBuilder(name == null ? "" : name);
buf.append(" (");
buf.append(comp.getClass()
.getSimpleName());
buf.append(comp.getClass().getSimpleName());
buf.append(")");
return buf.toString();
}
@ -581,8 +584,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
public String getValue(ComponentInfo info, Settings settings, Object data,
ServiceProvider provider) throws IllegalArgumentException {
Set<AWTKeyStroke> keys = info.getComponent()
.getFocusTraversalKeys(
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
return keys == null ? "" : keys.toString();
}
@ -760,8 +762,7 @@ public class ComponentInfoDialog extends DialogComponentProvider implements Prop
}
public String getClassSimpleName() {
String name = component.getClass()
.getName();
String name = component.getClass().getName();
int lastIndexOf = name.lastIndexOf(".");
if (lastIndexOf < 0) {
return name;

View file

@ -197,7 +197,9 @@ public class TaskDialog extends DialogComponentProvider implements TaskMonitor {
private void setup(boolean canCancel) {
monitorComponent = new TaskMonitorComponent(false, false);
monitorComponent.getAccessibleContext().setAccessibleName("Monitor");
activityPanel = new ChompingBitsAnimationPanel();
activityPanel.getAccessibleContext().setAccessibleName("Activity");
setCancelEnabled(canCancel);
setRememberLocation(false);
@ -205,6 +207,7 @@ public class TaskDialog extends DialogComponentProvider implements TaskMonitor {
setTransient(true);
mainPanel = new JPanel(new BorderLayout());
mainPanel.getAccessibleContext().setAccessibleName("Task");
addWorkPanel(mainPanel);
if (supportsProgress) {