This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 184430
Collapse All | Expand All

(-)a/core.ui/arch.xml (-1 / +9 lines)
Lines 580-586 Link Here
580
-->
580
-->
581
 <answer id="exec-property">
581
 <answer id="exec-property">
582
  <p>
582
  <p>
583
   XXX no answer for exec-property
583
      <api name="netbeans.indexing.noFileRefresh" group="systemproperty" type="export" category="devel">
584
        When set, no check for external file changes is performed on focus gain. Works in
585
        concert with Parsing API.
586
      </api>
587
588
        <api category="devel" group="preferences" name="org.openide.actions.FileSystemRefreshAction.manual" type="import">
589
            External changes refresh is only performed when manual refresh is off.
590
            Various UI elements can also change the value of this preference setting.
591
        </api>
584
  </p>
592
  </p>
585
 </answer>
593
 </answer>
586
594
(-)a/core.ui/src/org/netbeans/core/ui/options/filetypes/Bundle.properties (+2 lines)
Lines 92-94 Link Here
92
# display name for options export
92
# display name for options export
93
Files.Options.Export.displayName=Files
93
Files.Options.Export.displayName=Files
94
OpenAsPanel.lblDescription.text=NetBeans does not know this type of file. Please specify how should these files be treated.
94
OpenAsPanel.lblDescription.text=NetBeans does not know this type of file. Please specify how should these files be treated.
95
FileAssociationsPanel.autoScan.text=Auto-scan for external changes when IDE gains focus
96
FileAssociationsPanel.autoScanLabel.text=You may want to turn this off if you have a large project or if you don't use external tools
(-)a/core.ui/src/org/netbeans/core/ui/options/filetypes/FileAssociationsPanel.form (-16 / +62 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 22-28 Link Here
22
                  <Group type="102" alignment="0" attributes="0">
22
                  <Group type="102" alignment="0" attributes="0">
23
                      <Component id="lblFileAssociations" min="-2" max="-2" attributes="0"/>
23
                      <Component id="lblFileAssociations" min="-2" max="-2" attributes="0"/>
24
                      <EmptySpace max="-2" attributes="0"/>
24
                      <EmptySpace max="-2" attributes="0"/>
25
                      <Component id="sepFileAssociations" pref="530" max="32767" attributes="0"/>
25
                      <Component id="sepFileAssociations" pref="542" max="32767" attributes="0"/>
26
                  </Group>
26
                  </Group>
27
                  <Group type="102" alignment="0" attributes="0">
27
                  <Group type="102" alignment="0" attributes="0">
28
                      <EmptySpace min="10" pref="10" max="10" attributes="0"/>
28
                      <EmptySpace min="10" pref="10" max="10" attributes="0"/>
Lines 35-46 Link Here
35
                          <Group type="102" alignment="0" attributes="0">
35
                          <Group type="102" alignment="0" attributes="0">
36
                              <Component id="lblAssociatedAlso" min="-2" max="-2" attributes="0"/>
36
                              <Component id="lblAssociatedAlso" min="-2" max="-2" attributes="0"/>
37
                              <EmptySpace max="-2" attributes="0"/>
37
                              <EmptySpace max="-2" attributes="0"/>
38
                              <Component id="lblAssociatedAlsoExt" pref="281" max="32767" attributes="0"/>
38
                              <Component id="lblAssociatedAlsoExt" pref="323" max="32767" attributes="0"/>
39
                          </Group>
39
                          </Group>
40
                          <Group type="102" alignment="0" attributes="0">
40
                          <Group type="102" alignment="0" attributes="0">
41
                              <Group type="103" groupAlignment="0" attributes="0">
41
                              <Group type="103" groupAlignment="0" attributes="0">
42
                                  <Component id="cbExtension" alignment="0" pref="254" max="32767" attributes="1"/>
42
                                  <Component id="cbExtension" alignment="0" pref="293" max="32767" attributes="1"/>
43
                                  <Component id="cbType" alignment="0" pref="254" max="32767" attributes="1"/>
43
                                  <Component id="cbType" alignment="0" pref="293" max="32767" attributes="1"/>
44
                              </Group>
44
                              </Group>
45
                              <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
45
                              <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
46
                              <Group type="103" groupAlignment="0" attributes="0">
46
                              <Group type="103" groupAlignment="0" attributes="0">
Lines 55-75 Link Here
55
                      </Group>
55
                      </Group>
56
                  </Group>
56
                  </Group>
57
                  <Group type="102" alignment="0" attributes="0">
57
                  <Group type="102" alignment="0" attributes="0">
58
                      <Group type="103" groupAlignment="0" attributes="0">
59
                          <Group type="102" attributes="0">
60
                              <Group type="103" groupAlignment="0" attributes="0">
61
                                  <Group type="102" attributes="0">
62
                                      <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
63
                                      <Component id="lblPattern" min="-2" max="-2" attributes="0"/>
64
                                  </Group>
65
                                  <Group type="102" alignment="0" attributes="0">
66
                                      <Component id="autoScan" pref="503" max="32767" attributes="0"/>
67
                                      <EmptySpace min="44" pref="44" max="44" attributes="0"/>
68
                                  </Group>
69
                              </Group>
70
                              <EmptySpace min="-2" pref="41" max="-2" attributes="0"/>
71
                          </Group>
72
                          <Group type="102" attributes="0">
73
                              <EmptySpace min="21" pref="21" max="21" attributes="0"/>
74
                              <Component id="autoScanLabel" min="-2" max="-2" attributes="0"/>
75
                              <EmptySpace max="-2" attributes="0"/>
76
                          </Group>
77
                      </Group>
78
                      <Component id="txtPatternError" pref="72" max="32767" attributes="0"/>
79
                  </Group>
80
                  <Group type="102" alignment="0" attributes="0">
58
                      <Component id="lblFilesIgnored" min="-2" max="-2" attributes="0"/>
81
                      <Component id="lblFilesIgnored" min="-2" max="-2" attributes="0"/>
59
                      <EmptySpace max="-2" attributes="0"/>
82
                      <EmptySpace max="-2" attributes="0"/>
60
                      <Component id="setFilesIgnored" pref="482" max="32767" attributes="0"/>
61
                  </Group>
62
                  <Group type="102" alignment="0" attributes="0">
63
                      <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
64
                      <Component id="lblPattern" min="-2" max="-2" attributes="0"/>
65
                      <EmptySpace min="-2" pref="41" max="-2" attributes="0"/>
66
                      <Group type="103" groupAlignment="0" attributes="0">
83
                      <Group type="103" groupAlignment="0" attributes="0">
67
                          <Component id="txtPatternError" alignment="0" pref="455" max="32767" attributes="0"/>
84
                          <Group type="102" attributes="0">
68
                          <Group type="102" alignment="0" attributes="0">
85
                              <Component id="jScrollPane1" pref="407" max="32767" attributes="0"/>
69
                              <Component id="jScrollPane1" max="32767" attributes="0"/>
70
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
86
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
71
                              <Component id="btnDefaultIgnored" min="-2" max="-2" attributes="1"/>
87
                              <Component id="btnDefaultIgnored" min="-2" max="-2" attributes="1"/>
72
                          </Group>
88
                          </Group>
89
                          <Component id="setFilesIgnored" alignment="0" pref="499" max="32767" attributes="0"/>
73
                      </Group>
90
                      </Group>
74
                  </Group>
91
                  </Group>
75
              </Group>
92
              </Group>
Lines 115-122 Link Here
115
                  <Component id="jScrollPane1" min="-2" pref="45" max="-2" attributes="0"/>
132
                  <Component id="jScrollPane1" min="-2" pref="45" max="-2" attributes="0"/>
116
              </Group>
133
              </Group>
117
              <EmptySpace max="-2" attributes="0"/>
134
              <EmptySpace max="-2" attributes="0"/>
118
              <Component id="txtPatternError" pref="123" max="32767" attributes="0"/>
135
              <Group type="103" groupAlignment="0" attributes="0">
119
              <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
136
                  <Group type="102" attributes="0">
137
                      <EmptySpace max="-2" attributes="0"/>
138
                      <Component id="txtPatternError" pref="129" max="32767" attributes="0"/>
139
                      <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
140
                  </Group>
141
                  <Group type="102" alignment="0" attributes="0">
142
                      <EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
143
                      <Component id="autoScan" min="-2" max="-2" attributes="0"/>
144
                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
145
                      <Component id="autoScanLabel" min="-2" max="-2" attributes="0"/>
146
                      <EmptySpace min="-2" pref="79" max="-2" attributes="0"/>
147
                  </Group>
148
              </Group>
120
          </Group>
149
          </Group>
121
      </Group>
150
      </Group>
122
    </DimensionLayout>
151
    </DimensionLayout>
Lines 359-363 Link Here
359
        </Property>
388
        </Property>
360
      </AccessibilityProperties>
389
      </AccessibilityProperties>
361
    </Component>
390
    </Component>
391
    <Component class="javax.swing.JCheckBox" name="autoScan">
392
      <Properties>
393
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
394
          <ResourceString bundle="org/netbeans/core/ui/options/filetypes/Bundle.properties" key="FileAssociationsPanel.autoScan.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;, {arguments})"/>
395
        </Property>
396
      </Properties>
397
      <Events>
398
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="autoScanActionPerformed"/>
399
      </Events>
400
    </Component>
401
    <Component class="javax.swing.JLabel" name="autoScanLabel">
402
      <Properties>
403
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
404
          <ResourceString bundle="org/netbeans/core/ui/options/filetypes/Bundle.properties" key="FileAssociationsPanel.autoScanLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;, {arguments})"/>
405
        </Property>
406
      </Properties>
407
    </Component>
362
  </SubComponents>
408
  </SubComponents>
363
</Form>
409
</Form>
(-)a/core.ui/src/org/netbeans/core/ui/options/filetypes/FileAssociationsPanel.java (-15 / +62 lines)
Lines 42-54 Link Here
42
42
43
import java.util.ArrayList;
43
import java.util.ArrayList;
44
import java.util.Collections;
44
import java.util.Collections;
45
import javax.swing.UIManager;
45
import java.util.prefs.Preferences;
46
import javax.swing.event.DocumentEvent;
46
import javax.swing.event.DocumentEvent;
47
import javax.swing.event.DocumentListener;
47
import javax.swing.event.DocumentListener;
48
import org.netbeans.core.ui.options.filetypes.FileAssociationsModel.MimeItem;
48
import org.netbeans.core.ui.options.filetypes.FileAssociationsModel.MimeItem;
49
import org.openide.DialogDescriptor;
49
import org.openide.DialogDescriptor;
50
import org.openide.DialogDisplayer;
50
import org.openide.DialogDisplayer;
51
import org.openide.util.NbBundle;
51
import org.openide.util.NbBundle;
52
import org.openide.util.NbPreferences;
52
53
53
/** Options panel with extensions and associated MIME types.
54
/** Options panel with extensions and associated MIME types.
54
 *
55
 *
Lines 95-100 Link Here
95
        jScrollPane1 = new javax.swing.JScrollPane();
96
        jScrollPane1 = new javax.swing.JScrollPane();
96
        txtPattern = new javax.swing.JTextArea();
97
        txtPattern = new javax.swing.JTextArea();
97
        txtPatternError = new javax.swing.JLabel();
98
        txtPatternError = new javax.swing.JLabel();
99
        autoScan = new javax.swing.JCheckBox();
100
        autoScanLabel = new javax.swing.JLabel();
98
101
99
        lblExtension.setLabelFor(cbExtension);
102
        lblExtension.setLabelFor(cbExtension);
100
        org.openide.awt.Mnemonics.setLocalizedText(lblExtension, org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.lblExtension.text")); // NOI18N
103
        org.openide.awt.Mnemonics.setLocalizedText(lblExtension, org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.lblExtension.text")); // NOI18N
Lines 169-174 Link Here
169
        txtPatternError.setVerticalAlignment(javax.swing.SwingConstants.TOP);
172
        txtPatternError.setVerticalAlignment(javax.swing.SwingConstants.TOP);
170
        txtPatternError.setFocusable(false);
173
        txtPatternError.setFocusable(false);
171
174
175
        org.openide.awt.Mnemonics.setLocalizedText(autoScan, org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.autoScan.text", new Object[] {})); // NOI18N
176
        autoScan.addActionListener(new java.awt.event.ActionListener() {
177
            public void actionPerformed(java.awt.event.ActionEvent evt) {
178
                autoScanActionPerformed(evt);
179
            }
180
        });
181
182
        org.openide.awt.Mnemonics.setLocalizedText(autoScanLabel, org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.autoScanLabel.text", new Object[] {})); // NOI18N
183
172
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
184
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
173
        this.setLayout(layout);
185
        this.setLayout(layout);
174
        layout.setHorizontalGroup(
186
        layout.setHorizontalGroup(
Lines 179-185 Link Here
179
                    .addGroup(layout.createSequentialGroup()
191
                    .addGroup(layout.createSequentialGroup()
180
                        .addComponent(lblFileAssociations)
192
                        .addComponent(lblFileAssociations)
181
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
193
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
182
                        .addComponent(sepFileAssociations, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE))
194
                        .addComponent(sepFileAssociations, javax.swing.GroupLayout.DEFAULT_SIZE, 542, Short.MAX_VALUE))
183
                    .addGroup(layout.createSequentialGroup()
195
                    .addGroup(layout.createSequentialGroup()
184
                        .addGap(10, 10, 10)
196
                        .addGap(10, 10, 10)
185
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
197
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Lines 190-200 Link Here
190
                            .addGroup(layout.createSequentialGroup()
202
                            .addGroup(layout.createSequentialGroup()
191
                                .addComponent(lblAssociatedAlso)
203
                                .addComponent(lblAssociatedAlso)
192
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
204
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
193
                                .addComponent(lblAssociatedAlsoExt, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE))
205
                                .addComponent(lblAssociatedAlsoExt, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE))
194
                            .addGroup(layout.createSequentialGroup()
206
                            .addGroup(layout.createSequentialGroup()
195
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
207
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
196
                                    .addComponent(cbExtension, 0, 254, Short.MAX_VALUE)
208
                                    .addComponent(cbExtension, 0, 293, Short.MAX_VALUE)
197
                                    .addComponent(cbType, 0, 254, Short.MAX_VALUE))
209
                                    .addComponent(cbType, 0, 293, Short.MAX_VALUE))
198
                                .addGap(10, 10, 10)
210
                                .addGap(10, 10, 10)
199
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
211
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
200
                                    .addGroup(layout.createSequentialGroup()
212
                                    .addGroup(layout.createSequentialGroup()
Lines 203-221 Link Here
203
                                        .addComponent(btnRemove))
215
                                        .addComponent(btnRemove))
204
                                    .addComponent(btnDefault)))))
216
                                    .addComponent(btnDefault)))))
205
                    .addGroup(layout.createSequentialGroup()
217
                    .addGroup(layout.createSequentialGroup()
218
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
219
                            .addGroup(layout.createSequentialGroup()
220
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
221
                                    .addGroup(layout.createSequentialGroup()
222
                                        .addGap(10, 10, 10)
223
                                        .addComponent(lblPattern))
224
                                    .addGroup(layout.createSequentialGroup()
225
                                        .addComponent(autoScan, javax.swing.GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE)
226
                                        .addGap(44, 44, 44)))
227
                                .addGap(41, 41, 41))
228
                            .addGroup(layout.createSequentialGroup()
229
                                .addGap(21, 21, 21)
230
                                .addComponent(autoScanLabel)
231
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
232
                        .addComponent(txtPatternError, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
233
                    .addGroup(layout.createSequentialGroup()
206
                        .addComponent(lblFilesIgnored)
234
                        .addComponent(lblFilesIgnored)
207
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
235
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
208
                        .addComponent(setFilesIgnored, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE))
209
                    .addGroup(layout.createSequentialGroup()
210
                        .addGap(10, 10, 10)
211
                        .addComponent(lblPattern)
212
                        .addGap(41, 41, 41)
213
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
236
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
214
                            .addComponent(txtPatternError, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
215
                            .addGroup(layout.createSequentialGroup()
237
                            .addGroup(layout.createSequentialGroup()
216
                                .addComponent(jScrollPane1)
238
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)
217
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
239
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
218
                                .addComponent(btnDefaultIgnored)))))
240
                                .addComponent(btnDefaultIgnored))
241
                            .addComponent(setFilesIgnored, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE))))
219
                .addContainerGap())
242
                .addContainerGap())
220
        );
243
        );
221
        layout.setVerticalGroup(
244
        layout.setVerticalGroup(
Lines 250-257 Link Here
250
                    .addComponent(btnDefaultIgnored)
273
                    .addComponent(btnDefaultIgnored)
251
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
274
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
252
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
275
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
253
                .addComponent(txtPatternError, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
276
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
254
                .addGap(16, 16, 16))
277
                    .addGroup(layout.createSequentialGroup()
278
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
279
                        .addComponent(txtPatternError, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
280
                        .addGap(16, 16, 16))
281
                    .addGroup(layout.createSequentialGroup()
282
                        .addGap(20, 20, 20)
283
                        .addComponent(autoScan)
284
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
285
                        .addComponent(autoScanLabel)
286
                        .addGap(79, 79, 79))))
255
        );
287
        );
256
288
257
        lblExtension.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.lblExtension.AN")); // NOI18N
289
        lblExtension.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(FileAssociationsPanel.class, "FileAssociationsPanel.lblExtension.AN")); // NOI18N
Lines 354-359 Link Here
354
    txtPattern.setText(IgnoredFilesPreferences.DEFAULT_IGNORED_FILES);
386
    txtPattern.setText(IgnoredFilesPreferences.DEFAULT_IGNORED_FILES);
355
}//GEN-LAST:event_btnDefaultIgnoredActionPerformed
387
}//GEN-LAST:event_btnDefaultIgnoredActionPerformed
356
388
389
private void autoScanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autoScanActionPerformed
390
    controller.changed();
391
}//GEN-LAST:event_autoScanActionPerformed
392
357
    void load() {
393
    void load() {
358
        cbExtension.removeAllItems();
394
        cbExtension.removeAllItems();
359
        cbType.removeAllItems();
395
        cbType.removeAllItems();
Lines 378-383 Link Here
378
        txtPattern.setText(IgnoredFilesPreferences.getIgnoredFiles());
414
        txtPattern.setText(IgnoredFilesPreferences.getIgnoredFiles());
379
        txtPattern.getDocument().addDocumentListener(patternListener);
415
        txtPattern.getDocument().addDocumentListener(patternListener);
380
        btnDefaultIgnored.setEnabled(!IgnoredFilesPreferences.DEFAULT_IGNORED_FILES.equals(txtPattern.getText()));
416
        btnDefaultIgnored.setEnabled(!IgnoredFilesPreferences.DEFAULT_IGNORED_FILES.equals(txtPattern.getText()));
417
418
        boolean manual = NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction").getBoolean("manual", false); // NOI18N
419
        autoScan.setSelected(!manual);
381
    }
420
    }
382
    
421
    
383
    void store() {
422
    void store() {
Lines 385-390 Link Here
385
        model.store();
424
        model.store();
386
        // store ignored files pattern
425
        // store ignored files pattern
387
        IgnoredFilesPreferences.setIgnoredFiles(txtPattern.getText());
426
        IgnoredFilesPreferences.setIgnoredFiles(txtPattern.getText());
427
428
        final Preferences nd = NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction"); // NOI18N
429
        boolean manual = nd.getBoolean("manual", false);
430
        if (manual == autoScan.isSelected()) {
431
            nd.putBoolean("manual", !manual);  // NOI18N
432
        }
388
    }
433
    }
389
434
390
    boolean valid() {
435
    boolean valid() {
Lines 394-399 Link Here
394
    }
439
    }
395
440
396
    // Variables declaration - do not modify//GEN-BEGIN:variables
441
    // Variables declaration - do not modify//GEN-BEGIN:variables
442
    private javax.swing.JCheckBox autoScan;
443
    private javax.swing.JLabel autoScanLabel;
397
    private javax.swing.JButton btnDefault;
444
    private javax.swing.JButton btnDefault;
398
    private javax.swing.JButton btnDefaultIgnored;
445
    private javax.swing.JButton btnDefaultIgnored;
399
    private javax.swing.JButton btnNew;
446
    private javax.swing.JButton btnNew;
(-)a/core.ui/src/org/netbeans/core/ui/warmup/Bundle.properties (-5 / +8 lines)
Lines 44-55 Link Here
44
LOG_WINDOW_ACTIVATED=Main Window Activated, refresh took {0} ms
44
LOG_WINDOW_ACTIVATED=Main Window Activated, refresh took {0} ms
45
LOG_WINDOW_DEACTIVATED=Main Window Deactivated
45
LOG_WINDOW_DEACTIVATED=Main Window Deactivated
46
LOG_WINDOW_REFRESH_CANCEL=Refresh canceled for {0} time
46
LOG_WINDOW_REFRESH_CANCEL=Refresh canceled for {0} time
47
LOG_WINDOW_REFRESH_OFF=Turning off refresh on focus gained
47
48
48
MSG_Refresh=Checking for external changes
49
MSG_Refresh=Checking for external changes
49
MSG_Refresh_Suspend=Suspended
50
MSG_Refresh_Suspend=Suspended
50
MSG_SoDInfo=<html>You seem to have troubles with long refreshes.\n \
51
MSG_SoDInfo=When you switch from another program to the IDE, the IDE scans for \
51
There exist an experimental module <b>Scan On Demand</b> which\n \
52
changes to your code.\n\
52
disables automatic refreshes all together and replaces them\n \
53
You can disable this feature and \
53
with manual <em>File/Refresh All</em> action.\n \
54
manually scan your project when you make changes\n\
54
Do you want to download the module now?
55
using the Refresh Folder action or Source/Scan for External Changes action.\
56
\n\n\
57
Disable scanning for external changes?
55
58
(-)a/core.ui/src/org/netbeans/core/ui/warmup/MenuWarmUpTask.java (-24 / +34 lines)
Lines 54-60 Link Here
54
import java.util.logging.Level;
54
import java.util.logging.Level;
55
import java.util.logging.LogRecord;
55
import java.util.logging.LogRecord;
56
import java.util.logging.Logger;
56
import java.util.logging.Logger;
57
import javax.swing.Action;
58
import javax.swing.JEditorPane;
57
import javax.swing.JEditorPane;
59
import javax.swing.JFrame;
58
import javax.swing.JFrame;
60
import javax.swing.JLabel;
59
import javax.swing.JLabel;
Lines 73-78 Link Here
73
import org.openide.util.Cancellable;
72
import org.openide.util.Cancellable;
74
import org.openide.util.Exceptions;
73
import org.openide.util.Exceptions;
75
import org.openide.util.NbBundle;
74
import org.openide.util.NbBundle;
75
import org.openide.util.NbPreferences;
76
import org.openide.util.Utilities;
76
import org.openide.util.Utilities;
77
77
78
/**
78
/**
Lines 141-146 Link Here
141
        private AtomicBoolean goOn;
141
        private AtomicBoolean goOn;
142
        private static final Logger UILOG = Logger.getLogger("org.netbeans.ui.focus"); // NOI18N
142
        private static final Logger UILOG = Logger.getLogger("org.netbeans.ui.focus"); // NOI18N
143
        private static final Logger LOG = Logger.getLogger("org.netbeans.core.ui.focus"); // NOI18N
143
        private static final Logger LOG = Logger.getLogger("org.netbeans.core.ui.focus"); // NOI18N
144
        private boolean warnedNoRefresh;
144
145
145
        @Override
146
        @Override
146
        public void windowActivated(WindowEvent e) {
147
        public void windowActivated(WindowEvent e) {
Lines 178-186 Link Here
178
            }
179
            }
179
        }
180
        }
180
181
182
        private static boolean isNoRefresh() {
183
            if (Boolean.getBoolean("netbeans.indexing.noFileRefresh")) {
184
                return true;
185
            }
186
            return NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction").getBoolean("manual", false); // NOI18N
187
        }
188
181
        @Override
189
        @Override
182
        public void run() {
190
        public void run() {
183
            if (Boolean.getBoolean("netbeans.indexing.noFileRefresh") == true) { // NOI18N
191
            if (isNoRefresh()) {
192
                if (!warnedNoRefresh) {
193
                    LOG.info("External Changes Refresh on focus gain disabled"); // NOI18N
194
                    warnedNoRefresh = true;
195
                }
184
                LOG.fine("Refresh disabled, aborting");
196
                LOG.fine("Refresh disabled, aborting");
185
                return; // no file refresh
197
                return; // no file refresh
186
            }
198
            }
Lines 307-335 Link Here
307
319
308
            ++counter;
320
            ++counter;
309
321
310
            LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N
322
            {
311
            r.setParameters(new Object[]{counter});
323
                LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N
312
            r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
324
                r.setParameters(new Object[]{counter});
313
            r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
325
                r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
314
            r.setLoggerName(UILOG.getName());
326
                r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
315
            UILOG.log(r);
327
                r.setLoggerName(UILOG.getName());
328
                UILOG.log(r);
329
            }
316
330
317
            if (counter >= 3) {
331
            if (counter >= 1) {
318
                FileObject action = FileUtil.getConfigFile("Actions/System/org-netbeans-modules-autoupdate-ui-actions-PluginManagerAction.instance"); // NOI18N
332
                Message nd = new Message(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo"));
319
                Object obj = action == null ? null : action.getAttribute("instanceCreate"); // NOI18N
333
                nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION });
320
                if (obj instanceof Action) {
334
                if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) {
321
                    JEditorPane browser = new JEditorPane();
335
                    NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction").putBoolean("manual", true); // NOI18N
322
                    browser.setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 8, 0, 8));
336
                    
323
                    browser.setPreferredSize(new Dimension(300, 150));
337
                    LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_OFF"); // NOI18N
324
                    browser.setEditable(false);
338
                    r.setParameters(new Object[]{counter});
325
                    browser.setEditorKit(new HTMLEditorKit()); // needed up to nb5.5
339
                    r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
326
                    browser.setBackground(new JLabel().getBackground());
340
                    r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
327
                    browser.setText(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo"));
341
                    r.setLoggerName(UILOG.getName());
328
                    Message nd = new Message(browser);
342
                    UILOG.log(r);
329
                    nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION });
330
                    if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) {
331
                        ((Action)obj).actionPerformed(new ActionEvent(this, 0, ""));
332
                    }
333
                }
343
                }
334
            }
344
            }
335
            return true;
345
            return true;
(-)a/openide.loaders/arch.xml (-1 / +5 lines)
Lines 1210-1216 Link Here
1210
-->
1210
-->
1211
 <answer id="resources-preferences">
1211
 <answer id="resources-preferences">
1212
  <p>
1212
  <p>
1213
   XXX no answer for resources-preferences
1213
   <api category="devel" group="preferences" name="org.openide.actions.FileSystemRefreshAction.manual" type="export">
1214
       If <code>NbPreferences.root().node("org.openide.actions.FileSystemRefreshAction").getBoolean("manual", false)</a>
1215
       returns true, then <a href="@TOP@/org/openide/actions/FileSystemRefreshAction.html">FileSystemRefreshAction</a>
1216
       is displayed in popup menu of folders.
1217
   </api>
1214
  </p>
1218
  </p>
1215
 </answer>
1219
 </answer>
1216
1220
(-)a/openide.loaders/src/org/openide/actions/FileSystemAction.java (-1 / +7 lines)
Lines 139-150 Link Here
139
                backSet.addAll(backupList);
139
                backSet.addAll(backupList);
140
                result.addAll(Arrays.asList(fs.getActions (backSet)));
140
                result.addAll(Arrays.asList(fs.getActions (backSet)));
141
            }
141
            }
142
            
142
143
            if (isManualRefresh()) {
144
                result.add(FileSystemRefreshAction.get(FileSystemRefreshAction.class));
145
            }
143
            
146
            
144
            return createMenu (Collections.enumeration (result), popUp, createProxyLookup(lookup, backSet)/*lookup*/);
147
            return createMenu (Collections.enumeration (result), popUp, createProxyLookup(lookup, backSet)/*lookup*/);
145
        }
148
        }
146
        return NONE;
149
        return NONE;
147
    }
150
    }
151
    private static boolean isManualRefresh() {
152
        return NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction").getBoolean("manual", false); // NOI18N
153
    }
148
154
149
    private static ProxyLookup createProxyLookup(final Lookup lookup, final Set<FileObject> backSet) {
155
    private static ProxyLookup createProxyLookup(final Lookup lookup, final Set<FileObject> backSet) {
150
        return new ProxyLookup(lookup, Lookups.fixed((Object[])backSet.toArray(new FileObject [backSet.size()])));
156
        return new ProxyLookup(lookup, Lookups.fixed((Object[])backSet.toArray(new FileObject [backSet.size()])));
(-)6c7bff0022c6 (+87 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2010 Sun Microsystems, Inc.
38
 */
39
40
package org.openide.actions;
41
42
import java.io.IOException;
43
import java.util.prefs.Preferences;
44
import javax.swing.Action;
45
import javax.swing.JComponent;
46
import org.netbeans.junit.NbTestCase;
47
import org.openide.awt.DynamicMenuContent;
48
import org.openide.filesystems.FileObject;
49
import org.openide.filesystems.FileUtil;
50
import org.openide.loaders.DataFolder;
51
import org.openide.util.Lookup;
52
import org.openide.util.NbPreferences;
53
import org.openide.util.actions.Presenter;
54
import org.openide.util.lookup.Lookups;
55
56
/**
57
 *
58
 * @author Jaroslav Tulach <jtulach@netbeans.org>
59
 */
60
public class FileSystemActionTest extends NbTestCase {
61
62
    public FileSystemActionTest(String s) {
63
        super(s);
64
    }
65
66
    public void testManualRefreshPreference() throws IOException {
67
        Preferences pref = NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction");
68
        assertFalse("Not set", pref.getBoolean("manual", false));
69
70
        FileObject fo = FileUtil.toFileObject(getWorkDir());
71
        Lookup lkp = Lookups.singleton(DataFolder.findFolder(fo).getNodeDelegate());
72
73
        FileSystemAction fsa = FileSystemAction.get(FileSystemAction.class);
74
        Action a = fsa.createContextAwareInstance(lkp);
75
76
        assertEquals("Menu presenter ", true, a instanceof Presenter.Menu);
77
78
        Presenter.Menu pm = (Presenter.Menu)a;
79
        DynamicMenuContent submenu = (DynamicMenuContent)pm.getMenuPresenter();
80
        assertEquals("No submenu", 0, submenu.getMenuPresenters().length);
81
82
        pref.putBoolean("manual", true);
83
84
        DynamicMenuContent submenu2 = (DynamicMenuContent)pm.getMenuPresenter();
85
        assertEquals("One action", 1, submenu2.getMenuPresenters().length);
86
    }
87
}

Return to bug 184430