Lines 47-52
Link Here
|
47 |
import java.util.Collection; |
47 |
import java.util.Collection; |
48 |
import java.util.concurrent.Callable; |
48 |
import java.util.concurrent.Callable; |
49 |
import javax.swing.SwingUtilities; |
49 |
import javax.swing.SwingUtilities; |
|
|
50 |
import org.netbeans.api.annotations.common.NonNull; |
51 |
import org.netbeans.api.annotations.common.NullAllowed; |
50 |
import org.netbeans.modules.parsing.impl.Utilities; |
52 |
import org.netbeans.modules.parsing.impl.Utilities; |
51 |
import org.netbeans.modules.parsing.impl.event.EventSupport; |
53 |
import org.netbeans.modules.parsing.impl.event.EventSupport; |
52 |
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater; |
54 |
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater; |
Lines 101-107
Link Here
|
101 |
* be reindexed. |
103 |
* be reindexed. |
102 |
*/ |
104 |
*/ |
103 |
public void refreshIndex(URL root, Collection<? extends URL> files) { |
105 |
public void refreshIndex(URL root, Collection<? extends URL> files) { |
104 |
refreshIndex(root, files, true); |
106 |
refreshIndex(root, files, true, false); |
105 |
} |
107 |
} |
106 |
|
108 |
|
107 |
/** |
109 |
/** |
Lines 131-137
Link Here
|
131 |
* @since 1.16 |
133 |
* @since 1.16 |
132 |
*/ |
134 |
*/ |
133 |
public void refreshIndex(URL root, Collection<? extends URL> files, boolean fullRescan) { |
135 |
public void refreshIndex(URL root, Collection<? extends URL> files, boolean fullRescan) { |
134 |
RepositoryUpdater.getDefault().addIndexingJob(root, files, false, false, false, fullRescan, true); |
136 |
refreshIndex(root, files, fullRescan, false); |
|
|
137 |
} |
138 |
|
139 |
/** |
140 |
* Schedules new files for indexing. The set of files passed to this method |
141 |
* will be scheduled for reindexing. That means that all the indexers appropriate |
142 |
* for each file will have a chance to update their index. |
143 |
* |
144 |
* <p>If <code>forceRefresh</code> parameter is set to <code>true</code> |
145 |
* no timestamp checks will be done for the files passed to this method. |
146 |
* This means that even files that have not been changed since their last indexing |
147 |
* will be reindexed again. On the other hand if <code>forceRefresh</code> is |
148 |
* <code>false</code> the infrastructure will check timestamps and will reindex |
149 |
* only files that have been changed since the last time they were indexed. |
150 |
* |
151 |
* <p>IMPORTANT: Please use this with extreme caution. Indexing is generally |
152 |
* very expensive operation and the more files you ask to reindex the longer the |
153 |
* job will take. |
154 |
* |
155 |
* <p> If <code>checkEditor</code> is true the indexers will use unsaved content |
156 |
* of editor documents. Scan is using the file content rather than editor content, |
157 |
* the editor content is needed only in special cases like error badge recovery. |
158 |
* Simpler version {@link IndexingManager#refreshIndex(java.net.URL, java.util.Collection, boolean)} |
159 |
* should be preferred. |
160 |
* |
161 |
* @param root The common parent folder of the files that should be reindexed. |
162 |
* @param filesOrFolders The files to reindex. Can be <code>null</code> or an empty |
163 |
* collection in which case <b>all</b> files under the <code>root</code> will |
164 |
* be reindexed. |
165 |
* @param fullRescan If <code>true</code> no timestamps check will be done |
166 |
* on the <code>files</code> passed in and they all will be reindexed. If |
167 |
* <code>false</code> only changed files will be reindexed. |
168 |
* @param checkEditor when true the indexers will use content of modified editor |
169 |
* documents rather than saved files. For scans the indexers should prefer |
170 |
* content of files. the document content may be useful for example for error badge |
171 |
* recovery. |
172 |
* |
173 |
* @since 1.37 |
174 |
*/ |
175 |
public void refreshIndex(@NonNull URL root, @NullAllowed Collection<? extends URL> files, boolean fullRescan, boolean checkEditor) { |
176 |
RepositoryUpdater.getDefault().addIndexingJob(root, files, false, checkEditor, false, fullRescan, true); |
135 |
} |
177 |
} |
136 |
|
178 |
|
137 |
/** |
179 |
/** |