mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Core/lib manager: INSTALLED label
This commit is contained in:
parent
e27e2f1847
commit
0110fd8ff1
@ -77,8 +77,8 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
HTMLDocument html = (HTMLDocument) doc;
|
HTMLDocument html = (HTMLDocument) doc;
|
||||||
StyleSheet stylesheet = html.getStyleSheet();
|
StyleSheet stylesheet = html.getStyleSheet();
|
||||||
stylesheet.addRule("body { margin: 0; padding: 0;"
|
stylesheet.addRule("body { margin: 0; padding: 0;"
|
||||||
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
|
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
|
||||||
+ "font-size: 100%;" + "font-size: 0.95em; }");
|
+ "font-size: 100%;" + "font-size: 0.95em; }");
|
||||||
}
|
}
|
||||||
description.setOpaque(false);
|
description.setOpaque(false);
|
||||||
description.setBorder(new EmptyBorder(4, 7, 7, 7));
|
description.setBorder(new EmptyBorder(4, 7, 7, 7));
|
||||||
@ -138,12 +138,12 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
downgradeButton.setEnabled(!disableDowngrade);
|
downgradeButton.setEnabled(!disableDowngrade);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
panel = new JPanel();
|
panel = new JPanel();
|
||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
||||||
|
|
||||||
panel.add(description);
|
panel.add(description);
|
||||||
|
|
||||||
{
|
{
|
||||||
buttonsPanel = new JPanel();
|
buttonsPanel = new JPanel();
|
||||||
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
|
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
|
||||||
@ -165,7 +165,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
|
|
||||||
panel.add(buttonsPanel);
|
panel.add(buttonsPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
inactiveButtonsPanel = new JPanel();
|
inactiveButtonsPanel = new JPanel();
|
||||||
inactiveButtonsPanel.setLayout(new BoxLayout(inactiveButtonsPanel, BoxLayout.X_AXIS));
|
inactiveButtonsPanel.setLayout(new BoxLayout(inactiveButtonsPanel, BoxLayout.X_AXIS));
|
||||||
@ -286,24 +286,31 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
if (installedLib != null && installedLib.isReadOnly()) {
|
if (installedLib != null && installedLib.isReadOnly()) {
|
||||||
desc += "Built-In ";
|
desc += "Built-In ";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...author...
|
// ...author...
|
||||||
desc += format("<font color=\"{0}\">", midcolor);
|
desc += format("<font color=\"{0}\">", midcolor);
|
||||||
if (author != null && !author.isEmpty()) {
|
if (author != null && !author.isEmpty()) {
|
||||||
desc += format(" by <b>{0}</b>", author);
|
desc += format(" by <b>{0}</b>", author);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...version.
|
// ...version.
|
||||||
if (installedLib != null) {
|
if (installedLib != null) {
|
||||||
String installedVer = installedLib.getVersion();
|
String installedVer = installedLib.getVersion();
|
||||||
if (installedVer == null)
|
if (installedVer == null) {
|
||||||
desc += " " + _("Version unknown");
|
desc += " " + _("Version unknown");
|
||||||
else
|
} else {
|
||||||
desc += " " + format(_("Version <b>{0}</b>"), installedVer);
|
desc += " " + format(_("Version <b>{0}</b>"), installedVer);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// not installed...
|
// not installed...
|
||||||
}
|
}
|
||||||
desc += "</font><br />";
|
desc += "</font>";
|
||||||
|
|
||||||
|
if (installedLib != null) {
|
||||||
|
desc += " <strong><font color=\"#00979D\">INSTALLED</font></strong>";
|
||||||
|
}
|
||||||
|
|
||||||
|
desc += "<br/>";
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
if (sentence != null) {
|
if (sentence != null) {
|
||||||
@ -319,7 +326,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
desc += "</body></html>";
|
desc += "</body></html>";
|
||||||
description.setText(desc);
|
description.setText(desc);
|
||||||
description.setBackground(Color.WHITE);
|
description.setBackground(Color.WHITE);
|
||||||
|
|
||||||
// If the selected lib is available from repository...
|
// If the selected lib is available from repository...
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
removeButton.setText(_("Remove"));
|
removeButton.setText(_("Remove"));
|
||||||
@ -365,7 +372,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
|||||||
buttonsPanel.setVisible(enabled);
|
buttonsPanel.setVisible(enabled);
|
||||||
inactiveButtonsPanel.setVisible(!enabled);
|
inactiveButtonsPanel.setVisible(!enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enable(boolean enabled) {
|
public void enable(boolean enabled) {
|
||||||
installButton.setEnabled(enabled);
|
installButton.setEnabled(enabled);
|
||||||
removeButton.setEnabled(enabled);
|
removeButton.setEnabled(enabled);
|
||||||
|
@ -78,8 +78,8 @@ public class ContributedPlatformTableCell extends InstallerTableCell {
|
|||||||
HTMLDocument html = (HTMLDocument) doc;
|
HTMLDocument html = (HTMLDocument) doc;
|
||||||
StyleSheet stylesheet = html.getStyleSheet();
|
StyleSheet stylesheet = html.getStyleSheet();
|
||||||
stylesheet.addRule("body { margin: 0; padding: 0;"
|
stylesheet.addRule("body { margin: 0; padding: 0;"
|
||||||
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
|
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
|
||||||
+ "font-size: 100%;" + "font-size: 0.95em; }");
|
+ "font-size: 100%;" + "font-size: 0.95em; }");
|
||||||
}
|
}
|
||||||
description.setOpaque(false);
|
description.setOpaque(false);
|
||||||
description.setBorder(new EmptyBorder(4, 7, 7, 7));
|
description.setBorder(new EmptyBorder(4, 7, 7, 7));
|
||||||
@ -268,7 +268,7 @@ public class ContributedPlatformTableCell extends InstallerTableCell {
|
|||||||
desc += " " + format("by <b>{0}</b>", author);
|
desc += " " + format("by <b>{0}</b>", author);
|
||||||
}
|
}
|
||||||
if (removable) {
|
if (removable) {
|
||||||
desc += " " + format(_("version <b>{0}</b>"), installedPlatform.getVersion());
|
desc += " " + format(_("version <b>{0}</b>"), installedPlatform.getVersion()) + " <strong><font color=\"#00979D\">INSTALLED</font></strong>";
|
||||||
}
|
}
|
||||||
desc += "<br />";
|
desc += "<br />";
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ public class ContributedPlatformTableCell extends InstallerTableCell {
|
|||||||
|
|
||||||
int width = parentTable.getBounds().width;
|
int width = parentTable.getBounds().width;
|
||||||
setJTextPaneDimensionToFitContainedText(description, width);
|
setJTextPaneDimensionToFitContainedText(description, width);
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
panel.setBackground(parentTable.getSelectionBackground());
|
panel.setBackground(parentTable.getSelectionBackground());
|
||||||
panel.setForeground(parentTable.getSelectionForeground());
|
panel.setForeground(parentTable.getSelectionForeground());
|
||||||
|
Loading…
Reference in New Issue
Block a user