New upstream version 4.17
Emmanuel Bourg
3 years ago
2 | 2 | <extension> |
3 | 3 | <groupId>org.eclipse.tycho.extras</groupId> |
4 | 4 | <artifactId>tycho-pomless</artifactId> |
5 | <version>1.7.0</version> | |
5 | <version>2.0.0</version> | |
6 | 6 | </extension> |
7 | 7 | </extensions>⏎ |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.core.filebuffers.tests;singleton:=true |
4 | Bundle-Version: 3.11.500.qualifier | |
4 | Bundle-Version: 3.11.600.qualifier | |
5 | 5 | Bundle-Activator: org.eclipse.core.filebuffers.tests.FileBuffersTestPlugin |
6 | 6 | Bundle-ActivationPolicy: lazy |
7 | 7 | Bundle-Vendor: %Plugin.providerName |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.core</groupId> |
20 | 20 | <artifactId>org.eclipse.core.filebuffers.tests</artifactId> |
21 | <version>3.11.500-SNAPSHOT</version> | |
21 | <version>3.11.600-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
+3
-3
140 | 140 | if (srcChildren == null) { |
141 | 141 | throw new IOException("Content from directory '" + src.getAbsolutePath() + "' can not be listed."); //$NON-NLS-1$ //$NON-NLS-2$ |
142 | 142 | } |
143 | for(int i = 0; i < srcChildren.length; ++i){ | |
144 | File srcChild= new File(src, srcChildren[i]); | |
145 | File dstChild= new File(dst, srcChildren[i]); | |
143 | for (String srcChild2 : srcChildren) { | |
144 | File srcChild= new File(src, srcChild2); | |
145 | File dstChild= new File(dst, srcChild2); | |
146 | 146 | copy(srcChild, dstChild); |
147 | 147 | } |
148 | 148 | } else |
0 | 0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
1 | 1 | <component id="org.eclipse.jface.text" version="2"> |
2 | <resource path="META-INF/MANIFEST.MF"> | |
3 | <filter comment="Bug 552134 - org.eclipse.rcp misses dependency to org.eclipse.jface.text" id="924844039"> | |
2 | <resource path="META-INF/MANIFEST.MF" type="org.eclipse.jface.text.Assert"> | |
3 | <filter comment="Planned deletion" id="305422471"> | |
4 | 4 | <message_arguments> |
5 | <message_argument value="3.16.300"/> | |
6 | <message_argument value="3.16.200"/> | |
7 | </message_arguments> | |
8 | </filter> | |
9 | <filter comment="Version wrongly bumped again in Bug 483846 - [typing] Spaces only mode: backspace key to remove many spaces " id="931135546"> | |
10 | <message_arguments> | |
11 | <message_argument value="3.16.100"/> | |
12 | <message_argument value="3.15.300"/> | |
13 | </message_arguments> | |
14 | </filter> | |
15 | </resource> | |
16 | <resource path="src/org/eclipse/jface/text/ITextViewer.java" type="org.eclipse.jface.text.ITextViewer"> | |
17 | <filter comment="Method introduction unlikely to collide with existing implementations." id="404000815"> | |
18 | <message_arguments> | |
19 | <message_argument value="org.eclipse.jface.text.ITextViewer"/> | |
20 | <message_argument value="getLastKnownSelection()"/> | |
5 | <message_argument value="org.eclipse.jface.text.Assert"/> | |
6 | <message_argument value="org.eclipse.jface.text_3.16.300"/> | |
21 | 7 | </message_arguments> |
22 | 8 | </filter> |
23 | 9 | </resource> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.jface.text |
4 | Bundle-Version: 3.16.300.qualifier | |
4 | Bundle-Version: 3.16.400.qualifier | |
5 | 5 | Bundle-Vendor: %providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: |
+2
-2
855 | 855 | try { |
856 | 856 | catchupWithProjectionAnnotationModel(event); |
857 | 857 | } catch (BadLocationException x) { |
858 | throw new IllegalArgumentException(); | |
858 | throw new IllegalArgumentException(x); | |
859 | 859 | } |
860 | 860 | |
861 | 861 | } else |
893 | 893 | try { |
894 | 894 | catchupWithProjectionAnnotationModel(null); |
895 | 895 | } catch (BadLocationException x1) { |
896 | throw new IllegalArgumentException(); | |
896 | throw new IllegalArgumentException(x1); | |
897 | 897 | } finally { |
898 | 898 | synchronized (fLock) { |
899 | 899 | fPendingRequests.clear(); |
+3
-11
72 | 72 | private Label fSeparator; |
73 | 73 | /** The font of the optional status text label.*/ |
74 | 74 | private Font fStatusTextFont; |
75 | /** | |
76 | * The color of the optional status text label or <code>null</code> if none. | |
77 | * | |
78 | * @since 3.6 | |
79 | */ | |
80 | private Color fStatusTextForegroundColor; | |
81 | 75 | /** The maximal widget width. */ |
82 | 76 | private int fMaxWidth; |
83 | 77 | /** The maximal widget height. */ |
172 | 166 | GridData gd2= new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING); |
173 | 167 | fStatusField.setLayoutData(gd2); |
174 | 168 | |
175 | fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f)); | |
176 | fStatusField.setForeground(fStatusTextForegroundColor); | |
169 | Color statusTextForegroundColor= new Color(fStatusField.getDisplay(), | |
170 | blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f)); | |
171 | fStatusField.setForeground(statusTextForegroundColor); | |
177 | 172 | |
178 | 173 | fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); |
179 | 174 | } |
239 | 234 | if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) |
240 | 235 | fStatusTextFont.dispose(); |
241 | 236 | fStatusTextFont= null; |
242 | if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) | |
243 | fStatusTextForegroundColor.dispose(); | |
244 | fStatusTextForegroundColor= null; | |
245 | 237 | |
246 | 238 | fTextFont= null; |
247 | 239 | fShell= null; |
86 | 86 | * @since 3.4.2 |
87 | 87 | */ |
88 | 88 | private Font fStatusLabelFont; |
89 | /** | |
90 | * Color for the label in the status line or <code>null</code> if none. | |
91 | * | |
92 | * @since 3.6 | |
93 | */ | |
94 | private Color fStatusLabelForeground; | |
95 | 89 | /** The toolbar manager used by the toolbar or <code>null</code> if none. */ |
96 | 90 | private final ToolBarManager fToolBarManager; |
97 | 91 | /** Status line toolbar or <code>null</code> if none. */ |
516 | 510 | fStatusLabelFont.dispose(); |
517 | 511 | fStatusLabelFont= null; |
518 | 512 | } |
519 | if (fStatusLabelForeground != null) { | |
520 | fStatusLabelForeground.dispose(); | |
521 | fStatusLabelForeground= null; | |
522 | } | |
523 | 513 | } |
524 | 514 | |
525 | 515 | @Override |
634 | 624 | |
635 | 625 | private void setStatusLabelColors(Color foreground, Color background) { |
636 | 626 | if (foreground == null || background == null) return; |
637 | if (fStatusLabelForeground != null) { | |
638 | fStatusLabelForeground.dispose(); | |
639 | } | |
640 | fStatusLabelForeground = new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f)); | |
641 | fStatusLabel.setForeground(fStatusLabelForeground); | |
627 | Color statusLabelForeground= new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f)); | |
628 | fStatusLabel.setForeground(statusLabelForeground); | |
642 | 629 | fStatusLabel.setBackground(background); |
643 | 630 | } |
644 | 631 |
+0
-1
292 | 292 | displayProposals(); |
293 | 293 | } |
294 | 294 | }, true, false, true); |
295 | fFilteredProposals= new ArrayList<>(fComputedProposals != null ? fComputedProposals : Collections.emptyList()); | |
296 | 295 | return getErrorMessage(); |
297 | 296 | } |
298 | 297 |
+1
-1
603 | 603 | fProposalShell.setFont(JFaceResources.getDefaultFont()); |
604 | 604 | fProposalTable= new Table(fProposalShell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL); |
605 | 605 | |
606 | Listener listener= event -> handleSetData(event); | |
606 | Listener listener= this::handleSetData; | |
607 | 607 | fProposalTable.addListener(SWT.SetData, listener); |
608 | 608 | |
609 | 609 | fIsColoredLabelsSupportEnabled= fContentAssistant.isColoredLabelsSupportEnabled(); |
+0
-10
90 | 90 | private boolean fIsUsingNativeLinkColor; |
91 | 91 | /** The link color specification. May be <code>null</code>. */ |
92 | 92 | private RGB fRGB; |
93 | /** Tells whether to dispose the color on uninstall. */ | |
94 | private boolean fDisposeColor; | |
95 | 93 | /** The currently active region. */ |
96 | 94 | private IRegion fActiveRegion; |
97 | 95 | /** The currently active style range as position. */ |
108 | 106 | */ |
109 | 107 | public DefaultHyperlinkPresenter(IPreferenceStore store) { |
110 | 108 | fPreferenceStore= store; |
111 | fDisposeColor= true; | |
112 | 109 | } |
113 | 110 | |
114 | 111 | /** |
129 | 126 | */ |
130 | 127 | public DefaultHyperlinkPresenter(RGB color) { |
131 | 128 | fRGB= color; |
132 | fDisposeColor= true; | |
133 | 129 | } |
134 | 130 | |
135 | 131 | @Override |
193 | 189 | document.removeDocumentListener(this); |
194 | 190 | |
195 | 191 | if (fColor != null) { |
196 | if (fDisposeColor) | |
197 | fColor.dispose(); | |
198 | 192 | fColor= null; |
199 | 193 | } |
200 | 194 | |
217 | 211 | public void setColor(Color color) { |
218 | 212 | Assert.isNotNull(fTextViewer); |
219 | 213 | Assert.isTrue(fPreferenceStore == null, "Cannot set color if preference store is set"); //$NON-NLS-1$ |
220 | if (fColor != null && fDisposeColor) | |
221 | fColor.dispose(); | |
222 | 214 | fColor= color; |
223 | 215 | } |
224 | 216 | |
349 | 341 | @Override |
350 | 342 | public void propertyChange(PropertyChangeEvent event) { |
351 | 343 | if (HYPERLINK_COLOR.equals(event.getProperty())) { |
352 | if (fColor != null && fDisposeColor) | |
353 | fColor.dispose(); | |
354 | 344 | fColor= createColorFromPreferenceStore(); |
355 | 345 | return; |
356 | 346 | } |
37 | 37 | Color getColor(RGB rgb); |
38 | 38 | |
39 | 39 | /** |
40 | * Tells this object to dispose all its managed colors. | |
40 | * Tells this object to dispose all its managed objects- Note that colors do not need dispose | |
41 | * anymore | |
42 | * | |
41 | 43 | */ |
42 | void dispose(); | |
44 | default void dispose() { | |
45 | // nothing to do anymore as colors do not require disposal | |
46 | } | |
43 | 47 | } |
13 | 13 | <parent> |
14 | 14 | <artifactId>eclipse.platform.text</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | </parent> |
18 | 18 | <groupId>org.eclipse.core</groupId> |
19 | 19 | <artifactId>org.eclipse.jface.text.examples</artifactId> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.jface.text.tests |
4 | Bundle-Version: 3.11.1100.qualifier | |
4 | Bundle-Version: 3.11.1200.qualifier | |
5 | 5 | Bundle-Vendor: %Plugin.providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.jface</groupId> |
20 | 20 | <artifactId>org.eclipse.jface.text.tests</artifactId> |
21 | <version>3.11.1100-SNAPSHOT</version> | |
21 | <version>3.11.1200-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
+2
-0
22 | 22 | import org.eclipse.jface.text.tests.contentassist.ContextInformationPresenterTest; |
23 | 23 | import org.eclipse.jface.text.tests.contentassist.ContextInformationTest; |
24 | 24 | import org.eclipse.jface.text.tests.contentassist.FilteringAsyncContentAssistTests; |
25 | import org.eclipse.jface.text.tests.contentassist.IncrementalAsyncContentAssistTests; | |
25 | 26 | import org.eclipse.jface.text.tests.reconciler.AbstractReconcilerTest; |
26 | 27 | import org.eclipse.jface.text.tests.rules.DefaultPartitionerTest; |
27 | 28 | import org.eclipse.jface.text.tests.rules.DefaultPartitionerZeroLengthTest; |
52 | 53 | DefaultPairMatcherTest2.class, |
53 | 54 | AsyncContentAssistTest.class, |
54 | 55 | FilteringAsyncContentAssistTests.class, |
56 | IncrementalAsyncContentAssistTests.class, | |
55 | 57 | ContextInformationTest.class, |
56 | 58 | ContextInformationPresenterTest.class, |
57 | 59 |
+0
-4
97 | 97 | public Color getColor(RGB rgb) { |
98 | 98 | return null; |
99 | 99 | } |
100 | ||
101 | @Override | |
102 | public void dispose() { | |
103 | } | |
104 | 100 | }); |
105 | 101 | projectionSupport.install(); |
106 | 102 | fViewer.doOperation(ProjectionViewer.TOGGLE); |
+56
-31
9 | 9 | *******************************************************************************/ |
10 | 10 | package org.eclipse.jface.text.tests.contentassist; |
11 | 11 | |
12 | import static java.util.Collections.singletonList; | |
12 | 13 | import static org.junit.Assert.assertEquals; |
13 | 14 | import static org.junit.Assert.assertTrue; |
14 | 15 | |
15 | 16 | import java.lang.reflect.Field; |
17 | import java.util.ArrayList; | |
18 | import java.util.Arrays; | |
16 | 19 | import java.util.List; |
17 | 20 | import java.util.concurrent.CountDownLatch; |
18 | 21 | import java.util.function.Predicate; |
34 | 37 | import org.eclipse.jface.text.Document; |
35 | 38 | import org.eclipse.jface.text.DocumentEvent; |
36 | 39 | import org.eclipse.jface.text.IDocument; |
40 | import org.eclipse.jface.text.IInformationControlCreator; | |
37 | 41 | import org.eclipse.jface.text.ITextViewer; |
38 | 42 | import org.eclipse.jface.text.contentassist.ContentAssistant; |
39 | 43 | import org.eclipse.jface.text.contentassist.ContextInformationValidator; |
40 | 44 | import org.eclipse.jface.text.contentassist.ICompletionProposal; |
41 | 45 | import org.eclipse.jface.text.contentassist.ICompletionProposalExtension; |
42 | 46 | import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; |
47 | import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3; | |
43 | 48 | import org.eclipse.jface.text.contentassist.IContentAssistProcessor; |
44 | 49 | import org.eclipse.jface.text.contentassist.IContextInformation; |
45 | 50 | import org.eclipse.jface.text.contentassist.IContextInformationValidator; |
202 | 207 | IDocument document = viewer.getDocument(); |
203 | 208 | |
204 | 209 | ca.addContentAssistProcessor(new ImmediateContentAssistProcessor("xx"), IDocument.DEFAULT_CONTENT_TYPE); |
205 | ca.addContentAssistProcessor(new DelayedContentAssistProcessor("yy", 3000, false), | |
210 | ca.addContentAssistProcessor(new DelayedContentAssistProcessor(singletonList("yy"), 3000, false), | |
206 | 211 | IDocument.DEFAULT_CONTENT_TYPE); |
207 | 212 | |
208 | 213 | ca.install(viewer); |
246 | 251 | public void testCA_WithFirstDelayedThenImmediateProposals() throws Exception { |
247 | 252 | IDocument document = viewer.getDocument(); |
248 | 253 | |
249 | ca.addContentAssistProcessor(new LongInitialContentAssistProcessor("abc", 500, true), | |
254 | ca.addContentAssistProcessor(new LongInitialContentAssistProcessor(singletonList("abc"), 500, true), | |
250 | 255 | IDocument.DEFAULT_CONTENT_TYPE); |
251 | 256 | |
252 | 257 | ca.install(viewer); |
286 | 291 | IDocument document = viewer.getDocument(); |
287 | 292 | |
288 | 293 | ca.addContentAssistProcessor(new ImmediateContentAssistProcessor("xxxx"), IDocument.DEFAULT_CONTENT_TYPE); |
289 | ca.addContentAssistProcessor(new DelayedContentAssistProcessor("yyyy", 5000, false), | |
294 | ca.addContentAssistProcessor(new DelayedContentAssistProcessor(singletonList("yyyy"), 5000, false), | |
290 | 295 | IDocument.DEFAULT_CONTENT_TYPE); |
291 | 296 | |
292 | 297 | ca.install(viewer); |
353 | 358 | |
354 | 359 | } |
355 | 360 | |
356 | private class ImmediateContentAssistProcessor implements IContentAssistProcessor { | |
357 | ||
358 | final private String template; | |
361 | static class ImmediateContentAssistProcessor implements IContentAssistProcessor { | |
362 | ||
363 | final private List<String> templates; | |
359 | 364 | final private boolean incomplete; |
360 | 365 | |
361 | ImmediateContentAssistProcessor(String template) { | |
362 | this(template, false); | |
363 | } | |
364 | ||
365 | ImmediateContentAssistProcessor(String template, boolean incomplete) { | |
366 | this.template = template; | |
366 | ImmediateContentAssistProcessor(String... templates) { | |
367 | this(Arrays.asList(templates), false); | |
368 | } | |
369 | ||
370 | ImmediateContentAssistProcessor(List<String> templates, boolean incomplete) { | |
371 | this.templates= templates; | |
367 | 372 | this.incomplete = incomplete; |
368 | 373 | } |
369 | 374 | |
370 | 375 | @Override |
371 | 376 | public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int offset) { |
377 | List<ICompletionProposal> proposals= new ArrayList<>(); | |
372 | 378 | try { |
373 | 379 | IDocument document= textViewer.getDocument(); |
374 | if (document != null && (document.getLength() == 0 || isSubstringFoundOrderedInString(document.get(0, offset), template))) { | |
375 | if (incomplete) { | |
376 | return new ICompletionProposal[] { | |
377 | new IncompleteCompletionProposal(template, offset, 0, offset, template) }; | |
378 | } else { | |
379 | CompletionProposal proposal = new CompletionProposal(template, offset, 0, offset, template); | |
380 | return new ICompletionProposal[] { proposal }; | |
380 | for (String template : templates) { | |
381 | if (document != null && (document.getLength() == 0 || isSubstringFoundOrderedInString(document.get(0, offset), template))) { | |
382 | if (incomplete) { | |
383 | proposals.add(new IncompleteCompletionProposal(template, offset, 0, offset, template)); | |
384 | } else { | |
385 | proposals.add(new CompletionProposal(template, offset, 0, offset, template)); | |
386 | } | |
381 | 387 | } |
382 | 388 | } |
383 | 389 | } catch (BadLocationException e) { |
384 | 390 | throw new IllegalStateException("Error computing proposals"); |
385 | 391 | } |
386 | return new ICompletionProposal[0]; | |
392 | return proposals.toArray(new ICompletionProposal[0]); | |
387 | 393 | } |
388 | 394 | |
389 | 395 | @Override |
413 | 419 | |
414 | 420 | } |
415 | 421 | |
416 | private class DelayedContentAssistProcessor extends ImmediateContentAssistProcessor { | |
422 | static class DelayedContentAssistProcessor extends ImmediateContentAssistProcessor { | |
417 | 423 | |
418 | 424 | protected long delay; |
419 | 425 | |
420 | DelayedContentAssistProcessor(String template, long delay, boolean incomplete) { | |
421 | super(template, incomplete); | |
426 | DelayedContentAssistProcessor(List<String> templates, long delay, boolean incomplete) { | |
427 | super(templates, incomplete); | |
422 | 428 | this.delay = delay; |
423 | 429 | } |
424 | 430 | |
431 | 437 | throw new IllegalStateException("Cannot generate delayed content assist proposals!"); |
432 | 438 | } |
433 | 439 | } |
434 | return super.computeCompletionProposals(viewer, offset); | |
440 | return super.computeCompletionProposals(textViewer, offset); | |
435 | 441 | } |
436 | 442 | } |
437 | 443 | |
438 | 444 | private class LongInitialContentAssistProcessor extends DelayedContentAssistProcessor { |
439 | 445 | |
440 | LongInitialContentAssistProcessor(String template, long delay, boolean incomplete) { | |
441 | super(template, delay, incomplete); | |
446 | LongInitialContentAssistProcessor(List<String> templates, long delay, boolean incomplete) { | |
447 | super(templates, delay, incomplete); | |
442 | 448 | } |
443 | 449 | |
444 | 450 | @Override |
453 | 459 | |
454 | 460 | final CountDownLatch blocked= new CountDownLatch(1); |
455 | 461 | |
456 | BlockingProcessor(String template) { | |
457 | super(template, false); | |
462 | BlockingProcessor(String... templates) { | |
463 | super(Arrays.asList(templates), false); | |
458 | 464 | } |
459 | 465 | |
460 | 466 | @Override |
483 | 489 | } |
484 | 490 | |
485 | 491 | @SuppressWarnings("unchecked") |
486 | private static List<ICompletionProposal> getFilteredProposals(ContentAssistant ca) throws Exception { | |
492 | static List<ICompletionProposal> getFilteredProposals(ContentAssistant ca) throws Exception { | |
487 | 493 | Field f = ContentAssistant.class.getDeclaredField("fProposalPopup"); |
488 | 494 | f.setAccessible(true); |
489 | 495 | Object caPopup = f.get(ca); |
565 | 571 | } |
566 | 572 | } |
567 | 573 | |
568 | private static class CompletionProposal extends IncompleteCompletionProposal | |
569 | implements ICompletionProposalExtension, ICompletionProposalExtension2 { | |
574 | static class CompletionProposal extends IncompleteCompletionProposal | |
575 | implements ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3 { | |
570 | 576 | |
571 | 577 | public CompletionProposal(String replacementString, int replacementOffset, int replacementLength, |
572 | 578 | int cursorPosition, String displayString) { |
623 | 629 | return 0; |
624 | 630 | } |
625 | 631 | |
632 | @Override | |
633 | public int getPrefixCompletionStart(IDocument document, int completionOffset) { | |
634 | return 0; | |
635 | } | |
636 | ||
637 | @Override | |
638 | public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) { | |
639 | return getDisplayString(); | |
640 | } | |
641 | ||
642 | @Override | |
643 | public IInformationControlCreator getInformationControlCreator() { | |
644 | return null; | |
645 | } | |
646 | ||
647 | @Override | |
648 | public String toString() { | |
649 | return getDisplayString(); | |
650 | } | |
626 | 651 | } |
627 | 652 | |
628 | 653 | @SuppressWarnings("boxing") |
+124
-0
0 | /******************************************************************************* | |
1 | * Copyright (c) 2020 Julian Honnen | |
2 | * All rights reserved. This program and the accompanying materials | |
3 | * are made available under the terms of the Eclipse Public License v1.0 | |
4 | * which accompanies this distribution, and is available at | |
5 | * https://www.eclipse.org/legal/epl-v10.html | |
6 | * | |
7 | * Contributors: | |
8 | * Julian Honnen - initial API and implementation | |
9 | *******************************************************************************/ | |
10 | package org.eclipse.jface.text.tests.contentassist; | |
11 | ||
12 | import static java.util.stream.Collectors.toList; | |
13 | import static org.junit.Assert.assertEquals; | |
14 | ||
15 | import java.util.Arrays; | |
16 | import java.util.Comparator; | |
17 | import java.util.List; | |
18 | ||
19 | import org.junit.After; | |
20 | import org.junit.Before; | |
21 | import org.junit.Test; | |
22 | ||
23 | import org.eclipse.swt.SWT; | |
24 | import org.eclipse.swt.widgets.Shell; | |
25 | ||
26 | import org.eclipse.jface.text.Document; | |
27 | import org.eclipse.jface.text.IDocument; | |
28 | import org.eclipse.jface.text.contentassist.ContentAssistant; | |
29 | import org.eclipse.jface.text.contentassist.ICompletionProposal; | |
30 | import org.eclipse.jface.text.source.SourceViewer; | |
31 | import org.eclipse.jface.text.tests.util.DisplayHelper; | |
32 | ||
33 | public class IncrementalAsyncContentAssistTests { | |
34 | ||
35 | private Shell shell; | |
36 | ||
37 | private SourceViewer viewer; | |
38 | ||
39 | private ContentAssistant ca; | |
40 | ||
41 | @Before | |
42 | public void setup() { | |
43 | tearDown(); | |
44 | ||
45 | shell= new Shell(); | |
46 | shell.setSize(300, 300); | |
47 | shell.open(); | |
48 | ||
49 | viewer= new SourceViewer(shell, null, SWT.NONE); | |
50 | Document document= new Document(); | |
51 | viewer.setDocument(document); | |
52 | ca= new ContentAssistant(true); | |
53 | ||
54 | Comparator<ICompletionProposal> comparator= Comparator.comparing(ICompletionProposal::getDisplayString); | |
55 | ca.setSorter(comparator::compare); | |
56 | } | |
57 | ||
58 | @After | |
59 | public void tearDown() { | |
60 | if (shell != null) { | |
61 | ca.uninstall(); | |
62 | if (!shell.isDisposed()) { | |
63 | shell.dispose(); | |
64 | } | |
65 | shell= null; | |
66 | } | |
67 | } | |
68 | ||
69 | @Test | |
70 | public void testIncrementalComplete() throws Exception { | |
71 | ca.addContentAssistProcessor(new FilteringAsyncContentAssistTests.ImmediateContentAssistProcessor("testC", "testB", "testA"), IDocument.DEFAULT_CONTENT_TYPE); | |
72 | ||
73 | viewer.getDocument().set("t"); | |
74 | ||
75 | ca.install(viewer); | |
76 | viewer.setSelectedRange(1, 0); | |
77 | ||
78 | ca.completePrefix(); | |
79 | ||
80 | DisplayHelper.sleep(shell.getDisplay(), 300); | |
81 | ||
82 | List<String> filteredProposals= FilteringAsyncContentAssistTests.getFilteredProposals(ca).stream() // | |
83 | .map(ICompletionProposal::getDisplayString) // | |
84 | .collect(toList()); | |
85 | assertEquals(Arrays.asList("testA", "testB", "testC"), filteredProposals); | |
86 | } | |
87 | ||
88 | @Test | |
89 | public void testIncrementalComplete_async() throws Exception { | |
90 | long delay= 200; | |
91 | ca.addContentAssistProcessor(new FilteringAsyncContentAssistTests.DelayedContentAssistProcessor(Arrays.asList("testC", "testB", "testA"), delay, false), IDocument.DEFAULT_CONTENT_TYPE); | |
92 | ||
93 | viewer.getDocument().set("t"); | |
94 | ||
95 | ca.install(viewer); | |
96 | viewer.setSelectedRange(1, 0); | |
97 | ||
98 | ca.completePrefix(); | |
99 | ||
100 | DisplayHelper.sleep(shell.getDisplay(), delay + 100); | |
101 | ||
102 | List<String> filteredProposals= FilteringAsyncContentAssistTests.getFilteredProposals(ca).stream() // | |
103 | .map(ICompletionProposal::getDisplayString) // | |
104 | .collect(toList()); | |
105 | assertEquals(Arrays.asList("testA", "testB", "testC"), filteredProposals); | |
106 | } | |
107 | ||
108 | @Test | |
109 | public void testIncrementalCompleteOfSingleProposal() throws Exception { | |
110 | ca.enableAutoInsert(true); | |
111 | ca.addContentAssistProcessor(new FilteringAsyncContentAssistTests.ImmediateContentAssistProcessor("testA"), IDocument.DEFAULT_CONTENT_TYPE); | |
112 | ||
113 | ca.install(viewer); | |
114 | viewer.setSelectedRange(0, 0); | |
115 | ||
116 | ca.completePrefix(); | |
117 | ||
118 | DisplayHelper.sleep(shell.getDisplay(), 300); | |
119 | ||
120 | assertEquals("testA", viewer.getDocument().get()); | |
121 | } | |
122 | ||
123 | } |
0 | 0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
1 | 1 | <component id="org.eclipse.search" version="2"> |
2 | <resource path="META-INF/MANIFEST.MF"> | |
3 | <filter comment="Revert of Java 11 update, version cannot be decreased anymore" id="926941240"> | |
4 | <message_arguments> | |
5 | <message_argument value="3.12.0"/> | |
6 | <message_argument value="3.11.1000"/> | |
7 | </message_arguments> | |
8 | </filter> | |
9 | </resource> | |
2 | 10 | <resource path="search/org/eclipse/search/internal/ui/SearchDialog.java" type="org.eclipse.search.internal.ui.SearchDialog"> |
3 | 11 | <filter id="571519004"> |
4 | 12 | <message_arguments> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.search; singleton:=true |
4 | Bundle-Version: 3.11.1000.qualifier | |
4 | Bundle-Version: 3.12.0.qualifier | |
5 | 5 | Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin |
6 | 6 | Bundle-ActivationPolicy: lazy |
7 | 7 | Bundle-Vendor: %providerName |
+1
-1
171 | 171 | ListenerAndLabelProvider listenerAndLP= new ListenerAndLabelProvider(); |
172 | 172 | |
173 | 173 | fListViewer.setLabelProvider(listenerAndLP); |
174 | fListViewer.setContentProvider(new ArrayContentProvider()); | |
174 | fListViewer.setContentProvider(ArrayContentProvider.getInstance()); | |
175 | 175 | fListViewer.addSelectionChangedListener(listenerAndLP); |
176 | 176 | fListViewer.addCheckStateListener(listenerAndLP); |
177 | 177 | fListViewer.setInput(fAllFilters); |
+1
-1
294 | 294 | parent.setLayoutData(new GridData(GridData.FILL_BOTH)); |
295 | 295 | |
296 | 296 | fViewer= new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION); |
297 | fViewer.setContentProvider(new ArrayContentProvider()); | |
297 | fViewer.setContentProvider(ArrayContentProvider.getInstance()); | |
298 | 298 | |
299 | 299 | final Table table= fViewer.getTable(); |
300 | 300 | table.addMouseListener(new MouseAdapter() { |
332 | 332 | |
333 | 333 | String message= SearchMessages.SearchPageSelectionDialog_message; |
334 | 334 | |
335 | ListSelectionDialog dialog= new ListSelectionDialog(getShell(), input, new ArrayContentProvider(), labelProvider, message) { | |
335 | ListSelectionDialog dialog = new ListSelectionDialog(getShell(), input, ArrayContentProvider.getInstance(), | |
336 | labelProvider, message) { | |
336 | 337 | Button fLastUsedPageButton; |
337 | 338 | |
338 | 339 | @Override |
332 | 332 | if (Thread.currentThread() == display.getThread()) |
333 | 333 | handleNewSearchResult(); |
334 | 334 | else { |
335 | display.syncExec(() -> handleNewSearchResult()); | |
335 | display.syncExec(this::handleNewSearchResult); | |
336 | 336 | } |
337 | 337 | SearchPlugin.getWorkspace().addResourceChangeListener(this); |
338 | 338 | } |
113 | 113 | fPotentialMatchFgColor= new Color(SearchPlugin.getActiveWorkbenchShell().getDisplay(), SearchPreferencePage.getPotentialMatchForegroundColor()); |
114 | 114 | |
115 | 115 | setUseHashlookup(true); |
116 | setContentProvider(new ArrayContentProvider()); | |
116 | setContentProvider(ArrayContentProvider.getInstance()); | |
117 | 117 | |
118 | 118 | ILabelProvider labelProvider= new SearchResultLabelProvider(new FileLabelProvider(FileLabelProvider.SHOW_LABEL)); |
119 | 119 | setLabelProvider(labelProvider); |
125 | 125 | ListDialog dlg= new ListDialog(SearchPlugin.getActiveWorkbenchShell()); |
126 | 126 | dlg.setInput(input); |
127 | 127 | dlg.setTitle(title); |
128 | dlg.setContentProvider(new ArrayContentProvider()); | |
128 | dlg.setContentProvider(ArrayContentProvider.getInstance()); | |
129 | 129 | dlg.setLabelProvider(labelProvider); |
130 | 130 | dlg.setMessage(message); |
131 | 131 | if (selectedAction != null) { |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.search.tests |
4 | Bundle-Version: 3.9.600.qualifier | |
4 | Bundle-Version: 3.9.700.qualifier | |
5 | 5 | Bundle-Activator: org.eclipse.search.tests.SearchTestPlugin |
6 | 6 | Bundle-Vendor: %providerName |
7 | 7 | Bundle-Localization: plugin |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.search</groupId> |
20 | 20 | <artifactId>org.eclipse.search.tests</artifactId> |
21 | <version>3.9.600-SNAPSHOT</version> | |
21 | <version>3.9.700-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
142 | 142 | if (srcChildren == null) { |
143 | 143 | throw new IOException("Content from directory '" + src.getAbsolutePath() + "' can not be listed."); //$NON-NLS-1$ //$NON-NLS-2$ |
144 | 144 | } |
145 | for(int i = 0; i < srcChildren.length; ++i){ | |
146 | File srcChild= new File(src, srcChildren[i]); | |
147 | File dstChild= new File(dst, srcChildren[i]); | |
145 | for (String srcChild2 : srcChildren) { | |
146 | File srcChild= new File(src, srcChild2); | |
147 | File dstChild= new File(dst, srcChild2); | |
148 | 148 | copy(srcChild, dstChild); |
149 | 149 | } |
150 | 150 | } else |
0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
1 | <component id="org.eclipse.text" version="2"> | |
2 | <resource path="META-INF/MANIFEST.MF" type="org.eclipse.jface.text.Assert"> | |
3 | <filter comment="Planned deletion" id="305324134"> | |
4 | <message_arguments> | |
5 | <message_argument value="org.eclipse.jface.text.Assert"/> | |
6 | <message_argument value="org.eclipse.text_3.10.200"/> | |
7 | </message_arguments> | |
8 | </filter> | |
9 | <filter comment="Planned deletion" id="305324134"> | |
10 | <message_arguments> | |
11 | <message_argument value="org.eclipse.jface.text.Assert"/> | |
12 | <message_argument value="org.eclipse.text_3.10.300"/> | |
13 | </message_arguments> | |
14 | </filter> | |
15 | </resource> | |
16 | </component> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.text |
4 | Bundle-Version: 3.10.200.qualifier | |
4 | Bundle-Version: 3.10.300.qualifier | |
5 | 5 | Bundle-Vendor: %providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: |
0 | /******************************************************************************* | |
1 | * Copyright (c) 2000, 2009 IBM Corporation and others. | |
2 | * | |
3 | * This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License 2.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * https://www.eclipse.org/legal/epl-2.0/ | |
7 | * | |
8 | * SPDX-License-Identifier: EPL-2.0 | |
9 | * | |
10 | * Contributors: | |
11 | * IBM Corporation - initial API and implementation | |
12 | *******************************************************************************/ | |
13 | package org.eclipse.jface.text; | |
14 | ||
15 | ||
16 | /** | |
17 | * <code>Assert</code> is useful for for embedding runtime sanity checks | |
18 | * in code. The static predicate methods all test a condition and throw some | |
19 | * type of unchecked exception if the condition does not hold. | |
20 | * <p> | |
21 | * Assertion failure exceptions, like most runtime exceptions, are | |
22 | * thrown when something is misbehaving. Assertion failures are invariably | |
23 | * unspecified behavior; consequently, clients should never rely on | |
24 | * these being thrown (or not thrown). <b>If you find yourself in the | |
25 | * position where you need to catch an assertion failure, you have most | |
26 | * certainly written your program incorrectly.</b> | |
27 | * </p> | |
28 | * <p> | |
29 | * Note that an <code>assert</code> statement is slated to be added to the | |
30 | * Java language in JDK 1.4, rending this class obsolete. | |
31 | * </p> | |
32 | * | |
33 | * @deprecated As of 3.3, replaced by {@link org.eclipse.core.runtime.Assert} | |
34 | * @noinstantiate This class is not intended to be instantiated by clients. | |
35 | * | |
36 | * @noreference This class is planned to be deleted, see Bug 528191 | |
37 | * | |
38 | */ | |
39 | @Deprecated | |
40 | public final class Assert { | |
41 | ||
42 | /** | |
43 | * <code>AssertionFailedException</code> is a runtime exception thrown | |
44 | * by some of the methods in <code>Assert</code>. | |
45 | * <p> | |
46 | * This class is not declared public to prevent some misuses; programs that catch | |
47 | * or otherwise depend on assertion failures are susceptible to unexpected | |
48 | * breakage when assertions in the code are added or removed. | |
49 | * </p> | |
50 | * <p> | |
51 | * This class is not intended to be serialized. | |
52 | * </p> | |
53 | */ | |
54 | private static class AssertionFailedException extends RuntimeException { | |
55 | ||
56 | /** | |
57 | * Serial version UID for this class. | |
58 | * <p> | |
59 | * Note: This class is not intended to be serialized. | |
60 | * </p> | |
61 | * @since 3.1 | |
62 | */ | |
63 | private static final long serialVersionUID= 3689918374733886002L; | |
64 | ||
65 | /** | |
66 | * Constructs a new exception with the given message. | |
67 | * | |
68 | * @param detail the detailed message | |
69 | */ | |
70 | public AssertionFailedException(String detail) { | |
71 | super(detail); | |
72 | } | |
73 | } | |
74 | ||
75 | /* This class is not intended to be instantiated. */ | |
76 | private Assert() { | |
77 | } | |
78 | ||
79 | /** | |
80 | * Asserts that an argument is legal. If the given boolean is | |
81 | * not <code>true</code>, an <code>IllegalArgumentException</code> | |
82 | * is thrown. | |
83 | * | |
84 | * @param expression the outcome of the check | |
85 | * @return <code>true</code> if the check passes (does not return | |
86 | * if the check fails) | |
87 | * @exception IllegalArgumentException if the legality test failed | |
88 | */ | |
89 | public static boolean isLegal(boolean expression) { | |
90 | // succeed as quickly as possible | |
91 | if (expression) { | |
92 | return true; | |
93 | } | |
94 | return isLegal(expression, "");//$NON-NLS-1$ | |
95 | } | |
96 | ||
97 | /** | |
98 | * Asserts that an argument is legal. If the given boolean is | |
99 | * not <code>true</code>, an <code>IllegalArgumentException</code> | |
100 | * is thrown. | |
101 | * The given message is included in that exception, to aid debugging. | |
102 | * | |
103 | * @param expression the outcome of the check | |
104 | * @param message the message to include in the exception | |
105 | * @return <code>true</code> if the check passes (does not return | |
106 | * if the check fails) | |
107 | * @exception IllegalArgumentException if the legality test failed | |
108 | */ | |
109 | public static boolean isLegal(boolean expression, String message) { | |
110 | if (!expression) | |
111 | throw new IllegalArgumentException("assertion failed; " + message); //$NON-NLS-1$ | |
112 | return expression; | |
113 | } | |
114 | ||
115 | /** | |
116 | * Asserts that the given object is not <code>null</code>. If this | |
117 | * is not the case, some kind of unchecked exception is thrown. | |
118 | * <p> | |
119 | * As a general rule, parameters passed to API methods must not be | |
120 | * <code>null</code> unless <b>explicitly</b> allowed in the method's | |
121 | * specification. Similarly, results returned from API methods are never | |
122 | * <code>null</code> unless <b>explicitly</b> allowed in the method's | |
123 | * specification. Implementations are encouraged to make regular use of | |
124 | * <code>Assert.isNotNull</code> to ensure that <code>null</code> | |
125 | * parameters are detected as early as possible. | |
126 | * </p> | |
127 | * | |
128 | * @param object the value to test | |
129 | * @exception RuntimeException an unspecified unchecked exception if the object | |
130 | * is <code>null</code> | |
131 | */ | |
132 | public static void isNotNull(Object object) { | |
133 | // succeed as quickly as possible | |
134 | if (object != null) { | |
135 | return; | |
136 | } | |
137 | isNotNull(object, "");//$NON-NLS-1$ | |
138 | } | |
139 | ||
140 | /** | |
141 | * Asserts that the given object is not <code>null</code>. If this | |
142 | * is not the case, some kind of unchecked exception is thrown. | |
143 | * The given message is included in that exception, to aid debugging. | |
144 | * <p> | |
145 | * As a general rule, parameters passed to API methods must not be | |
146 | * <code>null</code> unless <b>explicitly</b> allowed in the method's | |
147 | * specification. Similarly, results returned from API methods are never | |
148 | * <code>null</code> unless <b>explicitly</b> allowed in the method's | |
149 | * specification. Implementations are encouraged to make regular use of | |
150 | * <code>Assert.isNotNull</code> to ensure that <code>null</code> | |
151 | * parameters are detected as early as possible. | |
152 | * </p> | |
153 | * | |
154 | * @param object the value to test | |
155 | * @param message the message to include in the exception | |
156 | * @exception RuntimeException an unspecified unchecked exception if the object | |
157 | * is <code>null</code> | |
158 | */ | |
159 | public static void isNotNull(Object object, String message) { | |
160 | if (object == null) | |
161 | throw new AssertionFailedException("null argument;" + message);//$NON-NLS-1$ | |
162 | } | |
163 | ||
164 | /** | |
165 | * Asserts that the given boolean is <code>true</code>. If this | |
166 | * is not the case, some kind of unchecked exception is thrown. | |
167 | * | |
168 | * @param expression the outcome of the check | |
169 | * @return <code>true</code> if the check passes (does not return | |
170 | * if the check fails) | |
171 | */ | |
172 | public static boolean isTrue(boolean expression) { | |
173 | // succeed as quickly as possible | |
174 | if (expression) { | |
175 | return true; | |
176 | } | |
177 | return isTrue(expression, "");//$NON-NLS-1$ | |
178 | } | |
179 | ||
180 | /** | |
181 | * Asserts that the given boolean is <code>true</code>. If this | |
182 | * is not the case, some kind of unchecked exception is thrown. | |
183 | * The given message is included in that exception, to aid debugging. | |
184 | * | |
185 | * @param expression the outcome of the check | |
186 | * @param message the message to include in the exception | |
187 | * @return <code>true</code> if the check passes (does not return | |
188 | * if the check fails) | |
189 | */ | |
190 | public static boolean isTrue(boolean expression, String message) { | |
191 | if (!expression) | |
192 | throw new AssertionFailedException("Assertion failed: "+message);//$NON-NLS-1$ | |
193 | return expression; | |
194 | } | |
195 | } |
18 | 18 | <parent> |
19 | 19 | <artifactId>tests-pom</artifactId> |
20 | 20 | <groupId>eclipse.platform.text</groupId> |
21 | <version>4.16.0-SNAPSHOT</version> | |
21 | <version>4.17.0-SNAPSHOT</version> | |
22 | 22 | <relativePath>../tests-pom/</relativePath> |
23 | 23 | </parent> |
24 | 24 | <groupId>org.eclipse.text</groupId> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.text.tests |
4 | Bundle-Version: 3.12.600.qualifier | |
4 | Bundle-Version: 3.12.700.qualifier | |
5 | 5 | Bundle-Vendor: %Plugin.providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.text</groupId> |
20 | 20 | <artifactId>org.eclipse.text.tests</artifactId> |
21 | <version>3.12.600-SNAPSHOT</version> | |
21 | <version>3.12.700-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
+1
-2
145 | 145 | |
146 | 146 | if (!expectedSet.isEmpty()) { |
147 | 147 | String message= "Missing annotations in result with models [" + getAnnotationModelNames(insideModel, beforeModel, afterModel) + "]"; |
148 | for (Iterator<Annotation> iterator= expectedSet.iterator(); iterator.hasNext();) { | |
149 | Annotation missing= iterator.next(); | |
148 | for (Annotation missing : expectedSet) { | |
150 | 149 | message= message + "\n" + getName(missing); |
151 | 150 | } |
152 | 151 | assertTrue(message, false); |
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | private void assertExist(ArrayList<AnnotationData> added) { |
1281 | for (int i= 0, size= added.size(); i < size; i++) { | |
1282 | AnnotationData data= added.get(i); | |
1281 | for (AnnotationData data : added) { | |
1283 | 1282 | IAnnotationModel model= getModel(data.annotationNumber); |
1284 | 1283 | assertTrue(model.getPosition(data.annotation) == data.position); |
1285 | 1284 | } |
1287 | 1286 | ArrayList<Annotation> annotations= getAllAnnotations(); |
1288 | 1287 | assertEquals(added.size(), annotations.size()); |
1289 | 1288 | |
1290 | for (int i= 0, size= annotations.size(); i < size; i++) { | |
1291 | Annotation annotation= annotations.get(i); | |
1292 | ||
1289 | for (Annotation annotation : annotations) { | |
1293 | 1290 | AnnotationData data= getAnnotationData(added, annotation); |
1294 | 1291 | assertNotNull(data); |
1295 | 1292 | |
1298 | 1295 | } |
1299 | 1296 | |
1300 | 1297 | private void assertExistNew(ArrayList<AnnotationData> added) { |
1301 | for (int i= 0, size= added.size(); i < size; i++) { | |
1302 | AnnotationData data= added.get(i); | |
1298 | for (AnnotationData data : added) { | |
1303 | 1299 | IAnnotationModel model= getModel(data.annotationNumber); |
1304 | 1300 | assertTrue(model.getPosition(data.annotation) == data.position); |
1305 | 1301 | } |
1307 | 1303 | ArrayList<Annotation> annotations= getAllAnnotationsNew(); |
1308 | 1304 | assertEquals(added.size(), annotations.size()); |
1309 | 1305 | |
1310 | for (int i= 0, size= annotations.size(); i < size; i++) { | |
1311 | Annotation annotation= annotations.get(i); | |
1312 | ||
1306 | for (Annotation annotation : annotations) { | |
1313 | 1307 | AnnotationData data= getAnnotationData(added, annotation); |
1314 | 1308 | assertNotNull(data); |
1315 | 1309 | |
1318 | 1312 | } |
1319 | 1313 | |
1320 | 1314 | private AnnotationData getAnnotationData(ArrayList<AnnotationData> datas, Annotation annotation) { |
1321 | for (int i= 0, size= datas.size(); i < size; i++) { | |
1322 | AnnotationData data= datas.get(i); | |
1315 | for (AnnotationData data : datas) { | |
1323 | 1316 | if (data.annotation == annotation) |
1324 | 1317 | return data; |
1325 | 1318 | } |
0 | 0 | /******************************************************************************* |
1 | * Copyright (c) 2019 Thomas Wolf and others. | |
1 | * Copyright (c) 2019, 2020 Thomas Wolf and others. | |
2 | 2 | * |
3 | 3 | * This program and the accompanying materials |
4 | 4 | * are made available under the terms of the Eclipse Public License 2.0 |
12 | 12 | import static org.junit.Assert.assertEquals; |
13 | 13 | import static org.junit.Assert.assertNotNull; |
14 | 14 | import static org.junit.Assert.assertNull; |
15 | import static org.junit.Assert.assertThrows; | |
15 | 16 | |
16 | 17 | import java.util.Collections; |
17 | 18 | import java.util.List; |
18 | 19 | |
19 | import org.junit.Rule; | |
20 | 20 | import org.junit.Test; |
21 | import org.junit.rules.ExpectedException; | |
22 | 21 | |
23 | 22 | import org.eclipse.jface.text.MultiStringMatcher; |
24 | 23 | import org.eclipse.jface.text.MultiStringMatcher.Match; |
25 | 24 | |
26 | 25 | public class MultiStringMatcherTest { |
27 | ||
28 | @Rule | |
29 | public ExpectedException thrown = ExpectedException.none(); | |
30 | 26 | |
31 | 27 | private static Match run(String text, String... needles) { |
32 | 28 | return run(text, 0, needles); |
443 | 439 | public void addAfterBuild() throws Exception { |
444 | 440 | MultiStringMatcher.Builder b = MultiStringMatcher.builder().add("he", "she").add("his", "hers"); |
445 | 441 | b.build(); |
446 | thrown.expect(IllegalStateException.class); | |
447 | b.add("us"); | |
442 | assertThrows(IllegalStateException.class, () -> b.add("us")); | |
448 | 443 | } |
449 | 444 | |
450 | 445 | @Test |
451 | 446 | public void reuseBuilder() throws Exception { |
452 | 447 | MultiStringMatcher.Builder b = MultiStringMatcher.builder().add("he", "she").add("his", "hers"); |
453 | 448 | b.build(); |
454 | thrown.expect(IllegalStateException.class); | |
455 | b.build(); | |
449 | assertThrows(IllegalStateException.class, () -> b.build()); | |
456 | 450 | } |
457 | 451 | |
458 | 452 | @Test |
16 | 16 | |
17 | 17 | import java.util.ArrayList; |
18 | 18 | import java.util.Comparator; |
19 | import java.util.Iterator; | |
20 | 19 | import java.util.List; |
21 | 20 | |
22 | 21 | import org.junit.After; |
325 | 324 | |
326 | 325 | private static void compare(List<TextEdit> org, List<TextEdit> copy) { |
327 | 326 | assertTrue("Same length", org.size() == copy.size()); |
328 | for (Iterator<TextEdit> iter= copy.iterator(); iter.hasNext();) { | |
329 | TextEdit edit= iter.next(); | |
327 | for (TextEdit edit : copy) { | |
330 | 328 | assertTrue("Original is part of copy list", !org.contains(edit)); |
331 | 329 | if (edit instanceof MoveSourceEdit) { |
332 | 330 | MoveSourceEdit source= (MoveSourceEdit)edit; |
17 | 17 | import static org.junit.Assert.fail; |
18 | 18 | |
19 | 19 | import java.util.ArrayList; |
20 | import java.util.Iterator; | |
21 | 20 | import java.util.List; |
22 | 21 | |
23 | 22 | import org.junit.Assert; |
191 | 190 | events.add(new DocumentEvent(reference, 9, 2, "asd")); |
192 | 191 | events.add(new DocumentEvent(reference, 0, 2, "asd")); |
193 | 192 | |
194 | for (Iterator<DocumentEvent> iterator= events.iterator(); iterator.hasNext();) { | |
195 | DocumentEvent event= iterator.next(); | |
193 | for (DocumentEvent event : events) { | |
196 | 194 | currentLength += event.getText().length() - event.getLength(); |
197 | 195 | } |
198 | 196 | |
203 | 201 | events.add(event); |
204 | 202 | } |
205 | 203 | |
206 | for (Iterator<DocumentEvent> iterator= events.iterator(); iterator.hasNext();) { | |
207 | DocumentEvent event= iterator.next(); | |
204 | for (DocumentEvent event : events) { | |
208 | 205 | |
209 | 206 | // System.err.println(event.getOffset() + ", " + event.getLength() + ", [" + event.getText() + "]") ; |
210 | 207 | |
244 | 241 | events.add(new DocumentEvent(reference, 9, 2, "asd")); |
245 | 242 | events.add(new DocumentEvent(reference, 0, 2, "asd")); |
246 | 243 | |
247 | for (Iterator<DocumentEvent> iterator= events.iterator(); iterator.hasNext();) { | |
248 | DocumentEvent event= iterator.next(); | |
244 | for (DocumentEvent event : events) { | |
249 | 245 | currentLength += event.getText().length() - event.getLength(); |
250 | 246 | } |
251 | 247 | |
256 | 252 | events.add(event); |
257 | 253 | } |
258 | 254 | |
259 | for (Iterator<DocumentEvent> iterator= events.iterator(); iterator.hasNext();) { | |
260 | DocumentEvent event= iterator.next(); | |
261 | ||
255 | for (DocumentEvent event : events) { | |
262 | 256 | reference.replace(event.getOffset(), event.getLength(), event.getText()); |
263 | 257 | if (Math.random() < 0.3) { |
264 | 258 | check(reference, testee); |
0 | 0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
1 | 1 | <component id="org.eclipse.ui.editors" version="2"> |
2 | <resource path="src/org/eclipse/ui/editors/text/EncodingActionGroup.java" type="org.eclipse.ui.editors.text.EncodingActionGroup"> | |
3 | <filter id="338944126"> | |
4 | <message_arguments> | |
5 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
6 | <message_argument value="dispose()"/> | |
7 | </message_arguments> | |
8 | </filter> | |
9 | <filter id="338944126"> | |
10 | <message_arguments> | |
11 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
12 | <message_argument value="fillActionBars(IActionBars)"/> | |
13 | </message_arguments> | |
14 | </filter> | |
15 | <filter id="338944126"> | |
16 | <message_arguments> | |
17 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
18 | <message_argument value="retarget(ITextEditor)"/> | |
19 | </message_arguments> | |
20 | </filter> | |
21 | <filter id="338944126"> | |
22 | <message_arguments> | |
23 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
24 | <message_argument value="update()"/> | |
25 | </message_arguments> | |
26 | </filter> | |
27 | <filter id="338948223"> | |
28 | <message_arguments> | |
29 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
30 | <message_argument value="EncodingActionGroup()"/> | |
31 | </message_arguments> | |
32 | </filter> | |
33 | <filter id="338948223"> | |
34 | <message_arguments> | |
35 | <message_argument value="org.eclipse.ui.editors.text.EncodingActionGroup"/> | |
36 | <message_argument value="EncodingActionGroup(ITextEditor)"/> | |
37 | </message_arguments> | |
38 | </filter> | |
39 | </resource> | |
40 | 2 | <resource path="src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java" type="org.eclipse.ui.editors.text.ITextEditorHelpContextIds"> |
41 | 3 | <filter id="571473929"> |
42 | 4 | <message_arguments> |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.editors; singleton:=true |
4 | Bundle-Version: 3.13.200.qualifier | |
4 | Bundle-Version: 3.13.300.qualifier | |
5 | 5 | Bundle-Activator: org.eclipse.ui.internal.editors.text.EditorsPlugin |
6 | 6 | Bundle-ActivationPolicy: lazy |
7 | 7 | Bundle-Vendor: %providerName |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
81 | 81 | spelling.label= Spelling Errors |
82 | 82 | revisionInfo.label= Revision Information |
83 | 83 | |
84 | goToLastEditPosition.label= Last Edit Lo&cation | |
85 | goToLastEditPosition.tooltip= Last Edit Location | |
84 | goToLastEditPosition.label= Previous Edit Lo&cation | |
85 | goToLastEditPosition.tooltip= Previous Edit Location | |
86 | goToNextEditPosition.label= Next Edit Lo&cation | |
87 | goToNextEditPosition.tooltip= Next Edit Location | |
86 | 88 | |
87 | 89 | textEditorNavigationActionSet.label= Editor Navigation |
88 | 90 |
469 | 469 | id="org.eclipse.ui.edit.text.actionSet.navigation"> |
470 | 470 | <action |
471 | 471 | toolbarPath="org.eclipse.ui.workbench.navigate/history.group" |
472 | id="org.eclipse.ui.edit.text.gotoNextEditPosition" | |
473 | class="org.eclipse.ui.texteditor.GotoNextEditPositionAction" | |
474 | definitionId="org.eclipse.ui.edit.text.gotoNextEditPosition" | |
475 | disabledIcon="$nl$/icons/full/dtool16/next_edit_pos.png" | |
476 | icon="$nl$/icons/full/etool16/next_edit_pos.png" | |
477 | helpContextId="org.eclipse.ui.goto_next_edit_position_action_context" | |
478 | label="%goToNextEditPosition.label" | |
479 | menubarPath="navigate/" | |
480 | tooltip="%goToNextEditPosition.tooltip" | |
481 | initialEnabled="false"> | |
482 | </action> | |
483 | <action | |
484 | toolbarPath="org.eclipse.ui.workbench.navigate/history.group" | |
472 | 485 | id="org.eclipse.ui.edit.text.gotoLastEditPosition" |
473 | 486 | class="org.eclipse.ui.texteditor.GotoLastEditPositionAction" |
474 | 487 | definitionId="org.eclipse.ui.edit.text.gotoLastEditPosition" |
+1
-1
259 | 259 | |
260 | 260 | |
261 | 261 | fDecorationViewer= new ComboViewer(optionsComposite, SWT.READ_ONLY); |
262 | fDecorationViewer.setContentProvider(new ArrayContentProvider()); | |
262 | fDecorationViewer.setContentProvider(ArrayContentProvider.getInstance()); | |
263 | 263 | fDecorationViewer.setLabelProvider(new ArrayLabelProvider()); |
264 | 264 | fDecorationViewer.setComparator(new ViewerComparator(Collator.getInstance())); |
265 | 265 |
+1
-1
271 | 271 | fShowInTextCheckBox.setLayoutData(gd); |
272 | 272 | |
273 | 273 | fDecorationViewer= new ComboViewer(optionsComposite, SWT.READ_ONLY); |
274 | fDecorationViewer.setContentProvider(new ArrayContentProvider()); | |
274 | fDecorationViewer.setContentProvider(ArrayContentProvider.getInstance()); | |
275 | 275 | fDecorationViewer.setLabelProvider(new ArrayLabelProvider()); |
276 | 276 | fDecorationViewer.setComparator(new ViewerComparator(Collator.getInstance())); |
277 | 277 |
+3
-8
91 | 91 | * @since 3.3 |
92 | 92 | */ |
93 | 93 | private void dispose(Map<RGB, Color> colorTable) { |
94 | if (colorTable == null) | |
95 | return; | |
96 | ||
97 | Iterator<Color> iter= colorTable.values().iterator(); | |
98 | while (iter.hasNext()) | |
99 | iter.next().dispose(); | |
100 | ||
101 | colorTable.clear(); | |
94 | if (colorTable != null) { | |
95 | colorTable.clear(); | |
96 | } | |
102 | 97 | } |
103 | 98 | |
104 | 99 | } |
+3
-11
78 | 78 | private Label fSeparator; |
79 | 79 | /** The font of the optional status text label.*/ |
80 | 80 | private Font fStatusTextFont; |
81 | /** | |
82 | * The color of the optional status text label or <code>null</code> if none. | |
83 | * | |
84 | * @since 3.6 | |
85 | */ | |
86 | private Color fStatusTextForegroundColor; | |
87 | 81 | /** The maximal widget width. */ |
88 | 82 | private int fMaxWidth; |
89 | 83 | /** The maximal widget height. */ |
181 | 175 | GridData gd2= new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING); |
182 | 176 | fStatusField.setLayoutData(gd2); |
183 | 177 | |
184 | fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f)); | |
185 | fStatusField.setForeground(fStatusTextForegroundColor); | |
178 | Color statusTextForegroundColor= new Color(fStatusField.getDisplay(), | |
179 | blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f)); | |
180 | fStatusField.setForeground(statusTextForegroundColor); | |
186 | 181 | |
187 | 182 | fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); |
188 | 183 | } |
252 | 247 | if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) |
253 | 248 | fStatusTextFont.dispose(); |
254 | 249 | fStatusTextFont= null; |
255 | if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) | |
256 | fStatusTextForegroundColor.dispose(); | |
257 | fStatusTextForegroundColor= null; | |
258 | 250 | |
259 | 251 | fTextFont= null; |
260 | 252 | fShell= null; |
+4
-1
20 | 20 | import java.nio.charset.StandardCharsets; |
21 | 21 | import java.nio.charset.UnsupportedCharsetException; |
22 | 22 | import java.text.BreakIterator; |
23 | import java.text.DateFormat; | |
23 | 24 | import java.text.MessageFormat; |
25 | import java.util.Date; | |
24 | 26 | import java.util.Iterator; |
25 | 27 | |
26 | 28 | import org.eclipse.swt.SWT; |
1373 | 1375 | options.printTextForeground= true; |
1374 | 1376 | options.printTextBackground= true; |
1375 | 1377 | options.jobName= getTitle(); |
1376 | options.header= StyledTextPrintOptions.SEPARATOR + getTitle(); | |
1378 | options.header= getTitle() + StyledTextPrintOptions.SEPARATOR + StyledTextPrintOptions.SEPARATOR | |
1379 | + DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT).format(new Date()); | |
1377 | 1380 | options.footer= StyledTextPrintOptions.SEPARATOR + NLSUtility.format(TextEditorMessages.AbstractDecoratedTextEditor_printPageNumber, StyledTextPrintOptions.PAGE_TAG); |
1378 | 1381 | |
1379 | 1382 | if (isLineNumberRulerVisible()) { |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.editors.tests;singleton:=true |
4 | Bundle-Version: 3.11.700.qualifier | |
4 | Bundle-Version: 3.11.800.qualifier | |
5 | 5 | Bundle-Vendor: %Plugin.providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: org.eclipse.ui.editors.tests |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.ui</groupId> |
20 | 20 | <artifactId>org.eclipse.ui.editors.tests</artifactId> |
21 | <version>3.11.700-SNAPSHOT</version> | |
21 | <version>3.11.800-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
+0
-2
34 | 34 | import org.eclipse.core.runtime.CoreException; |
35 | 35 | import org.eclipse.core.runtime.ILog; |
36 | 36 | import org.eclipse.core.runtime.IProgressMonitor; |
37 | import org.eclipse.core.runtime.IProgressMonitorWithBlocking; | |
38 | 37 | import org.eclipse.core.runtime.IStatus; |
39 | 38 | import org.eclipse.core.runtime.NullProgressMonitor; |
40 | 39 | import org.eclipse.core.runtime.OperationCanceledException; |
109 | 108 | assertNotNull(progressMonitor); |
110 | 109 | assertFalse(progressMonitor instanceof NullProgressMonitor); |
111 | 110 | assertFalse(progressMonitor instanceof EventLoopProgressMonitor); |
112 | assertTrue(progressMonitor instanceof IProgressMonitorWithBlocking); | |
113 | 111 | |
114 | 112 | // Because this monitor is not EventLoopProgressMonitor, it will not |
115 | 113 | // process UI events while waiting on workspace lock |
+0
-2
32 | 32 | import org.eclipse.core.internal.resources.File; |
33 | 33 | |
34 | 34 | import org.eclipse.core.runtime.IProgressMonitor; |
35 | import org.eclipse.core.runtime.IProgressMonitorWithBlocking; | |
36 | 35 | import org.eclipse.core.runtime.NullProgressMonitor; |
37 | 36 | import org.eclipse.core.runtime.jobs.Job; |
38 | 37 | |
93 | 92 | assertNotNull(progressMonitor); |
94 | 93 | assertFalse(progressMonitor instanceof NullProgressMonitor); |
95 | 94 | assertFalse(progressMonitor instanceof EventLoopProgressMonitor); |
96 | assertTrue(progressMonitor instanceof IProgressMonitorWithBlocking); | |
97 | 95 | |
98 | 96 | // Because this monitor is not EventLoopProgressMonitor, it will not |
99 | 97 | // process UI events while waiting on workspace lock |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Bundle-Name |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.genericeditor;singleton:=true |
4 | Bundle-Version: 1.1.700.qualifier | |
4 | Bundle-Version: 1.1.800.qualifier | |
5 | 5 | Bundle-Vendor: %Bundle-Vendor |
6 | 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
7 | 7 | Require-Bundle: org.eclipse.ui.workbench.texteditor;bundle-version="3.10.0", |
0 | Bug 566471 - I20200828-0150 - Comparator Errors Found⏎ |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: Examples for Generic Editor |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.genericeditor.examples;singleton:=true |
4 | Bundle-Version: 1.1.600.qualifier | |
4 | Bundle-Version: 1.1.700.qualifier | |
5 | 5 | Bundle-Vendor: Eclipse.org |
6 | 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
7 | 7 | Require-Bundle: org.eclipse.ui.genericeditor;bundle-version="1.0.0", |
0 | Bug 521182 - [compiler] method reference on null object should throw NPE at runtime (JLS compliance)⏎ | |
0 | Bug 521182 - [compiler] method reference on null object should throw NPE at runtime (JLS compliance) | |
1 | Bug 566471 - I20200828-0150 - Comparator Errors Found⏎ |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.genericeditor.tests;singleton:=true |
4 | Bundle-Version: 1.1.500.qualifier | |
4 | Bundle-Version: 1.1.600.qualifier | |
5 | 5 | Bundle-Vendor: %Plugin.providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: org.eclipse.ui.genericeditor.tests, |
0 | # To force a version qualifier update add the bug here | |
1 | Bug 566471 - I20200828-0150 - Comparator Errors Found |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.ui</groupId> |
20 | 20 | <artifactId>org.eclipse.ui.genericeditor.tests</artifactId> |
21 | <version>1.1.500-SNAPSHOT</version> | |
21 | <version>1.1.600-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
0 | 0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
1 | 1 | <component id="org.eclipse.ui.workbench.texteditor" version="2"> |
2 | <resource path="META-INF/MANIFEST.MF"> | |
3 | <filter comment="Bug 549604" id="926941240"> | |
4 | <message_arguments> | |
5 | <message_argument value="3.13.0"/> | |
6 | <message_argument value="3.12.0"/> | |
7 | </message_arguments> | |
8 | </filter> | |
9 | </resource> | |
10 | <resource path="src/org/eclipse/ui/texteditor/AbstractTextEditor.java" type="org.eclipse.ui.texteditor.AbstractTextEditor"> | |
11 | <filter comment="Bug 549604" id="336658481"> | |
12 | <message_arguments> | |
13 | <message_argument value="org.eclipse.ui.texteditor.AbstractTextEditor"/> | |
14 | <message_argument value="PREFERENCE_SHOW_CARET_OFFSET"/> | |
15 | </message_arguments> | |
16 | </filter> | |
17 | <filter comment="Bug 549604" id="336658481"> | |
18 | <message_arguments> | |
19 | <message_argument value="org.eclipse.ui.texteditor.AbstractTextEditor"/> | |
20 | <message_argument value="PREFERENCE_SHOW_SELECTION_SIZE"/> | |
21 | </message_arguments> | |
22 | </filter> | |
23 | </resource> | |
24 | 2 | <resource path="src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java" type="org.eclipse.ui.texteditor.ITextEditorActionConstants"> |
25 | 3 | <filter id="571473929"> |
26 | 4 | <message_arguments> |
43 | 43 | org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled |
44 | 44 | org.eclipse.jdt.core.compiler.problem.discouragedReference=error |
45 | 45 | org.eclipse.jdt.core.compiler.problem.emptyStatement=warning |
46 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | |
46 | 47 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
47 | 48 | org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning |
48 | 49 | org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning |
99 | 100 | org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=info |
100 | 101 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore |
101 | 102 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore |
103 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | |
102 | 104 | org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled |
103 | 105 | org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error |
104 | 106 | org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled |
131 | 133 | org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning |
132 | 134 | org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning |
133 | 135 | org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning |
136 | org.eclipse.jdt.core.compiler.release=disabled | |
134 | 137 | org.eclipse.jdt.core.compiler.source=1.8 |
138 | org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false | |
135 | 139 | org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 |
136 | 140 | org.eclipse.jdt.core.formatter.align_type_members_on_columns=false |
141 | org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false | |
142 | org.eclipse.jdt.core.formatter.align_with_spaces=false | |
143 | org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 | |
137 | 144 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 |
138 | 145 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 |
139 | 146 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 |
140 | 147 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 |
141 | 148 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 |
142 | 149 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 |
150 | org.eclipse.jdt.core.formatter.alignment_for_assertion_message=16 | |
143 | 151 | org.eclipse.jdt.core.formatter.alignment_for_assignment=0 |
144 | 152 | org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 |
153 | org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 | |
145 | 154 | org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 |
155 | org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 | |
146 | 156 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 |
147 | org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 | |
157 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 | |
158 | org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 | |
148 | 159 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 |
149 | 160 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 |
161 | org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 | |
150 | 162 | org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 |
163 | org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 | |
151 | 164 | org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 |
165 | org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 | |
152 | 166 | org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 |
153 | 167 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 |
154 | 168 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 |
169 | org.eclipse.jdt.core.formatter.alignment_for_record_components=16 | |
170 | org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 | |
155 | 171 | org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 |
156 | 172 | org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 |
173 | org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 | |
174 | org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 | |
157 | 175 | org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 |
158 | 176 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 |
177 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 | |
159 | 178 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 |
160 | 179 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 |
161 | 180 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 |
163 | 182 | org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 |
164 | 183 | org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 |
165 | 184 | org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 |
185 | org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 | |
166 | 186 | org.eclipse.jdt.core.formatter.blank_lines_after_package=1 |
187 | org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 | |
167 | 188 | org.eclipse.jdt.core.formatter.blank_lines_before_field=0 |
168 | 189 | org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 |
169 | 190 | org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 |
172 | 193 | org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 |
173 | 194 | org.eclipse.jdt.core.formatter.blank_lines_before_package=0 |
174 | 195 | org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 |
196 | org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 | |
175 | 197 | org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 |
176 | 198 | org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line |
177 | 199 | org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line |
183 | 205 | org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line |
184 | 206 | org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line |
185 | 207 | org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line |
208 | org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line | |
209 | org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line | |
186 | 210 | org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line |
187 | 211 | org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line |
212 | org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true | |
213 | org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false | |
188 | 214 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false |
189 | 215 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false |
216 | org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true | |
190 | 217 | org.eclipse.jdt.core.formatter.comment.format_block_comments=true |
191 | 218 | org.eclipse.jdt.core.formatter.comment.format_header=false |
192 | 219 | org.eclipse.jdt.core.formatter.comment.format_html=true |
193 | 220 | org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true |
194 | 221 | org.eclipse.jdt.core.formatter.comment.format_line_comments=true |
195 | 222 | org.eclipse.jdt.core.formatter.comment.format_source_code=true |
196 | org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true | |
197 | org.eclipse.jdt.core.formatter.comment.indent_root_tags=true | |
223 | org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false | |
224 | org.eclipse.jdt.core.formatter.comment.indent_root_tags=false | |
225 | org.eclipse.jdt.core.formatter.comment.indent_tag_description=false | |
198 | 226 | org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert |
199 | org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert | |
227 | org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert | |
228 | org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert | |
200 | 229 | org.eclipse.jdt.core.formatter.comment.line_length=80 |
201 | 230 | org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true |
202 | 231 | org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true |
207 | 236 | org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off |
208 | 237 | org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on |
209 | 238 | org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false |
210 | org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true | |
239 | org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false | |
211 | 240 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true |
212 | 241 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true |
213 | 242 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true |
243 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true | |
214 | 244 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true |
215 | 245 | org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true |
216 | 246 | org.eclipse.jdt.core.formatter.indent_empty_lines=false |
242 | 272 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert |
243 | 273 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert |
244 | 274 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert |
275 | org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert | |
245 | 276 | org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert |
277 | org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert | |
278 | org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert | |
246 | 279 | org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert |
247 | 280 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert |
248 | 281 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert |
249 | 282 | org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert |
283 | org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert | |
250 | 284 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert |
251 | 285 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert |
252 | 286 | org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert |
272 | 306 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert |
273 | 307 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert |
274 | 308 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert |
309 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert | |
275 | 310 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert |
311 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert | |
276 | 312 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert |
277 | 313 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert |
278 | 314 | org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert |
279 | 315 | org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert |
316 | org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert | |
317 | org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert | |
318 | org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert | |
280 | 319 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert |
281 | 320 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert |
282 | 321 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert |
293 | 332 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert |
294 | 333 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert |
295 | 334 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert |
335 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert | |
296 | 336 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert |
297 | 337 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert |
298 | 338 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert |
301 | 341 | org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert |
302 | 342 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert |
303 | 343 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert |
344 | org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert | |
304 | 345 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert |
305 | 346 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert |
347 | org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert | |
348 | org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert | |
306 | 349 | org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert |
350 | org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert | |
307 | 351 | org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert |
352 | org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert | |
353 | org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert | |
308 | 354 | org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert |
309 | 355 | org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert |
310 | 356 | org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert |
357 | org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert | |
311 | 358 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert |
312 | 359 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert |
313 | 360 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert |
324 | 371 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert |
325 | 372 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert |
326 | 373 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert |
374 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert | |
327 | 375 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert |
328 | 376 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert |
329 | 377 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert |
350 | 398 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert |
351 | 399 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert |
352 | 400 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert |
401 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert | |
353 | 402 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert |
403 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert | |
354 | 404 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert |
355 | 405 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert |
356 | 406 | org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert |
357 | 407 | org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert |
408 | org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert | |
409 | org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert | |
358 | 410 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert |
359 | 411 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert |
360 | 412 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert |
366 | 418 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert |
367 | 419 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert |
368 | 420 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert |
421 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert | |
422 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert | |
369 | 423 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert |
370 | 424 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert |
371 | 425 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert |
381 | 435 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert |
382 | 436 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert |
383 | 437 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert |
438 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert | |
384 | 439 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert |
385 | 440 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert |
386 | 441 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert |
391 | 446 | org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert |
392 | 447 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert |
393 | 448 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert |
449 | org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert | |
394 | 450 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert |
395 | 451 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert |
396 | 452 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert |
453 | org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert | |
454 | org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert | |
397 | 455 | org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert |
398 | 456 | org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert |
399 | 457 | org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert |
405 | 463 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert |
406 | 464 | org.eclipse.jdt.core.formatter.join_lines_in_comments=true |
407 | 465 | org.eclipse.jdt.core.formatter.join_wrapped_lines=true |
466 | org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never | |
467 | org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never | |
468 | org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never | |
408 | 469 | org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false |
409 | 470 | org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false |
471 | org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never | |
472 | org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never | |
473 | org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never | |
410 | 474 | org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false |
475 | org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never | |
476 | org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never | |
477 | org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never | |
478 | org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never | |
479 | org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never | |
480 | org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false | |
481 | org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false | |
482 | org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false | |
483 | org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false | |
411 | 484 | org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false |
485 | org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never | |
412 | 486 | org.eclipse.jdt.core.formatter.lineSplit=120 |
413 | 487 | org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false |
414 | 488 | org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false |
489 | org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 | |
490 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 | |
415 | 491 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 |
492 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 | |
493 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 | |
494 | org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 | |
416 | 495 | org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 |
417 | 496 | org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines |
418 | 497 | org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines |
422 | 501 | org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines |
423 | 502 | org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines |
424 | 503 | org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines |
504 | org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines | |
425 | 505 | org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines |
426 | 506 | org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines |
427 | 507 | org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true |
428 | 508 | org.eclipse.jdt.core.formatter.tabulation.char=tab |
429 | 509 | org.eclipse.jdt.core.formatter.tabulation.size=4 |
510 | org.eclipse.jdt.core.formatter.text_block_indentation=0 | |
430 | 511 | org.eclipse.jdt.core.formatter.use_on_off_tags=false |
431 | 512 | org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false |
513 | org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true | |
514 | org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true | |
432 | 515 | org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false |
433 | 516 | org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true |
517 | org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true | |
434 | 518 | org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true |
519 | org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true | |
520 | org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true | |
435 | 521 | org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true |
522 | org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true | |
523 | org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true | |
524 | org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true | |
436 | 525 | org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true |
437 | 526 | org.eclipse.jdt.core.incompatibleJDKLevel=ignore |
438 | 527 | org.eclipse.jdt.core.incompleteClasspath=error |
0 | 0 | eclipse.preferences.version=1 |
1 | 1 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true |
2 | 2 | formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile |
3 | formatter_settings_version=12 | |
3 | formatter_settings_version=20 | |
4 | 4 | org.eclipse.jdt.ui.exception.name=e |
5 | 5 | org.eclipse.jdt.ui.gettersetter.use.is=true |
6 | 6 | org.eclipse.jdt.ui.ignorelowercasenames=true |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %pluginName |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor; singleton:=true |
4 | Bundle-Version: 3.14.200.qualifier | |
4 | Bundle-Version: 3.15.0.qualifier | |
5 | 5 | Bundle-Activator: org.eclipse.ui.internal.texteditor.TextEditorPlugin |
6 | 6 | Bundle-ActivationPolicy: lazy |
7 | 7 | Bundle-Vendor: %providerName |
64 | 64 | lowerCase.description= Changes the selection to lower case |
65 | 65 | lowerCase.label= To Lower Case |
66 | 66 | |
67 | goToLastEditPosition.label= Last Edit Location | |
68 | goToLastEditPosition.description= Last edit location | |
67 | goToLastEditPosition.label= Previous Edit Location | |
68 | goToLastEditPosition.description= Previous edit location | |
69 | goToNextEditPosition.label= Next Edit Location | |
70 | goToNextEditPosition.description= Next edit location | |
69 | 71 | |
70 | 72 | command.clearMark.description = Clear the mark |
71 | 73 | command.clearMark.name = Clear Mark |
196 | 198 | blockSelectionModeFont.label= Text Editor Block Selection Font |
197 | 199 | blockSelectionModeFont.description= The block selection mode font is used by text editors in block (column) mode. A monospace font should be used. |
198 | 200 | |
199 | MinimapView.name=Minimap⏎ | |
201 | MinimapView.name=Minimap |
356 | 356 | description="%goToLastEditPosition.description" |
357 | 357 | categoryId="org.eclipse.ui.category.navigate" |
358 | 358 | id="org.eclipse.ui.edit.text.gotoLastEditPosition"> |
359 | </command> | |
360 | <command | |
361 | name="%goToNextEditPosition.label" | |
362 | description="%goToNextEditPosition.description" | |
363 | categoryId="org.eclipse.ui.category.navigate" | |
364 | id="org.eclipse.ui.edit.text.gotoNextEditPosition"> | |
359 | 365 | </command> |
360 | 366 | <command |
361 | 367 | name="%smartEnter.label" |
590 | 596 | commandId="org.eclipse.ui.edit.text.gotoLastEditPosition" |
591 | 597 | contextId="org.eclipse.ui.contexts.window" |
592 | 598 | schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" |
593 | sequence="CTRL+Q"/> <!-- Command+Q is quit on carbon, so don't overwrite it --> | |
599 | sequence="M3+CTRL+ARROW_LEFT"/> | |
600 | <key | |
601 | commandId="org.eclipse.ui.edit.text.gotoNextEditPosition" | |
602 | contextId="org.eclipse.ui.contexts.window" | |
603 | schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" | |
604 | sequence="M3+CTRL+ARROW_RIGHT"/> | |
605 | <key | |
606 | commandId="org.eclipse.ui.edit.text.gotoLastEditPosition" | |
607 | contextId="org.eclipse.ui.contexts.window" | |
608 | schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" | |
609 | sequence="CTRL+Q"/><!-- legacy mapping --> | |
594 | 610 | <key |
595 | 611 | commandId="org.eclipse.ui.edit.text.smartEnter" |
596 | 612 | contextId="org.eclipse.ui.textEditorScope" |
+49
-0
31 | 31 | private final String fEditorId; |
32 | 32 | /** The position */ |
33 | 33 | private final Position fPosition; |
34 | /** | |
35 | * how many characters may come in between two edit positions for them to | |
36 | * still be lumped into same bucket in position history (designed to prevent | |
37 | * filling history with meaningless noise of very similar positions) | |
38 | */ | |
39 | public static final int PROXIMITY_THRESHOLD = 30; | |
34 | 40 | |
35 | 41 | /** |
36 | 42 | * Creates a new edit position. |
72 | 78 | public Position getPosition() { |
73 | 79 | return fPosition; |
74 | 80 | } |
81 | ||
82 | /** | |
83 | * @param a Position to compare the other arg against | |
84 | * @param b Another position to compare the first arg against | |
85 | * @param threshold The maximum allowed distance between Position args for them | |
86 | * to be considered co-located | |
87 | * @return true if both Position args are colocated as defined by the threshold | |
88 | * param | |
89 | * @since 3.15 | |
90 | */ | |
91 | public static boolean areCoLocated(Position a, Position b, int threshold) { | |
92 | if (a == null || b == null) { | |
93 | return false; | |
94 | } | |
95 | int center1 = a.offset + (a.length / 2); | |
96 | int center2 = b.offset + (b.length / 2); | |
97 | int centerDistance = Math.abs(center1 - center2); | |
98 | int minWithoutOverlap = a.length / 2 + b.length / 2; | |
99 | return centerDistance < (minWithoutOverlap + threshold); | |
100 | } | |
101 | ||
102 | /** | |
103 | * @since 3.15 | |
104 | */ | |
105 | public static boolean areCoLocated(Position a, Position b) { | |
106 | return EditPosition.areCoLocated(a, b, EditPosition.PROXIMITY_THRESHOLD); | |
107 | } | |
108 | ||
109 | /** | |
110 | * @since 3.15 | |
111 | */ | |
112 | public static boolean areCoLocated(EditPosition a, EditPosition b, int threshold) { | |
113 | return a != null && b != null && a.getEditorInput().getName() | |
114 | .equals(b.getEditorInput().getName()) | |
115 | && EditPosition.areCoLocated(a.getPosition(), b.getPosition(), threshold); | |
116 | } | |
117 | ||
118 | /** | |
119 | * @since 3.15 | |
120 | */ | |
121 | public static boolean areCoLocated(EditPosition a, EditPosition b) { | |
122 | return EditPosition.areCoLocated(a, b, EditPosition.PROXIMITY_THRESHOLD); | |
123 | } | |
75 | 124 | } |
+2
-0
27 | 27 | |
28 | 28 | public static String Editor_error_gotoLastEditPosition_title; |
29 | 29 | public static String Editor_error_gotoLastEditPosition_message; |
30 | public static String Editor_error_gotoNextEditPosition_title; | |
31 | public static String Editor_error_gotoNextEditPosition_message; | |
30 | 32 | |
31 | 33 | static { |
32 | 34 | NLS.initializeMessages(BUNDLE_NAME, EditorMessages.class); |
+2
-0
16 | 16 | |
17 | 17 | Editor_error_gotoLastEditPosition_title= Problems going to last edit position |
18 | 18 | Editor_error_gotoLastEditPosition_message= Unable to go to the last edit position. |
19 | Editor_error_gotoNextEditPosition_title= Problems going to next edit position | |
20 | Editor_error_gotoNextEditPosition_message= Unable to go to the next edit position. |
+412
-0
0 | /******************************************************************************* | |
1 | * Copyright (c) 2020 Ari Kast and others. | |
2 | * | |
3 | * This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License 2.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * https://www.eclipse.org/legal/epl-2.0/ | |
7 | * | |
8 | * SPDX-License-Identifier: EPL-2.0 | |
9 | * | |
10 | * Contributors: | |
11 | * Ari Kast - initial API and implementation | |
12 | *******************************************************************************/ | |
13 | ||
14 | package org.eclipse.ui.internal.texteditor; | |
15 | ||
16 | import java.lang.reflect.Array; | |
17 | ||
18 | /** | |
19 | * @author Ari Kast | |
20 | * | |
21 | * Tracks history in order of insertion. It can operate either as a ring | |
22 | * or as a line: in ring mode, if history size is N, then calling | |
23 | * goBackward N times brings you full circle back to your current | |
24 | * location in linear mode, if history size is N, then calling | |
25 | * goBackward N times brings you to the beginning, after which | |
26 | * additional calls to goBackward will have no effect until either | |
27 | * goForward is called or a new entry is added. Both linear and ring | |
28 | * mode overwrite history as needed when buffer is full | |
29 | * @param <T> the type of the object instances being tracked in history | |
30 | * | |
31 | * @since 3.15 | |
32 | */ | |
33 | public class HistoryTracker<T> { | |
34 | // the actual historical data | |
35 | T[] fHistory; | |
36 | ||
37 | // function to determine whether history elements can be merged | |
38 | CandidateEvaluator<T> fEvaluator; | |
39 | ||
40 | // pointer to current location in history queue | |
41 | Navigator<T> fBrowsePoint; | |
42 | ||
43 | // pointer to most recent insertion to history queue. New insertions always | |
44 | // go to index fMostRecent + 1 | |
45 | Navigator<T> fInsertionPoint; | |
46 | ||
47 | // the size of the dataset contained in history queue | |
48 | // grows til it reaches history.length, and generally wont | |
49 | // shrink | |
50 | int fSize; | |
51 | ||
52 | // controls whether navigation wraps around in circular fashion | |
53 | // or if it is purely linear | |
54 | boolean fUseCircularNavigation; | |
55 | ||
56 | /** | |
57 | * @param historySize the buffer size. additional insertions will | |
58 | * overwrite oldest insertions | |
59 | * @param clazz the class type of the objects being tracked | |
60 | * @param evaluator The expression which compares incoming elements | |
61 | * against existing elements. If this expression | |
62 | * yields true, then the element(s) for which it | |
63 | * was true is/are replaced | |
64 | * @param useCircularNavigation when true the history operates in ring mode, | |
65 | * otherwise it is linear | |
66 | */ | |
67 | @SuppressWarnings("unchecked") | |
68 | public HistoryTracker(int historySize, Class<T> clazz, CandidateEvaluator<T> evaluator, | |
69 | boolean useCircularNavigation) { | |
70 | historySize = Math.max(historySize, 1); // size < 1 makes no sense, so | |
71 | // enforce at least size 1 | |
72 | fHistory = (T[]) Array.newInstance(clazz, historySize); | |
73 | this.fEvaluator = evaluator; | |
74 | this.fUseCircularNavigation = useCircularNavigation; | |
75 | fBrowsePoint = new Navigator<>(this); | |
76 | fInsertionPoint = new Navigator<>(this); | |
77 | } | |
78 | ||
79 | public T browseBackward() { | |
80 | if (canGoBackward()) { | |
81 | fBrowsePoint.decr(); | |
82 | } | |
83 | return getCurrentBrowsePoint(); | |
84 | } | |
85 | ||
86 | public T browseForward() { | |
87 | if (canGoForward()) { | |
88 | fBrowsePoint.incr(); | |
89 | } | |
90 | return getCurrentBrowsePoint(); | |
91 | } | |
92 | ||
93 | private boolean canGoBackward() { | |
94 | return fSize > 0 && (fUseCircularNavigation || fBrowsePoint.getPriorIndex() != fInsertionPoint.getIndex()); | |
95 | } | |
96 | ||
97 | private boolean canGoForward() { | |
98 | return fSize > 0 && (fUseCircularNavigation || fBrowsePoint.getIndex() != fInsertionPoint.getIndex()); | |
99 | } | |
100 | ||
101 | public T getCurrentBrowsePoint() { | |
102 | return fBrowsePoint.currentItem(); | |
103 | } | |
104 | ||
105 | public T getNext() { | |
106 | if (canGoForward()) { | |
107 | return getAt(fBrowsePoint.getNextIndex()); | |
108 | } else { | |
109 | return fBrowsePoint.currentItem(); | |
110 | } | |
111 | } | |
112 | ||
113 | T getAt(int index) { | |
114 | if (fSize == 0) { | |
115 | return null; | |
116 | } | |
117 | ||
118 | int i = moddedIndex(index); | |
119 | return fHistory[i]; | |
120 | } | |
121 | ||
122 | /** | |
123 | * This method always adds the parameter element at the current history | |
124 | * location. If history is full (capacity == size) then an existing element is | |
125 | * overwritten in the process. If there exists an element such that | |
126 | * evaluator.canReplace() yields true, then that element is prioritized for | |
127 | * being overwritten | |
128 | * | |
129 | * @param newItem The object instance being added to history | |
130 | * @return The element which was evicted to make room for the incoming element. | |
131 | * Returns null if nothing was evicted | |
132 | */ | |
133 | public T addOrReplace(T newItem) { | |
134 | ||
135 | T answer = null; | |
136 | // if a replacement candidate exists, delete it since this | |
137 | // incoming will be replacing it | |
138 | ||
139 | /** | |
140 | * This loop could potentially degrade to N^2 performance in case of multiple | |
141 | * deletions, but in practice it 1) shouldnt matter for our small history sizes, | |
142 | * and 2) will seldom delete more than 1 item for O(N) performance. | |
143 | * | |
144 | * If performance is ever a concern, several improvements could be made: 1) | |
145 | * perform all deletions in a single pass, then do a single additional pass for | |
146 | * compaction for a total of 2 passes 2) uncomment the "break" statement as | |
147 | * explained below 3) use a different data structure altogether, eg maybe an | |
148 | * ordered tree of some kind | |
149 | */ | |
150 | for (int i = fInsertionPoint.getIndex(); i > fInsertionPoint.getIndex() - fSize; i--) { | |
151 | T candidate = getAt(i); | |
152 | if (candidate != null && fEvaluator.canReplace(newItem, candidate)) { | |
153 | answer = deleteAt(i); | |
154 | /** | |
155 | * if performance is ever a concern, the below break could be uncommented so | |
156 | * that this method only de-dupes first match instead of all matches. generally | |
157 | * first match would be sufficient, except there can be drift over time eg if | |
158 | * history contains [10,20,30] and vicinity threshold defined as distance 2, | |
159 | * then you insert the following series: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 | |
160 | * even if each insert overwrote the prior, you still could end up with dataset | |
161 | * [20, 20, 30]. By not breaking here we prevent that state from occuring, but | |
162 | * at some computation cost. Therefore if cost (performance) ever a problem, we | |
163 | * could just accept that occasional suboptimal history state for better | |
164 | * performance | |
165 | */ | |
166 | // break; | |
167 | } | |
168 | } | |
169 | ||
170 | T replaced = addLast(newItem); | |
171 | if (answer == null) { | |
172 | answer = replaced; | |
173 | } | |
174 | ||
175 | return answer; | |
176 | } | |
177 | ||
178 | private T addLast(T newItem) { | |
179 | if (newItem == null) { | |
180 | return deleteLast(); | |
181 | } | |
182 | ||
183 | if (fSize >= fHistory.length) { | |
184 | // no space, so just overwrite next slot | |
185 | fInsertionPoint.incr(); | |
186 | fBrowsePoint.jumpTo(fInsertionPoint); | |
187 | return replaceAt(newItem, fInsertionPoint); | |
188 | } else { | |
189 | // there's at least one empty slot so data size can grow | |
190 | expand(); | |
191 | fInsertionPoint.incr(); | |
192 | fBrowsePoint.jumpTo(fInsertionPoint); | |
193 | return shiftInsert(newItem); | |
194 | } | |
195 | ||
196 | } | |
197 | ||
198 | // inserts here and shifts existing values until either empty space is found | |
199 | // or end is reached, in which case last evaluated slot is discarded | |
200 | private T shiftInsert(T newItem) { | |
201 | ||
202 | T answer = replaceAt(newItem, fInsertionPoint); | |
203 | T tmp = answer; | |
204 | ||
205 | // shift from here to the end until empty slot found | |
206 | for (int i = fInsertionPoint.getIndex() + 1; i < fSize; i++) { | |
207 | tmp = replaceAt(tmp, i); | |
208 | } | |
209 | ||
210 | return answer; | |
211 | } | |
212 | ||
213 | // deletes and shifts to fill in the hole created by deletion | |
214 | private T deleteAt(int index) { | |
215 | if (fSize == 0) { | |
216 | return null; | |
217 | } | |
218 | int modIndex = moddedIndex(index); | |
219 | T answer = replaceAt(null, modIndex); | |
220 | ||
221 | // shift to fill in any gaps to keep data contiguous so that mod | |
222 | // calculations work | |
223 | T priorVal = null; | |
224 | for (int i = fSize - 1; i >= modIndex; i--) { | |
225 | priorVal = replaceAt(priorVal, i); | |
226 | } | |
227 | ||
228 | if (answer != null) { | |
229 | fSize--; | |
230 | } | |
231 | ||
232 | // adjust insertion point if it was affected by the shift | |
233 | if (fInsertionPoint.getIndex() >= modIndex && fSize > 0) { | |
234 | fInsertionPoint.decr(); | |
235 | } | |
236 | ||
237 | // adjust browse point if it was affected by the shift | |
238 | if (fBrowsePoint.getIndex() >= modIndex && fSize > 0) { | |
239 | fBrowsePoint.decr(); | |
240 | } | |
241 | ||
242 | return answer; | |
243 | } | |
244 | ||
245 | public T deleteLast() { | |
246 | T answer = deleteAt(fInsertionPoint.getIndex()); | |
247 | return answer; | |
248 | } | |
249 | ||
250 | private T replaceAt(T newItem, int index) { | |
251 | if (fSize == 0) { | |
252 | return null; | |
253 | } | |
254 | int i = moddedIndex(index); | |
255 | ||
256 | T replaced = getAt(i); | |
257 | fHistory[i] = newItem; | |
258 | return replaced; | |
259 | } | |
260 | ||
261 | private T replaceAt(T newItem, Navigator<T> navigator) { | |
262 | return replaceAt(newItem, navigator.getIndex()); | |
263 | } | |
264 | ||
265 | public T replaceLast(T newItem) { | |
266 | if (newItem == null) { | |
267 | return deleteLast(); | |
268 | } | |
269 | fBrowsePoint.jumpTo(fInsertionPoint); | |
270 | return replaceAt(newItem, fInsertionPoint); | |
271 | } | |
272 | ||
273 | void expand() { | |
274 | fSize = Math.max(fSize, (fSize + 1) % (fHistory.length + 1)); | |
275 | } | |
276 | ||
277 | private int moddedIndex(int index) { | |
278 | return Math.floorMod(index, fSize); | |
279 | } | |
280 | ||
281 | public boolean isEmpty() { | |
282 | return fInsertionPoint.currentItem() == null; | |
283 | } | |
284 | ||
285 | public int getSize() { | |
286 | return fSize; | |
287 | } | |
288 | ||
289 | public Navigator<T> navigator() { | |
290 | Navigator<T> answer = new Navigator<>(this); | |
291 | answer.jumpTo(fInsertionPoint); | |
292 | return answer; | |
293 | } | |
294 | ||
295 | // for internal use, not public | |
296 | Navigator<T> navigator(int index) { | |
297 | Navigator<T> answer = new Navigator<>(this); | |
298 | answer.jumpTo(index); | |
299 | return answer; | |
300 | } | |
301 | ||
302 | /** | |
303 | * This method is intended for testing/troubleshooting, not for general use | |
304 | * Beware it has O(N) performance | |
305 | * | |
306 | * @param item The item to check whether this history contains | |
307 | * @return true if history contains item | |
308 | */ | |
309 | public boolean contains(T item) { | |
310 | if (item == null) { | |
311 | return false; | |
312 | } | |
313 | ||
314 | for (int i = 0; i < fSize; i++) { | |
315 | if (item.equals(getAt(i))) { | |
316 | return true; | |
317 | } | |
318 | } | |
319 | return false; | |
320 | } | |
321 | ||
322 | /** | |
323 | * This method is intended for testing/troubleshooting | |
324 | * | |
325 | * @return true if the state of this object is healthy/as expected | |
326 | */ | |
327 | public boolean isHealthy() { | |
328 | // make sure nulls are consolidated not scattered | |
329 | boolean priorWasNull = false; | |
330 | int flipCount = 0; | |
331 | for (int i = 0; i < fHistory.length; i++) { | |
332 | boolean isNull = (fHistory[i] == null); | |
333 | if (priorWasNull != isNull) { | |
334 | flipCount++; | |
335 | priorWasNull = isNull; | |
336 | } | |
337 | } | |
338 | return flipCount < 2; | |
339 | } | |
340 | ||
341 | /** | |
342 | * | |
343 | * used during history compaction to consolidate like candidates in the history | |
344 | */ | |
345 | public static interface CandidateEvaluator<T> { | |
346 | public boolean canReplace(T a, T b); | |
347 | } | |
348 | ||
349 | /** | |
350 | * for easy traversing thru history | |
351 | */ | |
352 | public static class Navigator<T> { | |
353 | HistoryTracker<T> historyTracker; | |
354 | int fIndex; | |
355 | ||
356 | public Navigator(HistoryTracker<T> tracker) { | |
357 | this.historyTracker = tracker; | |
358 | fIndex = Math.floorMod(-1, tracker.fHistory.length); | |
359 | } | |
360 | ||
361 | void incr() { | |
362 | if (historyTracker.fSize == 0) { | |
363 | return; | |
364 | } | |
365 | ||
366 | fIndex = getNextIndex(); | |
367 | } | |
368 | ||
369 | void decr() { | |
370 | if (historyTracker.fSize == 0) { | |
371 | return; | |
372 | } | |
373 | ||
374 | fIndex = getPriorIndex(); | |
375 | } | |
376 | ||
377 | int getIndex() { | |
378 | return fIndex; | |
379 | } | |
380 | ||
381 | int getNextIndex() { | |
382 | return historyTracker.moddedIndex(fIndex + 1); | |
383 | } | |
384 | ||
385 | int getPriorIndex() { | |
386 | return historyTracker.moddedIndex(fIndex - 1); | |
387 | } | |
388 | ||
389 | public T currentItem() { | |
390 | return historyTracker.getAt(fIndex); | |
391 | } | |
392 | ||
393 | public T nextItem() { | |
394 | incr(); | |
395 | return historyTracker.getAt(fIndex); | |
396 | } | |
397 | ||
398 | public T priorItem() { | |
399 | decr(); | |
400 | return historyTracker.getAt(fIndex); | |
401 | } | |
402 | ||
403 | void jumpTo(Navigator<T> b) { | |
404 | this.fIndex = b.fIndex; | |
405 | } | |
406 | ||
407 | public void jumpTo(int index) { | |
408 | fIndex = historyTracker.moddedIndex(index); | |
409 | } | |
410 | } | |
411 | } |
+95
-27
46 | 46 | */ |
47 | 47 | public final class TextEditorPlugin extends AbstractUIPlugin implements IRegistryChangeListener { |
48 | 48 | |
49 | /** how many edit locations will be remembered in history */ | |
50 | public static final int EDIT_LOCATION_HISTORY_SIZE = 15; | |
51 | ||
49 | 52 | /** The plug-in instance */ |
50 | 53 | private static TextEditorPlugin fgPlugin; |
51 | 54 | |
52 | /** The last edit position */ | |
53 | private EditPosition fLastEditPosition; | |
55 | /** | |
56 | * tracks whether cursor has moved since fEditPositionHistory was used to return | |
57 | * to prior or next location. If cursor has moved, then goto last edit location | |
58 | * simply returns to last edit location. But if cursor has not moved, that means | |
59 | * the command was invoked twice in a row without intervening other actions; in | |
60 | * that case we are in a traversal state of BACKWARD (or FORWARD), so we start | |
61 | * traversing backward (or forward) through history to prior (or next) edit | |
62 | * locations. | |
63 | */ | |
64 | TraversalDirection fEditHistoryTraversalDirection = TraversalDirection.NONE; | |
65 | ||
66 | // an ordered history of prior edit positions | |
67 | private HistoryTracker<EditPosition> fEditPositionHistory = new HistoryTracker<>( | |
68 | EDIT_LOCATION_HISTORY_SIZE, EditPosition.class, | |
69 | (a, b) -> b.getPosition().isDeleted || b.getPosition().isDeleted | |
70 | || EditPosition.areCoLocated(a, b), | |
71 | false); | |
72 | ||
54 | 73 | /** The action which goes to the last edit position */ |
55 | private Set<IAction> fLastEditPositionDependentActions; | |
74 | private Set<IAction> fEditPositionDependentActions; | |
56 | 75 | |
57 | 76 | /** |
58 | 77 | * The quick diff extension registry. |
104 | 123 | */ |
105 | 124 | public static final String REFERENCE_PROVIDER_EXTENSION_POINT= "quickDiffReferenceProvider"; //$NON-NLS-1$ |
106 | 125 | |
126 | public TraversalDirection getEditHistoryTraversalDirection() { | |
127 | return fEditHistoryTraversalDirection; | |
128 | } | |
129 | ||
130 | public void setEditHistoryTraversalDirection(TraversalDirection direction) { | |
131 | this.fEditHistoryTraversalDirection = direction; | |
132 | } | |
133 | ||
134 | public HistoryTracker<EditPosition> getEditPositionHistory() { | |
135 | return fEditPositionHistory; | |
136 | } | |
137 | ||
138 | public void setEditPositionHistory(HistoryTracker<EditPosition> editPositionHistory) { | |
139 | fEditPositionHistory = editPositionHistory; | |
140 | } | |
141 | ||
107 | 142 | /** |
108 | 143 | * Returns the last edit position. |
109 | 144 | * |
110 | * @return the last edit position or <code>null</code> if there is no last edit position | |
145 | * @return the last edit position or <code>null</code> if there is no last | |
146 | * edit position | |
111 | 147 | * @see EditPosition |
112 | 148 | */ |
113 | 149 | public EditPosition getLastEditPosition() { |
114 | return fLastEditPosition; | |
115 | } | |
116 | ||
117 | /** | |
118 | * Sets the last edit position. | |
119 | * | |
120 | * @param lastEditPosition the last edit position | |
121 | * @see EditPosition | |
122 | */ | |
123 | public void setLastEditPosition(EditPosition lastEditPosition) { | |
124 | fLastEditPosition= lastEditPosition; | |
125 | if (fLastEditPosition != null && fLastEditPositionDependentActions != null) { | |
126 | Iterator<IAction> iter= fLastEditPositionDependentActions.iterator(); | |
150 | return fEditPositionHistory.getCurrentBrowsePoint(); | |
151 | } | |
152 | ||
153 | public EditPosition getNextEditPosition() { | |
154 | return fEditPositionHistory.getNext(); | |
155 | } | |
156 | ||
157 | public EditPosition backtrackEditPosition() { | |
158 | return fEditPositionHistory.browseBackward(); | |
159 | } | |
160 | ||
161 | public EditPosition advanceEditPosition() { | |
162 | return fEditPositionHistory.browseForward(); | |
163 | } | |
164 | ||
165 | public void enableLastEditPositionDependentActions() { | |
166 | EditPosition last = fEditPositionHistory.getCurrentBrowsePoint(); | |
167 | ||
168 | if (last != null && getDependentActions() != null) { | |
169 | Iterator<IAction> iter = getDependentActions().iterator(); | |
127 | 170 | while (iter.hasNext()) |
128 | 171 | iter.next().setEnabled(true); |
129 | fLastEditPositionDependentActions= null; | |
172 | setDependentActions(null); | |
130 | 173 | } |
131 | 174 | } |
132 | 175 | |
136 | 179 | * @param action the goto last edit position action |
137 | 180 | */ |
138 | 181 | public void addLastEditPositionDependentAction(IAction action) { |
139 | if (fLastEditPosition != null) | |
182 | if (!fEditPositionHistory.isEmpty()) { | |
140 | 183 | return; |
141 | if (fLastEditPositionDependentActions == null) | |
142 | fLastEditPositionDependentActions= new HashSet<>(); | |
143 | fLastEditPositionDependentActions.add(action); | |
184 | } | |
185 | ||
186 | addDependentAction(action); | |
144 | 187 | } |
145 | 188 | |
146 | 189 | /** |
149 | 192 | * @param action the action that depends on the last edit position |
150 | 193 | */ |
151 | 194 | public void removeLastEditPositionDependentAction(IAction action) { |
152 | if (fLastEditPosition != null) | |
195 | if (!fEditPositionHistory.isEmpty()) { | |
153 | 196 | return; |
154 | if (fLastEditPositionDependentActions != null) | |
155 | fLastEditPositionDependentActions.remove(action); | |
156 | } | |
157 | ||
197 | } | |
198 | ||
199 | removeDependentAction(action); | |
200 | } | |
201 | ||
202 | private Set<IAction> getDependentActions() { | |
203 | return fEditPositionDependentActions; | |
204 | } | |
205 | ||
206 | private void setDependentActions(Set<IAction> actions) { | |
207 | fEditPositionDependentActions = actions; | |
208 | } | |
209 | ||
210 | public void addDependentAction(IAction action) { | |
211 | if (getDependentActions() == null) { | |
212 | setDependentActions(new HashSet<>()); | |
213 | } | |
214 | getDependentActions().add(action); | |
215 | } | |
216 | ||
217 | public void removeDependentAction(IAction action) { | |
218 | if (getDependentActions() != null) { | |
219 | getDependentActions().remove(action); | |
220 | } | |
221 | } | |
158 | 222 | |
159 | 223 | @Override |
160 | 224 | public void start(BundleContext context) throws Exception { |
215 | 279 | public CodeMiningProviderRegistry getCodeMiningProviderRegistry() { |
216 | 280 | return fCodeMiningProviderRegistry; |
217 | 281 | } |
282 | ||
283 | public static enum TraversalDirection { | |
284 | NONE, BACKWARD, FORWARD; | |
285 | } | |
218 | 286 | } |
+6
-8
13 | 13 | package org.eclipse.ui.internal.texteditor.rulers; |
14 | 14 | |
15 | 15 | import java.util.Collections; |
16 | import java.util.Iterator; | |
17 | 16 | import java.util.LinkedHashMap; |
18 | 17 | import java.util.LinkedHashSet; |
19 | 18 | import java.util.Map; |
147 | 146 | */ |
148 | 147 | public void removeVertex(E vertex) { |
149 | 148 | Set<E> targets= fOut.removeAll(vertex); |
150 | for (Iterator<E> it= targets.iterator(); it.hasNext();) | |
151 | fIn.remove(it.next(), vertex); | |
149 | for (E e : targets) | |
150 | fIn.remove(e, vertex); | |
152 | 151 | Set<E> origins= fIn.removeAll(vertex); |
153 | for (Iterator<E> it= origins.iterator(); it.hasNext();) | |
154 | fOut.remove(it.next(), vertex); | |
152 | for (E e : origins) | |
153 | fOut.remove(e, vertex); | |
155 | 154 | } |
156 | 155 | |
157 | 156 | /** |
199 | 198 | if (start == end) |
200 | 199 | return true; |
201 | 200 | |
202 | Set<E> children= fOut.get(start); | |
203 | for (Iterator<E> it= children.iterator(); it.hasNext();) | |
201 | for (E e : fOut.get(start)) | |
204 | 202 | // recursion |
205 | if (hasPath(it.next(), end)) | |
203 | if (hasPath(e, end)) | |
206 | 204 | return true; |
207 | 205 | return false; |
208 | 206 | } |
+67
-115
214 | 214 | import org.eclipse.ui.dnd.IDragAndDropService; |
215 | 215 | import org.eclipse.ui.internal.texteditor.EditPosition; |
216 | 216 | import org.eclipse.ui.internal.texteditor.FocusedInformationPresenter; |
217 | import org.eclipse.ui.internal.texteditor.HistoryTracker; | |
217 | 218 | import org.eclipse.ui.internal.texteditor.NLSUtility; |
218 | 219 | import org.eclipse.ui.internal.texteditor.TextEditorPlugin; |
219 | 220 | import org.eclipse.ui.internal.texteditor.rulers.StringSetSerializer; |
604 | 605 | * |
605 | 606 | * @since 3.0 |
606 | 607 | */ |
607 | private Position fLocalLastEditPosition; | |
608 | 608 | |
609 | 609 | /** The posted updater code. */ |
610 | 610 | private Runnable fRunnable = () -> { |
615 | 615 | |
616 | 616 | // remember the last edit position |
617 | 617 | if (isDirty() && fUpdateLastEditPosition) { |
618 | HistoryTracker<EditPosition> positionHistory = TextEditorPlugin.getDefault() | |
619 | .getEditPositionHistory(); | |
618 | 620 | fUpdateLastEditPosition = false; |
619 | 621 | ISelection sel = getSelectionProvider().getSelection(); |
620 | 622 | IEditorInput input = getEditorInput(); |
621 | 623 | IDocument document = getDocumentProvider().getDocument(input); |
622 | ||
623 | if (fLocalLastEditPosition != null) { | |
624 | if (document != null) { | |
625 | document.removePosition(fLocalLastEditPosition); | |
626 | } | |
627 | fLocalLastEditPosition = null; | |
628 | } | |
624 | IEditorSite editorSite = getEditorSite(); | |
625 | if (editorSite instanceof MultiPageEditorSite) | |
626 | editorSite = ((MultiPageEditorSite) editorSite).getMultiPageEditor().getEditorSite(); | |
629 | 627 | |
630 | 628 | if (sel instanceof ITextSelection && !sel.isEmpty()) { |
631 | 629 | ITextSelection s = (ITextSelection) sel; |
632 | fLocalLastEditPosition = new Position(s.getOffset(), s.getLength()); | |
630 | Position newPosition = new Position(s.getOffset(), s.getLength()); | |
631 | EditPosition newEditPosition = new EditPosition(input, editorSite.getId(), newPosition); | |
632 | EditPosition replaced = positionHistory.addOrReplace(newEditPosition); | |
633 | 633 | if (document != null) { |
634 | if (replaced != null) { | |
635 | document.removePosition(replaced.getPosition()); | |
636 | } | |
634 | 637 | try { |
635 | document.addPosition(fLocalLastEditPosition); | |
638 | if (positionHistory.getSize() > 0) { | |
639 | document.addPosition(positionHistory.getCurrentBrowsePoint().getPosition()); | |
640 | } | |
636 | 641 | } catch (BadLocationException ex) { |
637 | fLocalLastEditPosition = null; | |
642 | positionHistory.deleteLast(); | |
638 | 643 | } |
639 | 644 | } |
640 | 645 | } |
641 | 646 | |
642 | IEditorSite editorSite = getEditorSite(); | |
643 | if (editorSite instanceof MultiPageEditorSite) | |
644 | editorSite = ((MultiPageEditorSite) editorSite).getMultiPageEditor().getEditorSite(); | |
645 | TextEditorPlugin.getDefault() | |
646 | .setLastEditPosition(new EditPosition(input, editorSite.getId(), fLocalLastEditPosition)); | |
647 | TextEditorPlugin.getDefault().enableLastEditPositionDependentActions(); | |
647 | 648 | } |
648 | 649 | } |
649 | 650 | }; |
680 | 681 | |
681 | 682 | @Override |
682 | 683 | public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { |
683 | if (oldInput != null && fLocalLastEditPosition != null) { | |
684 | oldInput.removePosition(fLocalLastEditPosition); | |
685 | fLocalLastEditPosition= null; | |
684 | HistoryTracker<EditPosition> positionHistory = TextEditorPlugin.getDefault().getEditPositionHistory(); | |
685 | if (oldInput != null && !positionHistory.isEmpty()) { | |
686 | for (int i = 0; i < positionHistory.getSize(); i++) | |
687 | oldInput.removePosition(positionHistory.browseBackward().getPosition()); | |
686 | 688 | } |
687 | 689 | } |
688 | 690 | |
689 | 691 | @Override |
690 | 692 | public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { |
693 | discardHistoryFor(oldInput); | |
694 | } | |
695 | ||
696 | private void discardHistoryFor(IDocument input) { | |
697 | HistoryTracker<EditPosition> positionHistory = TextEditorPlugin.getDefault().getEditPositionHistory(); | |
698 | if (input != null && !positionHistory.isEmpty()) { | |
699 | for (int i = 0; i < positionHistory.getSize(); i++) | |
700 | input.removePosition(positionHistory.browseBackward().getPosition()); | |
701 | } | |
702 | ||
691 | 703 | } |
692 | 704 | } |
693 | 705 | |
1738 | 1750 | */ |
1739 | 1751 | @Override |
1740 | 1752 | public void dispose() { |
1741 | for (Iterator<IContributedRulerColumn> iter= new ArrayList<>(fColumns).iterator(); iter.hasNext();) | |
1742 | removeColumn(getRuler(), iter.next()); | |
1753 | for (IContributedRulerColumn iContributedRulerColumn : new ArrayList<>(fColumns)) | |
1754 | removeColumn(getRuler(), iContributedRulerColumn); | |
1743 | 1755 | fColumns.clear(); |
1744 | 1756 | } |
1745 | 1757 | } |
2377 | 2389 | */ |
2378 | 2390 | private SelectionListener fSelectionListener; |
2379 | 2391 | /** The editor's font. */ |
2380 | private Font fFont; /** | |
2381 | * The editor's foreground color. | |
2382 | * @since 2.0 | |
2383 | */ | |
2384 | private Color fForegroundColor; | |
2385 | /** | |
2386 | * The editor's background color. | |
2387 | * @since 2.0 | |
2388 | */ | |
2389 | private Color fBackgroundColor; | |
2390 | /** | |
2391 | * The editor's selection foreground color. | |
2392 | * @since 3.0 | |
2393 | */ | |
2394 | private Color fSelectionForegroundColor; | |
2395 | /** | |
2396 | * The editor's selection background color. | |
2397 | * @since 3.0 | |
2398 | */ | |
2399 | private Color fSelectionBackgroundColor; | |
2392 | private Font fFont; | |
2400 | 2393 | /** |
2401 | 2394 | * The find scope's highlight color. |
2402 | 2395 | * @since 2.0 |
3091 | 3084 | private Runnable fRunnable = () -> { |
3092 | 3085 | // check whether editor has not been disposed yet |
3093 | 3086 | if (fSourceViewer != null && fSourceViewer.getDocument() != null) { |
3094 | handleCursorPositionChanged(); | |
3087 | handleCursorPositionChangedWrapper(); | |
3095 | 3088 | updateSelectionDependentActions(); |
3096 | 3089 | } |
3097 | 3090 | }; |
3128 | 3121 | |
3129 | 3122 | @Override |
3130 | 3123 | public void keyPressed(KeyEvent e) { |
3131 | handleCursorPositionChanged(); | |
3124 | handleCursorPositionChangedWrapper(); | |
3132 | 3125 | } |
3133 | 3126 | |
3134 | 3127 | @Override |
3145 | 3138 | |
3146 | 3139 | @Override |
3147 | 3140 | public void mouseUp(MouseEvent e) { |
3148 | handleCursorPositionChanged(); | |
3141 | handleCursorPositionChangedWrapper(); | |
3149 | 3142 | } |
3150 | 3143 | }; |
3151 | 3144 | } |
3250 | 3243 | |
3251 | 3244 | RulerColumnRegistry registry= RulerColumnRegistry.getDefault(); |
3252 | 3245 | List<RulerColumnDescriptor> descriptors= registry.getColumnDescriptors(); |
3253 | for (Iterator<RulerColumnDescriptor> it= descriptors.iterator(); it.hasNext();) { | |
3254 | final RulerColumnDescriptor descriptor= it.next(); | |
3246 | for (RulerColumnDescriptor descriptor : descriptors) { | |
3255 | 3247 | support.setColumnVisible(descriptor, adapter == null || adapter.isEnabled(descriptor)); |
3256 | 3248 | } |
3257 | 3249 | } |
3931 | 3923 | : createColor(store, PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay()); |
3932 | 3924 | styledText.setForeground(color); |
3933 | 3925 | |
3934 | if (fForegroundColor != null) | |
3935 | fForegroundColor.dispose(); | |
3936 | ||
3937 | fForegroundColor= color; | |
3938 | ||
3939 | 3926 | // ---------- background color ---------------------- |
3940 | 3927 | color= store.getBoolean(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) |
3941 | 3928 | ? null |
3942 | 3929 | : createColor(store, PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); |
3943 | 3930 | styledText.setBackground(color); |
3944 | 3931 | |
3945 | if (fBackgroundColor != null) | |
3946 | fBackgroundColor.dispose(); | |
3947 | ||
3948 | fBackgroundColor= color; | |
3949 | ||
3950 | 3932 | // ----------- selection foreground color -------------------- |
3951 | 3933 | color= store.getBoolean(PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT) |
3952 | 3934 | ? null |
3953 | 3935 | : createColor(store, PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay()); |
3954 | 3936 | styledText.setSelectionForeground(color); |
3955 | 3937 | |
3956 | if (fSelectionForegroundColor != null) | |
3957 | fSelectionForegroundColor.dispose(); | |
3958 | ||
3959 | fSelectionForegroundColor= color; | |
3960 | 3938 | |
3961 | 3939 | // ---------- selection background color ---------------------- |
3962 | 3940 | color= store.getBoolean(PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT) |
3964 | 3942 | : createColor(store, PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay()); |
3965 | 3943 | styledText.setSelectionBackground(color); |
3966 | 3944 | |
3967 | if (fSelectionBackgroundColor != null) | |
3968 | fSelectionBackgroundColor.dispose(); | |
3969 | ||
3970 | fSelectionBackgroundColor= color; | |
3971 | 3945 | } |
3972 | 3946 | } |
3973 | 3947 | |
3991 | 3965 | if (target != null && target instanceof IFindReplaceTargetExtension) |
3992 | 3966 | ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color); |
3993 | 3967 | |
3994 | if (fFindScopeHighlightColor != null) | |
3995 | fFindScopeHighlightColor.dispose(); | |
3996 | ||
3997 | fFindScopeHighlightColor= color; | |
3998 | 3968 | } |
3999 | 3969 | } |
4000 | 3970 | |
4333 | 4303 | |
4334 | 4304 | disposeNonDefaultCaret(); |
4335 | 4305 | fInitialCaret= null; |
4336 | ||
4337 | if (fForegroundColor != null) { | |
4338 | fForegroundColor.dispose(); | |
4339 | fForegroundColor= null; | |
4340 | } | |
4341 | ||
4342 | if (fBackgroundColor != null) { | |
4343 | fBackgroundColor.dispose(); | |
4344 | fBackgroundColor= null; | |
4345 | } | |
4346 | ||
4347 | if (fSelectionForegroundColor != null) { | |
4348 | fSelectionForegroundColor.dispose(); | |
4349 | fSelectionForegroundColor= null; | |
4350 | } | |
4351 | ||
4352 | if (fSelectionBackgroundColor != null) { | |
4353 | fSelectionBackgroundColor.dispose(); | |
4354 | fSelectionBackgroundColor= null; | |
4355 | } | |
4356 | ||
4357 | if (fFindScopeHighlightColor != null) { | |
4358 | fFindScopeHighlightColor.dispose(); | |
4359 | fFindScopeHighlightColor= null; | |
4360 | } | |
4361 | 4306 | |
4362 | 4307 | if (fFontPropertyChangeListener != null) { |
4363 | 4308 | JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener); |
4633 | 4578 | if (PREFERENCE_RULER_CONTRIBUTIONS.equals(property)) { |
4634 | 4579 | String[] difference= StringSetSerializer.getDifference((String) event.getOldValue(), (String) event.getNewValue()); |
4635 | 4580 | IColumnSupport support= getAdapter(IColumnSupport.class); |
4636 | for (int i= 0; i < difference.length; i++) { | |
4637 | RulerColumnDescriptor desc= RulerColumnRegistry.getDefault().getColumnDescriptor(difference[i]); | |
4581 | for (String element : difference) { | |
4582 | RulerColumnDescriptor desc= RulerColumnRegistry.getDefault().getColumnDescriptor(element); | |
4638 | 4583 | if (desc != null && support.isColumnSupported(desc)) { |
4639 | 4584 | boolean newState= !support.isColumnVisible(desc); |
4640 | 4585 | support.setColumnVisible(desc, newState); |
5356 | 5301 | private IAction findContributedAction(String actionID) { |
5357 | 5302 | List<IConfigurationElement> actions= new ArrayList<>(); |
5358 | 5303 | IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(PlatformUI.PLUGIN_ID, "editorActions"); //$NON-NLS-1$ |
5359 | for (int i= 0; i < elements.length; i++) { | |
5360 | IConfigurationElement element= elements[i]; | |
5304 | for (IConfigurationElement element : elements) { | |
5361 | 5305 | if (TAG_CONTRIBUTION_TYPE.equals(element.getName())) { |
5362 | 5306 | IWorkbenchPartSite site = getSite(); |
5363 | 5307 | if (site == null) { |
5366 | 5310 | if (!site.getId().equals(element.getAttribute("targetID"))) //$NON-NLS-1$ |
5367 | 5311 | continue; |
5368 | 5312 | |
5369 | IConfigurationElement[] children= element.getChildren("action"); //$NON-NLS-1$ | |
5370 | for (int j= 0; j < children.length; j++) { | |
5371 | IConfigurationElement child= children[j]; | |
5313 | for (IConfigurationElement child : element.getChildren("action")) { //$NON-NLS-1$ | |
5372 | 5314 | if (actionID.equals(child.getAttribute("actionID"))) //$NON-NLS-1$ |
5373 | 5315 | actions.add(child); |
5374 | 5316 | } |
5537 | 5479 | IAction action; |
5538 | 5480 | |
5539 | 5481 | StyledText textWidget= fSourceViewer.getTextWidget(); |
5540 | for (int i= 0; i < ACTION_MAP.length; i++) { | |
5541 | IdMapEntry entry= ACTION_MAP[i]; | |
5482 | for (IdMapEntry entry : ACTION_MAP) { | |
5542 | 5483 | action= new TextNavigationAction(textWidget, entry.getAction()); |
5543 | 5484 | action.setActionDefinitionId(entry.getActionId()); |
5544 | 5485 | setAction(entry.getActionId(), action); |
6103 | 6044 | menu.add(new Separator(ITextEditorActionConstants.GROUP_REST)); |
6104 | 6045 | menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); |
6105 | 6046 | |
6106 | for (Iterator<IMenuListener> i= fRulerContextMenuListeners.iterator(); i.hasNext();) | |
6107 | i.next().menuAboutToShow(menu); | |
6047 | for (IMenuListener iMenuListener : fRulerContextMenuListeners) | |
6048 | iMenuListener.menuAboutToShow(menu); | |
6108 | 6049 | |
6109 | 6050 | addAction(menu, ITextEditorActionConstants.RULER_MANAGE_BOOKMARKS); |
6110 | 6051 | addAction(menu, ITextEditorActionConstants.RULER_MANAGE_TASKS); |
6381 | 6322 | * @since 2.1 |
6382 | 6323 | */ |
6383 | 6324 | protected void editorSaved() { |
6384 | INavigationLocation[] locations= getSite().getPage().getNavigationHistory().getLocations(); | |
6385 | 6325 | IEditorInput input= getEditorInput(); |
6386 | for (int i= 0; i < locations.length; i++) { | |
6387 | if (locations[i] instanceof TextSelectionNavigationLocation) { | |
6388 | if(input.equals(locations[i].getInput())) { | |
6389 | TextSelectionNavigationLocation location= (TextSelectionNavigationLocation) locations[i]; | |
6326 | for (INavigationLocation location2 : getSite().getPage().getNavigationHistory().getLocations()) { | |
6327 | if (location2 instanceof TextSelectionNavigationLocation) { | |
6328 | if(input.equals(location2.getInput())) { | |
6329 | TextSelectionNavigationLocation location= (TextSelectionNavigationLocation) location2; | |
6390 | 6330 | location.partSaved(this); |
6391 | 6331 | } |
6392 | 6332 | } |
6670 | 6610 | } |
6671 | 6611 | |
6672 | 6612 | /** |
6673 | * Handles a potential change of the cursor position. | |
6674 | * Subclasses may extend. | |
6613 | * Prepares to handles a potential change of the cursor position. Wraps the | |
6614 | * actual handler which cannot itself be modified for fear of disrupting | |
6615 | * existing subclasses which may have overridden it without calling | |
6616 | * super.handleCursorPositionChanged() | |
6617 | * | |
6618 | * @since 3.15 | |
6619 | */ | |
6620 | private void handleCursorPositionChangedWrapper() { | |
6621 | TextEditorPlugin.getDefault() | |
6622 | .setEditHistoryTraversalDirection(TextEditorPlugin.TraversalDirection.NONE); | |
6623 | handleCursorPositionChanged(); | |
6624 | } | |
6625 | ||
6626 | /** | |
6627 | * Handles a potential change of the cursor position. Subclasses may extend. | |
6675 | 6628 | * |
6676 | 6629 | * @since 2.0 |
6677 | 6630 | */ |
7347 | 7300 | */ |
7348 | 7301 | protected final void updateIndentPrefixes() { |
7349 | 7302 | SourceViewerConfiguration configuration= getSourceViewerConfiguration(); |
7350 | String[] types= configuration.getConfiguredContentTypes(fSourceViewer); | |
7351 | for (int i= 0; i < types.length; i++) { | |
7352 | String[] prefixes= configuration.getIndentPrefixes(fSourceViewer, types[i]); | |
7303 | for (String type : configuration.getConfiguredContentTypes(fSourceViewer)) { | |
7304 | String[] prefixes= configuration.getIndentPrefixes(fSourceViewer, type); | |
7353 | 7305 | if (prefixes != null && prefixes.length > 0) |
7354 | fSourceViewer.setIndentPrefixes(prefixes, types[i]); | |
7306 | fSourceViewer.setIndentPrefixes(prefixes, type); | |
7355 | 7307 | } |
7356 | 7308 | } |
7357 | 7309 |
+41
-36
0 | 0 | /******************************************************************************* |
1 | * Copyright (c) 2015 Red Hat Inc. | |
1 | * Copyright (c) 2020 Red Hat Inc. | |
2 | 2 | * |
3 | 3 | * This program and the accompanying materials |
4 | 4 | * are made available under the terms of the Eclipse Public License 2.0 |
9 | 9 | * |
10 | 10 | * Contributors: |
11 | 11 | * Mickael Istria (Red Hat Inc.) - 469918 Zoom In/Out |
12 | * John Taylor <johnpaultaylorii@gmail.com> - Bug 564099 | |
12 | 13 | *******************************************************************************/ |
13 | 14 | package org.eclipse.ui.texteditor; |
14 | 15 | |
15 | import java.util.Arrays; | |
16 | import java.util.ArrayList; | |
17 | import java.util.Collections; | |
16 | 18 | import java.util.HashMap; |
17 | 19 | import java.util.HashSet; |
20 | import java.util.LinkedHashSet; | |
18 | 21 | import java.util.LinkedList; |
22 | import java.util.List; | |
19 | 23 | import java.util.Map; |
24 | import java.util.Queue; | |
20 | 25 | import java.util.Set; |
21 | 26 | |
22 | 27 | import org.eclipse.swt.graphics.FontData; |
74 | 79 | if (fontProperty == null) { |
75 | 80 | fontProperty= JFaceResources.TEXT_FONT; |
76 | 81 | } |
77 | Set<String> fontsToSet= getAffectedFontNames(fontProperty, fontRegistry); | |
78 | FontData[] initialFontData= null; | |
79 | String currentFontName= fontProperty; | |
80 | while (currentFontName != null && (initialFontData= fontRegistry.getFontData(currentFontName)) == null) { | |
81 | currentFontName= fgFontToDefault.get(currentFontName); | |
82 | } | |
83 | ||
84 | FontData[] newFontData= createFontDescriptor(initialFontData).getFontData(); | |
85 | if (newFontData != null) { | |
86 | fontsToSet.stream().forEach(fontName -> fontRegistry.put(fontName, newFontData)); | |
87 | } | |
82 | List<String> fontsToSet = getAffectedFontNames(fontProperty, fontRegistry); | |
83 | for (String fontName : fontsToSet) { | |
84 | FontData[] currentFontData = null; | |
85 | String currentFontName = fontName; | |
86 | while (currentFontName != null && (currentFontData = fontRegistry.getFontData(currentFontName)) == null) { | |
87 | currentFontName = fgFontToDefault.get(currentFontName); | |
88 | } | |
89 | FontData[] newFontData = createFontDescriptor(currentFontData).getFontData(); | |
90 | if (newFontData != null) { | |
91 | fontRegistry.put(fontName, newFontData); | |
92 | } | |
93 | } | |
94 | ||
88 | 95 | return Status.OK_STATUS; |
89 | 96 | } |
90 | 97 | |
132 | 139 | * are set to default or inherit from reference font or a common parent that is affected |
133 | 140 | * too. |
134 | 141 | */ |
135 | private Set<String> getAffectedFontNames(String referenceFontName, FontRegistry fontRegistry) { | |
142 | private List<String> getAffectedFontNames(String referenceFontName, FontRegistry fontRegistry) { | |
136 | 143 | synchronized (AbstractTextZoomHandler.class) { |
137 | 144 | if (fgFontToDefault == null) { |
138 | 145 | // TODO: This should rely on ThemeRegistry and IThemeElementDefinition, |
139 | 146 | // but those aren't visible at that time. So we're recreating the font hierarchy |
140 | 147 | fgFontToDefault= new HashMap<>(); |
141 | 148 | fgDefaultToFonts= new HashMap<>(); |
142 | IConfigurationElement[] themeElements= Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.themes"); //$NON-NLS-1$ | |
143 | for (int i= 0; i < themeElements.length; i++) { | |
144 | IConfigurationElement extension= themeElements[i]; | |
149 | for (IConfigurationElement extension : Platform.getExtensionRegistry() | |
150 | .getConfigurationElementsFor("org.eclipse.ui.themes")) { //$NON-NLS-1$ | |
145 | 151 | if ("fontDefinition".equals(extension.getName())) { //$NON-NLS-1$ |
146 | 152 | String fontId= extension.getAttribute("id"); //$NON-NLS-1$ |
147 | 153 | String defaultsTo= extension.getAttribute("defaultsTo"); //$NON-NLS-1$ |
157 | 163 | } |
158 | 164 | } |
159 | 165 | } |
160 | Set<String> res= new HashSet<>(); | |
161 | FontData[] referenceFontData= fontRegistry.getFontData(referenceFontName); | |
162 | if (fontRegistry.hasValueFor(referenceFontName)) { | |
163 | res.add(referenceFontName); | |
164 | } | |
166 | ||
165 | 167 | String currentFontName= referenceFontName; |
166 | String rootFontName= referenceFontName; | |
168 | ||
167 | 169 | // identify "root" font to change |
170 | String rootFontName = currentFontName; | |
168 | 171 | do { |
169 | 172 | currentFontName= fgFontToDefault.get(currentFontName); |
170 | if (currentFontName != null && Arrays.equals(referenceFontData, fontRegistry.getFontData(currentFontName))) { | |
173 | if (currentFontName != null) { | |
171 | 174 | rootFontName= currentFontName; |
172 | 175 | } |
173 | 176 | } while (currentFontName != null); |
174 | LinkedList<String> fontsToProcess= new LinkedList<>(); | |
177 | ||
178 | // propagate to "children" fonts | |
179 | Set<String> fontNames = new LinkedHashSet<>(); | |
180 | Set<String> alreadyProcessed = new HashSet<>(); | |
181 | Queue<String> fontsToProcess = new LinkedList<>(); | |
175 | 182 | fontsToProcess.add(rootFontName); |
176 | // propage to "children" fonts | |
177 | Set<String> alreadyProcessed= new HashSet<>(); | |
178 | 183 | while (!fontsToProcess.isEmpty()) { |
179 | currentFontName= fontsToProcess.get(0); | |
180 | fontsToProcess.remove(0); | |
181 | // with recent Java, use currentFOntName = fontsToProcess.poll instead of the 2 lines above | |
184 | currentFontName = fontsToProcess.poll(); | |
182 | 185 | if (!alreadyProcessed.contains(currentFontName)) { // avoid infinite loop |
183 | 186 | alreadyProcessed.add(currentFontName); |
184 | FontData[] currentFontData= fontRegistry.getFontData(currentFontName); | |
185 | if (currentFontData == null || Arrays.equals(referenceFontData, currentFontData)) { | |
186 | 187 | if (fontRegistry.hasValueFor(currentFontName)) { |
187 | res.add(currentFontName); | |
188 | fontNames.add(currentFontName); | |
188 | 189 | } |
189 | 190 | Set<String> children= fgDefaultToFonts.get(currentFontName); |
190 | 191 | if (children != null) { |
191 | 192 | fontsToProcess.addAll(children); |
192 | 193 | } |
193 | 194 | } |
194 | } | |
195 | } | |
196 | return res; | |
195 | } | |
196 | ||
197 | // Order matters. Child fonts must be set before parent fonts to avoid | |
198 | // double impacts. | |
199 | List<String> result = new ArrayList<>(fontNames); | |
200 | Collections.reverse(result); | |
201 | return result; | |
197 | 202 | } |
198 | 203 | |
199 | 204 | } |
+3
-3
1071 | 1071 | if (!getAnnotationType().equals(preference.getAnnotationType())) |
1072 | 1072 | return; |
1073 | 1073 | |
1074 | for (int i= 0; i < ATTRIBUTES.length; i++) { | |
1075 | if (!hasValue(ATTRIBUTES[i])) | |
1076 | setValue(ATTRIBUTES[i], preference.getValue(ATTRIBUTES[i])); | |
1074 | for (Object element : ATTRIBUTES) { | |
1075 | if (!hasValue(element)) | |
1076 | setValue(element, preference.getValue(element)); | |
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | if (fAnnotationImageProvider == null) |
+11
-12
167 | 167 | fHippieCompletion.setActionDefinitionId(ITextEditorActionDefinitionIds.HIPPIE_COMPLETION); |
168 | 168 | |
169 | 169 | fStatusFields= new HashMap<>(3); |
170 | for (int i= 0; i < STATUS_FIELD_DEFS.length; i++) { | |
171 | StatusFieldDef fieldDef= STATUS_FIELD_DEFS[i]; | |
170 | for (StatusFieldDef fieldDef : STATUS_FIELD_DEFS) { | |
172 | 171 | fStatusFields.put(fieldDef, new StatusLineContributionItem(fieldDef.category, fieldDef.visible, fieldDef.widthInChars)); |
173 | 172 | } |
174 | 173 | } |
208 | 207 | |
209 | 208 | if (fActiveEditorPart instanceof ITextEditorExtension) { |
210 | 209 | ITextEditorExtension extension= (ITextEditorExtension) fActiveEditorPart; |
211 | for (int i= 0; i < STATUS_FIELD_DEFS.length; i++) | |
212 | extension.setStatusField(null, STATUS_FIELD_DEFS[i].category); | |
210 | for (StatusFieldDef element : STATUS_FIELD_DEFS) | |
211 | extension.setStatusField(null, element.category); | |
213 | 212 | } |
214 | 213 | |
215 | 214 | fActiveEditorPart= part; |
216 | 215 | ITextEditor editor= (part instanceof ITextEditor) ? (ITextEditor) part : null; |
217 | 216 | |
218 | 217 | IActionBars actionBars= getActionBars(); |
219 | for (int i= 0; i < ACTIONS.length; i++) | |
220 | actionBars.setGlobalActionHandler(ACTIONS[i], getAction(editor, ACTIONS[i])); | |
218 | for (String element : ACTIONS) | |
219 | actionBars.setGlobalActionHandler(element, getAction(editor, element)); | |
221 | 220 | actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.SHOW_WHITESPACE_CHARACTERS, getAction(editor, ITextEditorActionConstants.SHOW_WHITESPACE_CHARACTERS)); |
222 | 221 | actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.BLOCK_SELECTION_MODE, getAction(editor, ITextEditorActionConstants.BLOCK_SELECTION_MODE)); |
223 | 222 | if (editor instanceof AbstractTextEditor && ((AbstractTextEditor)editor).isWordWrapSupported()) |
230 | 229 | fGotoLine.setAction(getAction(editor, ITextEditorActionConstants.GOTO_LINE)); |
231 | 230 | fHippieCompletion.setAction(getAction(editor, ITextEditorActionConstants.HIPPIE_COMPLETION)); |
232 | 231 | |
233 | for (int i= 0; i < STATUS_FIELD_DEFS.length; i++) { | |
232 | for (StatusFieldDef element : STATUS_FIELD_DEFS) { | |
234 | 233 | if (fActiveEditorPart instanceof ITextEditorExtension) { |
235 | StatusLineContributionItem statusField= fStatusFields.get(STATUS_FIELD_DEFS[i]); | |
236 | statusField.setActionHandler(getAction(editor, STATUS_FIELD_DEFS[i].actionId)); | |
234 | StatusLineContributionItem statusField= fStatusFields.get(element); | |
235 | statusField.setActionHandler(getAction(editor, element.actionId)); | |
237 | 236 | ITextEditorExtension extension= (ITextEditorExtension) fActiveEditorPart; |
238 | extension.setStatusField(statusField, STATUS_FIELD_DEFS[i].category); | |
237 | extension.setStatusField(statusField, element.category); | |
239 | 238 | } |
240 | 239 | } |
241 | 240 | } |
301 | 300 | @Override |
302 | 301 | public void contributeToStatusLine(IStatusLineManager statusLineManager) { |
303 | 302 | super.contributeToStatusLine(statusLineManager); |
304 | for (int i= 0; i < STATUS_FIELD_DEFS.length; i++) | |
305 | statusLineManager.add(fStatusFields.get(STATUS_FIELD_DEFS[i])); | |
303 | for (StatusFieldDef element : STATUS_FIELD_DEFS) | |
304 | statusLineManager.add(fStatusFields.get(element)); | |
306 | 305 | } |
307 | 306 | |
308 | 307 | @Override |
86 | 86 | IRegion[] ranges= JFaceTextUtil.getCoveredRanges(viewer, selection); |
87 | 87 | if (ranges.length > 1 && viewer instanceof ITextViewerExtension) |
88 | 88 | ((ITextViewerExtension) viewer).getRewriteTarget().beginCompoundChange(); |
89 | for (int i= 0; i < ranges.length; i++) { | |
90 | IRegion region= ranges[i]; | |
89 | for (IRegion region : ranges) { | |
91 | 90 | String target= document.get(region.getOffset(), region.getLength()); |
92 | 91 | String replacement= (fToUpper ? target.toUpperCase() : target.toLowerCase()); |
93 | 92 | if (!target.equals(replacement)) { |
+4
-5
467 | 467 | if ((button.getStyle() & SWT.RADIO) != 0) { |
468 | 468 | Composite buttonParent= button.getParent(); |
469 | 469 | if (buttonParent != null) { |
470 | Control[] children= buttonParent.getChildren(); | |
471 | for (int i= 0; i < children.length; i++) | |
472 | ((Button)children[i]).setSelection(false); | |
470 | for (Control child : buttonParent.getChildren()) | |
471 | ((Button)child).setSelection(false); | |
473 | 472 | } |
474 | 473 | button.setSelection(true); |
475 | 474 | } else { |
1638 | 1637 | */ |
1639 | 1638 | private void updateCombo(Combo combo, List<String> content) { |
1640 | 1639 | combo.removeAll(); |
1641 | for (int i= 0; i < content.size(); i++) { | |
1642 | combo.add(content.get(i).toString()); | |
1640 | for (String element : content) { | |
1641 | combo.add(element.toString()); | |
1643 | 1642 | } |
1644 | 1643 | } |
1645 | 1644 |
+54
-37
68 | 68 | |
69 | 69 | @Override |
70 | 70 | public void run() { |
71 | EditPosition editPosition= TextEditorPlugin.getDefault().getLastEditPosition(); | |
72 | if (editPosition == null) | |
73 | return; | |
71 | if (TextEditorPlugin.TraversalDirection.BACKWARD == TextEditorPlugin.getDefault() | |
72 | .getEditHistoryTraversalDirection()) { | |
73 | TextEditorPlugin.getDefault().backtrackEditPosition(); | |
74 | } | |
75 | EditPosition editPosition = TextEditorPlugin.getDefault().getLastEditPosition(); | |
76 | try { | |
74 | 77 | |
75 | final Position pos= editPosition.getPosition(); | |
76 | if (pos == null || pos.isDeleted) | |
77 | return; | |
78 | if (editPosition == null) { | |
79 | return; | |
80 | } | |
78 | 81 | |
79 | IWorkbenchWindow window= getWindow(); | |
80 | if (window == null) | |
81 | return; | |
82 | final Position pos = editPosition.getPosition(); | |
83 | if (pos == null || pos.isDeleted) { | |
84 | return; | |
85 | } | |
82 | 86 | |
83 | IWorkbenchPage page= window.getActivePage(); | |
87 | IWorkbenchWindow window = getWindow(); | |
88 | if (window == null) { | |
89 | return; | |
90 | } | |
84 | 91 | |
85 | IEditorPart editor; | |
86 | try { | |
87 | editor= page.openEditor(editPosition.getEditorInput(), editPosition.getEditorId()); | |
88 | } catch (PartInitException ex) { | |
89 | IStatus status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "Go to Last Edit Location failed", ex); //$NON-NLS-1$ | |
90 | TextEditorPlugin.getDefault().getLog().log(status); | |
91 | return; | |
92 | } | |
92 | IWorkbenchPage page = window.getActivePage(); | |
93 | 93 | |
94 | // Optimization - could also use else branch | |
95 | if (editor instanceof ITextEditor) { | |
96 | ITextEditor textEditor= (ITextEditor)editor; | |
97 | textEditor.selectAndReveal(pos.offset, pos.length); | |
98 | return; | |
99 | } | |
94 | IEditorPart editor; | |
95 | try { | |
96 | editor = page.openEditor(editPosition.getEditorInput(), editPosition.getEditorId()); | |
97 | } catch (PartInitException ex) { | |
98 | IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, | |
99 | "Go to Previous Edit Location failed", ex); //$NON-NLS-1$ | |
100 | TextEditorPlugin.getDefault().getLog().log(status); | |
101 | return; | |
102 | } | |
100 | 103 | |
101 | /* | |
102 | * Workaround: send out a text selection | |
103 | * XXX: Needs to be improved, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214 | |
104 | */ | |
105 | if (editor != null) { | |
106 | IEditorSite site= editor.getEditorSite(); | |
107 | if (site == null) | |
104 | // Optimization - could also use else branch | |
105 | if (editor instanceof ITextEditor) { | |
106 | ITextEditor textEditor = (ITextEditor) editor; | |
107 | textEditor.selectAndReveal(pos.offset, pos.length); | |
108 | 108 | return; |
109 | } | |
109 | 110 | |
110 | ISelectionProvider provider= editor.getEditorSite().getSelectionProvider(); | |
111 | if (provider == null) | |
112 | return; | |
111 | /* | |
112 | * Workaround: send out a text selection XXX: Needs to be improved, | |
113 | * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214 | |
114 | */ | |
115 | if (editor != null) { | |
116 | IEditorSite site = editor.getEditorSite(); | |
117 | if (site == null) { | |
118 | return; | |
119 | } | |
113 | 120 | |
114 | provider.setSelection(new TextSelection(pos.offset, pos.length)); | |
121 | ISelectionProvider provider = editor.getEditorSite().getSelectionProvider(); | |
122 | if (provider == null) { | |
123 | return; | |
124 | } | |
125 | ||
126 | provider.setSelection(new TextSelection(pos.offset, pos.length)); | |
127 | } | |
128 | } finally { | |
129 | TextEditorPlugin.getDefault() | |
130 | .setEditHistoryTraversalDirection(TextEditorPlugin.TraversalDirection.BACKWARD); | |
115 | 131 | } |
116 | 132 | } |
117 | 133 | |
126 | 142 | // adding the same action twice has no effect. |
127 | 143 | TextEditorPlugin.getDefault().addLastEditPositionDependentAction(action); |
128 | 144 | // this is always the same action for this instance |
129 | fAction= action; | |
145 | fAction = action; | |
130 | 146 | } |
131 | 147 | } |
132 | 148 | |
136 | 152 | * @return the workbench window |
137 | 153 | */ |
138 | 154 | private IWorkbenchWindow getWindow() { |
139 | if (fWindow == null) | |
155 | if (fWindow == null) { | |
140 | 156 | fWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
157 | } | |
141 | 158 | return fWindow; |
142 | 159 | } |
143 | 160 |
+164
-0
0 | /******************************************************************************* | |
1 | * Copyright (c) 2020 IBM Corporation and others. | |
2 | * | |
3 | * This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License 2.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * https://www.eclipse.org/legal/epl-2.0/ | |
7 | * | |
8 | * SPDX-License-Identifier: EPL-2.0 | |
9 | * | |
10 | * Contributors: | |
11 | * Ari Kast - initial API and implementation | |
12 | *******************************************************************************/ | |
13 | package org.eclipse.ui.texteditor; | |
14 | ||
15 | import org.eclipse.core.runtime.IStatus; | |
16 | import org.eclipse.core.runtime.Status; | |
17 | ||
18 | import org.eclipse.jface.action.Action; | |
19 | import org.eclipse.jface.action.IAction; | |
20 | import org.eclipse.jface.viewers.ISelection; | |
21 | import org.eclipse.jface.viewers.ISelectionProvider; | |
22 | ||
23 | import org.eclipse.jface.text.Position; | |
24 | import org.eclipse.jface.text.TextSelection; | |
25 | ||
26 | import org.eclipse.ui.IEditorPart; | |
27 | import org.eclipse.ui.IEditorSite; | |
28 | import org.eclipse.ui.IWorkbenchPage; | |
29 | import org.eclipse.ui.IWorkbenchWindow; | |
30 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; | |
31 | import org.eclipse.ui.PartInitException; | |
32 | import org.eclipse.ui.PlatformUI; | |
33 | import org.eclipse.ui.internal.texteditor.EditPosition; | |
34 | import org.eclipse.ui.internal.texteditor.TextEditorPlugin; | |
35 | ||
36 | ||
37 | /** | |
38 | * Goes to next edit position, ie travels forward in the edit position history | |
39 | * Acts as a complement to GotoLastEditPositionAction which travels backward in | |
40 | * the history. | |
41 | * | |
42 | * @since 3.15 | |
43 | */ | |
44 | public class GotoNextEditPositionAction extends Action implements IWorkbenchWindowActionDelegate { | |
45 | ||
46 | /** The workbench window */ | |
47 | private IWorkbenchWindow fWindow; | |
48 | /** The action */ | |
49 | private IAction fAction; | |
50 | ||
51 | /** | |
52 | * Creates a goto next edit action. | |
53 | */ | |
54 | public GotoNextEditPositionAction() { | |
55 | PlatformUI.getWorkbench().getHelpSystem().setHelp(this, | |
56 | IAbstractTextEditorHelpContextIds.GOTO_NEXT_EDIT_POSITION_ACTION); | |
57 | setId(ITextEditorActionDefinitionIds.GOTO_NEXT_EDIT_POSITION); | |
58 | setActionDefinitionId(ITextEditorActionDefinitionIds.GOTO_NEXT_EDIT_POSITION); | |
59 | setEnabled(false); | |
60 | } | |
61 | ||
62 | @Override | |
63 | public void init(IWorkbenchWindow window) { | |
64 | fWindow= window; | |
65 | } | |
66 | ||
67 | @Override | |
68 | public void run(IAction action) { | |
69 | run(); | |
70 | } | |
71 | ||
72 | @Override | |
73 | public void run() { | |
74 | if (TextEditorPlugin.TraversalDirection.FORWARD == TextEditorPlugin.getDefault() | |
75 | .getEditHistoryTraversalDirection()) { | |
76 | TextEditorPlugin.getDefault().advanceEditPosition(); | |
77 | } | |
78 | EditPosition editPosition = TextEditorPlugin.getDefault().getNextEditPosition(); | |
79 | try { | |
80 | ||
81 | if (editPosition == null) | |
82 | return; | |
83 | ||
84 | final Position pos = editPosition.getPosition(); | |
85 | if (pos == null || pos.isDeleted) | |
86 | return; | |
87 | ||
88 | IWorkbenchWindow window = getWindow(); | |
89 | if (window == null) | |
90 | return; | |
91 | ||
92 | IWorkbenchPage page = window.getActivePage(); | |
93 | ||
94 | IEditorPart editor; | |
95 | try { | |
96 | editor = page.openEditor(editPosition.getEditorInput(), editPosition.getEditorId()); | |
97 | } catch (PartInitException ex) { | |
98 | IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, | |
99 | "Go to Next Edit Location failed", ex); //$NON-NLS-1$ | |
100 | TextEditorPlugin.getDefault().getLog().log(status); | |
101 | return; | |
102 | } | |
103 | ||
104 | // Optimization - could also use else branch | |
105 | if (editor instanceof ITextEditor) { | |
106 | ITextEditor textEditor = (ITextEditor) editor; | |
107 | textEditor.selectAndReveal(pos.offset, pos.length); | |
108 | return; | |
109 | } | |
110 | ||
111 | /* | |
112 | * Workaround: send out a text selection XXX: Needs to be improved, | |
113 | * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214 | |
114 | */ | |
115 | if (editor != null) { | |
116 | IEditorSite site = editor.getEditorSite(); | |
117 | if (site == null) | |
118 | return; | |
119 | ||
120 | ISelectionProvider provider = editor.getEditorSite().getSelectionProvider(); | |
121 | if (provider == null) | |
122 | return; | |
123 | ||
124 | provider.setSelection(new TextSelection(pos.offset, pos.length)); | |
125 | } | |
126 | } finally { | |
127 | TextEditorPlugin.getDefault() | |
128 | .setEditHistoryTraversalDirection(TextEditorPlugin.TraversalDirection.FORWARD); | |
129 | } | |
130 | } | |
131 | ||
132 | @Override | |
133 | public void selectionChanged(IAction action, ISelection selection) { | |
134 | boolean enabled= TextEditorPlugin.getDefault().getLastEditPosition() != null; | |
135 | setEnabled(enabled); | |
136 | action.setEnabled(enabled); | |
137 | ||
138 | // This is no longer needed once the action is enabled. | |
139 | if (!enabled) { | |
140 | // adding the same action twice has no effect. | |
141 | TextEditorPlugin.getDefault().addLastEditPositionDependentAction(action); | |
142 | // this is always the same action for this instance | |
143 | fAction = action; | |
144 | } | |
145 | } | |
146 | ||
147 | /** | |
148 | * Returns the workbench window. | |
149 | * | |
150 | * @return the workbench window | |
151 | */ | |
152 | private IWorkbenchWindow getWindow() { | |
153 | if (fWindow == null) | |
154 | fWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); | |
155 | return fWindow; | |
156 | } | |
157 | ||
158 | @Override | |
159 | public void dispose() { | |
160 | fWindow= null; | |
161 | TextEditorPlugin.getDefault().removeLastEditPositionDependentAction(fAction); | |
162 | } | |
163 | } |
+1
-5
17 | 17 | import java.util.Arrays; |
18 | 18 | import java.util.Collection; |
19 | 19 | import java.util.Collections; |
20 | import java.util.Iterator; | |
21 | 20 | import java.util.List; |
22 | 21 | import java.util.Objects; |
23 | 22 | import java.util.stream.Collectors; |
212 | 211 | if (prefix == null || prefix.isEmpty()) |
213 | 212 | return NO_PROPOSALS; |
214 | 213 | |
215 | List<String> suggestions= getSuggestions(viewer, offset, prefix); | |
216 | ||
217 | 214 | List<ICompletionProposal> result= new ArrayList<>(); |
218 | for (Iterator<String> it= suggestions.iterator(); it.hasNext();) { | |
219 | String string= it.next(); | |
215 | for (String string : getSuggestions(viewer, offset, prefix)) { | |
220 | 216 | if (!string.isEmpty()) |
221 | 217 | result.add(createProposal(string, prefix, offset)); |
222 | 218 | } |
+4
-5
135 | 135 | return false; |
136 | 136 | |
137 | 137 | String targetId= getTargetId(); |
138 | for (int i= 0; i < targets.length; i++) { | |
139 | if (targetId.equals(targets[i].getId())) { | |
140 | fTarget= targets[i]; | |
138 | for (HyperlinkDetectorTargetDescriptor target : targets) { | |
139 | if (targetId.equals(target.getId())) { | |
140 | fTarget= target; | |
141 | 141 | return true; |
142 | 142 | } |
143 | 143 | } |
224 | 224 | private static HyperlinkDetectorDescriptor[] createDescriptors(IConfigurationElement[] elements) { |
225 | 225 | HyperlinkDetectorTargetDescriptor[] targets= HyperlinkDetectorTargetDescriptor.getContributedHyperlinkDetectorTargets(); |
226 | 226 | List<HyperlinkDetectorDescriptor> result= new ArrayList<>(elements.length); |
227 | for (int i= 0; i < elements.length; i++) { | |
228 | IConfigurationElement element= elements[i]; | |
227 | for (IConfigurationElement element : elements) { | |
229 | 228 | if (HYPERLINK_DETECTOR_ELEMENT.equals(element.getName())) { |
230 | 229 | HyperlinkDetectorDescriptor desc= new HyperlinkDetectorDescriptor(element); |
231 | 230 | if (desc.isValid(targets)) |
+3
-3
161 | 161 | initHyperlinkDetectorDescriptors(); |
162 | 162 | |
163 | 163 | List<HyperlinkDetectorDelegate> result= new ArrayList<>(); |
164 | for (int i= 0; i < fHyperlinkDetectorDescriptors.length; i++) { | |
165 | if (targetId.equals(fHyperlinkDetectorDescriptors[i].getTargetId())) { | |
166 | HyperlinkDetectorDelegate detector= new HyperlinkDetectorDelegate(fHyperlinkDetectorDescriptors[i]); | |
164 | for (HyperlinkDetectorDescriptor fHyperlinkDetectorDescriptor : fHyperlinkDetectorDescriptors) { | |
165 | if (targetId.equals(fHyperlinkDetectorDescriptor.getTargetId())) { | |
166 | HyperlinkDetectorDelegate detector= new HyperlinkDetectorDelegate(fHyperlinkDetectorDescriptor); | |
167 | 167 | result.add(detector); |
168 | 168 | detector.setContext(context); |
169 | 169 | } |
+1
-2
126 | 126 | |
127 | 127 | private static HyperlinkDetectorTargetDescriptor[] createDescriptors(IConfigurationElement[] elements) { |
128 | 128 | List<HyperlinkDetectorTargetDescriptor> result= new ArrayList<>(elements.length); |
129 | for (int i= 0; i < elements.length; i++) { | |
130 | IConfigurationElement element= elements[i]; | |
129 | for (IConfigurationElement element : elements) { | |
131 | 130 | if (TARGET_ELEMENT.equals(element.getName())) { |
132 | 131 | HyperlinkDetectorTargetDescriptor desc= new HyperlinkDetectorTargetDescriptor(element); |
133 | 132 | if (desc.isValid()) |
+11
-2
298 | 298 | String GOTO_LAST_EDIT_POSITION_ACTION= PREFIX + "goto_last_edit_position" + ACTION_POSTFIX; //$NON-NLS-1$ |
299 | 299 | |
300 | 300 | /** |
301 | * Help context id for the action. | |
302 | * Value: <code>"org.eclipse.ui.move_lines_action_context"</code> | |
301 | * Help context id for the action. Value: | |
302 | * <code>"org.eclipse.ui.goto_next_edit_position_action_context"</code> | |
303 | * | |
304 | * @since 3.15 | |
305 | */ | |
306 | String GOTO_NEXT_EDIT_POSITION_ACTION = PREFIX + "goto_next_edit_position" + ACTION_POSTFIX; //$NON-NLS-1$ | |
307 | ||
308 | /** | |
309 | * Help context id for the action. Value: | |
310 | * <code>"org.eclipse.ui.move_lines_action_context"</code> | |
311 | * | |
303 | 312 | * @since 3.0 |
304 | 313 | */ |
305 | 314 | String MOVE_LINES_ACTION= PREFIX + "move_lines" + ACTION_POSTFIX; //$NON-NLS-1$ |
+8
-0
441 | 441 | String GOTO_LAST_EDIT_POSITION= "org.eclipse.ui.edit.text.gotoLastEditPosition"; //$NON-NLS-1$ |
442 | 442 | |
443 | 443 | /** |
444 | * Action definition id of go to next edit position action. Value: | |
445 | * <code>"org.eclipse.ui.edit.text.gotoNextEditPosition"</code> | |
446 | * | |
447 | * @since 3.15 | |
448 | */ | |
449 | String GOTO_NEXT_EDIT_POSITION= "org.eclipse.ui.edit.text.gotoNextEditPosition"; //$NON-NLS-1$ | |
450 | ||
451 | /** | |
444 | 452 | * Action definition id of go to next annotation action. |
445 | 453 | * Value: <code>"org.eclipse.ui.edit.text.gotoNextAnnotation"</code> |
446 | 454 | * @since 3.0 |
79 | 79 | fScrolledComposite.addDisposeListener(e -> { |
80 | 80 | JFaceResources.getFontRegistry().removeListener(fPropertyChangeListener); |
81 | 81 | fScrolledComposite = null; |
82 | fSeparatorColor.dispose(); | |
83 | 82 | fSeparatorColor = null; |
84 | 83 | fHeader = null; |
85 | 84 | fBanner = null; |
+3
-1
107 | 107 | |
108 | 108 | if (fStackLayout.topControl != front) { |
109 | 109 | fStackLayout.topControl= front; |
110 | fParent.layout(); | |
110 | if (front != null) { | |
111 | front.requestLayout(); | |
112 | } | |
111 | 113 | updateStatusFields(); |
112 | 114 | } |
113 | 115 |
+11
-1
0 | 0 | /******************************************************************************* |
1 | * Copyright (c) 2000, 2016 IBM Corporation and others. | |
1 | * Copyright (c) 2000, 2020 IBM Corporation and others. | |
2 | 2 | * |
3 | 3 | * This program and the accompanying materials |
4 | 4 | * are made available under the terms of the Eclipse Public License 2.0 |
10 | 10 | * Contributors: |
11 | 11 | * IBM Corporation - initial API and implementation |
12 | 12 | * Tom Eicher (Avaloq Evolution AG) - block selection mode |
13 | * Pierre-Yves Bigourdan, pyvesdev@gmail.com - Bug 564929: Delete line shortcut does not delete last editor line | |
13 | 14 | *******************************************************************************/ |
14 | 15 | package org.eclipse.ui.texteditor; |
15 | 16 | |
268 | 269 | resultOffset= document.getLineOffset(line); |
269 | 270 | int endLine= selection.getEndLine(); |
270 | 271 | resultLength= document.getLineOffset(endLine) + document.getLineLength(endLine) - resultOffset; |
272 | if (resultLength == 0 && line > 0) { | |
273 | // Selection is on the last empty line of the editor. Delete | |
274 | // delimiter of the previous line to effectively remove it. | |
275 | String previousLineDelimiter= document.getLineDelimiter(line - 1); | |
276 | if (previousLineDelimiter != null) { | |
277 | resultOffset-= previousLineDelimiter.length(); | |
278 | resultLength= previousLineDelimiter.length(); | |
279 | } | |
280 | } | |
271 | 281 | break; |
272 | 282 | |
273 | 283 | case DeleteLineAction.TO_BEGINNING: |
+1
-3
18 | 18 | import java.util.Collections; |
19 | 19 | import java.util.Comparator; |
20 | 20 | import java.util.HashMap; |
21 | import java.util.Iterator; | |
22 | 21 | import java.util.List; |
23 | 22 | import java.util.ListIterator; |
24 | 23 | import java.util.Map; |
151 | 150 | List<RulerColumnDescriptor> descriptors= new ArrayList<>(); |
152 | 151 | Map<String, RulerColumnDescriptor> descriptorMap= new HashMap<>(); |
153 | 152 | |
154 | for (Iterator<IConfigurationElement> iter= elements.iterator(); iter.hasNext();) { | |
155 | IConfigurationElement element= iter.next(); | |
153 | for (IConfigurationElement element : elements) { | |
156 | 154 | try { |
157 | 155 | RulerColumnDescriptor desc= new RulerColumnDescriptor(element, this); |
158 | 156 | String id= desc.getId(); |
0 | 0 | eclipse.preferences.version=1 |
1 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true | |
1 | 2 | formatter_profile=_JDT UI Code Style Conventions |
2 | 3 | formatter_settings_version=12 |
3 | 4 | org.eclipse.jdt.ui.exception.name=e |
8 | 9 | org.eclipse.jdt.ui.ondemandthreshold=99 |
9 | 10 | org.eclipse.jdt.ui.overrideannotation=true |
10 | 11 | org.eclipse.jdt.ui.staticondemandthreshold=99 |
12 | sp_cleanup.add_default_serial_version_id=true | |
13 | sp_cleanup.add_generated_serial_version_id=false | |
14 | sp_cleanup.add_missing_annotations=true | |
15 | sp_cleanup.add_missing_deprecated_annotations=true | |
16 | sp_cleanup.add_missing_methods=false | |
17 | sp_cleanup.add_missing_nls_tags=false | |
18 | sp_cleanup.add_missing_override_annotations=true | |
19 | sp_cleanup.add_missing_override_annotations_interface_methods=true | |
20 | sp_cleanup.add_serial_version_id=false | |
21 | sp_cleanup.always_use_blocks=true | |
22 | sp_cleanup.always_use_parentheses_in_expressions=false | |
23 | sp_cleanup.always_use_this_for_non_static_field_access=false | |
24 | sp_cleanup.always_use_this_for_non_static_method_access=false | |
25 | sp_cleanup.convert_functional_interfaces=false | |
26 | sp_cleanup.convert_to_enhanced_for_loop=false | |
27 | sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false | |
28 | sp_cleanup.correct_indentation=false | |
29 | sp_cleanup.format_source_code=true | |
30 | sp_cleanup.format_source_code_changes_only=true | |
31 | sp_cleanup.insert_inferred_type_arguments=false | |
32 | sp_cleanup.lazy_logical_operator=false | |
33 | sp_cleanup.make_local_variable_final=true | |
34 | sp_cleanup.make_parameters_final=false | |
35 | sp_cleanup.make_private_fields_final=true | |
36 | sp_cleanup.make_type_abstract_if_missing_method=false | |
37 | sp_cleanup.make_variable_declarations_final=false | |
38 | sp_cleanup.merge_conditional_blocks=false | |
39 | sp_cleanup.never_use_blocks=false | |
40 | sp_cleanup.never_use_parentheses_in_expressions=true | |
41 | sp_cleanup.number_suffix=false | |
42 | sp_cleanup.on_save_use_additional_actions=true | |
43 | sp_cleanup.organize_imports=true | |
44 | sp_cleanup.push_down_negation=false | |
45 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=false | |
46 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true | |
47 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true | |
48 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=false | |
49 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=false | |
50 | sp_cleanup.remove_private_constructors=true | |
51 | sp_cleanup.remove_redundant_modifiers=false | |
52 | sp_cleanup.remove_redundant_semicolons=false | |
53 | sp_cleanup.remove_redundant_type_arguments=false | |
54 | sp_cleanup.remove_trailing_whitespaces=true | |
55 | sp_cleanup.remove_trailing_whitespaces_all=true | |
56 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false | |
57 | sp_cleanup.remove_unnecessary_array_creation=false | |
58 | sp_cleanup.remove_unnecessary_casts=true | |
59 | sp_cleanup.remove_unnecessary_nls_tags=false | |
60 | sp_cleanup.remove_unused_imports=false | |
61 | sp_cleanup.remove_unused_local_variables=false | |
62 | sp_cleanup.remove_unused_private_fields=true | |
63 | sp_cleanup.remove_unused_private_members=false | |
64 | sp_cleanup.remove_unused_private_methods=true | |
65 | sp_cleanup.remove_unused_private_types=true | |
66 | sp_cleanup.simplify_lambda_expression_and_method_ref=false | |
67 | sp_cleanup.sort_members=false | |
68 | sp_cleanup.sort_members_all=false | |
69 | sp_cleanup.use_anonymous_class_creation=false | |
70 | sp_cleanup.use_autoboxing=false | |
71 | sp_cleanup.use_blocks=false | |
72 | sp_cleanup.use_blocks_only_for_return_and_throw=false | |
73 | sp_cleanup.use_directly_map_method=false | |
74 | sp_cleanup.use_lambda=true | |
75 | sp_cleanup.use_parentheses_in_expressions=false | |
76 | sp_cleanup.use_this_for_non_static_field_access=false | |
77 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true | |
78 | sp_cleanup.use_this_for_non_static_method_access=false | |
79 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true | |
80 | sp_cleanup.use_unboxing=false | |
81 | sp_cleanup.use_var=false |
1 | 1 | Bundle-ManifestVersion: 2 |
2 | 2 | Bundle-Name: %Plugin.name |
3 | 3 | Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor.tests |
4 | Bundle-Version: 3.12.500.qualifier | |
4 | Bundle-Version: 3.12.600.qualifier | |
5 | 5 | Bundle-Vendor: %Plugin.providerName |
6 | 6 | Bundle-Localization: plugin |
7 | 7 | Export-Package: |
0 | # To force a version qualifier update add the bug here | |
1 | Bug 566471 - I20200828-0150 - Comparator Errors Found |
13 | 13 | <parent> |
14 | 14 | <artifactId>tests-pom</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | <relativePath>../tests-pom/</relativePath> |
18 | 18 | </parent> |
19 | 19 | <groupId>org.eclipse.ui</groupId> |
20 | 20 | <artifactId>org.eclipse.ui.workbench.texteditor.tests</artifactId> |
21 | <version>3.12.500-SNAPSHOT</version> | |
21 | <version>3.12.600-SNAPSHOT</version> | |
22 | 22 | <packaging>eclipse-test-plugin</packaging> |
23 | 23 | <properties> |
24 | 24 | <testSuite>${project.artifactId}</testSuite> |
+387
-0
0 | /******************************************************************************* | |
1 | * Copyright (c) 2000, 2016 IBM Corporation and others. | |
2 | * | |
3 | * This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License 2.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * https://www.eclipse.org/legal/epl-2.0/ | |
7 | * | |
8 | * SPDX-License-Identifier: EPL-2.0 | |
9 | * | |
10 | * Contributors: | |
11 | * IBM Corporation - initial API and implementation | |
12 | *******************************************************************************/ | |
13 | package org.eclipse.ui.workbench.texteditor.tests; | |
14 | ||
15 | import static org.junit.Assert.assertEquals; | |
16 | import static org.junit.Assert.assertFalse; | |
17 | import static org.junit.Assert.assertNotEquals; | |
18 | import static org.junit.Assert.assertTrue; | |
19 | ||
20 | import java.util.Random; | |
21 | ||
22 | import org.junit.FixMethodOrder; | |
23 | import org.junit.Rule; | |
24 | import org.junit.Test; | |
25 | import org.junit.rules.TestName; | |
26 | import org.junit.runners.MethodSorters; | |
27 | ||
28 | import org.eclipse.ui.internal.texteditor.HistoryTracker; | |
29 | ||
30 | /** | |
31 | * Tests the FindReplaceDialog. | |
32 | * | |
33 | * @since 3.1 | |
34 | */ | |
35 | @FixMethodOrder(MethodSorters.NAME_ASCENDING) | |
36 | public class TextEditorPluginTest { | |
37 | ||
38 | @Rule | |
39 | public TestName testName = new TestName(); | |
40 | ||
41 | Random rand = new Random(55); //pseudo-random for repeatability | |
42 | ||
43 | @Test | |
44 | public void testEditPositionHistory() { | |
45 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
46 | Integer.class, | |
47 | (a, b) -> Math.abs(a - b) < 5, true); | |
48 | ||
49 | assertEquals(0, history.getSize()); | |
50 | history.addOrReplace(10); | |
51 | assertEquals(1, history.getSize()); | |
52 | assertTrue(10 == history.getCurrentBrowsePoint()); | |
53 | ||
54 | history.addOrReplace(20); | |
55 | assertEquals(2, history.getSize()); | |
56 | assertTrue(20 == history.getCurrentBrowsePoint()); | |
57 | ||
58 | history.addOrReplace(30); | |
59 | assertEquals(3, history.getSize()); | |
60 | assertTrue(30 == history.getCurrentBrowsePoint()); | |
61 | ||
62 | checkContent(history, new Integer[] { 10, 20, 30 }); | |
63 | ||
64 | ||
65 | int replaced = history.addOrReplace(40); | |
66 | assertEquals(3, history.getSize()); | |
67 | assertEquals(10, replaced); | |
68 | assertEquals(Integer.valueOf(40), history.getCurrentBrowsePoint()); | |
69 | ||
70 | HistoryTracker.Navigator<Integer> nav = history.navigator(); | |
71 | assertEquals(Integer.valueOf(40), nav.currentItem()); | |
72 | assertEquals(Integer.valueOf(30), nav.priorItem()); | |
73 | assertEquals(Integer.valueOf(20), nav.priorItem()); | |
74 | assertEquals(Integer.valueOf(40), nav.priorItem()); | |
75 | checkContent(history, new Integer[] { 20, 30, 40 }); | |
76 | ||
77 | assertFalse(history.contains(10)); | |
78 | ||
79 | replaced = history.addOrReplace(22); | |
80 | assertTrue(history.contains(22)); | |
81 | assertFalse(history.contains(20)); | |
82 | assertEquals(20, replaced); | |
83 | checkContent(history, new Integer[] { 30, 40, 22 }); | |
84 | //assertTrue(22 == history.getCurrentBrowsePoint()); | |
85 | ||
86 | replaced = history.addOrReplace(31); | |
87 | assertTrue(history.contains(31)); | |
88 | assertFalse(history.contains(30)); | |
89 | assertEquals(30, replaced); | |
90 | assertTrue(31 == history.getCurrentBrowsePoint()); | |
91 | checkContent(history, new Integer[] { 40, 22, 31 }); | |
92 | ||
93 | replaced = history.addOrReplace(60); | |
94 | assertTrue(history.contains(60)); | |
95 | assertTrue(60 == history.getCurrentBrowsePoint()); | |
96 | assertEquals(3, history.getSize()); | |
97 | checkContent(history, new Integer[] { 22, 31, 60 }); | |
98 | ||
99 | assertTrue(31 == history.browseBackward()); | |
100 | assertTrue(31 == history.getCurrentBrowsePoint()); | |
101 | assertEquals(3, history.getSize()); | |
102 | ||
103 | //consuming size times should bring you full circle back to origin | |
104 | testBacktrackCycle(history); | |
105 | ||
106 | //try editing after backtracking less than full cycle | |
107 | history.browseBackward(); | |
108 | Integer last = history.getCurrentBrowsePoint(); | |
109 | assertEquals(Integer.valueOf(22), last); | |
110 | history.addOrReplace(11); | |
111 | checkContent(history, new Integer[] { 31, 60, 11 }); | |
112 | ||
113 | testBacktrackCycle(history); | |
114 | history.browseBackward(); | |
115 | assertEquals(Integer.valueOf(60), history.getCurrentBrowsePoint()); | |
116 | } | |
117 | ||
118 | <T> void checkContent(HistoryTracker<T> history, T[] data) { | |
119 | HistoryTracker.Navigator<T> nav = history.navigator(); | |
120 | assertEquals(data[data.length - 1], nav.currentItem()); | |
121 | ||
122 | for(int i=data.length - 2; i>0; i--) { | |
123 | assertEquals(data[i], nav.priorItem()); | |
124 | } | |
125 | assertEquals(history.getSize(), data.length); | |
126 | } | |
127 | ||
128 | @Test | |
129 | public void testEditPositionHistory2() { | |
130 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
131 | Integer.class, | |
132 | (a, b) -> Math.abs(a - b) < 5, true); | |
133 | ||
134 | assertEquals(0, history.getSize()); | |
135 | history.addOrReplace(10); | |
136 | assertEquals(1, history.getSize()); | |
137 | assertTrue(10 == history.getCurrentBrowsePoint()); | |
138 | ||
139 | history.addOrReplace(20); | |
140 | assertEquals(2, history.getSize()); | |
141 | assertTrue(20 == history.getCurrentBrowsePoint()); | |
142 | ||
143 | history.addOrReplace(30); | |
144 | assertEquals(3, history.getSize()); | |
145 | assertTrue(30 == history.getCurrentBrowsePoint()); | |
146 | ||
147 | int replaced = history.addOrReplace(22); | |
148 | assertEquals(3, history.getSize()); | |
149 | assertEquals(20, replaced); | |
150 | assertEquals(Integer.valueOf(22), history.getCurrentBrowsePoint()); | |
151 | ||
152 | assertEquals(Integer.valueOf(30), history.browseBackward()); | |
153 | assertEquals(Integer.valueOf(10), history.browseBackward()); | |
154 | assertEquals(Integer.valueOf(22), history.browseBackward()); | |
155 | ||
156 | testBacktrackCycle(history); | |
157 | } | |
158 | ||
159 | @Test | |
160 | public void testHistoryEviction() { | |
161 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
162 | Integer.class, | |
163 | (a, b) -> Math.abs(a - b) < 5, | |
164 | true); | |
165 | ||
166 | assertEquals(0, history.getSize()); | |
167 | history.addOrReplace(10); | |
168 | assertEquals(1, history.getSize()); | |
169 | assertTrue(10 == history.getCurrentBrowsePoint()); | |
170 | ||
171 | history.addOrReplace(10); | |
172 | assertEquals(1, history.getSize()); | |
173 | assertTrue(10 == history.getCurrentBrowsePoint()); | |
174 | ||
175 | history.addOrReplace(11); | |
176 | assertEquals(1, history.getSize()); | |
177 | assertTrue(11 == history.getCurrentBrowsePoint()); | |
178 | } | |
179 | ||
180 | @Test | |
181 | public void testHistoryEviction2() { | |
182 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
183 | Integer.class, | |
184 | (a, b) -> Math.abs(a - b) < 5, | |
185 | true); | |
186 | ||
187 | history.addOrReplace(10); | |
188 | history.addOrReplace(20); | |
189 | history.addOrReplace(30); | |
190 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
191 | assertEquals(Integer.valueOf(10), history.addOrReplace(40)); | |
192 | } | |
193 | ||
194 | @Test | |
195 | public void testHistoryEviction3() { | |
196 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
197 | Integer.class, | |
198 | (a, b) -> Math.abs(a - b) < 5, | |
199 | true); | |
200 | ||
201 | history.addOrReplace(10); | |
202 | history.addOrReplace(11); | |
203 | history.addOrReplace(20); | |
204 | history.addOrReplace(21); | |
205 | history.addOrReplace(12); | |
206 | checkContent(history, new Integer[] { 21, 12 }); | |
207 | } | |
208 | ||
209 | @Test | |
210 | public void testLinearEditPositionHistory() { | |
211 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
212 | Integer.class, | |
213 | (a, b) -> Math.abs(a - b) < 5, | |
214 | false); | |
215 | ||
216 | assertEquals(0, history.getSize()); | |
217 | history.addOrReplace(10); | |
218 | assertEquals(1, history.getSize()); | |
219 | assertTrue(10 == history.getCurrentBrowsePoint()); | |
220 | ||
221 | history.addOrReplace(20); | |
222 | assertEquals(2, history.getSize()); | |
223 | assertTrue(20 == history.getCurrentBrowsePoint()); | |
224 | ||
225 | history.addOrReplace(30); | |
226 | assertEquals(3, history.getSize()); | |
227 | assertTrue(30 == history.getCurrentBrowsePoint()); | |
228 | ||
229 | int replaced = history.addOrReplace(22); | |
230 | assertEquals(3, history.getSize()); | |
231 | assertEquals(20, replaced); | |
232 | assertEquals(Integer.valueOf(22), history.getCurrentBrowsePoint()); | |
233 | ||
234 | assertEquals(Integer.valueOf(30), history.browseBackward()); | |
235 | assertEquals(Integer.valueOf(10), history.browseBackward()); | |
236 | assertEquals(Integer.valueOf(10), history.browseBackward()); | |
237 | ||
238 | assertEquals(Integer.valueOf(30), history.browseForward()); | |
239 | assertEquals(Integer.valueOf(22), history.browseForward()); | |
240 | assertEquals(Integer.valueOf(22), history.browseForward()); | |
241 | ||
242 | } | |
243 | ||
244 | @Test | |
245 | public void testLinearEditPositionHistory2() { | |
246 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
247 | Integer.class, | |
248 | (a, b) -> Math.abs(a - b) < 5, | |
249 | false); | |
250 | ||
251 | history.addOrReplace(10); | |
252 | history.addOrReplace(20); | |
253 | history.addOrReplace(30); | |
254 | ||
255 | int replaced = history.addOrReplace(22); | |
256 | assertEquals(3, history.getSize()); | |
257 | assertEquals(20, replaced); | |
258 | assertEquals(Integer.valueOf(22), history.getCurrentBrowsePoint()); | |
259 | ||
260 | //end reached, go no further | |
261 | assertEquals(Integer.valueOf(22), history.getNext()); | |
262 | ||
263 | assertEquals(Integer.valueOf(30), history.browseBackward()); | |
264 | assertEquals(Integer.valueOf(10), history.browseBackward()); | |
265 | ||
266 | //beginning reached, go no further | |
267 | assertEquals(Integer.valueOf(10), history.browseBackward()); | |
268 | } | |
269 | ||
270 | @Test | |
271 | public void testMRUOrderAlwaysPreserved() { | |
272 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
273 | Integer.class, | |
274 | (a, b) -> Math.abs(a - b) < 5, | |
275 | false); | |
276 | ||
277 | history.addOrReplace(10); | |
278 | history.addOrReplace(20); | |
279 | history.addOrReplace(30); | |
280 | ||
281 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
282 | history.addOrReplace(11); | |
283 | assertEquals(Integer.valueOf(11), history.getCurrentBrowsePoint()); | |
284 | ||
285 | assertEquals(Integer.valueOf(30), history.browseBackward()); | |
286 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
287 | } | |
288 | ||
289 | @Test | |
290 | public void testMRUOrderAlwaysPreserved2() { | |
291 | HistoryTracker<Integer> history= new HistoryTracker<>(3, | |
292 | Integer.class, | |
293 | (a, b) -> Math.abs(a - b) < 5, | |
294 | false); | |
295 | ||
296 | history.addOrReplace(10); | |
297 | history.addOrReplace(20); | |
298 | history.addOrReplace(30); | |
299 | ||
300 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
301 | history.addOrReplace(40); | |
302 | assertEquals(Integer.valueOf(40), history.getCurrentBrowsePoint()); | |
303 | ||
304 | assertEquals(Integer.valueOf(30), history.browseBackward()); | |
305 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
306 | assertEquals(Integer.valueOf(20), history.browseBackward()); | |
307 | ||
308 | } | |
309 | ||
310 | private <T> void testBacktrackCycle(HistoryTracker<T> history) { | |
311 | T last = history.getCurrentBrowsePoint(); | |
312 | for(int i=0; i<history.getSize() -1; i++) { | |
313 | history.browseBackward(); | |
314 | assertNotEquals(last, history.getCurrentBrowsePoint()); | |
315 | } | |
316 | history.browseBackward(); | |
317 | assertEquals(last, history.getCurrentBrowsePoint()); | |
318 | } | |
319 | ||
320 | @Test | |
321 | public void testEditPositionHistoryChaos() { | |
322 | final int HISTORY_SIZE= 10; | |
323 | HistoryTracker<Integer> history= new HistoryTracker<>(HISTORY_SIZE, | |
324 | Integer.class, | |
325 | (a, b) -> Math.abs(a - b) < 5, true); | |
326 | ||
327 | for(int i=0;i<100;i++) { | |
328 | if(rand.nextBoolean()) { | |
329 | addRandom(history); | |
330 | } else { | |
331 | goBack(history); | |
332 | } | |
333 | assertTrue(history.isHealthy()); | |
334 | assertTrue(history.getSize() <= HISTORY_SIZE); | |
335 | } | |
336 | } | |
337 | ||
338 | @Test | |
339 | public void testLinearEditPositionHistoryChaos() { | |
340 | final int HISTORY_SIZE= 10; | |
341 | HistoryTracker<Integer> history= new HistoryTracker<>(HISTORY_SIZE, | |
342 | Integer.class, | |
343 | (a,b) -> Math.abs(a - b) < 5, | |
344 | false | |
345 | ); | |
346 | ||
347 | int backsInARow = 0; | |
348 | for(int i=0;i<100;i++) { | |
349 | if(rand.nextBoolean()) { | |
350 | backsInARow = 0; | |
351 | addRandom(history); | |
352 | } else { | |
353 | backsInARow ++; | |
354 | goBackLinear(history, backsInARow < history.getSize()); | |
355 | } | |
356 | assertTrue(history.isHealthy()); | |
357 | assertTrue(history.getSize() <= HISTORY_SIZE); | |
358 | } | |
359 | } | |
360 | ||
361 | ||
362 | private void addRandom(HistoryTracker<Integer> history) { | |
363 | Integer latest = rand.nextInt(50); | |
364 | history.addOrReplace(latest); | |
365 | assertEquals(latest, history.getCurrentBrowsePoint()); | |
366 | } | |
367 | ||
368 | private void goBack(HistoryTracker<Integer> history) { | |
369 | int size = history.getSize(); | |
370 | Integer latest = history.getCurrentBrowsePoint(); | |
371 | Integer prior = history.browseBackward(); | |
372 | if (size > 1) { | |
373 | assertNotEquals(latest, prior); | |
374 | } | |
375 | } | |
376 | ||
377 | private void goBackLinear(HistoryTracker<Integer> history, boolean shouldMove) { | |
378 | Integer latest= history.getCurrentBrowsePoint(); | |
379 | Integer prior = history.browseBackward(); | |
380 | if(shouldMove) | |
381 | assertNotEquals(latest, prior); | |
382 | else | |
383 | assertEquals(latest, prior); | |
384 | } | |
385 | ||
386 | } |
+107
-0
0 | /******************************************************************************* | |
1 | * Copyright (c) 2020 Pierre-Yves Bigourdan and others. | |
2 | * | |
3 | * This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License 2.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * https://www.eclipse.org/legal/epl-2.0/ | |
7 | * | |
8 | * SPDX-License-Identifier: EPL-2.0 | |
9 | * | |
10 | * Contributors: | |
11 | * Pierre-Yves Bigourdan - initial API and implementation | |
12 | *******************************************************************************/ | |
13 | package org.eclipse.ui.workbench.texteditor.tests; | |
14 | ||
15 | import static org.junit.Assert.assertEquals; | |
16 | import static org.junit.Assert.assertThrows; | |
17 | ||
18 | import org.junit.Before; | |
19 | import org.junit.Test; | |
20 | ||
21 | import org.eclipse.swt.SWT; | |
22 | import org.eclipse.swt.dnd.Clipboard; | |
23 | import org.eclipse.swt.dnd.TextTransfer; | |
24 | import org.eclipse.swt.widgets.Display; | |
25 | import org.eclipse.swt.widgets.Shell; | |
26 | ||
27 | import org.eclipse.jface.action.IAction; | |
28 | ||
29 | import org.eclipse.jface.text.Document; | |
30 | import org.eclipse.jface.text.TextSelection; | |
31 | import org.eclipse.jface.text.TextViewer; | |
32 | ||
33 | import org.eclipse.ui.texteditor.DeleteLineAction; | |
34 | import org.eclipse.ui.texteditor.TextViewerDeleteLineTarget; | |
35 | ||
36 | public class TextViewerDeleteLineTargetTest { | |
37 | ||
38 | private Document document; | |
39 | ||
40 | private TextViewerDeleteLineTarget underTest; | |
41 | ||
42 | @Before | |
43 | public void setUp() { | |
44 | document= new Document("first line\n" + | |
45 | "\n" + | |
46 | "third line\n"); | |
47 | ||
48 | TextViewer textViewer= new TextViewer(new Shell(), SWT.NONE); | |
49 | textViewer.setDocument(document); | |
50 | ||
51 | underTest= new TextViewerDeleteLineTarget(textViewer); | |
52 | } | |
53 | ||
54 | @Test | |
55 | public void testWholeLineDeletion() throws Exception { | |
56 | underTest.deleteLine(document, new TextSelection(document, 1, 3), DeleteLineAction.WHOLE, false); | |
57 | ||
58 | assertEquals("\n" + | |
59 | "third line\n", document.get()); | |
60 | } | |
61 | ||
62 | @Test | |
63 | public void testWholeLineDeletionOnLastEmptyLine() throws Exception { | |
64 | underTest.deleteLine(document, new TextSelection(document, 23, 0), DeleteLineAction.WHOLE, false); | |
65 | ||
66 | assertEquals("first line\n" + | |
67 | "\n" + | |
68 | "third line", document.get()); | |
69 | } | |
70 | ||
71 | @Test | |
72 | public void testWholeLineDeletionWithCopyToClipboard() throws Exception { | |
73 | Clipboard clipboard= new Clipboard(Display.getCurrent()); | |
74 | try { | |
75 | underTest.deleteLine(document, new TextSelection(document, 1, 4), DeleteLineAction.WHOLE, true); | |
76 | ||
77 | assertEquals("first line\n", clipboard.getContents(TextTransfer.getInstance())); | |
78 | } finally { | |
79 | clipboard.dispose(); | |
80 | } | |
81 | } | |
82 | ||
83 | @Test | |
84 | public void testLineDeletionToBeginning() throws Exception { | |
85 | underTest.deleteLine(document, new TextSelection(document, 6, 0), DeleteLineAction.TO_BEGINNING, false); | |
86 | ||
87 | assertEquals("line\n" + | |
88 | "\n" + | |
89 | "third line\n", document.get()); | |
90 | } | |
91 | ||
92 | @Test | |
93 | public void testLineDeletionToEnd() throws Exception { | |
94 | underTest.deleteLine(document, new TextSelection(document, 17, 0), DeleteLineAction.TO_END, false); | |
95 | ||
96 | assertEquals("first line\n" + | |
97 | "\n" + | |
98 | "third\n", document.get()); | |
99 | } | |
100 | ||
101 | @Test | |
102 | public void testThrowsExceptionWithUnsupportedDeleteLineActionType() throws Exception { | |
103 | assertThrows(IllegalArgumentException.class, () -> underTest.deleteLine(document, 0, 0, IAction.AS_RADIO_BUTTON, false)); | |
104 | } | |
105 | ||
106 | } |
+4
-2
0 | 0 | /******************************************************************************* |
1 | * Copyright (c) 2000, 2016 IBM Corporation and others. | |
1 | * Copyright (c) 2000, 2020 IBM Corporation and others. | |
2 | 2 | * |
3 | 3 | * This program and the accompanying materials |
4 | 4 | * are made available under the terms of the Eclipse Public License 2.0 |
41 | 41 | AbstractTextZoomHandlerTest.class, |
42 | 42 | DocumentLineDifferTest.class, |
43 | 43 | MinimapPageTest.class, |
44 | MinimapWidgetTest.class | |
44 | MinimapWidgetTest.class, | |
45 | TextEditorPluginTest.class, | |
46 | TextViewerDeleteLineTargetTest.class | |
45 | 47 | }) |
46 | 48 | public class WorkbenchTextEditorTestSuite { |
47 | 49 | // see @SuiteClasses |
14 | 14 | <parent> |
15 | 15 | <groupId>org.eclipse</groupId> |
16 | 16 | <artifactId>eclipse-platform-parent</artifactId> |
17 | <version>4.16.0-SNAPSHOT</version> | |
17 | <version>4.17.0-SNAPSHOT</version> | |
18 | 18 | <relativePath>../eclipse-platform-parent</relativePath> |
19 | 19 | </parent> |
20 | 20 | |
21 | 21 | <groupId>eclipse.platform.text</groupId> |
22 | 22 | <artifactId>eclipse.platform.text</artifactId> |
23 | <version>4.16.0-SNAPSHOT</version> | |
23 | <version>4.17.0-SNAPSHOT</version> | |
24 | 24 | <packaging>pom</packaging> |
25 | 25 | |
26 | 26 | <properties> |
13 | 13 | <parent> |
14 | 14 | <artifactId>eclipse.platform.text</artifactId> |
15 | 15 | <groupId>eclipse.platform.text</groupId> |
16 | <version>4.16.0-SNAPSHOT</version> | |
16 | <version>4.17.0-SNAPSHOT</version> | |
17 | 17 | </parent> |
18 | 18 | <artifactId>tests-pom</artifactId> |
19 | <version>4.16.0-SNAPSHOT</version> | |
19 | <version>4.17.0-SNAPSHOT</version> | |
20 | 20 | <packaging>pom</packaging> |
21 | 21 | <properties> |
22 | 22 | <code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings> |