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 / +4 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>
584
  </p>
587
  </p>
585
 </answer>
588
 </answer>
586
589
(-)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 (-23 / +25 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 141-146 Link Here
141
        private AtomicBoolean goOn;
140
        private AtomicBoolean goOn;
142
        private static final Logger UILOG = Logger.getLogger("org.netbeans.ui.focus"); // NOI18N
141
        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
142
        private static final Logger LOG = Logger.getLogger("org.netbeans.core.ui.focus"); // NOI18N
143
        private boolean warnedNoRefresh;
144
144
145
        @Override
145
        @Override
146
        public void windowActivated(WindowEvent e) {
146
        public void windowActivated(WindowEvent e) {
Lines 181-186 Link Here
181
        @Override
181
        @Override
182
        public void run() {
182
        public void run() {
183
            if (Boolean.getBoolean("netbeans.indexing.noFileRefresh") == true) { // NOI18N
183
            if (Boolean.getBoolean("netbeans.indexing.noFileRefresh") == true) { // NOI18N
184
                if (!warnedNoRefresh) {
185
                    LOG.info("External Changes Refresh on focus gain disabled"); // NOI18N
186
                    warnedNoRefresh = true;
187
                }
184
                LOG.fine("Refresh disabled, aborting");
188
                LOG.fine("Refresh disabled, aborting");
185
                return; // no file refresh
189
                return; // no file refresh
186
            }
190
            }
Lines 306-334 Link Here
306
310
307
            ++counter;
311
            ++counter;
308
312
309
            LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N
313
            {
310
            r.setParameters(new Object[]{counter});
314
                LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N
311
            r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
315
                r.setParameters(new Object[]{counter});
312
            r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
316
                r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
313
            r.setLoggerName(UILOG.getName());
317
                r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
314
            UILOG.log(r);
318
                r.setLoggerName(UILOG.getName());
319
                UILOG.log(r);
320
            }
315
321
316
            if (counter >= 3) {
322
            if (counter >= 1) {
317
                FileObject action = FileUtil.getConfigFile("Actions/System/org-netbeans-modules-autoupdate-ui-actions-PluginManagerAction.instance"); // NOI18N
323
                Message nd = new Message(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo"));
318
                Object obj = action == null ? null : action.getAttribute("instanceCreate"); // NOI18N
324
                nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION });
319
                if (obj instanceof Action) {
325
                if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) {
320
                    JEditorPane browser = new JEditorPane();
326
                    System.setProperty("netbeans.indexing.noFileRefresh", "true"); // NOI18N
321
                    browser.setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 8, 0, 8));
327
                    
322
                    browser.setPreferredSize(new Dimension(300, 150));
328
                    LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_OFF"); // NOI18N
323
                    browser.setEditable(false);
329
                    r.setParameters(new Object[]{counter});
324
                    browser.setEditorKit(new HTMLEditorKit()); // needed up to nb5.5
330
                    r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
325
                    browser.setBackground(new JLabel().getBackground());
331
                    r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
326
                    browser.setText(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo"));
332
                    r.setLoggerName(UILOG.getName());
327
                    Message nd = new Message(browser);
333
                    UILOG.log(r);
328
                    nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION });
329
                    if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) {
330
                        ((Action)obj).actionPerformed(new ActionEvent(this, 0, ""));
331
                    }
332
                }
334
                }
333
            }
335
            }
334
            return true;
336
            return true;
(-)a/parsing.api/arch.xml (-1 / +5 lines)
Lines 744-750 Link Here
744
-->
744
-->
745
 <answer id="exec-property">
745
 <answer id="exec-property">
746
  <p>
746
  <p>
747
   XXX no answer for exec-property
747
      <api name="netbeans.indexing.noFileRefresh" group="systemproperty" type="export" category="devel">
748
        this property allows core.ui module to disable refresh on focus gain.
749
        If that happens, the Parsing API then shows "Refresh Folder" action
750
        on each folder.
751
      </api>
748
  </p>
752
  </p>
749
 </answer>
753
 </answer>
750
754
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/ScanForExternalChanges.java (+3 lines)
Lines 42-47 Link Here
42
import java.awt.event.ActionEvent;
42
import java.awt.event.ActionEvent;
43
import javax.swing.AbstractAction;
43
import javax.swing.AbstractAction;
44
import org.netbeans.modules.parsing.api.indexing.IndexingManager;
44
import org.netbeans.modules.parsing.api.indexing.IndexingManager;
45
import org.openide.filesystems.FileUtil;
45
import org.openide.util.NbBundle;
46
import org.openide.util.NbBundle;
46
47
47
/**
48
/**
Lines 54-60 Link Here
54
        super(NbBundle.getMessage(ScanForExternalChanges.class, "ScanForExternalChanges_name")); //NOI18N
55
        super(NbBundle.getMessage(ScanForExternalChanges.class, "ScanForExternalChanges_name")); //NOI18N
55
    }
56
    }
56
57
58
    @Override
57
    public void actionPerformed(ActionEvent e) {
59
    public void actionPerformed(ActionEvent e) {
60
        FileUtil.refreshAll();
58
        RepositoryUpdater.getDefault().refreshAll(false, false, true);
61
        RepositoryUpdater.getDefault().refreshAll(false, false, true);
59
    }
62
    }
60
63
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/ErrorAnnotator.java (+6 lines)
Lines 40-45 Link Here
40
 */
40
 */
41
package org.netbeans.modules.parsing.impl.indexing.errors;
41
package org.netbeans.modules.parsing.impl.indexing.errors;
42
42
43
import org.openide.actions.FileSystemRefreshAction;
44
import org.openide.util.actions.SystemAction;
43
import org.netbeans.api.java.classpath.ClassPath;
45
import org.netbeans.api.java.classpath.ClassPath;
44
import java.awt.Image;
46
import java.awt.Image;
45
import java.io.File;
47
import java.io.File;
Lines 173-179 Link Here
173
        return null;
175
        return null;
174
    }
176
    }
175
177
178
    @Override
176
    public Action[] actions(Set files) {
179
    public Action[] actions(Set files) {
180
        if (Boolean.getBoolean("netbeans.indexing.noFileRefresh")) { // NOI18N
181
            return new Action[]{SystemAction.get(FileSystemRefreshAction.class)};
182
        }
177
        return null;
183
        return null;
178
    }
184
    }
179
185
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/layer.xml (-2 / +7 lines)
Lines 40-50 Link Here
40
Version 2 license, then the option applies only if the new code is
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
41
made subject to such option by the copyright holder.
42
-->
42
-->
43
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.0//EN" "http://www.netbeans.org/dtds/filesystem-1_0.dtd">
43
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
44
<filesystem>
44
<filesystem>
45
    <folder name="Actions">
45
    <folder name="Actions">
46
        <folder name="Source">
46
        <folder name="Source">
47
            <file name="org-netbeans-modules-parsing-impl-indexing-ScanForExternalChanges.instance"/>
47
            <file name="org-netbeans-modules-parsing-impl-indexing-ScanForExternalChanges.instance">
48
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
49
                <attr name="delegate" newvalue="org.netbeans.modules.parsing.impl.indexing.ScanForExternalChanges"/>
50
                <attr name="displayName" bundlevalue="org.netbeans.modules.parsing.impl.indexing.Bundle#ScanForExternalChanges_name"/>
51
                <attr name="asynchronous" boolvalue="true"/>
52
            </file>
48
        </folder>
53
        </folder>
49
    </folder>
54
    </folder>
50
    <folder name="Menu">
55
    <folder name="Menu">

Return to bug 184430