Skip to content

Commit d71f273

Browse files
author
Federico Fissore
committed
Preferences: added tooltip about additional boards manager urls. Fixes #3092
1 parent 4c3de26 commit d71f273

File tree

4 files changed

+69
-77
lines changed

4 files changed

+69
-77
lines changed

app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.form

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
44
<Properties>
55
<Property name="defaultCloseOperation" type="int" value="2"/>
6-
<Property name="title" type="java.lang.String" value="_(&quot;Additional Boards Manager URLs: &quot;)"/>
6+
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
7+
<Connection code="_(&quot;Additional Boards Manager URLs&quot;)" type="code"/>
8+
</Property>
79
<Property name="modal" type="boolean" value="true"/>
810
<Property name="modalExclusionType" type="java.awt.Dialog$ModalExclusionType" editor="org.netbeans.modules.form.editors.EnumEditor">
911
<Value id="APPLICATION_EXCLUDE"/>
@@ -32,12 +34,16 @@
3234
<EmptySpace max="-2" attributes="0"/>
3335
<Group type="103" groupAlignment="0" attributes="0">
3436
<Group type="102" attributes="0">
35-
<EmptySpace min="0" pref="439" max="32767" attributes="0"/>
37+
<EmptySpace min="0" pref="332" max="32767" attributes="0"/>
3638
<Component id="ok" min="-2" max="-2" attributes="0"/>
3739
<EmptySpace max="-2" attributes="0"/>
3840
<Component id="cancel" min="-2" max="-2" attributes="0"/>
3941
</Group>
4042
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
43+
<Group type="102" alignment="0" attributes="0">
44+
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
45+
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
46+
</Group>
4147
</Group>
4248
<EmptySpace max="-2" attributes="0"/>
4349
</Group>
@@ -47,7 +53,9 @@
4753
<Group type="103" groupAlignment="0" attributes="0">
4854
<Group type="102" alignment="0" attributes="0">
4955
<EmptySpace max="-2" attributes="0"/>
50-
<Component id="jScrollPane1" pref="141" max="32767" attributes="0"/>
56+
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
57+
<EmptySpace max="-2" attributes="0"/>
58+
<Component id="jScrollPane1" pref="118" max="32767" attributes="0"/>
5159
<EmptySpace max="-2" attributes="0"/>
5260
<Group type="103" groupAlignment="3" attributes="0">
5361
<Component id="cancel" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -82,7 +90,9 @@
8290
</Container>
8391
<Component class="javax.swing.JButton" name="cancel">
8492
<Properties>
85-
<Property name="text" type="java.lang.String" value="Cancel"/>
93+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
94+
<Connection code="_(&quot;Cancel&quot;)" type="code"/>
95+
</Property>
8696
</Properties>
8797
<Events>
8898
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelActionPerformed"/>
@@ -94,7 +104,9 @@
94104
</Component>
95105
<Component class="javax.swing.JButton" name="ok">
96106
<Properties>
97-
<Property name="text" type="java.lang.String" value="OK"/>
107+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
108+
<Connection code="_(&quot;OK&quot;)" type="code"/>
109+
</Property>
98110
</Properties>
99111
<Events>
100112
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okActionPerformed"/>
@@ -104,5 +116,16 @@
104116
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
105117
</AuxValues>
106118
</Component>
119+
<Component class="javax.swing.JLabel" name="jLabel1">
120+
<Properties>
121+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
122+
<Connection code="_(&quot;Enter additional URLs, one for each row&quot;)" type="code"/>
123+
</Property>
124+
</Properties>
125+
<AuxValues>
126+
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
127+
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
128+
</AuxValues>
129+
</Component>
107130
</SubComponents>
108131
</Form>

app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.java

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ private void initComponents() {
7474
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
7575
javax.swing.JButton cancel = new javax.swing.JButton();
7676
javax.swing.JButton ok = new javax.swing.JButton();
77+
javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
7778

7879
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
7980
setTitle(_("Additional Boards Manager URLs"));
@@ -99,6 +100,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
99100
}
100101
});
101102

103+
jLabel1.setText(_("Enter additional URLs, one for each row"));
104+
102105
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
103106
getContentPane().setLayout(layout);
104107
layout.setHorizontalGroup(
@@ -107,18 +110,23 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
107110
.addContainerGap()
108111
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
109112
.addGroup(layout.createSequentialGroup()
110-
.addGap(0, 439, Short.MAX_VALUE)
113+
.addGap(0, 332, Short.MAX_VALUE)
111114
.addComponent(ok)
112115
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
113116
.addComponent(cancel))
114-
.addComponent(jScrollPane1))
117+
.addComponent(jScrollPane1)
118+
.addGroup(layout.createSequentialGroup()
119+
.addComponent(jLabel1)
120+
.addGap(0, 0, Short.MAX_VALUE)))
115121
.addContainerGap())
116122
);
117123
layout.setVerticalGroup(
118124
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
119125
.addGroup(layout.createSequentialGroup()
120126
.addContainerGap()
121-
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
127+
.addComponent(jLabel1)
128+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
129+
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
122130
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
123131
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
124132
.addComponent(cancel)
@@ -139,48 +147,6 @@ private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:even
139147
cancelActionPerformed(evt);
140148
}//GEN-LAST:event_okActionPerformed
141149

142-
/**
143-
* @param args the command line arguments
144-
*/
145-
public static void main(String args[]) {
146-
/* Set the Nimbus look and feel */
147-
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
148-
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
149-
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
150-
*/
151-
try {
152-
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
153-
if ("Nimbus".equals(info.getName())) {
154-
javax.swing.UIManager.setLookAndFeel(info.getClassName());
155-
break;
156-
}
157-
}
158-
} catch (ClassNotFoundException ex) {
159-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
160-
} catch (InstantiationException ex) {
161-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
162-
} catch (IllegalAccessException ex) {
163-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
164-
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
165-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
166-
}
167-
//</editor-fold>
168-
169-
/* Create and display the dialog */
170-
java.awt.EventQueue.invokeLater(new Runnable() {
171-
public void run() {
172-
AdditionalBoardsManagerURLTextArea dialog = new AdditionalBoardsManagerURLTextArea(new javax.swing.JFrame());
173-
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
174-
@Override
175-
public void windowClosing(java.awt.event.WindowEvent e) {
176-
System.exit(0);
177-
}
178-
});
179-
dialog.setVisible(true);
180-
}
181-
});
182-
}
183-
184150
public void setText(String text) {
185151
Collection<String> urls = splitAndTrim(text, ",");
186152
additionalBoardsManagerURLs.setText(Joiner.on("\n").skipNulls().join(urls));

app/src/cc/arduino/view/preferences/Preferences.form

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,16 @@
7575
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
7676
</Group>
7777
<Group type="102" alignment="1" attributes="0">
78-
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
79-
<Group type="103" groupAlignment="0" attributes="0">
80-
<Group type="102" alignment="1" attributes="0">
81-
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
82-
<EmptySpace max="-2" attributes="0"/>
83-
<Component id="additionalBoardsManagerField" min="-2" pref="494" max="-2" attributes="0"/>
84-
<EmptySpace max="-2" attributes="0"/>
85-
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
86-
</Group>
87-
<Group type="102" alignment="1" attributes="0">
88-
<Component id="okButton" min="-2" max="-2" attributes="0"/>
89-
<EmptySpace max="-2" attributes="0"/>
90-
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
91-
</Group>
92-
</Group>
78+
<Component id="okButton" min="-2" max="-2" attributes="0"/>
79+
<EmptySpace max="-2" attributes="0"/>
80+
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
81+
</Group>
82+
<Group type="102" alignment="1" attributes="0">
83+
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
84+
<EmptySpace max="-2" attributes="0"/>
85+
<Component id="additionalBoardsManagerField" min="-2" pref="500" max="-2" attributes="0"/>
86+
<EmptySpace max="-2" attributes="0"/>
87+
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
9388
</Group>
9489
</Group>
9590
<EmptySpace max="-2" attributes="0"/>
@@ -472,13 +467,21 @@
472467
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
473468
<Connection code="_(&quot;Additional Boards Manager URLs: &quot;)" type="code"/>
474469
</Property>
470+
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
471+
<Connection code="_(&quot;Enter a comma separated list of urls&quot;)" type="code"/>
472+
</Property>
475473
</Properties>
476474
<AuxValues>
477475
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
478476
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
479477
</AuxValues>
480478
</Component>
481479
<Component class="javax.swing.JTextField" name="additionalBoardsManagerField">
480+
<Properties>
481+
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
482+
<Connection code="_(&quot;Enter a comma separated list of urls&quot;)" type="code"/>
483+
</Property>
484+
</Properties>
482485
</Component>
483486
<Component class="javax.swing.JButton" name="extendedAdditionalUrlFieldWindow">
484487
<Properties>

app/src/cc/arduino/view/preferences/Preferences.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
379379
);
380380

381381
additionalBoardsManagerLabel.setText(_("Additional Boards Manager URLs: "));
382+
additionalBoardsManagerLabel.setToolTipText(_("Enter a comma separated list of urls"));
383+
384+
additionalBoardsManagerField.setToolTipText(_("Enter a comma separated list of urls"));
382385

383386
extendedAdditionalUrlFieldWindow.setIcon(new ImageIcon(Base.getThemeImage("newwindow.gif", this)));
384387
extendedAdditionalUrlFieldWindow.addActionListener(new java.awt.event.ActionListener() {
@@ -490,18 +493,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
490493
.addComponent(preferencesFileLabel))
491494
.addGap(0, 0, Short.MAX_VALUE))
492495
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
493-
.addGap(0, 0, Short.MAX_VALUE)
494-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
495-
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
496-
.addComponent(additionalBoardsManagerLabel)
497-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
498-
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE)
499-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
500-
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
501-
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
502-
.addComponent(okButton)
503-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
504-
.addComponent(cancelButton)))))
496+
.addComponent(okButton)
497+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
498+
.addComponent(cancelButton))
499+
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
500+
.addComponent(additionalBoardsManagerLabel)
501+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
502+
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
503+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
504+
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
505505
.addContainerGap())
506506
);
507507
layout.setVerticalGroup(

0 commit comments

Comments
 (0)