Codebase list eclipse-platform-text / cfaa390
New upstream version 4.26 Emmanuel Bourg 1 year, 4 months ago
51 changed file(s) with 416 addition(s) and 539 deletion(s). Raw diff Collapse all Expand all
0 version: 2
1 updates:
2 - package-ecosystem: github-actions
3 directory: "/"
4 schedule:
5 interval: daily
66 core.*
77 Snap.*
88 # maven
9 >>>>>>> 2411f5e... Bug 548210 - Only send textDocument/didSave if the supports it
109 target/
11 /*/target/
1210 .DS_Store
11 .polyglot.*
12 pom.tycho
33 <extension>
44 <groupId>org.eclipse.tycho</groupId>
55 <artifactId>tycho-build</artifactId>
6 <version>2.7.2</version>
6 <version>3.0.0</version>
77 </extension>
88 </extensions>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.core.filebuffers.tests;singleton:=true
4 Bundle-Version: 3.12.200.qualifier
4 Bundle-Version: 3.12.300.qualifier
55 Bundle-Activator: org.eclipse.core.filebuffers.tests.FileBuffersTestPlugin
66 Bundle-ActivationPolicy: lazy
77 Bundle-Vendor: %Plugin.providerName
2222 src.includes = about.html
2323
2424 source.. = src/
25
26 # Maven/Tycho pom model adjustments
27 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
28 pom.model.property.testClass = org.eclipse.core.filebuffers.tests.FileBuffersTestSuite
+0
-27
org.eclipse.core.filebuffers.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.core.filebuffers.tests</artifactId>
20 <version>3.12.200-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testSuite>${project.artifactId}</testSuite>
24 <testClass>org.eclipse.core.filebuffers.tests.FileBuffersTestSuite</testClass>
25 </properties>
26 </project>
00 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
11 <component id="org.eclipse.jface.text" version="2">
2 <resource path="src/org/eclipse/jface/text/TextViewer.java" type="org.eclipse.jface.text.TextViewer">
3 <filter id="572522506">
2 <resource path="META-INF/MANIFEST.MF">
3 <filter comment="See https://github.com/eclipse-pde/eclipse.pde/issues/411 , applied to addition of IExitPolicy.doExit(...) addition" id="926941240">
44 <message_arguments>
5 <message_argument value="ChildDocumentManager"/>
6 <message_argument value="TextViewer"/>
5 <message_argument value="3.22.0"/>
6 <message_argument value="3.21.0"/>
77 </message_arguments>
88 </filter>
99 </resource>
10 <resource path="src/org/eclipse/jface/text/templates/persistence/TemplatePersistenceData.java" type="org.eclipse.jface.text.templates.persistence.TemplatePersistenceData">
11 <filter comment="Extended to prevent API breakage" id="571473929">
10 <resource path="src/org/eclipse/jface/text/link/LinkedModeUI.java" type="org.eclipse.jface.text.link.LinkedModeUI$IExitPolicy">
11 <filter comment="A new default IExitPolicy.doExit(LinkedModeModel model, DocumentEvent event) method is added. Despite the fact that the interface is implementable by Clients and https://wiki.eclipse.org/Evolving_Java-based_APIs_2#Evolving_API_Interfaces say that such a change may 'break compatibility', we don't know any such client that may implement such a method at present, so we believe this change will NOT add any compatibility break." id="404000815">
1212 <message_arguments>
13 <message_argument value="TemplatePersistenceData"/>
14 <message_argument value="TemplatePersistenceData"/>
15 </message_arguments>
16 </filter>
17 </resource>
18 <resource path="src/org/eclipse/jface/text/templates/persistence/TemplateReaderWriter.java" type="org.eclipse.jface.text.templates.persistence.TemplateReaderWriter">
19 <filter comment="Extended to prevent API breakage" id="571473929">
20 <message_arguments>
21 <message_argument value="TemplateReaderWriter"/>
22 <message_argument value="TemplateReaderWriter"/>
13 <message_argument value="org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy"/>
14 <message_argument value="doExit(LinkedModeModel, DocumentEvent)"/>
2315 </message_arguments>
2416 </filter>
2517 </resource>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.jface.text
4 Bundle-Version: 3.21.0.qualifier
4 Bundle-Version: 3.22.0.qualifier
55 Bundle-Vendor: %providerName
66 Bundle-Localization: plugin
77 Export-Package:
8787 * label and <code>false</code> otherwise.
8888 */
8989 private boolean hasAtLeastOneResolvedMiningNotEmpty() {
90 if (fMinings.stream().anyMatch(m -> m.getLabel() != null)) {
91 return true; // will have a resolved mining.
92 }
93
9094 if (fResolvedMinings == null || fResolvedMinings.length == 0) {
9195 return false;
9296 }
4343 @Override
4444 public void uninstall() {
4545 ITextViewer viewer= getTextViewer();
46 if (viewer != null && viewer.getTextWidget().getData(KEY) == this) {
46 if (viewer != null && viewer.getTextWidget() != null && viewer.getTextWidget().getData(KEY) == this) {
4747 super.uninstall();
4848 viewer.getTextWidget().setData(KEY, null);
4949 }
50 viewer= null;
5051 }
5152
5253
00 /*******************************************************************************
1 * Copyright (c) 2000, 2018 IBM Corporation and others.
1 * Copyright (c) 2000, 2022 IBM Corporation and others.
22 *
33 * This program and the accompanying materials
44 * are made available under the terms of the Eclipse Public License 2.0
3030 import org.eclipse.swt.widgets.Shell;
3131
3232 import org.eclipse.core.runtime.Assert;
33
34 import org.eclipse.text.undo.DocumentUndoEvent;
35 import org.eclipse.text.undo.DocumentUndoManagerRegistry;
36 import org.eclipse.text.undo.IDocumentUndoListener;
37 import org.eclipse.text.undo.IDocumentUndoManager;
3338
3439 import org.eclipse.jface.internal.text.link.contentassist.ContentAssistant2;
3540 import org.eclipse.jface.internal.text.link.contentassist.IProposalListener;
276281 * should be taken
277282 */
278283 ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length);
284
285 /**
286 * Checks whether the linked mode should be left after receiving the given
287 * <code>DocumentEvent</code>, especially allowing to control Copy-Paste operations.
288 *
289 * @param model the linked mode model
290 * @param event the document event
291 * @return valid exit flags or <code>null</code> if no special action should be taken
292 * @since 3.22
293 */
294 default ExitFlags doExit(LinkedModeModel model, DocumentEvent event) {
295 return null;
296 }
279297 }
280298
281299 /**
291309 /**
292310 * Listens for shell events and acts upon them.
293311 */
294 private class Closer implements ShellListener, ITextInputListener {
312 private class Closer implements ShellListener, ITextInputListener, IDocumentUndoListener {
295313
296314 @Override
297315 public void shellActivated(ShellEvent e) {
368386 public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
369387 }
370388
389 @Override
390 public void documentUndoNotification(DocumentUndoEvent event) {
391 int type= event.getEventType();
392 if ((type & DocumentUndoEvent.ABOUT_TO_UNDO) != 0 || (type & DocumentUndoEvent.ABOUT_TO_REDO) != 0) {
393 // default behavior: any document change outside a linked position
394 // causes us to exit
395 String textRemoved= event.getPreservedText();
396 int end= event.getOffset() + (textRemoved != null ? textRemoved.length() : 0);
397 for (int offset= event.getOffset(); offset <= end; offset++) {
398 if (!fModel.anyPositionContains(offset)) {
399 ITextViewer viewer= fCurrentTarget.getViewer();
400 if (fFramePosition != null && viewer instanceof IEditingSupportRegistry) {
401 IEditingSupport[] helpers= ((IEditingSupportRegistry) viewer).getRegisteredSupports();
402 for (IEditingSupport helper : helpers) {
403 if (helper.isOriginator(null, new Region(fFramePosition.getOffset(), fFramePosition.getLength())))
404 return;
405 }
406 }
407
408 leave(ILinkedModeListener.EXTERNAL_MODIFICATION);
409 return;
410 }
411 }
412
413 // Make sure that any document compound change is done committed
414 endCompoundChangeIfNeeded();
415 }
416 }
371417 }
372418
373419 /**
392438 }
393439
394440 leave(ILinkedModeListener.EXTERNAL_MODIFICATION);
441 return;
442 }
443 }
444
445 // Apply ExitPolicy to any inserted text if the insertion is made inside a linked region
446 if (fExitPolicy != null) {
447 ExitFlags flags= fExitPolicy.doExit(fModel, event);
448 if (flags != null) {
449 leave(flags.flags);
395450 return;
396451 }
397452 }
9541009 viewer.addTextInputListener(fCloser);
9551010
9561011 viewer.getDocument().addDocumentListener(fDocumentListener);
1012
1013 IDocumentUndoManager undoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(viewer.getDocument());
1014 if (undoManager != null) {
1015 undoManager.addDocumentUndoListener(fCloser);
1016 }
9571017 }
9581018
9591019 /**
10961156
10971157 ((IPostSelectionProvider) viewer).removePostSelectionChangedListener(fSelectionListener);
10981158
1159 IDocumentUndoManager undoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(viewer.getDocument());
1160 if (undoManager != null) {
1161 undoManager.removeDocumentUndoListener(fCloser);
1162 }
1163
10991164 redraw();
11001165 }
11011166
11 output.. = bin/
22 bin.includes = META-INF/,\
33 .
4
5 # Maven/Tycho pom model adjustments
6 # bundle not in baseline
7 pom.model.property.skipAPIAnalysis = true
+0
-28
org.eclipse.jface.text.examples/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2014 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>eclipse.platform.text</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 </parent>
18 <groupId>org.eclipse.core</groupId>
19 <artifactId>org.eclipse.jface.text.examples</artifactId>
20 <version>1.1.0-SNAPSHOT</version>
21 <packaging>eclipse-plugin</packaging>
22
23 <properties>
24 <skipAPIAnalysis>true</skipAPIAnalysis> <!-- bundle not in baseline -->
25 </properties>
26
27 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.jface.text.tests
4 Bundle-Version: 3.12.500.qualifier
4 Bundle-Version: 3.12.600.qualifier
55 Bundle-Vendor: %Plugin.providerName
66 Bundle-Localization: plugin
77 Export-Package:
2020 src.includes = about.html
2121
2222 source.. = src/
23
24 # Maven/Tycho pom model adjustments
25 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
26 pom.model.property.testClass = org.eclipse.jface.text.tests.JFaceTextTestSuite
27 pom.model.property.tycho.surefire.useUIHarness = true
28 pom.model.property.tycho.surefire.useUIThread = true
+0
-41
org.eclipse.jface.text.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <groupId>org.eclipse.jface</groupId>
20 <artifactId>org.eclipse.jface.text.tests</artifactId>
21 <version>3.12.500-SNAPSHOT</version>
22 <packaging>eclipse-test-plugin</packaging>
23 <properties>
24 <testClass>org.eclipse.jface.text.tests.JFaceTextTestSuite</testClass>
25 </properties>
26 <build>
27 <plugins>
28 <plugin>
29 <groupId>org.eclipse.tycho</groupId>
30 <artifactId>tycho-surefire-plugin</artifactId>
31 <version>${tycho.version}</version>
32 <configuration>
33 <useUIHarness>true</useUIHarness>
34 <useUIThread>true</useUIThread>
35 </configuration>
36 </plugin>
37 </plugins>
38 </build>
39 </project>
40
1919
2020 import java.util.Arrays;
2121 import java.util.Set;
22 import java.util.concurrent.atomic.AtomicBoolean;
2223 import java.util.stream.Collectors;
2324
2425 import org.junit.After;
152153 final Set<Shell> beforeShells= Arrays.stream(display.getShells()).filter(Shell::isVisible).collect(Collectors.toSet());
153154 Event keyEvent= new Event();
154155 Control control= viewer.getTextWidget();
155 display.timerExec(200, new Runnable() {
156 @Override
157 public void run() {
158 control.forceFocus();
159 keyEvent.widget= control;
160 keyEvent.type= SWT.KeyDown;
161 keyEvent.character= 'b';
162 keyEvent.keyCode= 'b';
163 control.getDisplay().post(keyEvent);
164 keyEvent.type= SWT.KeyUp;
165 control.getDisplay().post(keyEvent);
166 DisplayHelper.driveEventQueue(control.getDisplay());
167 if (!document.get().startsWith("bb")) {
168 display.timerExec(200, this);
169 }
170 }
171 });
172 assertTrue("Completion item not shown", new DisplayHelper() {
173 @Override
174 protected boolean condition() {
175 Set<Shell> newShells= Arrays.stream(display.getShells()).filter(Shell::isVisible).collect(Collectors.toSet());
176 newShells.removeAll(beforeShells);
177 if (!newShells.isEmpty()) {
178 Table completionTable= findCompletionSelectionControl(newShells.iterator().next());
179 return Arrays.stream(completionTable.getItems()).map(TableItem::getText).anyMatch(item -> item.contains(BarContentAssistProcessor.PROPOSAL.substring(document.getLength())));
180 }
181 return false;
182 }
183 }.waitForCondition(display, 4000));
156 AtomicBoolean testEnded= new AtomicBoolean();
157 try {
158 display.timerExec(0, new Runnable() {
159 @Override
160 public void run() {
161 if (control.isDisposed() || testEnded.get()) {
162 // https://github.com/eclipse-platform/eclipse.platform.text/issues/75#issuecomment-1263429480
163 return; // do not fail other unit tests
164 }
165 control.getShell().forceActive();
166 if (!control.forceFocus()) {
167 display.timerExec(200, this);
168 System.out.println("no focus");
169 return;
170 }
171 keyEvent.widget= control;
172 keyEvent.type= SWT.KeyDown;
173 keyEvent.character= 'b';
174 keyEvent.keyCode= 'b';
175 control.getDisplay().post(keyEvent);
176 keyEvent.type= SWT.KeyUp;
177 control.getDisplay().post(keyEvent);
178 DisplayHelper.driveEventQueue(control.getDisplay());
179 if (!document.get().startsWith("bb")) {
180 System.out.println("character b not added to control");
181 display.timerExec(200, this);
182 }
183 }
184 });
185 assertTrue("Completion item not shown", new DisplayHelper() {
186 @Override
187 protected boolean condition() {
188 Set<Shell> newShells= Arrays.stream(display.getShells()).filter(Shell::isVisible).collect(Collectors.toSet());
189 newShells.removeAll(beforeShells);
190 if (!newShells.isEmpty()) {
191 Table completionTable= findCompletionSelectionControl(newShells.iterator().next());
192 return Arrays.stream(completionTable.getItems()).map(TableItem::getText).anyMatch(item -> item.contains(BarContentAssistProcessor.PROPOSAL.substring(document.getLength())));
193 }
194 return false;
195 }
196 }.waitForCondition(display, 4000));
197 } finally {
198 testEnded.set(true);
199 }
184200 }
185201
186202 private static Table findCompletionSelectionControl(Widget control) {
2727 } catch (InterruptedException e) {
2828 Thread.currentThread().interrupt();
2929 }
30 throw new RuntimeException();
30 throw new RuntimeException("Expected Exception for junit test");
3131 }
3232
3333 @Override
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.search; singleton:=true
4 Bundle-Version: 3.14.200.qualifier
4 Bundle-Version: 3.14.300.qualifier
55 Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin
66 Bundle-ActivationPolicy: lazy
77 Bundle-Vendor: %providerName
126126 private final String fDescription;
127127 private final IResource[] fRootElements;
128128 private final String[] fFileNamePatterns;
129 private final Matcher fPositiveFileNameMatcher;
130 private final Matcher fNegativeFileNameMatcher;
129 private final ThreadLocal<Matcher> fPositiveFileNameMatcher;
130 private final ThreadLocal<Matcher> fNegativeFileNameMatcher;
131131
132132 private boolean fVisitDerived;
133133 private IWorkingSet[] fWorkingSets;
138138 fFileNamePatterns= fileNamePatterns;
139139 fVisitDerived= visitDerived;
140140 fWorkingSets= workingSets;
141 fPositiveFileNameMatcher= createMatcher(fileNamePatterns, false);
142 fNegativeFileNameMatcher= createMatcher(fileNamePatterns, true);
141 fPositiveFileNameMatcher = ThreadLocal.withInitial(() -> createMatcher(fileNamePatterns, false));
142 fNegativeFileNameMatcher = ThreadLocal.withInitial(() -> createMatcher(fileNamePatterns, true));
143143 }
144144
145145 /**
222222 }
223223
224224 private boolean matchesFileName(String fileName) {
225 if (fPositiveFileNameMatcher != null && !fPositiveFileNameMatcher.reset(fileName).matches()) {
225 Matcher positiveFileNameMatcher = fPositiveFileNameMatcher.get();
226 if (positiveFileNameMatcher != null && !positiveFileNameMatcher.reset(fileName).matches()) {
226227 return false;
227228 }
228 if (fNegativeFileNameMatcher != null && fNegativeFileNameMatcher.reset(fileName).matches()) {
229 Matcher negativeFileNameMatcher = fNegativeFileNameMatcher.get();
230 if (negativeFileNameMatcher != null && negativeFileNameMatcher.reset(fileName).matches()) {
229231 return false;
230232 }
231233 return true;
180180 SubMonitor subMonitor = SubMonitor.convert(inner, fileBatches.size() / jobCount); // approximate
181181 this.fileCharSequenceProvider= new FileCharSequenceProvider();
182182 List<IFile> sameFiles;
183 while (((sameFiles = fileBatches.poll()) != null) && !fFatalError) {
183 while (((sameFiles = fileBatches.poll()) != null) && !fFatalError && !fProgressMonitor.isCanceled()) {
184184 IStatus status = processFile(sameFiles, subMonitor.split(1));
185185 // Only accumulate interesting status
186186 if (!status.isOK())
189189 // Stop processing and return the status for the completed jobs.
190190 }
191191 fileCharSequenceProvider= null;
192 synchronized (fLock) {
193 fLock.notify();
194 }
192195 return multiStatus;
193196 }
194197
290293 private final TextSearchRequestor fCollector;
291294 private final Pattern fSearchPattern;
292295
293 private IProgressMonitor fProgressMonitor;
294
295 private int fNumberOfFilesToScan;
296 private volatile IProgressMonitor fProgressMonitor;
297
296298 private int fNumberOfScannedFiles; // Protected by fLock
297299 private IFile fCurrentFile; // Protected by fLock
298 private Object fLock= new Object();
300 private final Object fLock = new Object();
299301
300302 private final MultiStatus fStatus;
301303 private volatile boolean fFatalError; // If true, terminates the search.
302304
303 private boolean fIsLightweightAutoRefresh;
305 private volatile boolean fIsLightweightAutoRefresh;
304306
305307 public TextSearchVisitor(TextSearchRequestor collector, Pattern searchPattern) {
306308 fCollector= collector;
316318 if (files.length == 0) {
317319 return fStatus;
318320 }
319 fProgressMonitor= monitor == null ? new NullProgressMonitor() : monitor;
320 fNumberOfScannedFiles= 0;
321 fNumberOfFilesToScan= files.length;
322 fCurrentFile= null;
323
321 fProgressMonitor = monitor == null ? new NullProgressMonitor() : monitor;
322 synchronized (fLock) {
323 fNumberOfScannedFiles = 0;
324 fCurrentFile = null;
325 }
324326 int threadsNeeded = Math.min(files.length, NUMBER_OF_LOGICAL_THREADS);
325327 // All but 1 threads should search. 1 thread does the UI updates:
326328 int jobCount = fCollector.canRunInParallel() && threadsNeeded > 1 ? threadsNeeded - 1 : 1;
327
328 // Seed count over 1 can cause endless waits, see bug 543629 comment 2
329 // TODO use seed = jobCount after the bug 543660 in JobGroup is fixed
330 final int seed = 1;
331 final JobGroup jobGroup = new TextSearchJobGroup("Text Search", jobCount, seed); //$NON-NLS-1$
332329 long startTime= TRACING ? System.currentTimeMillis() : 0;
333
334 Job monitorUpdateJob= new Job(SearchMessages.TextSearchVisitor_progress_updating_job) {
335 private int fLastNumberOfScannedFiles= 0;
336
337 @Override
338 public IStatus run(IProgressMonitor inner) {
339 while (!inner.isCanceled()) {
340 // Propagate user cancellation to the JobGroup.
341 if (fProgressMonitor.isCanceled()) {
342 jobGroup.cancel();
343 break;
344 }
345
346 IFile file;
347 int numberOfScannedFiles;
348 synchronized (fLock) {
349 file= fCurrentFile;
350 numberOfScannedFiles= fNumberOfScannedFiles;
351 }
352 if (file != null) {
353 String fileName= file.getName();
354 Object[] args= { fileName, Integer.valueOf(numberOfScannedFiles), Integer.valueOf(fNumberOfFilesToScan)};
355 fProgressMonitor.subTask(Messages.format(SearchMessages.TextSearchVisitor_scanning, args));
356 int steps= numberOfScannedFiles - fLastNumberOfScannedFiles;
357 fProgressMonitor.worked(steps);
358 fLastNumberOfScannedFiles += steps;
359 }
360 try {
361 Thread.sleep(100);
362 } catch (InterruptedException e) {
363 return Status.OK_STATUS;
364 }
365 }
366 return Status.OK_STATUS;
367 }
368 };
369330
370331 try {
371332 String taskName= fSearchPattern.pattern().isEmpty()
372333 ? SearchMessages.TextSearchVisitor_filesearch_task_label
373334 : ""; //$NON-NLS-1$
374 fProgressMonitor.beginTask(taskName, fNumberOfFilesToScan);
375 monitorUpdateJob.setSystem(true);
376 monitorUpdateJob.schedule();
377335 try {
378336 fCollector.beginReporting();
337 if (fProgressMonitor.isCanceled()) {
338 throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
339 }
340
379341 Map<IFile, IDocument> documentsInEditors= PlatformUI.isWorkbenchRunning() ? evalNonFileBufferDocuments() : Collections.emptyMap();
380342
381343 // group files with same content together:
382
383344 Map<String, List<IFile>> localFilesByLocation = new LinkedHashMap<>();
384 Map<String, List<IFile>> remotFilesByLocation = new LinkedHashMap<>();
345 Map<String, List<IFile>> remoteFilesByLocation = new LinkedHashMap<>();
385346
386347 for (IFile file : files) {
387348 IPath path = file.getLocation();
388349 String key = path == null ? file.getLocationURI().toString() : path.toString();
389350 Map<String, List<IFile>> filesByLocation = (path != null) ? localFilesByLocation
390 : remotFilesByLocation;
351 : remoteFilesByLocation;
391352 filesByLocation.computeIfAbsent(key, k -> new ArrayList<>()).add(file);
392353
393354 }
394355 localFilesByLocation.values().forEach(fileBatches::offer);
395 remotFilesByLocation.values().forEach(fileBatches::offer);
396
356 remoteFilesByLocation.values().forEach(fileBatches::offer);
357 int numberOfFilesToScan = fileBatches.size();
358 fProgressMonitor.beginTask(taskName, numberOfFilesToScan);
359
360 // Seed count over 1 can cause endless waits, see bug 543629
361 // comment 2
362 // TODO use seed = jobCount after the bug 543660 in JobGroup is
363 // fixed
364
365 final int seed = 1;
366 final JobGroup jobGroup = new TextSearchJobGroup("Text Search", jobCount, seed); //$NON-NLS-1$
397367 for (int i = 0; i < jobCount; i++) {
398368 Job job = new TextSearchJob(documentsInEditors, jobCount);
399369 job.setJobGroup(jobGroup);
400370 job.schedule();
401371 }
402
403 // The monitorUpdateJob is managing progress and cancellation,
404 // so it is ok to pass a null monitor into the job group.
372 // update progress until finished or canceled:
373 int numberOfScannedFiles = 0;
374 int lastNumberOfScannedFiles = 0;
375 while (!fProgressMonitor.isCanceled() && !jobGroup.getActiveJobs().isEmpty()
376 && numberOfScannedFiles != numberOfFilesToScan) {
377 IFile file;
378 synchronized (fLock) {
379 try {
380 // time only relevant on how often progress is
381 // updated, but cancel is notified immediately:
382 fLock.wait(100);
383 } catch (InterruptedException e) {
384 fProgressMonitor.setCanceled(true);
385 break;
386 }
387 file = fCurrentFile;
388 numberOfScannedFiles = fNumberOfScannedFiles;
389 }
390 if (file != null) {
391 String fileName = file.getName();
392 Object[] args = { fileName, Integer.valueOf(numberOfScannedFiles),
393 Integer.valueOf(numberOfFilesToScan) };
394 fProgressMonitor.subTask(Messages.format(SearchMessages.TextSearchVisitor_scanning, args));
395 int steps = numberOfScannedFiles - lastNumberOfScannedFiles;
396 fProgressMonitor.worked(steps);
397 lastNumberOfScannedFiles += steps;
398 }
399 }
400 if (fProgressMonitor.isCanceled()) {
401 jobGroup.cancel();
402 }
403 // no need to pass progressMonitor (which would show wrong
404 // progress) but null because jobGroup was already finished /
405 // canceled anyway:
405406 jobGroup.join(0, null);
406 if (fProgressMonitor.isCanceled())
407 if (fProgressMonitor.isCanceled()) {
407408 throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
409 }
408410
409411 fStatus.addAll(jobGroup.getResult());
410412 return fStatus;
411413 } catch (InterruptedException e) {
412414 throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
413415 } finally {
414 monitorUpdateJob.cancel();
415416 fileBatches.clear();
416417 }
417418 } finally {
500501 }
501502 }
502503 } catch (IndexOutOfBoundsException e) {
504 // ignored
503505 } catch (FileCharSequenceException ex) {
504506 if (ex.getCause() instanceof CharConversionException)
505507 return true;
133133 public static String TextSearchPage_searchBinary_label;
134134 public static String TextSearchVisitor_filesearch_task_label;
135135 public static String TextSearchVisitor_patterntoocomplex0;
136 public static String TextSearchVisitor_progress_updating_job;
137136 public static String TextSearchVisitor_scanning;
138137 public static String TextSearchVisitor_error;
139138 public static String TextSearchVisitor_canceled;
105105 TextSearchVisitor_canceled= Operation Canceled
106106 TextSearchVisitor_unsupportedcharset=File ''{1}'' has been skipped: Unsupported encoding ''{0}''.
107107 TextSearchVisitor_patterntoocomplex0=Search pattern is too complex. Search canceled.
108 TextSearchVisitor_progress_updating_job=Search progress polling
109108 TextSearchVisitor_filesearch_task_label=Searching for files...
110 TextSearchVisitor_textsearch_task_label=Searching for pattern ''{0}''...
109 TextSearchVisitor_textsearch_task_label=Searching ''{0}''
111110 TextSearchVisitor_illegalcharset=File ''{1}'' has been skipped: Illegal encoding ''{0}''.
112111
113112 SortDropDownAction_label= S&ort By
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.search.tests
4 Bundle-Version: 3.10.100.qualifier
4 Bundle-Version: 3.10.200.qualifier
55 Bundle-Activator: org.eclipse.search.tests.SearchTestPlugin
66 Bundle-Vendor: %providerName
77 Bundle-Localization: plugin
1919 META-INF/,\
2020 about.html,\
2121 test.xml
22
23 # Maven/Tycho pom model adjustments
24 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
25 pom.model.property.testClass = org.eclipse.search.tests.AllSearchTests
26 pom.model.property.tycho.surefire.useUIHarness = true
27 pom.model.property.tycho.surefire.useUIThread = true
+0
-39
org.eclipse.search.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.search.tests</artifactId>
20 <version>3.10.100-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testClass>org.eclipse.search.tests.AllSearchTests</testClass>
24 </properties>
25 <build>
26 <plugins>
27 <plugin>
28 <groupId>org.eclipse.tycho</groupId>
29 <artifactId>tycho-surefire-plugin</artifactId>
30 <version>${tycho.version}</version>
31 <configuration>
32 <useUIHarness>true</useUIHarness>
33 <useUIThread>true</useUIThread>
34 </configuration>
35 </plugin>
36 </plugins>
37 </build>
38 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.text
4 Bundle-Version: 3.12.200.qualifier
4 Bundle-Version: 3.12.300.qualifier
55 Bundle-Vendor: %providerName
66 Bundle-Localization: plugin
77 Export-Package:
1313 package org.eclipse.jface.text;
1414
1515 import java.util.ArrayList;
16 import java.util.Collections;
1617 import java.util.Iterator;
1718 import java.util.List;
1819
7980 return this.offset > -1 && this.length > -1;
8081 }
8182 }
82
83 /**
84 * The active rewrite session.
85 *
86 * @since 3.1
87 */
88 private DocumentRewriteSession fActiveRewriteSession;
89 /**
90 * The list of pending requests.
91 *
92 * @since 3.1
93 */
94 private List<Request> fPendingRequests;
83
84 /**
85 * Holder of the active {@link DocumentRewriteSession} with associated list of {@link Request}
86 * objects.
87 * <p>
88 * On starting new {@link DocumentRewriteSession} or on the end of the active
89 * {@link DocumentRewriteSession} this object is being replaced by another one.
90 * <p>
91 *
92 * @see AbstractLineTracker#startRewriteSession(DocumentRewriteSession)
93 * @see AbstractLineTracker#stopRewriteSession(DocumentRewriteSession, String)
94 */
95 private static class SessionData {
96
97 /**
98 * The active rewrite session. Not final, but can only be changed to null.
99 *
100 * @since 3.1
101 */
102 private volatile DocumentRewriteSession fActiveRewriteSession;
103 /**
104 * The list of pending requests.
105 *
106 * @since 3.1
107 */
108 private List<Request> fPendingRequests;
109
110 /**
111 * @param activeRewriteSession may be null
112 */
113 SessionData(DocumentRewriteSession activeRewriteSession){
114 fActiveRewriteSession = activeRewriteSession;
115 if (activeRewriteSession != null) {
116 fPendingRequests = new ArrayList<>(20);
117 } else {
118 fPendingRequests = Collections.emptyList();
119 }
120 }
121
122 boolean isSessionActive() {
123 return fActiveRewriteSession != null;
124 }
125
126 boolean setIfActive(String text) {
127 if (isSessionActive()) {
128 synchronized (this) {
129 if (!isSessionActive()) {
130 return false;
131 }
132 fPendingRequests.clear();
133 fPendingRequests.add(new Request(text));
134 }
135 return true;
136 } else {
137 return false;
138 }
139 }
140
141 boolean addIfActive(int offset, int length, String text) {
142 if (isSessionActive()) {
143 synchronized (this) {
144 if (!isSessionActive()) {
145 return false;
146 }
147 fPendingRequests.add(new Request(offset, length, text));
148 }
149 return true;
150 } else {
151 return false;
152 }
153 }
154
155 Iterator<Request> flush() {
156 synchronized (this) {
157 fActiveRewriteSession = null;
158 Iterator<Request> requests = fPendingRequests.iterator();
159 fPendingRequests = Collections.emptyList();
160 return requests;
161 }
162 }
163
164 boolean sameSession(DocumentRewriteSession session) {
165 return fActiveRewriteSession == session;
166 }
167
168 @Override
169 public String toString() {
170 StringBuilder builder= new StringBuilder();
171 builder.append("SessionData ["); //$NON-NLS-1$
172 builder.append("activeRewriteSession="); //$NON-NLS-1$
173 builder.append(fActiveRewriteSession);
174 builder.append(", "); //$NON-NLS-1$
175 builder.append("pendingRequests="); //$NON-NLS-1$
176 builder.append(fPendingRequests);
177 builder.append("]"); //$NON-NLS-1$
178 return builder.toString();
179 }
180 }
181
182 private volatile SessionData sessionData;
183 private final Object sessionLock = new Object();
184
95185 /**
96186 * The implementation that this tracker delegates to.
97187 *
98188 * @since 3.2
99189 */
100 private ILineTracker fDelegate= new ListLineTracker() {
190 private volatile ILineTracker fDelegate= new ListLineTracker() {
101191 @Override
102192 public String[] getLegalLineDelimiters() {
103193 return AbstractLineTracker.this.getLegalLineDelimiters();
117207 * Creates a new line tracker.
118208 */
119209 protected AbstractLineTracker() {
210 sessionData = new SessionData(null);
120211 }
121212
122213 @Override
178269
179270 @Override
180271 public void set(String text) {
181 if (hasActiveRewriteSession()) {
182 fPendingRequests.clear();
183 fPendingRequests.add(new Request(text));
272 boolean hasActiveRewriteSession = sessionData.setIfActive(text);
273 if (hasActiveRewriteSession) {
184274 return;
185275 }
186276
189279
190280 @Override
191281 public void replace(int offset, int length, String text) throws BadLocationException {
192 if (hasActiveRewriteSession()) {
193 fPendingRequests.add(new Request(offset, length, text));
282 boolean hasActiveRewriteSession = sessionData.addIfActive(offset, length, text);
283 if (hasActiveRewriteSession) {
194284 return;
195285 }
196286
204294 *
205295 * @since 3.2
206296 */
207 private void checkImplementation() {
297 private synchronized void checkImplementation() {
208298 if (fNeedsConversion) {
209299 fNeedsConversion= false;
210300 fDelegate= new TreeLineTracker((ListLineTracker) fDelegate) {
233323
234324 @Override
235325 public final void startRewriteSession(DocumentRewriteSession session) {
236 if (fActiveRewriteSession != null)
237 throw new IllegalStateException();
238 fActiveRewriteSession= session;
239 fPendingRequests= new ArrayList<>(20);
326 synchronized (sessionLock) {
327 if (sessionData.isSessionActive()){
328 throw new IllegalStateException("Rewrite session is already active: " + sessionData); //$NON-NLS-1$
329 }
330 sessionData = new SessionData(session);
331 }
240332 }
241333
242334 @Override
243335 public final void stopRewriteSession(DocumentRewriteSession session, String text) {
244 if (fActiveRewriteSession == session) {
245 fActiveRewriteSession= null;
246 fPendingRequests= null;
247 set(text);
336 synchronized (sessionLock) {
337 if (sessionData.sameSession(session)) {
338 sessionData = new SessionData(null);
339 set(text);
340 }
248341 }
249342 }
250343
256349 * @since 3.1
257350 */
258351 protected final boolean hasActiveRewriteSession() {
259 return fActiveRewriteSession != null;
352 return sessionData.isSessionActive();
260353 }
261354
262355 /**
267360 */
268361 protected final void flushRewriteSession() throws BadLocationException {
269362 if (DEBUG)
270 System.out.println("AbstractLineTracker: Flushing rewrite session: " + fActiveRewriteSession); //$NON-NLS-1$
271
272 Iterator<Request> e= fPendingRequests.iterator();
273
274 fPendingRequests= null;
275 fActiveRewriteSession= null;
276
277 while (e.hasNext()) {
278 Request request= e.next();
279 if (request.isReplaceRequest())
280 replace(request.offset, request.length, request.text);
281 else
282 set(request.text);
363 System.out.println("AbstractLineTracker: Flushing rewrite session: " + sessionData); //$NON-NLS-1$
364 synchronized (sessionData) {
365 Iterator<Request> e= sessionData.flush();
366 while (e.hasNext()) {
367 Request request= e.next();
368 if (request.isReplaceRequest())
369 replace(request.offset, request.length, request.text);
370 else
371 set(request.text);
372 }
283373 }
284374 }
285375
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.text.quicksearch;singleton:=true
4 Bundle-Version: 1.1.300.qualifier
4 Bundle-Version: 1.1.400.qualifier
55 Bundle-Activator: org.eclipse.text.quicksearch.internal.ui.QuickSearchActivator
66 Require-Bundle: org.eclipse.ui;bundle-version="[3.113.0,4.0.0)",
77 org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)",
3030 import org.eclipse.core.commands.ExecutionEvent;
3131 import org.eclipse.core.commands.IHandler;
3232 import org.eclipse.core.resources.IFile;
33 import org.eclipse.core.runtime.ICoreRunnable;
3334 import org.eclipse.core.runtime.IPath;
3435 import org.eclipse.core.runtime.IProgressMonitor;
3536 import org.eclipse.core.runtime.IStatus;
129130
130131 public static final Styler HIGHLIGHT_STYLE = org.eclipse.search.internal.ui.text.DecoratingFileSearchLabelProvider.HIGHLIGHT_STYLE;
131132
132 private UIJob refreshJob = new UIJob(Messages.QuickSearchDialog_RefreshJob) {
133 @Override
134 public IStatus runInUIThread(IProgressMonitor monitor) {
135 refreshWidgets();
136 return Status.OK_STATUS;
137 }
138 };
133 private UIJob refreshJob = UIJob.create(Messages.QuickSearchDialog_RefreshJob,
134 (ICoreRunnable) m -> refreshWidgets());
139135
140136 protected void openSelection() {
141137 try {
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %pluginName
33 Bundle-SymbolicName: org.eclipse.text.quicksearch.tests
4 Bundle-Version: 1.1.200.qualifier
4 Bundle-Version: 1.1.300.qualifier
55 Require-Bundle: org.eclipse.core.runtime,
66 org.eclipse.text.quicksearch;bundle-version="1.0.300",
77 org.eclipse.core.resources,
1616 about.html,\
1717 .,\
1818 plugin.properties
19
20 # Maven/Tycho pom model adjustments
21 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
22 pom.model.property.testClass = org.eclipse.text.quicksearch.tests.*Test
23 pom.model.property.tycho.surefire.useUIHarness = true
24 pom.model.property.tycho.surefire.useUIThread = true
+0
-45
org.eclipse.text.quicksearch.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2014. 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v2.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v20.php
7
8 SPDX-License-Identifier: EPL-2.0
9
10 Contributors:
11 Igor Fedorenko - initial implementation
12 Pivotal Inc - copy adapted for quicksearch
13 -->
14 <project xmlns="http://maven.apache.org/POM/4.0.0"
15 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
17 <modelVersion>4.0.0</modelVersion>
18 <parent>
19 <artifactId>text-tests-pom</artifactId>
20 <groupId>org.eclipse.platform</groupId>
21 <version>4.25.0-SNAPSHOT</version>
22 <relativePath>../tests-pom/</relativePath>
23 </parent>
24 <artifactId>org.eclipse.text.quicksearch.tests</artifactId>
25 <version>1.1.200-SNAPSHOT</version>
26 <packaging>eclipse-test-plugin</packaging>
27 <properties>
28 <testSuite>${project.artifactId}</testSuite>
29 <testClass>org.eclipse.text.quicksearch.tests.*Test</testClass>
30 </properties>
31
32 <build>
33 <plugins>
34 <plugin>
35 <groupId>org.eclipse.tycho</groupId>
36 <artifactId>tycho-surefire-plugin</artifactId>
37 <configuration>
38 <useUIHarness>true</useUIHarness>
39 <useUIThread>true</useUIThread>
40 </configuration>
41 </plugin>
42 </plugins>
43 </build>
44 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.text.tests
4 Bundle-Version: 3.13.100.qualifier
4 Bundle-Version: 3.13.200.qualifier
55 Bundle-Vendor: %Plugin.providerName
66 Bundle-Localization: plugin
77 Export-Package:
2020
2121 source.. = projection/,\
2222 src/
23
24 # Maven/Tycho pom model adjustments
25 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
26 pom.model.property.testClass = org.eclipse.text.tests.EclipseTextTestSuite
+0
-27
org.eclipse.text.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.text.tests</artifactId>
20 <version>3.13.100-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testSuite>${project.artifactId}</testSuite>
24 <testClass>org.eclipse.text.tests.EclipseTextTestSuite</testClass>
25 </properties>
26 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.ui.editors.tests;singleton:=true
4 Bundle-Version: 3.12.500.qualifier
4 Bundle-Version: 3.12.600.qualifier
55 Bundle-Vendor: %Plugin.providerName
66 Bundle-Localization: plugin
77 Export-Package: org.eclipse.ui.editors.tests
2121 src.includes = about.html
2222
2323 source.. = src/
24
25 # Maven/Tycho pom model adjustments
26 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
27 pom.model.property.testClass = org.eclipse.ui.editors.tests.EditorsTestSuite
28 pom.model.property.tycho.surefire.useUIHarness = true
29 pom.model.property.tycho.surefire.useUIThread = true
+0
-39
org.eclipse.ui.editors.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.ui.editors.tests</artifactId>
20 <version>3.12.500-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testClass>org.eclipse.ui.editors.tests.EditorsTestSuite</testClass>
24 </properties>
25 <build>
26 <plugins>
27 <plugin>
28 <groupId>org.eclipse.tycho</groupId>
29 <artifactId>tycho-surefire-plugin</artifactId>
30 <version>${tycho.version}</version>
31 <configuration>
32 <useUIHarness>true</useUIHarness>
33 <useUIThread>true</useUIThread>
34 </configuration>
35 </plugin>
36 </plugins>
37 </build>
38 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Bundle-Name
33 Bundle-SymbolicName: org.eclipse.ui.genericeditor;singleton:=true
4 Bundle-Version: 1.2.200.qualifier
4 Bundle-Version: 1.2.300.qualifier
55 Bundle-Vendor: %Bundle-Vendor
66 Bundle-RequiredExecutionEnvironment: JavaSE-11
77 Require-Bundle: org.eclipse.ui.workbench.texteditor;bundle-version="3.10.0",
7373 setAutoActivationDelay(0);
7474 enableColoredLabels(true);
7575 enableAutoActivation(true);
76 enableAutoActivateCompletionOnType(true);
7677 setInformationControlCreator(new AbstractReusableInformationControlCreator() {
7778 @Override
7879 protected IInformationControl doCreateInformationControl(Shell parent) {
1818 import org.eclipse.compare.CompareConfiguration;
1919 import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
2020 import org.eclipse.core.runtime.content.IContentType;
21 import org.eclipse.jface.preference.IPreferenceStore;
2122 import org.eclipse.jface.text.IDocument;
2223 import org.eclipse.jface.text.ITextInputListener;
2324 import org.eclipse.jface.text.TextViewer;
2425 import org.eclipse.jface.text.source.ISourceViewer;
2526 import org.eclipse.jface.text.source.SourceViewer;
2627 import org.eclipse.swt.widgets.Composite;
28 import org.eclipse.ui.editors.text.EditorsUI;
2729 import org.eclipse.ui.internal.genericeditor.ExtensionBasedTextViewerConfiguration;
2830 import org.eclipse.ui.internal.genericeditor.GenericEditorPlugin;
31 import org.eclipse.ui.texteditor.ChainedPreferenceStore;
2932
3033 public class GenericEditorMergeViewer extends TextMergeViewer {
3134
5861 protected void configureTextViewer(TextViewer textViewer) {
5962 if (textViewer.getDocument() != null && textViewer instanceof ISourceViewer) {
6063 ExtensionBasedTextViewerConfiguration configuration = new ExtensionBasedTextViewerConfiguration(null,
61 GenericEditorPlugin.getDefault().getPreferenceStore());
64 new ChainedPreferenceStore(new IPreferenceStore[] { EditorsUI.getPreferenceStore(),
65 GenericEditorPlugin.getDefault().getPreferenceStore() }));
6266 configuration.setFallbackContentTypes(fallbackContentTypes);
6367 ((ISourceViewer) textViewer).configure(configuration);
6468 }
11 Bundle-ManifestVersion: 2
22 Bundle-Name: Examples for Generic Editor
33 Bundle-SymbolicName: org.eclipse.ui.genericeditor.examples;singleton:=true
4 Bundle-Version: 1.2.0.qualifier
4 Bundle-Version: 1.2.100.qualifier
55 Bundle-Vendor: Eclipse.org
66 Bundle-RequiredExecutionEnvironment: JavaSE-11
77 Require-Bundle: org.eclipse.ui.genericeditor;bundle-version="1.0.0",
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.ui.genericeditor.tests;singleton:=true
4 Bundle-Version: 1.2.100.qualifier
4 Bundle-Version: 1.2.200.qualifier
55 Bundle-Vendor: %Plugin.providerName
66 Bundle-Localization: plugin
77 Export-Package: org.eclipse.ui.genericeditor.tests,
2222 src.includes = about.html
2323
2424 source.. = src/
25
26 # Maven/Tycho pom model adjustments
27 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
28 pom.model.property.testClass = org.eclipse.ui.genericeditor.tests.GenericEditorTestSuite
29 pom.model.property.tycho.surefire.useUIHarness = true
30 pom.model.property.tycho.surefire.useUIThread = true
+0
-39
org.eclipse.ui.genericeditor.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.ui.genericeditor.tests</artifactId>
20 <version>1.2.100-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testClass>org.eclipse.ui.genericeditor.tests.GenericEditorTestSuite</testClass>
24 </properties>
25 <build>
26 <plugins>
27 <plugin>
28 <groupId>org.eclipse.tycho</groupId>
29 <artifactId>tycho-surefire-plugin</artifactId>
30 <version>${tycho.version}</version>
31 <configuration>
32 <useUIHarness>true</useUIHarness>
33 <useUIThread>true</useUIThread>
34 </configuration>
35 </plugin>
36 </plugins>
37 </build>
38 </project>
11 Bundle-ManifestVersion: 2
22 Bundle-Name: %Plugin.name
33 Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor.tests
4 Bundle-Version: 3.13.100.qualifier
4 Bundle-Version: 3.13.200.qualifier
55 Bundle-Vendor: %Plugin.providerName
66 Bundle-Localization: plugin
77 Export-Package:
2020 src.includes = about.html
2121
2222 source.. = src/
23
24 # Maven/Tycho pom model adjustments
25 pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
26 pom.model.property.testClass = org.eclipse.ui.workbench.texteditor.tests.WorkbenchTextEditorTestSuite
27 pom.model.property.tycho.surefire.useUIHarness = true
28 pom.model.property.tycho.surefire.useUIThread = true
+0
-39
org.eclipse.ui.workbench.texteditor.tests/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2012, 2019 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 Igor Fedorenko - initial implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>text-tests-pom</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 <relativePath>../tests-pom/</relativePath>
18 </parent>
19 <artifactId>org.eclipse.ui.workbench.texteditor.tests</artifactId>
20 <version>3.13.100-SNAPSHOT</version>
21 <packaging>eclipse-test-plugin</packaging>
22 <properties>
23 <testClass>org.eclipse.ui.workbench.texteditor.tests.WorkbenchTextEditorTestSuite</testClass>
24 </properties>
25 <build>
26 <plugins>
27 <plugin>
28 <groupId>org.eclipse.tycho</groupId>
29 <artifactId>tycho-surefire-plugin</artifactId>
30 <version>${tycho.version}</version>
31 <configuration>
32 <useUIHarness>true</useUIHarness>
33 <useUIThread>true</useUIThread>
34 </configuration>
35 </plugin>
36 </plugins>
37 </build>
38 </project>
1414 <parent>
1515 <groupId>org.eclipse</groupId>
1616 <artifactId>eclipse-platform-parent</artifactId>
17 <version>4.25.0-SNAPSHOT</version>
17 <version>4.26.0-SNAPSHOT</version>
1818 <relativePath>../eclipse-platform-parent</relativePath>
1919 </parent>
2020
+0
-24
tests-pom/pom.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!--
2 Copyright (c) 2013 Eclipse Foundation and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Distribution License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/org/documents/edl-v10.php
7
8 Contributors:
9 IBM Corporation - initial API and implementation
10 -->
11 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12 <modelVersion>4.0.0</modelVersion>
13 <parent>
14 <artifactId>eclipse.platform.text</artifactId>
15 <groupId>org.eclipse.platform</groupId>
16 <version>4.25.0-SNAPSHOT</version>
17 </parent>
18 <artifactId>text-tests-pom</artifactId>
19 <packaging>pom</packaging>
20 <properties>
21 <code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
22 </properties>
23 </project>