From b9265a42b12004df150637e952b63a1362b85ff4 Mon Sep 17 00:00:00 2001 From: Joe Wegner Date: Fri, 27 Sep 2019 10:29:19 -0400 Subject: [PATCH] Add boarders to the teble items so screen readers will read while walking through the table --- .../ui/ContributedLibraryTableCellJPanel.java | 18 ++++++------------ .../ui/ContributedPlatformTableCellJPanel.java | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java index 865de5776..1c8b2d78c 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java @@ -3,21 +3,12 @@ package cc.arduino.contributions.libraries.ui; import static processing.app.I18n.format; import static processing.app.I18n.tr; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; +import java.awt.*; import java.util.Optional; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.JTextPane; +import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; import javax.swing.event.HyperlinkEvent; import javax.swing.text.Document; import javax.swing.text.html.HTMLDocument; @@ -128,6 +119,9 @@ public class ContributedLibraryTableCellJPanel extends JPanel { return; ContributedLibrary selected = releases.getSelected(); + TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); + titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); + setBorder(titledBorder); Optional mayInstalled = releases.getInstalled(); boolean installable, upgradable; diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index e10ca46cc..3136c5045 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -189,7 +189,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel { ContributedPlatform selected = releases.getSelected(); TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); - this.setBorder(titledBorder); + setBorder(titledBorder); ContributedPlatform installed = releases.getInstalled(); boolean removable, installable, upgradable; @@ -215,7 +215,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel { removeButtonPlaceholder.setVisible(!removable); String desc = ""; -// desc += "" + selected.getName() + ""; + desc += "" + selected.getName() + ""; if (installed != null && installed.isBuiltIn()) { desc += " Built-In "; }