diff -r b660de30f8bd core.ui/arch.xml --- a/core.ui/arch.xml Mon Apr 19 11:52:24 2010 +0200 +++ b/core.ui/arch.xml Mon Apr 19 16:03:24 2010 +0200 @@ -580,7 +580,10 @@ -->

- XXX no answer for exec-property + + When set, no check for external file changes is performed on focus gain. Works in + concert with Parsing API. +

diff -r b660de30f8bd core.ui/src/org/netbeans/core/ui/warmup/Bundle.properties --- a/core.ui/src/org/netbeans/core/ui/warmup/Bundle.properties Mon Apr 19 11:52:24 2010 +0200 +++ b/core.ui/src/org/netbeans/core/ui/warmup/Bundle.properties Mon Apr 19 16:03:24 2010 +0200 @@ -44,12 +44,15 @@ LOG_WINDOW_ACTIVATED=Main Window Activated, refresh took {0} ms LOG_WINDOW_DEACTIVATED=Main Window Deactivated LOG_WINDOW_REFRESH_CANCEL=Refresh canceled for {0} time +LOG_WINDOW_REFRESH_OFF=Turning off refresh on focus gained MSG_Refresh=Checking for external changes MSG_Refresh_Suspend=Suspended -MSG_SoDInfo=You seem to have troubles with long refreshes.\n \ -There exist an experimental module Scan On Demand which\n \ -disables automatic refreshes all together and replaces them\n \ -with manual File/Refresh All action.\n \ -Do you want to download the module now? +MSG_SoDInfo=When you switch from another program to the IDE, the IDE scans for \ +changes to your code.\n\ +You can disable this feature and \ +manually scan your project when you make changes\n\ +using the Refresh Folder action or Source/Scan for External Changes action.\ +\n\n\ +Disable scanning for external changes? diff -r b660de30f8bd core.ui/src/org/netbeans/core/ui/warmup/MenuWarmUpTask.java --- a/core.ui/src/org/netbeans/core/ui/warmup/MenuWarmUpTask.java Mon Apr 19 11:52:24 2010 +0200 +++ b/core.ui/src/org/netbeans/core/ui/warmup/MenuWarmUpTask.java Mon Apr 19 16:03:24 2010 +0200 @@ -54,7 +54,6 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; -import javax.swing.Action; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; @@ -141,6 +140,7 @@ private AtomicBoolean goOn; private static final Logger UILOG = Logger.getLogger("org.netbeans.ui.focus"); // NOI18N private static final Logger LOG = Logger.getLogger("org.netbeans.core.ui.focus"); // NOI18N + private boolean warnedNoRefresh; @Override public void windowActivated(WindowEvent e) { @@ -181,6 +181,10 @@ @Override public void run() { if (Boolean.getBoolean("netbeans.indexing.noFileRefresh") == true) { // NOI18N + if (!warnedNoRefresh) { + LOG.info("External Changes Refresh on focus gain disabled"); // NOI18N + warnedNoRefresh = true; + } LOG.fine("Refresh disabled, aborting"); return; // no file refresh } @@ -306,29 +310,27 @@ ++counter; - LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N - r.setParameters(new Object[]{counter}); - r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N - r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N - r.setLoggerName(UILOG.getName()); - UILOG.log(r); + { + LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_CANCEL"); // NOI18N + r.setParameters(new Object[]{counter}); + r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N + r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N + r.setLoggerName(UILOG.getName()); + UILOG.log(r); + } - if (counter >= 3) { - FileObject action = FileUtil.getConfigFile("Actions/System/org-netbeans-modules-autoupdate-ui-actions-PluginManagerAction.instance"); // NOI18N - Object obj = action == null ? null : action.getAttribute("instanceCreate"); // NOI18N - if (obj instanceof Action) { - JEditorPane browser = new JEditorPane(); - browser.setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 8, 0, 8)); - browser.setPreferredSize(new Dimension(300, 150)); - browser.setEditable(false); - browser.setEditorKit(new HTMLEditorKit()); // needed up to nb5.5 - browser.setBackground(new JLabel().getBackground()); - browser.setText(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo")); - Message nd = new Message(browser); - nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION }); - if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) { - ((Action)obj).actionPerformed(new ActionEvent(this, 0, "")); - } + if (counter >= 1) { + Message nd = new Message(NbBundle.getMessage(MenuWarmUpTask.class, "MSG_SoDInfo")); + nd.setOptions(new Object[] { Message.YES_OPTION, Message.NO_OPTION }); + if (DialogDisplayer.getDefault().notify(nd) == Message.YES_OPTION) { + System.setProperty("netbeans.indexing.noFileRefresh", "true"); // NOI18N + + LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_REFRESH_OFF"); // NOI18N + r.setParameters(new Object[]{counter}); + r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N + r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N + r.setLoggerName(UILOG.getName()); + UILOG.log(r); } } return true; diff -r b660de30f8bd parsing.api/arch.xml --- a/parsing.api/arch.xml Mon Apr 19 11:52:24 2010 +0200 +++ b/parsing.api/arch.xml Mon Apr 19 16:03:24 2010 +0200 @@ -744,7 +744,11 @@ -->

- XXX no answer for exec-property + + this property allows core.ui module to disable refresh on focus gain. + If that happens, the Parsing API then shows "Refresh Folder" action + on each folder. +

diff -r b660de30f8bd parsing.api/src/org/netbeans/modules/parsing/impl/indexing/ScanForExternalChanges.java --- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/ScanForExternalChanges.java Mon Apr 19 11:52:24 2010 +0200 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/ScanForExternalChanges.java Mon Apr 19 16:03:24 2010 +0200 @@ -42,6 +42,7 @@ import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import org.netbeans.modules.parsing.api.indexing.IndexingManager; +import org.openide.filesystems.FileUtil; import org.openide.util.NbBundle; /** @@ -54,7 +55,9 @@ super(NbBundle.getMessage(ScanForExternalChanges.class, "ScanForExternalChanges_name")); //NOI18N } + @Override public void actionPerformed(ActionEvent e) { + FileUtil.refreshAll(); RepositoryUpdater.getDefault().refreshAll(false, false, true); } diff -r b660de30f8bd parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/ErrorAnnotator.java --- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/ErrorAnnotator.java Mon Apr 19 11:52:24 2010 +0200 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/ErrorAnnotator.java Mon Apr 19 16:03:24 2010 +0200 @@ -40,6 +40,8 @@ */ package org.netbeans.modules.parsing.impl.indexing.errors; +import org.openide.actions.FileSystemRefreshAction; +import org.openide.util.actions.SystemAction; import org.netbeans.api.java.classpath.ClassPath; import java.awt.Image; import java.io.File; @@ -173,7 +175,11 @@ return null; } + @Override public Action[] actions(Set files) { + if (Boolean.getBoolean("netbeans.indexing.noFileRefresh")) { // NOI18N + return new Action[]{SystemAction.get(FileSystemRefreshAction.class)}; + } return null; } diff -r b660de30f8bd parsing.api/src/org/netbeans/modules/parsing/impl/layer.xml --- a/parsing.api/src/org/netbeans/modules/parsing/impl/layer.xml Mon Apr 19 11:52:24 2010 +0200 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/layer.xml Mon Apr 19 16:03:24 2010 +0200 @@ -40,11 +40,16 @@ Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder. --> - + - + + + + + +