1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00

Merge pull request #9262 from joew46167/master

Add titles to rows in the manager tables
This commit is contained in:
Martino Facchin 2019-10-14 11:17:56 +02:00 committed by GitHub
commit b4bcb304a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 26 deletions

View File

@ -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<ContributedLibrary> mayInstalled = releases.getInstalled();
boolean installable, upgradable;
@ -162,7 +156,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
String desc = "<html><body>";
// Library name...
desc += format("<b>{0}</b>", name);
// desc += format("<b>{0}</b>", name);
if (mayInstalled.isPresent() && mayInstalled.get().isIDEBuiltIn()) {
desc += " Built-In ";
}

View File

@ -32,20 +32,11 @@ package cc.arduino.contributions.packages.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 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;
@ -196,6 +187,9 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
}
ContributedPlatform selected = releases.getSelected();
TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName());
titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
setBorder(titledBorder);
ContributedPlatform installed = releases.getInstalled();
boolean removable, installable, upgradable;
@ -221,7 +215,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
removeButtonPlaceholder.setVisible(!removable);
String desc = "<html><body>";
desc += "<b>" + selected.getName() + "</b>";
// desc += "<b>" + selected.getName() + "</b>";
if (installed != null && installed.isBuiltIn()) {
desc += " Built-In ";
}