28
28
import cc .arduino .contributions .libraries .ContributedLibraryReleases ;
29
29
import cc .arduino .contributions .ui .InstallerTableCell ;
30
30
import processing .app .Base ;
31
+ import processing .app .PreferencesData ;
31
32
import processing .app .Theme ;
32
33
33
34
public class ContributedLibraryTableCellJPanel extends JPanel {
34
35
36
+ final JButton moreInfoButton ;
35
37
final JButton installButton ;
36
38
final Component installButtonPlaceholder ;
37
39
final JComboBox downgradeChooser ;
@@ -46,6 +48,8 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
46
48
super ();
47
49
setLayout (new BoxLayout (this , BoxLayout .Y_AXIS ));
48
50
51
+ moreInfoButton = new JButton (tr ("More info" ));
52
+ moreInfoButton .setVisible (false );
49
53
installButton = new JButton (tr ("Install" ));
50
54
int width = installButton .getPreferredSize ().width ;
51
55
installButtonPlaceholder = Box .createRigidArea (new Dimension (width , 1 ));
@@ -79,6 +83,9 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
79
83
buttonsPanel .setOpaque (false );
80
84
81
85
buttonsPanel .add (Box .createHorizontalStrut (7 ));
86
+ buttonsPanel .add (moreInfoButton );
87
+ buttonsPanel .add (Box .createHorizontalStrut (5 ));
88
+ buttonsPanel .add (Box .createHorizontalStrut (15 ));
82
89
buttonsPanel .add (downgradeChooser );
83
90
buttonsPanel .add (Box .createHorizontalStrut (5 ));
84
91
buttonsPanel .add (downgradeButton );
@@ -141,7 +148,7 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
141
148
String name = selected .getName ();
142
149
String author = selected .getAuthor ();
143
150
// String maintainer = selectedLib.getMaintainer();
144
- String website = selected .getWebsite ();
151
+ final String website = selected .getWebsite ();
145
152
String sentence = selected .getSentence ();
146
153
String paragraph = selected .getParagraph ();
147
154
// String availableVer = selectedLib.getVersion();
@@ -188,7 +195,16 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
188
195
desc += "<br />" ;
189
196
}
190
197
if (author != null && !author .isEmpty ()) {
191
- desc += format ("<a href=\" {0}\" >More info</a>" , website );
198
+ boolean accessibleIDE = PreferencesData .getBoolean ("ide.accessible" );
199
+ if (accessibleIDE ) {
200
+ moreInfoButton .setVisible (true );
201
+ moreInfoButton .addActionListener (e -> {
202
+ Base .openURL (website );
203
+ });
204
+ }
205
+ else {
206
+ desc += format ("<a href=\" {0}\" >More info</a>" , website );
207
+ }
192
208
}
193
209
194
210
desc += "</body></html>" ;
0 commit comments