Lines 43-67
Link Here
|
43 |
import java.awt.event.ActionEvent; |
43 |
import java.awt.event.ActionEvent; |
44 |
import java.awt.event.ActionListener; |
44 |
import java.awt.event.ActionListener; |
45 |
import java.io.File; |
45 |
import java.io.File; |
46 |
import java.io.FilenameFilter; |
|
|
47 |
import java.io.IOException; |
48 |
import java.io.InputStream; |
49 |
import java.io.StringReader; |
46 |
import java.io.StringReader; |
|
|
47 |
import java.util.ArrayList; |
50 |
import java.util.Arrays; |
48 |
import java.util.Arrays; |
|
|
49 |
import java.util.Enumeration; |
51 |
import java.util.List; |
50 |
import java.util.List; |
52 |
import java.util.Properties; |
|
|
53 |
import java.util.jar.JarFile; |
54 |
import java.util.zip.ZipEntry; |
55 |
import javax.swing.BorderFactory; |
51 |
import javax.swing.BorderFactory; |
56 |
import javax.swing.ComboBoxModel; |
52 |
import javax.swing.ComboBoxModel; |
57 |
import javax.swing.DefaultComboBoxModel; |
53 |
import javax.swing.DefaultComboBoxModel; |
58 |
import javax.swing.DefaultListCellRenderer; |
54 |
import javax.swing.DefaultListCellRenderer; |
|
|
55 |
import javax.swing.DefaultListModel; |
59 |
import javax.swing.JFileChooser; |
56 |
import javax.swing.JFileChooser; |
60 |
import javax.swing.JList; |
57 |
import javax.swing.JList; |
|
|
58 |
import javax.swing.JOptionPane; |
61 |
import javax.swing.ListCellRenderer; |
59 |
import javax.swing.ListCellRenderer; |
62 |
import javax.swing.SwingUtilities; |
60 |
import javax.swing.SwingUtilities; |
63 |
import javax.swing.event.DocumentEvent; |
61 |
import javax.swing.event.ListSelectionEvent; |
64 |
import javax.swing.event.DocumentListener; |
62 |
import javax.swing.event.ListSelectionListener; |
|
|
63 |
import javax.swing.table.AbstractTableModel; |
65 |
import org.netbeans.modules.maven.TextValueCompleter; |
64 |
import org.netbeans.modules.maven.TextValueCompleter; |
66 |
import org.netbeans.modules.maven.indexer.api.RepositoryIndexer; |
65 |
import org.netbeans.modules.maven.indexer.api.RepositoryIndexer; |
67 |
import org.netbeans.modules.maven.indexer.api.RepositoryInfo; |
66 |
import org.netbeans.modules.maven.indexer.api.RepositoryInfo; |
Lines 92-101
Link Here
|
92 |
private boolean changed; |
91 |
private boolean changed; |
93 |
private boolean valid; |
92 |
private boolean valid; |
94 |
private ActionListener listener; |
93 |
private ActionListener listener; |
95 |
private DocumentListener docList; |
|
|
96 |
private MavenOptionController controller; |
94 |
private MavenOptionController controller; |
97 |
private TextValueCompleter completer; |
95 |
private TextValueCompleter completer; |
|
|
96 |
private File commandLinePath; |
97 |
private List<MavenRuntime> mavenRuntimes; |
98 |
private AbstractTableModel tableModel = new AbstractTableModel() { |
98 |
|
99 |
|
|
|
100 |
@Override |
101 |
public int getRowCount() { |
102 |
return mavenRuntimes.size(); |
103 |
} |
104 |
|
105 |
@Override |
106 |
public int getColumnCount() { |
107 |
return 2; |
108 |
} |
109 |
|
110 |
@Override |
111 |
public Class<?> getColumnClass(int columnIndex) { |
112 |
if (columnIndex == 0) { |
113 |
return Boolean.class; |
114 |
} else { |
115 |
return String.class; |
116 |
} |
117 |
} |
118 |
|
119 |
@Override |
120 |
public boolean isCellEditable(int rowIndex, int columnIndex) { |
121 |
if (columnIndex == 0) { |
122 |
MavenRuntime runtime = mavenRuntimes.get(rowIndex); |
123 |
if (!runtime.isExternal() && commandLinePath == null) { |
124 |
return false; |
125 |
} |
126 |
|
127 |
return true; |
128 |
} |
129 |
return false; |
130 |
} |
131 |
|
132 |
@Override |
133 |
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { |
134 |
if (columnIndex == 0) { |
135 |
MavenRuntime runtime = mavenRuntimes.get(rowIndex); |
136 |
boolean newValue = (Boolean) aValue; |
137 |
if (!runtime.isExternal()) { |
138 |
if (commandLinePath != null) { |
139 |
if (newValue) { |
140 |
commandLinePath = null; |
141 |
fireTableDataChanged(); |
142 |
} |
143 |
} |
144 |
if (newValue == false && commandLinePath != null) { |
145 |
return; |
146 |
} |
147 |
|
148 |
commandLinePath = null; |
149 |
|
150 |
} else { |
151 |
commandLinePath = newValue ? new File(runtime.getPath()) : null; |
152 |
fireTableDataChanged(); |
153 |
} |
154 |
|
155 |
} else { |
156 |
super.setValueAt(aValue, rowIndex, columnIndex); |
157 |
} |
158 |
} |
159 |
|
160 |
@Override |
161 |
public Object getValueAt(int rowIndex, int columnIndex) { |
162 |
switch (columnIndex) { |
163 |
case 0: { |
164 |
MavenRuntime runtime = mavenRuntimes.get(rowIndex); |
165 |
if (commandLinePath != null && commandLinePath.getAbsolutePath().equals(runtime.getPath())) { |
166 |
return true; |
167 |
|
168 |
} else if (commandLinePath == null && !runtime.isExternal()) { |
169 |
return true; |
170 |
} |
171 |
|
172 |
return false; |
173 |
} |
174 |
|
175 |
case 1: { |
176 |
MavenRuntime runtime = mavenRuntimes.get(rowIndex); |
177 |
String key = runtime.isExternal() ? "MAVEN_RUNTIME_External" : "MAVEN_RUNTIME_Embedded"; |
178 |
return NbBundle.getMessage(SettingsPanel.class, key, |
179 |
new Object[]{runtime.getPath(), runtime.getVersion()}); |
180 |
} |
181 |
} |
182 |
|
183 |
return null; |
184 |
} |
185 |
}; |
186 |
|
187 |
private DefaultListModel optionsModel = new DefaultListModel(); |
188 |
|
99 |
/** Creates new form SettingsPanel */ |
189 |
/** Creates new form SettingsPanel */ |
100 |
SettingsPanel(MavenOptionController controller) { |
190 |
SettingsPanel(MavenOptionController controller) { |
101 |
initComponents(); |
191 |
initComponents(); |
Lines 105-110
Link Here
|
105 |
comJavadoc.setModel(new DefaultComboBoxModel(downloads)); |
195 |
comJavadoc.setModel(new DefaultComboBoxModel(downloads)); |
106 |
comSource.setModel(new DefaultComboBoxModel(downloads)); |
196 |
comSource.setModel(new DefaultComboBoxModel(downloads)); |
107 |
|
197 |
|
|
|
198 |
mavenRuntimes = new ArrayList<MavenRuntime>(); |
199 |
tblMavenRuntimes.setModel(tableModel); |
200 |
tblMavenRuntimes.setTableHeader(null); |
201 |
tblMavenRuntimes.getColumnModel().getColumn(0).setMaxWidth(20); |
202 |
tblMavenRuntimes.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
203 |
|
204 |
@Override |
205 |
public void valueChanged(ListSelectionEvent e) { |
206 |
if (!e.getValueIsAdjusting()) { |
207 |
int selected = tblMavenRuntimes.getSelectedRow(); |
208 |
if (selected != -1 && mavenRuntimes.get(selected).isExternal()) { |
209 |
btnEditRuntime.setEnabled(true); |
210 |
btnRemoveRuntime.setEnabled(true); |
211 |
} else { |
212 |
btnEditRuntime.setEnabled(false); |
213 |
btnRemoveRuntime.setEnabled(false); |
214 |
} |
215 |
} |
216 |
} |
217 |
|
218 |
}); |
219 |
|
220 |
lstOptions.setModel(optionsModel); |
221 |
lstOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
222 |
|
223 |
@Override |
224 |
public void valueChanged(ListSelectionEvent e) { |
225 |
if (!e.getValueIsAdjusting()) { |
226 |
if (optionsModel.getSize() > 0) { |
227 |
btnRemoveOption.setEnabled(true); |
228 |
} else { |
229 |
btnRemoveOption.setEnabled(false); |
230 |
} |
231 |
} |
232 |
} |
233 |
|
234 |
}); |
235 |
|
108 |
ListCellRenderer rend = new DefaultListCellRenderer() { |
236 |
ListCellRenderer rend = new DefaultListCellRenderer() { |
109 |
@Override |
237 |
@Override |
110 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
238 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
Lines 124-147
Link Here
|
124 |
comJavadoc.setRenderer(rend); |
252 |
comJavadoc.setRenderer(rend); |
125 |
|
253 |
|
126 |
this.controller = controller; |
254 |
this.controller = controller; |
127 |
docList = new DocumentListener() { |
|
|
128 |
public void insertUpdate(DocumentEvent e) { |
129 |
documentChanged(e); |
130 |
} |
131 |
public void removeUpdate(DocumentEvent e) { |
132 |
documentChanged(e); |
133 |
} |
134 |
public void changedUpdate(DocumentEvent e) { |
135 |
documentChanged(e); |
136 |
} |
137 |
}; |
138 |
initValues(); |
255 |
initValues(); |
139 |
((MyJTextField)txtLocalRepository).setHintText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "txt_default_repository")); |
256 |
((JHintTextField)txtLocalRepository).setHintText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "txt_default_repository")); |
140 |
listener = new ActionListenerImpl(); |
257 |
listener = new ActionListenerImpl(); |
141 |
cbSnapshots.addActionListener(listener); |
258 |
cbSnapshots.addActionListener(listener); |
142 |
comIndex.addActionListener(listener); |
259 |
comIndex.addActionListener(listener); |
143 |
completer = new TextValueCompleter(getGlobalOptions(), txtOptions, " "); //NOI18N |
|
|
144 |
initEmbeddedVersion(); |
145 |
} |
260 |
} |
146 |
|
261 |
|
147 |
static String[] AVAILABLE_OPTIONS = new String[] { |
262 |
static String[] AVAILABLE_OPTIONS = new String[] { |
Lines 183-194
Link Here
|
183 |
return Arrays.asList(AVAILABLE_OPTIONS); |
298 |
return Arrays.asList(AVAILABLE_OPTIONS); |
184 |
} |
299 |
} |
185 |
|
300 |
|
186 |
private void initEmbeddedVersion() |
301 |
// private void initEmbeddedVersion() { |
187 |
{ |
|
|
188 |
//there was a renumbering scheme for maven. current trunk is not 2.1 but 3.0 |
302 |
//there was a renumbering scheme for maven. current trunk is not 2.1 but 3.0 |
189 |
//http://blogs.sonatype.com/brian/2008/09/05/1220649145080.html |
303 |
//http://blogs.sonatype.com/brian/2008/09/05/1220649145080.html |
190 |
//XXX: just hardwire here to not confuse people with old style versions. |
304 |
//XXX: just hardwire here to not confuse people with old style versions. |
191 |
lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion2", "3.0-SNAPSHOT")); //NOI18N |
|
|
192 |
|
305 |
|
193 |
// InputStream resourceAsStream; |
306 |
// InputStream resourceAsStream; |
194 |
// try { |
307 |
// try { |
Lines 206-291
Link Here
|
206 |
// catch ( IOException e ) { |
319 |
// catch ( IOException e ) { |
207 |
// lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion3")); |
320 |
// lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion3")); |
208 |
// } |
321 |
// } |
209 |
} |
322 |
// } |
210 |
|
323 |
|
211 |
private void initExternalVersion() |
|
|
212 |
{ |
213 |
String path = txtCommandLine.getText().trim(); |
214 |
if (path.length() == 0) { |
215 |
String ver = MavenSettings.getDefaultMavenInstanceVersion(); |
216 |
if (ver != null) { |
217 |
lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion3", ver));//NOI18N |
218 |
} else { |
219 |
lblExternalVersion.setText(ver != null ? ver : ""); //NOI18N |
220 |
} |
221 |
return; |
222 |
} |
223 |
File root = new File(path); |
224 |
File lib = new File(root, "lib"); //NOI18N |
225 |
if (lib.exists()) { |
226 |
File[] jars = lib.listFiles(new FilenameFilter() { |
227 |
public boolean accept(File dir, String name) { |
228 |
return name.endsWith(".jar"); //NOI18N |
229 |
} |
230 |
}); |
231 |
for (File jar : jars) { |
232 |
JarFile jf = null; |
233 |
try |
234 |
{ |
235 |
jf = new JarFile(jar); |
236 |
ZipEntry entry = jf.getEntry("META-INF/maven/org.apache.maven/maven-core/pom.properties");//NOI18N |
237 |
if (entry != null) { |
238 |
InputStream resourceAsStream = jf.getInputStream(entry); |
239 |
Properties properties = new Properties(); |
240 |
properties.load( resourceAsStream ); |
241 |
if ( properties.getProperty( "builtOn" ) != null ) { //NOI18N |
242 |
lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion1", |
243 |
properties.getProperty( "version", "unknown" ), properties.getProperty( "builtOn" )));//NOI18N |
244 |
} else { |
245 |
lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion2", properties.getProperty( "version", "unknown" )));//NOI18N |
246 |
} |
247 |
return; |
248 |
} |
249 |
} catch ( IOException ex ) |
250 |
{ |
251 |
//ignore.. |
252 |
} finally { |
253 |
if (jf != null) { |
254 |
try { |
255 |
jf.close(); |
256 |
} catch (IOException x) {} |
257 |
} |
258 |
} |
259 |
} |
260 |
} |
261 |
//add red color.. |
262 |
lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "ERR_NoValidInstallation")); |
263 |
} |
264 |
|
265 |
private void initValues() { |
324 |
private void initValues() { |
266 |
comIndex.setSelectedIndex(0); |
325 |
comIndex.setSelectedIndex(0); |
267 |
cbSnapshots.setSelected(true); |
326 |
cbSnapshots.setSelected(true); |
268 |
} |
327 |
} |
269 |
|
328 |
|
270 |
private void documentChanged(DocumentEvent e) { |
|
|
271 |
changed = true; |
272 |
boolean oldvalid = valid; |
273 |
if (txtCommandLine.getText().trim().length() > 0) { |
274 |
File fil = new File(txtCommandLine.getText()); |
275 |
if (fil.exists() && new File(fil, "bin" + File.separator + "mvn").exists()) { //NOI18N |
276 |
valid = true; |
277 |
} else { |
278 |
valid = false; |
279 |
} |
280 |
} else { |
281 |
valid = true; |
282 |
} |
283 |
if (oldvalid != valid) { |
284 |
controller.firePropChange(MavenOptionController.PROP_VALID, Boolean.valueOf(oldvalid), Boolean.valueOf(valid)); |
285 |
} |
286 |
initExternalVersion(); |
287 |
} |
288 |
|
289 |
private ComboBoxModel createComboModel() { |
329 |
private ComboBoxModel createComboModel() { |
290 |
return new DefaultComboBoxModel( |
330 |
return new DefaultComboBoxModel( |
291 |
new String[] { |
331 |
new String[] { |
Lines 307-324
Link Here
|
307 |
bgChecksums = new javax.swing.ButtonGroup(); |
347 |
bgChecksums = new javax.swing.ButtonGroup(); |
308 |
bgPlugins = new javax.swing.ButtonGroup(); |
348 |
bgPlugins = new javax.swing.ButtonGroup(); |
309 |
bgFailure = new javax.swing.ButtonGroup(); |
349 |
bgFailure = new javax.swing.ButtonGroup(); |
310 |
lblCommandLine = new javax.swing.JLabel(); |
350 |
lblMavenRuntimes = new javax.swing.JLabel(); |
311 |
txtCommandLine = new javax.swing.JTextField(); |
351 |
btnRemoveRuntime = new javax.swing.JButton(); |
312 |
btnCommandLine = new javax.swing.JButton(); |
|
|
313 |
lblExternalVersion = new javax.swing.JLabel(); |
314 |
lblOptions = new javax.swing.JLabel(); |
352 |
lblOptions = new javax.swing.JLabel(); |
315 |
txtOptions = new javax.swing.JTextField(); |
|
|
316 |
btnOptions = new javax.swing.JButton(); |
317 |
cbSkipTests = new javax.swing.JCheckBox(); |
353 |
cbSkipTests = new javax.swing.JCheckBox(); |
318 |
lblLocalRepository = new javax.swing.JLabel(); |
354 |
lblLocalRepository = new javax.swing.JLabel(); |
319 |
txtLocalRepository = new MyJTextField(); |
355 |
txtLocalRepository = new org.netbeans.modules.maven.options.JHintTextField(); |
320 |
btnLocalRepository = new javax.swing.JButton(); |
356 |
btnLocalRepository = new javax.swing.JButton(); |
321 |
lblEmbeddedVersion = new javax.swing.JLabel(); |
|
|
322 |
lblBinaries = new javax.swing.JLabel(); |
357 |
lblBinaries = new javax.swing.JLabel(); |
323 |
comBinaries = new javax.swing.JComboBox(); |
358 |
comBinaries = new javax.swing.JComboBox(); |
324 |
lblJavadoc = new javax.swing.JLabel(); |
359 |
lblJavadoc = new javax.swing.JLabel(); |
Lines 332-360
Link Here
|
332 |
comIndex = new javax.swing.JComboBox(); |
367 |
comIndex = new javax.swing.JComboBox(); |
333 |
btnIndex = new javax.swing.JButton(); |
368 |
btnIndex = new javax.swing.JButton(); |
334 |
cbSnapshots = new javax.swing.JCheckBox(); |
369 |
cbSnapshots = new javax.swing.JCheckBox(); |
|
|
370 |
btnAddRuntime = new javax.swing.JButton(); |
371 |
btnEditRuntime = new javax.swing.JButton(); |
372 |
jScrollPane1 = new javax.swing.JScrollPane(); |
373 |
tblMavenRuntimes = new javax.swing.JTable(); |
374 |
jScrollPane2 = new javax.swing.JScrollPane(); |
375 |
lstOptions = new javax.swing.JList(); |
376 |
jLabel2 = new javax.swing.JLabel(); |
377 |
btnAddOption = new javax.swing.JButton(); |
378 |
btnRemoveOption = new javax.swing.JButton(); |
335 |
|
379 |
|
336 |
org.openide.awt.Mnemonics.setLocalizedText(lblCommandLine, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblCommandLine.text")); // NOI18N |
380 |
org.openide.awt.Mnemonics.setLocalizedText(lblMavenRuntimes, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblMavenRuntimes.text")); // NOI18N |
337 |
|
381 |
|
338 |
txtCommandLine.setText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.txtCommandLine.text")); // NOI18N |
382 |
org.openide.awt.Mnemonics.setLocalizedText(btnRemoveRuntime, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnRemoveRuntime.text")); // NOI18N |
339 |
|
383 |
btnRemoveRuntime.setEnabled(false); |
340 |
org.openide.awt.Mnemonics.setLocalizedText(btnCommandLine, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnCommandLine.text")); // NOI18N |
384 |
btnRemoveRuntime.addActionListener(new java.awt.event.ActionListener() { |
341 |
btnCommandLine.addActionListener(new java.awt.event.ActionListener() { |
|
|
342 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
385 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
343 |
btnCommandLineActionPerformed(evt); |
386 |
btnRemoveRuntimeActionPerformed(evt); |
344 |
} |
387 |
} |
345 |
}); |
388 |
}); |
346 |
|
389 |
|
347 |
org.openide.awt.Mnemonics.setLocalizedText(lblExternalVersion, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblExternalVersion.text", new Object[] {})); // NOI18N |
|
|
348 |
|
349 |
org.openide.awt.Mnemonics.setLocalizedText(lblOptions, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblOptions.text")); // NOI18N |
390 |
org.openide.awt.Mnemonics.setLocalizedText(lblOptions, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblOptions.text")); // NOI18N |
350 |
|
391 |
|
351 |
org.openide.awt.Mnemonics.setLocalizedText(btnOptions, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnOptions.text")); // NOI18N |
|
|
352 |
btnOptions.addActionListener(new java.awt.event.ActionListener() { |
353 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
354 |
btnOptionsActionPerformed(evt); |
355 |
} |
356 |
}); |
357 |
|
358 |
org.openide.awt.Mnemonics.setLocalizedText(cbSkipTests, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.cbSkipTests.text")); // NOI18N |
392 |
org.openide.awt.Mnemonics.setLocalizedText(cbSkipTests, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.cbSkipTests.text")); // NOI18N |
359 |
|
393 |
|
360 |
org.openide.awt.Mnemonics.setLocalizedText(lblLocalRepository, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblLocalRepository.text")); // NOI18N |
394 |
org.openide.awt.Mnemonics.setLocalizedText(lblLocalRepository, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblLocalRepository.text")); // NOI18N |
Lines 366-373
Link Here
|
366 |
} |
400 |
} |
367 |
}); |
401 |
}); |
368 |
|
402 |
|
369 |
org.openide.awt.Mnemonics.setLocalizedText(lblEmbeddedVersion, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblEmbeddedVersion.text")); // NOI18N |
|
|
370 |
|
371 |
lblBinaries.setLabelFor(comBinaries); |
403 |
lblBinaries.setLabelFor(comBinaries); |
372 |
org.openide.awt.Mnemonics.setLocalizedText(lblBinaries, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblBinaries.text")); // NOI18N |
404 |
org.openide.awt.Mnemonics.setLocalizedText(lblBinaries, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblBinaries.text")); // NOI18N |
373 |
|
405 |
|
Lines 402-511
Link Here
|
402 |
|
434 |
|
403 |
org.openide.awt.Mnemonics.setLocalizedText(cbSnapshots, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.cbSnapshots.text")); // NOI18N |
435 |
org.openide.awt.Mnemonics.setLocalizedText(cbSnapshots, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.cbSnapshots.text")); // NOI18N |
404 |
|
436 |
|
|
|
437 |
org.openide.awt.Mnemonics.setLocalizedText(btnAddRuntime, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnAddRuntime.text")); // NOI18N |
438 |
btnAddRuntime.addActionListener(new java.awt.event.ActionListener() { |
439 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
440 |
btnAddRuntimeActionPerformed(evt); |
441 |
} |
442 |
}); |
443 |
|
444 |
org.openide.awt.Mnemonics.setLocalizedText(btnEditRuntime, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnEditRuntime.text")); // NOI18N |
445 |
btnEditRuntime.setEnabled(false); |
446 |
btnEditRuntime.addActionListener(new java.awt.event.ActionListener() { |
447 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
448 |
btnEditRuntimeActionPerformed(evt); |
449 |
} |
450 |
}); |
451 |
|
452 |
tblMavenRuntimes.setModel(new javax.swing.table.DefaultTableModel( |
453 |
new Object [][] { |
454 |
{}, |
455 |
{}, |
456 |
{}, |
457 |
{} |
458 |
}, |
459 |
new String [] { |
460 |
|
461 |
} |
462 |
)); |
463 |
tblMavenRuntimes.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN); |
464 |
tblMavenRuntimes.setShowVerticalLines(false); |
465 |
jScrollPane1.setViewportView(tblMavenRuntimes); |
466 |
|
467 |
jScrollPane2.setViewportView(lstOptions); |
468 |
|
469 |
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.jLabel2.text")); // NOI18N |
470 |
|
471 |
org.openide.awt.Mnemonics.setLocalizedText(btnAddOption, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnAddOption.text")); // NOI18N |
472 |
btnAddOption.addActionListener(new java.awt.event.ActionListener() { |
473 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
474 |
btnAddOptionActionPerformed(evt); |
475 |
} |
476 |
}); |
477 |
|
478 |
org.openide.awt.Mnemonics.setLocalizedText(btnRemoveOption, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnRemoveOption.text")); // NOI18N |
479 |
btnRemoveOption.setEnabled(false); |
480 |
btnRemoveOption.addActionListener(new java.awt.event.ActionListener() { |
481 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
482 |
btnRemoveOptionActionPerformed(evt); |
483 |
} |
484 |
}); |
485 |
|
405 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
486 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
406 |
this.setLayout(layout); |
487 |
this.setLayout(layout); |
407 |
layout.setHorizontalGroup( |
488 |
layout.setHorizontalGroup( |
408 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
489 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
409 |
.add(layout.createSequentialGroup() |
490 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
410 |
.addContainerGap() |
491 |
.addContainerGap() |
411 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
492 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
493 |
.add(jLabel1) |
412 |
.add(layout.createSequentialGroup() |
494 |
.add(layout.createSequentialGroup() |
413 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
495 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
414 |
.add(lblCommandLine) |
496 |
.add(jLabel2) |
415 |
.add(lblOptions) |
497 |
.add(lblIndex)) |
416 |
.add(lblLocalRepository)) |
498 |
.add(10, 10, 10) |
|
|
499 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
500 |
.add(layout.createSequentialGroup() |
501 |
.add(2, 2, 2) |
502 |
.add(comIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 425, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
503 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
504 |
.add(btnIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
505 |
.add(cbSnapshots) |
506 |
.add(btnGoals, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 57, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) |
507 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
508 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
509 |
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() |
510 |
.add(9, 9, 9) |
511 |
.add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)) |
512 |
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() |
513 |
.add(10, 10, 10) |
514 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
515 |
.add(lblBinaries) |
516 |
.add(lblJavadoc) |
517 |
.add(lblSource)) |
518 |
.add(36, 36, 36) |
519 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) |
520 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, comSource, 0, 427, Short.MAX_VALUE) |
521 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, comJavadoc, 0, 427, Short.MAX_VALUE) |
522 |
.add(comBinaries, 0, 427, Short.MAX_VALUE))) |
523 |
.add(layout.createSequentialGroup() |
524 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
525 |
.add(lblMavenRuntimes) |
526 |
.add(lblOptions) |
527 |
.add(lblLocalRepository)) |
528 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
529 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
530 |
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) |
531 |
.add(org.jdesktop.layout.GroupLayout.LEADING, cbSkipTests, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) |
532 |
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) |
533 |
.add(txtLocalRepository, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)))) |
417 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
534 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
418 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
535 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
419 |
.add(lblEmbeddedVersion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) |
536 |
.add(btnLocalRepository) |
420 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
537 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) |
421 |
.add(txtCommandLine, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE) |
538 |
.add(org.jdesktop.layout.GroupLayout.LEADING, btnRemoveOption, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
422 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
539 |
.add(org.jdesktop.layout.GroupLayout.LEADING, btnAddOption, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
423 |
.add(btnCommandLine)) |
540 |
.add(org.jdesktop.layout.GroupLayout.LEADING, btnRemoveRuntime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
424 |
.add(lblExternalVersion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) |
541 |
.add(org.jdesktop.layout.GroupLayout.LEADING, btnEditRuntime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
425 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
542 |
.add(org.jdesktop.layout.GroupLayout.LEADING, btnAddRuntime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))))) |
426 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
427 |
.add(comSource, 0, 387, Short.MAX_VALUE) |
428 |
.add(comJavadoc, 0, 387, Short.MAX_VALUE) |
429 |
.add(comBinaries, 0, 387, Short.MAX_VALUE) |
430 |
.add(txtLocalRepository, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE) |
431 |
.add(txtOptions, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)) |
432 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
433 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
434 |
.add(btnLocalRepository) |
435 |
.add(btnOptions))) |
436 |
.add(cbSkipTests))) |
437 |
.add(jLabel1) |
438 |
.add(layout.createSequentialGroup() |
439 |
.add(12, 12, 12) |
440 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
441 |
.add(lblJavadoc) |
442 |
.add(lblBinaries) |
443 |
.add(lblSource) |
444 |
.add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)) |
445 |
.add(106, 106, 106)) |
446 |
.add(btnGoals) |
447 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
448 |
.add(lblIndex) |
449 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
450 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
451 |
.add(cbSnapshots) |
452 |
.add(comIndex, 0, 391, Short.MAX_VALUE)) |
453 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
454 |
.add(btnIndex))) |
455 |
.addContainerGap()) |
543 |
.addContainerGap()) |
456 |
); |
544 |
); |
457 |
|
|
|
458 |
layout.linkSize(new java.awt.Component[] {btnCommandLine, btnIndex, btnLocalRepository, btnOptions}, org.jdesktop.layout.GroupLayout.HORIZONTAL); |
459 |
|
460 |
layout.setVerticalGroup( |
545 |
layout.setVerticalGroup( |
461 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
546 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
462 |
.add(layout.createSequentialGroup() |
547 |
.add(layout.createSequentialGroup() |
463 |
.add(lblEmbeddedVersion) |
548 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
549 |
.add(layout.createSequentialGroup() |
550 |
.addContainerGap() |
551 |
.add(lblMavenRuntimes)) |
552 |
.add(layout.createSequentialGroup() |
553 |
.add(6, 6, 6) |
554 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
555 |
.add(layout.createSequentialGroup() |
556 |
.add(btnAddRuntime) |
557 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
558 |
.add(btnEditRuntime) |
559 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
560 |
.add(btnRemoveRuntime)) |
561 |
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 141, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) |
464 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
562 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
465 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
563 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
466 |
.add(lblCommandLine) |
564 |
.add(lblOptions) |
467 |
.add(txtCommandLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
565 |
.add(layout.createSequentialGroup() |
468 |
.add(btnCommandLine)) |
566 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
567 |
.add(layout.createSequentialGroup() |
568 |
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
569 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
570 |
.add(cbSkipTests)) |
571 |
.add(layout.createSequentialGroup() |
572 |
.add(btnAddOption) |
573 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
574 |
.add(btnRemoveOption))) |
575 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
576 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
577 |
.add(txtLocalRepository, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
578 |
.add(lblLocalRepository) |
579 |
.add(btnLocalRepository)))) |
469 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
580 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
470 |
.add(lblExternalVersion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|
|
471 |
.add(18, 18, 18) |
472 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
473 |
.add(lblOptions) |
474 |
.add(txtOptions, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
475 |
.add(btnOptions)) |
476 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
477 |
.add(cbSkipTests) |
478 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
479 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
480 |
.add(txtLocalRepository, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
481 |
.add(btnLocalRepository) |
482 |
.add(lblLocalRepository)) |
483 |
.add(16, 16, 16) |
484 |
.add(jLabel1) |
581 |
.add(jLabel1) |
485 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
582 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
486 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
583 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
487 |
.add(lblBinaries) |
584 |
.add(lblBinaries) |
488 |
.add(comBinaries, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
585 |
.add(comBinaries, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
489 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
586 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
490 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
587 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
491 |
.add(lblJavadoc) |
588 |
.add(lblJavadoc) |
492 |
.add(comJavadoc, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
589 |
.add(comJavadoc, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
|
|
590 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
591 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
592 |
.add(comSource, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
593 |
.add(lblSource)) |
594 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
595 |
.add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
493 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
596 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
494 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
597 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
495 |
.add(lblSource) |
598 |
.add(btnGoals) |
496 |
.add(comSource, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
599 |
.add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
497 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
600 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
498 |
.add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|
|
499 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
500 |
.add(btnGoals) |
501 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
502 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
601 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
503 |
.add(btnIndex) |
|
|
504 |
.add(lblIndex) |
602 |
.add(lblIndex) |
505 |
.add(comIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
603 |
.add(comIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|
|
604 |
.add(btnIndex)) |
506 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
605 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
507 |
.add(cbSnapshots) |
606 |
.add(cbSnapshots) |
508 |
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
607 |
.addContainerGap()) |
509 |
); |
608 |
); |
510 |
}// </editor-fold>//GEN-END:initComponents |
609 |
}// </editor-fold>//GEN-END:initComponents |
511 |
|
610 |
|
Lines 533-539
Link Here
|
533 |
chooser.setDialogTitle(NbBundle.getMessage(SettingsPanel.class, "TIT_Select")); |
632 |
chooser.setDialogTitle(NbBundle.getMessage(SettingsPanel.class, "TIT_Select")); |
534 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
633 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
535 |
chooser.setFileHidingEnabled(false); |
634 |
chooser.setFileHidingEnabled(false); |
536 |
String path = ((MyJTextField)txtLocalRepository).getRealText(); |
635 |
String path = ((JHintTextField)txtLocalRepository).getRealText(); |
537 |
if (path.trim().length() == 0) { |
636 |
if (path.trim().length() == 0) { |
538 |
path = new File(System.getProperty("user.home"), ".m2").getAbsolutePath(); //NOI18N |
637 |
path = new File(System.getProperty("user.home"), ".m2").getAbsolutePath(); //NOI18N |
539 |
} |
638 |
} |
Lines 545-576
Link Here
|
545 |
} |
644 |
} |
546 |
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { |
645 |
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { |
547 |
File projectDir = chooser.getSelectedFile(); |
646 |
File projectDir = chooser.getSelectedFile(); |
548 |
((MyJTextField)txtLocalRepository).setRealText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); |
647 |
((JHintTextField)txtLocalRepository).setRealText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); |
549 |
} |
648 |
} |
550 |
}//GEN-LAST:event_btnLocalRepositoryActionPerformed |
649 |
}//GEN-LAST:event_btnLocalRepositoryActionPerformed |
551 |
|
650 |
|
552 |
private void btnCommandLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCommandLineActionPerformed |
651 |
private void btnRemoveRuntimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveRuntimeActionPerformed |
553 |
JFileChooser chooser = new JFileChooser(); |
652 |
int selected = tblMavenRuntimes.getSelectedRow(); |
554 |
FileUtil.preventFileChooserSymlinkTraversal(chooser, null); |
653 |
if (selected != -1 && selected < mavenRuntimes.size()) { |
555 |
chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "TIT_Select2")); |
654 |
mavenRuntimes.remove(selected); |
556 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
655 |
tableModel.fireTableDataChanged(); |
557 |
chooser.setFileHidingEnabled(false); |
656 |
} |
558 |
String path = txtCommandLine.getText(); |
657 |
}//GEN-LAST:event_btnRemoveRuntimeActionPerformed |
559 |
if (path.trim().length() == 0) { |
|
|
560 |
path = new File(System.getProperty("user.home")).getAbsolutePath(); //NOI18N |
561 |
} |
562 |
if (path.length() > 0) { |
563 |
File f = new File(path); |
564 |
if (f.exists()) { |
565 |
chooser.setSelectedFile(f); |
566 |
} |
567 |
} |
568 |
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { |
569 |
File projectDir = chooser.getSelectedFile(); |
570 |
txtCommandLine.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); |
571 |
} |
572 |
|
573 |
}//GEN-LAST:event_btnCommandLineActionPerformed |
574 |
|
658 |
|
575 |
private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoalsActionPerformed |
659 |
private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoalsActionPerformed |
576 |
NbGlobalActionGoalProvider provider = null; |
660 |
NbGlobalActionGoalProvider provider = null; |
Lines 597-622
Link Here
|
597 |
} |
681 |
} |
598 |
}//GEN-LAST:event_btnGoalsActionPerformed |
682 |
}//GEN-LAST:event_btnGoalsActionPerformed |
599 |
|
683 |
|
600 |
private void btnOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOptionsActionPerformed |
684 |
private boolean tryEditMavenRuntime(String path, MavenRuntime mavenRuntime) { |
|
|
685 |
if (path == null || path.length() == 0) { |
686 |
path = new File(System.getProperty("user.home")).getAbsolutePath(); //NOI18N |
687 |
} |
688 |
JFileChooser chooser = new JFileChooser(); |
689 |
FileUtil.preventFileChooserSymlinkTraversal(chooser, null); |
690 |
chooser.setDialogTitle(NbBundle.getMessage(SettingsPanel.class, "TIT_Select2")); |
691 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
692 |
chooser.setFileHidingEnabled(false); |
693 |
if (path.length() > 0) { |
694 |
File f = new File(path); |
695 |
if (f.exists()) { |
696 |
chooser.setSelectedFile(f); |
697 |
} |
698 |
} |
699 |
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { |
700 |
File projectDir = chooser.getSelectedFile(); |
701 |
path = FileUtil.normalizeFile(projectDir).getAbsolutePath(); |
702 |
String version = MavenUtil.getExternalVersion(path); |
703 |
if (version == null) { |
704 |
JOptionPane.showMessageDialog(this, |
705 |
NbBundle.getMessage(SettingsPanel.class, "MAVEN_RUNTIME_Error_DuplicatedRuntime_Message", new Object[]{path}), |
706 |
NbBundle.getMessage(SettingsPanel.class, "MAVEN_RUNTIME_ErrorCaption"), |
707 |
JOptionPane.ERROR_MESSAGE); |
708 |
return false; |
709 |
} |
710 |
|
711 |
for (MavenRuntime runtime : mavenRuntimes) { |
712 |
if (runtime.isExternal() && runtime.getPath().equals(path)) { |
713 |
JOptionPane.showMessageDialog(this, |
714 |
NbBundle.getMessage(SettingsPanel.class, "MAVEN_RUNTIME_Error_AlreadyRegistered_Message", new Object[]{path}), |
715 |
NbBundle.getMessage(SettingsPanel.class, "MAVEN_RUNTIME_ErrorCaption"), |
716 |
JOptionPane.ERROR_MESSAGE); |
717 |
return false; |
718 |
} |
719 |
} |
720 |
|
721 |
mavenRuntime.setPath(path); |
722 |
mavenRuntime.setVersion(version); |
723 |
return true; |
724 |
} |
725 |
|
726 |
return false; |
727 |
} |
728 |
|
729 |
private void btnAddRuntimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddRuntimeActionPerformed |
730 |
int selected = tblMavenRuntimes.getSelectedRow(); |
731 |
String path = null; |
732 |
if (selected != -1) { |
733 |
path = mavenRuntimes.get(selected).getPath(); |
734 |
} |
735 |
|
736 |
MavenRuntime newRuntime = new MavenRuntime("", ""); |
737 |
if (tryEditMavenRuntime(path, newRuntime)) { |
738 |
mavenRuntimes.add(newRuntime); |
739 |
tableModel.fireTableDataChanged(); |
740 |
} |
741 |
}//GEN-LAST:event_btnAddRuntimeActionPerformed |
742 |
|
743 |
private void btnEditRuntimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditRuntimeActionPerformed |
744 |
int selected = tblMavenRuntimes.getSelectedRow(); |
745 |
if (selected == -1) { |
746 |
return; |
747 |
} |
748 |
|
749 |
MavenRuntime runtime = mavenRuntimes.get(selected); |
750 |
if (tryEditMavenRuntime(runtime.getPath(), runtime)) { |
751 |
tableModel.fireTableDataChanged(); |
752 |
} |
753 |
|
754 |
}//GEN-LAST:event_btnEditRuntimeActionPerformed |
755 |
|
756 |
private void btnAddOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddOptionActionPerformed |
601 |
GlobalOptionsPanel pnl = new GlobalOptionsPanel(); |
757 |
GlobalOptionsPanel pnl = new GlobalOptionsPanel(); |
602 |
DialogDescriptor dd = new DialogDescriptor(pnl, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "TIT_Add_Globals")); |
758 |
DialogDescriptor dd = new DialogDescriptor(pnl, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "TIT_Add_Globals")); |
603 |
Object ret = DialogDisplayer.getDefault().notify(dd); |
759 |
Object ret = DialogDisplayer.getDefault().notify(dd); |
604 |
if (ret == DialogDescriptor.OK_OPTION) { |
760 |
if (ret == DialogDescriptor.OK_OPTION) { |
605 |
txtOptions.setText(txtOptions.getText() + pnl.getSelectedOnes()); |
761 |
String[] newOptions = pnl.getSelectedOnes(); |
|
|
762 |
int size = optionsModel.getSize(); |
763 |
for (String option : newOptions) { |
764 |
if (optionsModel.contains(option)) { |
765 |
continue; |
766 |
} |
767 |
|
768 |
optionsModel.addElement(option); |
769 |
} |
770 |
if (lstOptions.getSelectedIndex() == -1 && size != optionsModel.getSize()) { |
771 |
lstOptions.setSelectedIndex(optionsModel.getSize() - 1); |
772 |
} |
606 |
} |
773 |
} |
|
|
774 |
}//GEN-LAST:event_btnAddOptionActionPerformed |
607 |
|
775 |
|
608 |
}//GEN-LAST:event_btnOptionsActionPerformed |
776 |
private void btnRemoveOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveOptionActionPerformed |
|
|
777 |
int[] selectedIndices = lstOptions.getSelectedIndices(); |
778 |
for (int i = selectedIndices.length - 1; i >= 0; --i) { |
779 |
optionsModel.remove(selectedIndices[i]); |
780 |
} |
781 |
int newSelected = selectedIndices.length > 0 && selectedIndices[0] < optionsModel.getSize() ? |
782 |
selectedIndices[0] : optionsModel.getSize() - 1; |
783 |
lstOptions.setSelectedIndex(newSelected); |
784 |
}//GEN-LAST:event_btnRemoveOptionActionPerformed |
609 |
|
785 |
|
610 |
|
786 |
|
611 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
787 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
612 |
private javax.swing.ButtonGroup bgChecksums; |
788 |
private javax.swing.ButtonGroup bgChecksums; |
613 |
private javax.swing.ButtonGroup bgFailure; |
789 |
private javax.swing.ButtonGroup bgFailure; |
614 |
private javax.swing.ButtonGroup bgPlugins; |
790 |
private javax.swing.ButtonGroup bgPlugins; |
615 |
private javax.swing.JButton btnCommandLine; |
791 |
private javax.swing.JButton btnAddOption; |
|
|
792 |
private javax.swing.JButton btnAddRuntime; |
793 |
private javax.swing.JButton btnEditRuntime; |
616 |
private javax.swing.JButton btnGoals; |
794 |
private javax.swing.JButton btnGoals; |
617 |
private javax.swing.JButton btnIndex; |
795 |
private javax.swing.JButton btnIndex; |
618 |
private javax.swing.JButton btnLocalRepository; |
796 |
private javax.swing.JButton btnLocalRepository; |
619 |
private javax.swing.JButton btnOptions; |
797 |
private javax.swing.JButton btnRemoveOption; |
|
|
798 |
private javax.swing.JButton btnRemoveRuntime; |
620 |
private javax.swing.JCheckBox cbSkipTests; |
799 |
private javax.swing.JCheckBox cbSkipTests; |
621 |
private javax.swing.JCheckBox cbSnapshots; |
800 |
private javax.swing.JCheckBox cbSnapshots; |
622 |
private javax.swing.JComboBox comBinaries; |
801 |
private javax.swing.JComboBox comBinaries; |
Lines 624-656
Link Here
|
624 |
private javax.swing.JComboBox comJavadoc; |
803 |
private javax.swing.JComboBox comJavadoc; |
625 |
private javax.swing.JComboBox comSource; |
804 |
private javax.swing.JComboBox comSource; |
626 |
private javax.swing.JLabel jLabel1; |
805 |
private javax.swing.JLabel jLabel1; |
|
|
806 |
private javax.swing.JLabel jLabel2; |
627 |
private javax.swing.JLabel jLabel3; |
807 |
private javax.swing.JLabel jLabel3; |
|
|
808 |
private javax.swing.JScrollPane jScrollPane1; |
809 |
private javax.swing.JScrollPane jScrollPane2; |
628 |
private javax.swing.JLabel lblBinaries; |
810 |
private javax.swing.JLabel lblBinaries; |
629 |
private javax.swing.JLabel lblCommandLine; |
|
|
630 |
private javax.swing.JLabel lblEmbeddedVersion; |
631 |
private javax.swing.JLabel lblExternalVersion; |
632 |
private javax.swing.JLabel lblIndex; |
811 |
private javax.swing.JLabel lblIndex; |
633 |
private javax.swing.JLabel lblJavadoc; |
812 |
private javax.swing.JLabel lblJavadoc; |
634 |
private javax.swing.JLabel lblLocalRepository; |
813 |
private javax.swing.JLabel lblLocalRepository; |
|
|
814 |
private javax.swing.JLabel lblMavenRuntimes; |
635 |
private javax.swing.JLabel lblOptions; |
815 |
private javax.swing.JLabel lblOptions; |
636 |
private javax.swing.JLabel lblSource; |
816 |
private javax.swing.JLabel lblSource; |
637 |
private javax.swing.JTextField txtCommandLine; |
817 |
private javax.swing.JList lstOptions; |
|
|
818 |
private javax.swing.JTable tblMavenRuntimes; |
638 |
private javax.swing.JTextField txtLocalRepository; |
819 |
private javax.swing.JTextField txtLocalRepository; |
639 |
private javax.swing.JTextField txtOptions; |
|
|
640 |
// End of variables declaration//GEN-END:variables |
820 |
// End of variables declaration//GEN-END:variables |
641 |
|
821 |
|
642 |
public void setValues() { |
822 |
public void setValues() { |
643 |
txtOptions.setText(MavenSettings.getDefault().getDefaultOptions()); |
823 |
String defaultOptions = MavenSettings.getDefault().getDefaultOptions(); |
644 |
txtCommandLine.getDocument().removeDocumentListener(docList); |
824 |
optionsModel.clear(); |
645 |
File command = MavenSettings.getDefault().getCommandLinePath(); |
825 |
if (!"".equals(defaultOptions.trim())) { // NOI18N |
646 |
txtCommandLine.setText(command != null ? command.getAbsolutePath() : ""); //NOI18N |
826 |
String[] optionArr = MavenSettings.getDefault().getDefaultOptions().split(" "); // NOI18N |
647 |
initExternalVersion(); |
827 |
for (String option : optionArr) { |
648 |
txtCommandLine.getDocument().addDocumentListener(docList); |
828 |
optionsModel.addElement(option); |
649 |
|
829 |
} |
|
|
830 |
} |
831 |
lstOptions.setSelectedIndex(-1); |
832 |
|
833 |
mavenRuntimes.clear(); |
834 |
MavenRuntime[] runtimes = MavenSettings.getDefault().getMavenRuntimes(); |
835 |
mavenRuntimes.addAll(Arrays.asList(runtimes)); |
836 |
tableModel.fireTableDataChanged(); |
837 |
|
838 |
commandLinePath = MavenSettings.getDefault().getCommandLinePath(); |
650 |
cbSnapshots.setSelected(RepositoryPreferences.getInstance().isIncludeSnapshots()); |
839 |
cbSnapshots.setSelected(RepositoryPreferences.getInstance().isIncludeSnapshots()); |
651 |
comIndex.setSelectedIndex(RepositoryPreferences.getInstance().getIndexUpdateFrequency()); |
840 |
comIndex.setSelectedIndex(RepositoryPreferences.getInstance().getIndexUpdateFrequency()); |
652 |
String repo = MavenSettings.getDefault().getCustomLocalRepository(); |
841 |
String repo = MavenSettings.getDefault().getCustomLocalRepository(); |
653 |
((MyJTextField)txtLocalRepository).setRealText(repo != null ? repo : ""); |
842 |
((JHintTextField)txtLocalRepository).setRealText(repo != null ? repo : ""); |
654 |
comBinaries.setSelectedItem(MavenSettings.getDefault().getBinaryDownloadStrategy()); |
843 |
comBinaries.setSelectedItem(MavenSettings.getDefault().getBinaryDownloadStrategy()); |
655 |
comJavadoc.setSelectedItem(MavenSettings.getDefault().getJavadocDownloadStrategy()); |
844 |
comJavadoc.setSelectedItem(MavenSettings.getDefault().getJavadocDownloadStrategy()); |
656 |
comSource.setSelectedItem(MavenSettings.getDefault().getSourceDownloadStrategy()); |
845 |
comSource.setSelectedItem(MavenSettings.getDefault().getSourceDownloadStrategy()); |
Lines 660-675
Link Here
|
660 |
} |
849 |
} |
661 |
|
850 |
|
662 |
public void applyValues() { |
851 |
public void applyValues() { |
663 |
MavenSettings.getDefault().setDefaultOptions(txtOptions.getText().trim()); |
852 |
String options = ""; |
664 |
MavenSettings.getDefault().setCustomLocalRepository(((MyJTextField)txtLocalRepository).getRealText()); |
853 |
Enumeration optEnum = optionsModel.elements(); |
665 |
String cl = txtCommandLine.getText().trim(); |
854 |
while(optEnum.hasMoreElements()) { |
666 |
if (cl.length() == 0) { |
855 |
options += optEnum.nextElement() + " "; |
667 |
cl = null; |
856 |
} |
668 |
} |
857 |
|
|
|
858 |
MavenSettings.getDefault().setDefaultOptions(options.trim()); |
859 |
MavenSettings.getDefault().setCustomLocalRepository(((JHintTextField)txtLocalRepository).getRealText()); |
860 |
MavenSettings.getDefault().setMavenRuntimes(mavenRuntimes.toArray(new MavenRuntime[0])); |
669 |
//MEVENIDE-553 |
861 |
//MEVENIDE-553 |
670 |
File command = cl != null ? new File(cl) : null; |
862 |
if (commandLinePath != null && commandLinePath.exists()) { |
671 |
if (command != null && command.exists()) { |
863 |
MavenSettings.getDefault().setCommandLinePath(commandLinePath); |
672 |
MavenSettings.getDefault().setCommandLinePath(command); |
|
|
673 |
} else { |
864 |
} else { |
674 |
MavenSettings.getDefault().setCommandLinePath(null); |
865 |
MavenSettings.getDefault().setCommandLinePath(null); |
675 |
} |
866 |
} |