~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to scripting/php/webproject/src/org/netbeans/modules/php/project/customizer/CustomizerCommandLine.java

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * CustomizerCommandLine.java
 
3
 *
 
4
 * Created on 18 Š”ŠµŠ½Ń‚яŠ±Ń€ŃŒ 2007 Š³., 18:28
 
5
 */
 
6
 
 
7
package org.netbeans.modules.php.project.customizer;
 
8
 
 
9
import java.awt.BorderLayout;
 
10
import java.awt.Color;
 
11
import java.awt.event.ActionEvent;
 
12
import java.awt.event.ActionListener;
 
13
import java.io.File;
 
14
import java.io.IOException;
 
15
import java.util.prefs.PreferenceChangeEvent;
 
16
import java.util.prefs.PreferenceChangeListener;
 
17
import javax.swing.JComponent;
 
18
import javax.swing.JFileChooser;
 
19
import javax.swing.JPanel;
 
20
import javax.swing.event.ChangeEvent;
 
21
import javax.swing.event.ChangeListener;
 
22
import javax.swing.event.DocumentEvent;
 
23
import javax.swing.event.DocumentListener;
 
24
import org.netbeans.api.progress.ProgressHandle;
 
25
import org.netbeans.api.progress.ProgressHandleFactory;
 
26
import org.netbeans.modules.php.project.PhpProject;
 
27
import org.netbeans.modules.php.project.options.CommandLinePreferences;
 
28
import org.netbeans.modules.php.project.options.PhpOptionsCategory;
 
29
import org.netbeans.modules.php.project.ui.actions.SystemPackageFinder;
 
30
import org.openide.util.NbBundle;
 
31
 
 
32
/**
 
33
 *
 
34
 * @author  avk
 
35
 */
 
36
public class CustomizerCommandLine extends javax.swing.JPanel {
 
37
 
 
38
    private static final String CONFIGURE = "CONFIGURE"; // NOI18N
 
39
    private static final String SEARCH = "SEARCH"; // NOI18N
 
40
    private static final String BROWSE = "BROWSE"; // NOI18N
 
41
    private static final String SELECT_PHP_LOCATION = "LBL_SelectPhpLocation"; // NOI18N
 
42
    private static final String MSG_ILLEGAL_PHP_PATH = "MSG_IllegalPhpPath"; // NOI18N
 
43
    private static final String MSG_ABSENT_FILE = "MSG_AbsentFile"; // NOI18N
 
44
 
 
45
    /** Creates new form CustomizerCommandLine */
 
46
    public CustomizerCommandLine(PhpProjectProperties uiProperties) {
 
47
        initComponents();
 
48
 
 
49
        load(uiProperties);
 
50
 
 
51
        myInterpreterPath.getDocument().addDocumentListener(new PathListener());
 
52
 
 
53
        RadioListener listener = new RadioListener();
 
54
        myDefaultRadio.addChangeListener(listener);
 
55
        mySpecialRadio.addChangeListener(listener);
 
56
    }
 
57
 
 
58
    private void load(PhpProjectProperties uiProperties) {
 
59
        myProps = uiProperties;
 
60
 
 
61
        loadDefaultInterpreterPath();
 
62
 
 
63
        String path = uiProperties.getProperty(PhpProject.COMMAND_PATH);
 
64
        if (path == null) {
 
65
            myDefaultRadio.setSelected(true);
 
66
        } else {
 
67
            mySpecialRadio.setSelected(true);
 
68
            myInterpreterPath.setText(path);
 
69
        }
 
70
    }
 
71
 
 
72
    private void loadDefaultInterpreterPath() {
 
73
        String defaultPath = CommandLinePreferences.getInstance().getPhpInterpreter();
 
74
        if (defaultPath != null) {
 
75
            myInterpreterPathDefault.setText(defaultPath);
 
76
        }
 
77
    }
 
78
 
 
79
    private class PathListener implements DocumentListener {
 
80
 
 
81
        /* (non-Javadoc)
 
82
         * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
 
83
         */
 
84
        public void changedUpdate(DocumentEvent e) {
 
85
            fireChange();
 
86
        }
 
87
 
 
88
        /* (non-Javadoc)
 
89
         * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
 
90
         */
 
91
        public void insertUpdate(DocumentEvent e) {
 
92
            fireChange();
 
93
        }
 
94
 
 
95
        /* (non-Javadoc)
 
96
         * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
 
97
         */
 
98
        public void removeUpdate(DocumentEvent e) {
 
99
            fireChange();
 
100
        }
 
101
 
 
102
        private void fireChange() {
 
103
            interpreterPathChanged();
 
104
        }
 
105
    }
 
106
 
 
107
    private class DefaultPathListener implements PreferenceChangeListener {
 
108
 
 
109
        public void preferenceChange(PreferenceChangeEvent evt) {
 
110
            loadDefaultInterpreterPath();
 
111
            CommandLinePreferences.getInstance().removePreferenceChangeListener(DefaultPathListener.this);
 
112
        }
 
113
    }
 
114
 
 
115
    private class RadioListener implements ChangeListener {
 
116
 
 
117
        public void stateChanged(ChangeEvent e) {
 
118
            Object obj = e.getSource();
 
119
            if (obj == myDefaultRadio && myDefaultRadio.isSelected()) {
 
120
                useDefaultInterpreterPath();
 
121
            } else if (obj == mySpecialRadio && mySpecialRadio.isSelected()) {
 
122
                interpreterPathChanged();
 
123
            }
 
124
        }
 
125
    }
 
126
 
 
127
    private void interpreterPathChanged() {
 
128
        mySpecialRadio.setSelected(true);
 
129
        interpreterPathIsValid();
 
130
        String path = myInterpreterPath.getText();
 
131
        getProperties().setProperty(PhpProject.COMMAND_PATH, path);
 
132
    }
 
133
 
 
134
    private void useDefaultInterpreterPath() {
 
135
        getProperties().remove(PhpProject.COMMAND_PATH);
 
136
    }
 
137
 
 
138
    boolean interpreterPathIsValid() {
 
139
        File destFolder = new File(myInterpreterPath.getText()).getAbsoluteFile();
 
140
        File file = getCanonicalFile(destFolder);
 
141
        if (file == null) {
 
142
            String message = NbBundle.getMessage(this.getClass(), MSG_ABSENT_FILE);
 
143
            //setErrorMessage(message);
 
144
            setMessage(message);
 
145
            return false;
 
146
        }
 
147
        if (!file.isFile()) {
 
148
            String message = NbBundle.getMessage(this.getClass(), MSG_ILLEGAL_PHP_PATH);
 
149
            //setErrorMessage(message);
 
150
            setMessage(message);
 
151
            return false;
 
152
        }
 
153
 
 
154
        setMessage("");
 
155
        return true;
 
156
    }
 
157
 
 
158
    public static File getCanonicalFile(File file) {
 
159
        try {
 
160
            return file.getCanonicalFile();
 
161
        } catch (IOException e) {
 
162
            return null;
 
163
        }
 
164
    }
 
165
 
 
166
    private void configureProgressPanel(JComponent progressComponent) {
 
167
        if (myProgress != null) {
 
168
            myProgressContainer.remove(myProgress);
 
169
        }
 
170
 
 
171
        myProgress = progressComponent == null 
 
172
                ? new JPanel() 
 
173
                : progressComponent;
 
174
        myProgressContainer.add(myProgress, BorderLayout.CENTER);
 
175
 
 
176
        myProgressContainer.validate();
 
177
        validate();
 
178
    }
 
179
 
 
180
    /** This method is called from within the constructor to
 
181
     * initialize the form.
 
182
     * WARNING: Do NOT modify this code. The content of this method is
 
183
     * always regenerated by the Form Editor.
 
184
     */
 
185
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 
186
    private void initComponents() {
 
187
        java.awt.GridBagConstraints gridBagConstraints;
 
188
 
 
189
        myRadioGroup = new javax.swing.ButtonGroup();
 
190
        interpreterContainer = new javax.swing.JPanel();
 
191
        myProgressContainer = new javax.swing.JPanel();
 
192
        myInterpreterLbl = new javax.swing.JLabel();
 
193
        myInterpreterPath = new javax.swing.JTextField();
 
194
        myPhpProgramBrowse = new javax.swing.JButton();
 
195
        myPhpProgramSearch = new javax.swing.JButton();
 
196
        myDefaultRadio = new javax.swing.JRadioButton();
 
197
        mySpecialRadio = new javax.swing.JRadioButton();
 
198
        myInterpreterPathDefault = new javax.swing.JTextField();
 
199
        myPaneLabel = new javax.swing.JLabel();
 
200
        myInterpreterLbl1 = new javax.swing.JLabel();
 
201
        myConfigureDefault = new javax.swing.JButton();
 
202
        myMessageContainer = new javax.swing.JPanel();
 
203
        myMessagePanel = new javax.swing.JTextPane();
 
204
        spacer = new javax.swing.JPanel();
 
205
 
 
206
        setLayout(new java.awt.GridBagLayout());
 
207
 
 
208
        myProgressContainer.setLayout(new java.awt.BorderLayout());
 
209
 
 
210
        myInterpreterLbl.setLabelFor(myInterpreterPath);
 
211
        org.openide.awt.Mnemonics.setLocalizedText(myInterpreterLbl, org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_CommandPath")); // NOI18N
 
212
 
 
213
        org.openide.awt.Mnemonics.setLocalizedText(myPhpProgramBrowse, org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_BrowseLocation_Button")); // NOI18N
 
214
        myPhpProgramBrowse.setActionCommand(BROWSE);
 
215
        myPhpProgramBrowse.addActionListener(new java.awt.event.ActionListener() {
 
216
            public void actionPerformed(java.awt.event.ActionEvent evt) {
 
217
                myPhpProgramBrowsebrowsePressed(evt);
 
218
            }
 
219
        });
 
220
 
 
221
        org.openide.awt.Mnemonics.setLocalizedText(myPhpProgramSearch, org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_SearchLocation_Button")); // NOI18N
 
222
        myPhpProgramSearch.setActionCommand(SEARCH);
 
223
        myPhpProgramSearch.addActionListener(new java.awt.event.ActionListener() {
 
224
            public void actionPerformed(java.awt.event.ActionEvent evt) {
 
225
                myPhpProgramSearchActionPerformed(evt);
 
226
            }
 
227
        });
 
228
 
 
229
        myRadioGroup.add(myDefaultRadio);
 
230
        myDefaultRadio.setSelected(true);
 
231
        myDefaultRadio.setText(org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_Default_Radio")); // NOI18N
 
232
 
 
233
        myRadioGroup.add(mySpecialRadio);
 
234
        mySpecialRadio.setText(org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_Special_Radio")); // NOI18N
 
235
 
 
236
        myInterpreterPathDefault.setEditable(false);
 
237
 
 
238
        myPaneLabel.setText(org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_Pane_Label")); // NOI18N
 
239
 
 
240
        myInterpreterLbl1.setLabelFor(myInterpreterPathDefault);
 
241
        org.openide.awt.Mnemonics.setLocalizedText(myInterpreterLbl1, org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_CommandPathDefault")); // NOI18N
 
242
 
 
243
        org.openide.awt.Mnemonics.setLocalizedText(myConfigureDefault, org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "LBL_ConfigureDefault_Button")); // NOI18N
 
244
        myConfigureDefault.setActionCommand(CONFIGURE);
 
245
        myConfigureDefault.addActionListener(new java.awt.event.ActionListener() {
 
246
            public void actionPerformed(java.awt.event.ActionEvent evt) {
 
247
                myConfigureDefaultActionPerformed(evt);
 
248
            }
 
249
        });
 
250
 
 
251
        org.jdesktop.layout.GroupLayout interpreterContainerLayout = new org.jdesktop.layout.GroupLayout(interpreterContainer);
 
252
        interpreterContainer.setLayout(interpreterContainerLayout);
 
253
        interpreterContainerLayout.setHorizontalGroup(
 
254
            interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
255
            .add(org.jdesktop.layout.GroupLayout.TRAILING, interpreterContainerLayout.createSequentialGroup()
 
256
                .addContainerGap()
 
257
                .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
258
                    .add(myPaneLabel)
 
259
                    .add(myDefaultRadio)
 
260
                    .add(mySpecialRadio)
 
261
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, interpreterContainerLayout.createSequentialGroup()
 
262
                        .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
263
                            .add(interpreterContainerLayout.createSequentialGroup()
 
264
                                .add(21, 21, 21)
 
265
                                .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 
266
                                    .add(org.jdesktop.layout.GroupLayout.LEADING, interpreterContainerLayout.createSequentialGroup()
 
267
                                        .add(myInterpreterLbl1)
 
268
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
269
                                        .add(myInterpreterPathDefault, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))
 
270
                                    .add(interpreterContainerLayout.createSequentialGroup()
 
271
                                        .add(myInterpreterLbl)
 
272
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
273
                                        .add(myInterpreterPath, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))))
 
274
                            .add(myProgressContainer, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE))
 
275
                        .add(10, 10, 10)
 
276
                        .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 
277
                            .add(myConfigureDefault, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 
278
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, myPhpProgramBrowse, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 
279
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, myPhpProgramSearch))))
 
280
                .addContainerGap())
 
281
        );
 
282
        interpreterContainerLayout.setVerticalGroup(
 
283
            interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
284
            .add(interpreterContainerLayout.createSequentialGroup()
 
285
                .addContainerGap()
 
286
                .add(myPaneLabel)
 
287
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
288
                .add(myDefaultRadio)
 
289
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
290
                .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 
291
                    .add(myInterpreterLbl1)
 
292
                    .add(myInterpreterPathDefault, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 
293
                    .add(myConfigureDefault))
 
294
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
295
                .add(mySpecialRadio)
 
296
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
297
                .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 
298
                    .add(myPhpProgramBrowse)
 
299
                    .add(myInterpreterPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 
300
                    .add(myInterpreterLbl))
 
301
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
302
                .add(interpreterContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 
303
                    .add(myProgressContainer, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 
304
                    .add(myPhpProgramSearch, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 
305
                .addContainerGap())
 
306
        );
 
307
 
 
308
        gridBagConstraints = new java.awt.GridBagConstraints();
 
309
        gridBagConstraints.gridx = 0;
 
310
        gridBagConstraints.gridy = 0;
 
311
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
 
312
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
 
313
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
314
        gridBagConstraints.weightx = 1.0;
 
315
        add(interpreterContainer, gridBagConstraints);
 
316
 
 
317
        myMessagePanel.setEditable(false);
 
318
        myMessagePanel.setText(org.openide.util.NbBundle.getMessage(CustomizerCommandLine.class, "CustomizerCommandLine.myMessagePanel.text")); // NOI18N
 
319
        myMessagePanel.setFocusable(false);
 
320
        myMessagePanel.setMinimumSize(new java.awt.Dimension(6, 10));
 
321
        myMessagePanel.setOpaque(false);
 
322
        myMessagePanel.setPreferredSize(new java.awt.Dimension(0, 0));
 
323
 
 
324
        org.jdesktop.layout.GroupLayout myMessageContainerLayout = new org.jdesktop.layout.GroupLayout(myMessageContainer);
 
325
        myMessageContainer.setLayout(myMessageContainerLayout);
 
326
        myMessageContainerLayout.setHorizontalGroup(
 
327
            myMessageContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
328
            .add(org.jdesktop.layout.GroupLayout.TRAILING, myMessagePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE)
 
329
        );
 
330
        myMessageContainerLayout.setVerticalGroup(
 
331
            myMessageContainerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
332
            .add(myMessageContainerLayout.createSequentialGroup()
 
333
                .add(myMessagePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 
334
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 
335
        );
 
336
 
 
337
        gridBagConstraints = new java.awt.GridBagConstraints();
 
338
        gridBagConstraints.gridx = 0;
 
339
        gridBagConstraints.gridy = 2;
 
340
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
 
341
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
 
342
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
 
343
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
344
        gridBagConstraints.weightx = 1.0;
 
345
        add(myMessageContainer, gridBagConstraints);
 
346
 
 
347
        org.jdesktop.layout.GroupLayout spacerLayout = new org.jdesktop.layout.GroupLayout(spacer);
 
348
        spacer.setLayout(spacerLayout);
 
349
        spacerLayout.setHorizontalGroup(
 
350
            spacerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
351
            .add(0, 438, Short.MAX_VALUE)
 
352
        );
 
353
        spacerLayout.setVerticalGroup(
 
354
            spacerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 
355
            .add(0, 27, Short.MAX_VALUE)
 
356
        );
 
357
 
 
358
        gridBagConstraints = new java.awt.GridBagConstraints();
 
359
        gridBagConstraints.gridx = 0;
 
360
        gridBagConstraints.gridy = 1;
 
361
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
 
362
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
 
363
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
 
364
        gridBagConstraints.weightx = 1.0;
 
365
        gridBagConstraints.weighty = 1.0;
 
366
        add(spacer, gridBagConstraints);
 
367
    }// </editor-fold>//GEN-END:initComponents
 
368
 
 
369
    private void myPhpProgramBrowsebrowsePressed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myPhpProgramBrowsebrowsePressed
 
370
        if (BROWSE.equals(evt.getActionCommand())) {
 
371
            mySpecialRadio.setSelected(true);
 
372
 
 
373
            JFileChooser chooser = new JFileChooser();
 
374
            chooser.setDialogTitle(NbBundle.getMessage(CustomizerCommandLine.class, SELECT_PHP_LOCATION));
 
375
            chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
 
376
            if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
 
377
                File projectDir = chooser.getSelectedFile();
 
378
                myInterpreterPath.setText(projectDir.getAbsolutePath());
 
379
            }
 
380
            interpreterPathChanged();
 
381
        }
 
382
    }//GEN-LAST:event_myPhpProgramBrowsebrowsePressed
 
383
 
 
384
    private void myPhpProgramSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myPhpProgramSearchActionPerformed
 
385
        if (SEARCH.equals(evt.getActionCommand())) {
 
386
            mySpecialRadio.setSelected(true);
 
387
 
 
388
            //String title = NbBundle.getMessage(CustomizerCommandLine.class, "LBL_BTN_Perform_Auto");
 
389
            ProgressHandle progress = ProgressHandleFactory.createHandle(SEARCH); // NOI18N
 
390
            JComponent progressComponent = ProgressHandleFactory.createProgressComponent(progress);
 
391
            configureProgressPanel(progressComponent);
 
392
            progress.start();
 
393
            myPhpProgramSearch.setEnabled(false);
 
394
 
 
395
 
 
396
            //myInterpreterPath.setText(projectDir.getAbsolutePath());
 
397
            String interpreter = SystemPackageFinder.getPhpInterpreterUserChoice();
 
398
            if (interpreter != null) {
 
399
                myInterpreterPath.setText(interpreter);
 
400
            }
 
401
 
 
402
            myPhpProgramSearch.setEnabled(true);
 
403
            interpreterPathChanged();
 
404
            progress.finish();
 
405
            configureProgressPanel(null);
 
406
        }
 
407
}//GEN-LAST:event_myPhpProgramSearchActionPerformed
 
408
 
 
409
    private void myConfigureDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myConfigureDefaultActionPerformed
 
410
        if (CONFIGURE.equals(evt.getActionCommand())) {
 
411
            myDefaultRadio.setSelected(true);
 
412
            CommandLinePreferences.getInstance().addPreferenceChangeListener(new DefaultPathListener());
 
413
            PhpOptionsCategory.displayPhpOptions();
 
414
        }
 
415
        // TODO add your handling code here:
 
416
    }//GEN-LAST:event_myConfigureDefaultActionPerformed
 
417
    // Variables declaration - do not modify//GEN-BEGIN:variables
 
418
    private javax.swing.JPanel interpreterContainer;
 
419
    private javax.swing.JButton myConfigureDefault;
 
420
    private javax.swing.JRadioButton myDefaultRadio;
 
421
    private javax.swing.JLabel myInterpreterLbl;
 
422
    private javax.swing.JLabel myInterpreterLbl1;
 
423
    private javax.swing.JTextField myInterpreterPath;
 
424
    private javax.swing.JTextField myInterpreterPathDefault;
 
425
    private javax.swing.JPanel myMessageContainer;
 
426
    private javax.swing.JTextPane myMessagePanel;
 
427
    private javax.swing.JLabel myPaneLabel;
 
428
    private javax.swing.JButton myPhpProgramBrowse;
 
429
    private javax.swing.JButton myPhpProgramSearch;
 
430
    private javax.swing.JPanel myProgressContainer;
 
431
    private javax.swing.ButtonGroup myRadioGroup;
 
432
    private javax.swing.JRadioButton mySpecialRadio;
 
433
    private javax.swing.JPanel spacer;
 
434
    // End of variables declaration//GEN-END:variables
 
435
 
 
436
    public void setMessage(String msg) {
 
437
        myMessagePanel.setText(msg);
 
438
        myMessagePanel.setForeground(Color.DARK_GRAY);
 
439
    }
 
440
 
 
441
    public void setErrorMessage(String msg) {
 
442
        myMessagePanel.setText(msg);
 
443
        myMessagePanel.setForeground(Color.RED);
 
444
    }
 
445
 
 
446
    private PhpProjectProperties getProperties() {
 
447
        return myProps;
 
448
    }
 
449
    private PhpProjectProperties myProps;
 
450
    private JComponent myProgress;
 
451
}
 
 
b'\\ No newline at end of file'