View | Details | Raw Unified | Return to bug 29692 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/texteditor/EditorMessages.properties (+3 lines)
Lines 118-120 Link Here
118
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
118
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
119
119
120
Editor_error_clipboard_copy_failed_message= Copy to clipboard failed.
120
Editor_error_clipboard_copy_failed_message= Copy to clipboard failed.
121
FindReplaceDialog_FindReplace_HighlightAllButton_label=Highlight All
122
FindReplaceDialog_FindReplace_Status_highlights_label={0} matches highlighted
123
FindReplaceDialog_FindReplace_Status_highlight_label=1 Match highlighted
(-)src/org/eclipse/ui/texteditor/FindReplaceDialog.java (-16 / +103 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.texteditor;
12
package org.eclipse.ui.texteditor;
12
13
Lines 16-21 Link Here
16
import java.util.Set;
17
import java.util.Set;
17
import java.util.regex.PatternSyntaxException;
18
import java.util.regex.PatternSyntaxException;
18
19
20
import org.eclipse.jface.dialogs.Dialog;
21
import org.eclipse.jface.dialogs.IDialogSettings;
22
import org.eclipse.jface.fieldassist.ComboContentAdapter;
23
import org.eclipse.jface.fieldassist.FieldDecoration;
24
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
25
import org.eclipse.jface.resource.JFaceColors;
26
import org.eclipse.jface.text.IFindReplaceTarget;
27
import org.eclipse.jface.text.IFindReplaceTargetExtension;
28
import org.eclipse.jface.text.IFindReplaceTargetExtension3;
29
import org.eclipse.jface.text.IFindReplaceTargetExtension4;
30
import org.eclipse.jface.text.IRegion;
31
import org.eclipse.jface.text.Region;
32
import org.eclipse.jface.text.TextUtilities;
19
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.custom.BusyIndicator;
34
import org.eclipse.swt.custom.BusyIndicator;
21
import org.eclipse.swt.events.ModifyEvent;
35
import org.eclipse.swt.events.ModifyEvent;
Lines 36-56 Link Here
36
import org.eclipse.swt.widgets.Group;
50
import org.eclipse.swt.widgets.Group;
37
import org.eclipse.swt.widgets.Label;
51
import org.eclipse.swt.widgets.Label;
38
import org.eclipse.swt.widgets.Shell;
52
import org.eclipse.swt.widgets.Shell;
39
40
import org.eclipse.jface.dialogs.Dialog;
41
import org.eclipse.jface.dialogs.IDialogSettings;
42
import org.eclipse.jface.fieldassist.ComboContentAdapter;
43
import org.eclipse.jface.fieldassist.FieldDecoration;
44
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
45
import org.eclipse.jface.resource.JFaceColors;
46
47
import org.eclipse.jface.text.IFindReplaceTarget;
48
import org.eclipse.jface.text.IFindReplaceTargetExtension;
49
import org.eclipse.jface.text.IFindReplaceTargetExtension3;
50
import org.eclipse.jface.text.IRegion;
51
import org.eclipse.jface.text.Region;
52
import org.eclipse.jface.text.TextUtilities;
53
54
import org.eclipse.ui.IEditorPart;
53
import org.eclipse.ui.IEditorPart;
55
import org.eclipse.ui.IWorkbenchPage;
54
import org.eclipse.ui.IWorkbenchPage;
56
import org.eclipse.ui.IWorkbenchWindow;
55
import org.eclipse.ui.IWorkbenchWindow;
Lines 203-208 Link Here
203
	 */
202
	 */
204
	private boolean fGiveFocusToFindField= true;
203
	private boolean fGiveFocusToFindField= true;
205
204
205
	/**
206
	 * "Highlight All" toggle button
207
	 * @since 3.4
208
	 */
209
	private Button fHighlightAllButton;
210
211
	/**
212
	 * whether anything is highlighted 
213
	 * after pressing "Highlight All"
214
	 * @since 3.4 
215
	 */
216
	private boolean fIsHighlighted;
217
206
218
207
	/**
219
	/**
208
	 * Creates a new dialog with the given shell as parent.
220
	 * Creates a new dialog with the given shell as parent.
Lines 341-351 Link Here
341
353
342
		// Make the all the buttons the same size as the Remove Selection button.
354
		// Make the all the buttons the same size as the Remove Selection button.
343
		fReplaceAllButton.setEnabled(isEditable());
355
		fReplaceAllButton.setEnabled(isEditable());
356
		
357
		fHighlightAllButton = new Button(panel,SWT.TOGGLE);
358
		fHighlightAllButton.setText(EditorMessages.FindReplaceDialog_FindReplace_HighlightAllButton_label); 
359
		fHighlightAllButton.setSelection(false);
360
		fHighlightAllButton.addSelectionListener(new SelectionAdapter(){
361
			public void widgetSelected(SelectionEvent e){
362
				if(fHighlightAllButton.getSelection()){
363
					performHighlightAll();
364
					updateFindHistory();
365
				}
366
				else {
367
					if(fIsHighlighted){
368
						clearHighlights();
369
					}
370
				}
371
			}
372
		});
373
		setGridData(fHighlightAllButton, SWT.FILL, true, SWT.FILL, false);
344
374
345
		return panel;
375
		return panel;
346
	}
376
	}
347
377
348
	/**
378
	/**
379
	 * Clears all highlights and corresponding annotations.
380
	 * 
381
	 * @since 3.4
382
	 */
383
	private void clearHighlights() {
384
		if(fTarget instanceof IFindReplaceTargetExtension4){
385
			((IFindReplaceTargetExtension4) fTarget).clearHighlights();
386
		}
387
		fIsHighlighted = false;
388
	}
389
390
	/**
349
	 * Creates the options configuration section of the find replace dialog.
391
	 * Creates the options configuration section of the find replace dialog.
350
	 *
392
	 *
351
	 * @param parent the parent composite
393
	 * @param parent the parent composite
Lines 947-953 Link Here
947
	 * Removes focus changed listener from browser and stores settings for re-open.
989
	 * Removes focus changed listener from browser and stores settings for re-open.
948
	 */
990
	 */
949
	private void handleDialogClose() {
991
	private void handleDialogClose() {
950
992
		// clear highlights
993
		if(fIsHighlighted){
994
			clearHighlights();
995
		}
996
		
951
		// remove listeners
997
		// remove listeners
952
		if (okToUse(fFindField)) {
998
		if (okToUse(fFindField)) {
953
			fFindField.removeModifyListener(fFindModifyListener);
999
			fFindField.removeModifyListener(fFindModifyListener);
Lines 1827-1830 Link Here
1827
		settings.put(sectionName, names);
1873
		settings.put(sectionName, names);
1828
		
1874
		
1829
	}
1875
	}
1876
	
1877
	/**
1878
	 * Highlights all occurrences of the user's findString 
1879
	 * in the text of the target.
1880
	 * 
1881
	 * @since 3.4
1882
	 */
1883
	private void performHighlightAll() {
1884
1885
		String findString= getFindString();
1886
		int matchCount;
1887
		
1888
		if(!(fTarget instanceof IFindReplaceTargetExtension4)) return;
1889
1890
		if (findString != null && findString.length() > 0) {
1891
			
1892
			try {
1893
					matchCount= ((IFindReplaceTargetExtension4) fTarget).highlightAll(findString, isCaseSensitiveSearch(), isWholeWordSearch(), isRegExSearchAvailableAndChecked());
1894
				
1895
				if (matchCount != 0) {
1896
					if(matchCount == 1){
1897
						String msg = EditorMessages.FindReplaceDialog_FindReplace_Status_highlight_label; 
1898
						statusMessage(msg);
1899
					} else {
1900
						String msg= EditorMessages.FindReplaceDialog_FindReplace_Status_highlights_label; 
1901
						msg= NLSUtility.format(msg, String.valueOf(matchCount));
1902
						statusMessage(msg);
1903
					}
1904
					fIsHighlighted = true; 
1905
				} else {
1906
					statusMessage(EditorMessages.FindReplace_Status_noMatch_label);
1907
					fIsHighlighted = false;
1908
				}
1909
			} catch (PatternSyntaxException ex) {
1910
				statusError(ex.getLocalizedMessage());
1911
			} catch (IllegalStateException ex) {
1912
				// we don't keep state in this dialog
1913
			}
1914
		}
1915
		writeSelection();		
1916
	}
1830
}
1917
}
(-)src/org/eclipse/ui/texteditor/EditorMessages.java (+4 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.texteditor;
12
package org.eclipse.ui.texteditor;
12
13
Lines 71-76 Link Here
71
	public static String Editor_mark_status_message_mark_set;
72
	public static String Editor_mark_status_message_mark_set;
72
	public static String Editor_mark_status_message_mark_cleared;
73
	public static String Editor_mark_status_message_mark_cleared;
73
	public static String Editor_mark_status_message_mark_swapped;
74
	public static String Editor_mark_status_message_mark_swapped;
75
	public static String FindReplaceDialog_FindReplace_HighlightAllButton_label;
76
	public static String FindReplaceDialog_FindReplace_Status_highlight_label;
77
	public static String FindReplaceDialog_FindReplace_Status_highlights_label;
74
	public static String MarkRegionTarget_markNotSet;
78
	public static String MarkRegionTarget_markNotSet;
75
	public static String MarkRegionTarget_markNotVisible;
79
	public static String MarkRegionTarget_markNotVisible;
76
	public static String Editor_FindIncremental_name;
80
	public static String Editor_FindIncremental_name;
(-)src/org/eclipse/ui/texteditor/FindReplaceTarget.java (-1 / +18 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.texteditor;
12
package org.eclipse.ui.texteditor;
12
13
Lines 16-21 Link Here
16
import org.eclipse.jface.text.IFindReplaceTarget;
17
import org.eclipse.jface.text.IFindReplaceTarget;
17
import org.eclipse.jface.text.IFindReplaceTargetExtension;
18
import org.eclipse.jface.text.IFindReplaceTargetExtension;
18
import org.eclipse.jface.text.IFindReplaceTargetExtension3;
19
import org.eclipse.jface.text.IFindReplaceTargetExtension3;
20
import org.eclipse.jface.text.IFindReplaceTargetExtension4;
19
import org.eclipse.jface.text.IRegion;
21
import org.eclipse.jface.text.IRegion;
20
22
21
23
Lines 23-29 Link Here
23
 * Internal find/replace target wrapping the editor's source viewer.
25
 * Internal find/replace target wrapping the editor's source viewer.
24
 * @since 2.1
26
 * @since 2.1
25
 */
27
 */
26
class FindReplaceTarget implements IFindReplaceTarget, IFindReplaceTargetExtension, IFindReplaceTargetExtension2, IFindReplaceTargetExtension3 {
28
class FindReplaceTarget implements IFindReplaceTarget, IFindReplaceTargetExtension, IFindReplaceTargetExtension2, IFindReplaceTargetExtension3, IFindReplaceTargetExtension4 {
27
29
28
	/** The editor */
30
	/** The editor */
29
	private AbstractTextEditor fEditor;
31
	private AbstractTextEditor fEditor;
Lines 219-222 Link Here
219
	public boolean validateTargetState() {
221
	public boolean validateTargetState() {
220
		return fEditor.validateEditorInputState();
222
		return fEditor.validateEditorInputState();
221
	}
223
	}
224
225
	/*
226
	 * @see org.eclipse.jface.text.IFindReplaceTargetExtension4#highlightAll(String, boolean, boolean, boolean)
227
	 */
228
	public int highlightAll(String findString, boolean caseSensitive,
229
			boolean wholeWord, boolean regExSearch) {
230
		return ((IFindReplaceTargetExtension4) fTarget).highlightAll(findString, caseSensitive, wholeWord, regExSearch);
231
	}
232
233
	/*
234
	 * @see org.eclipse.jface.text.IFindReplaceTargetExtension4#clearHighlights()
235
	 */
236
	public void clearHighlights() {
237
		((IFindReplaceTargetExtension4) fTarget).clearHighlights();
238
	}
222
}
239
}
(-)src/org/eclipse/jface/text/TextViewer.java (-1 / +186 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jface.text;
12
package org.eclipse.jface.text;
12
13
Lines 74-79 Link Here
74
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
75
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
75
import org.eclipse.jface.text.projection.ChildDocument;
76
import org.eclipse.jface.text.projection.ChildDocument;
76
import org.eclipse.jface.text.projection.ChildDocumentManager;
77
import org.eclipse.jface.text.projection.ChildDocumentManager;
78
import org.eclipse.jface.text.source.Annotation;
79
import org.eclipse.jface.text.source.AnnotationModel;
80
import org.eclipse.jface.text.source.ISourceViewer;
81
import org.eclipse.jface.text.source.SourceViewer;
77
82
78
83
79
/**
84
/**
Lines 754-760 Link Here
754
	/**
759
	/**
755
	 * This viewer's find/replace target.
760
	 * This viewer's find/replace target.
756
	 */
761
	 */
757
	class FindReplaceTarget implements IFindReplaceTarget, IFindReplaceTargetExtension, IFindReplaceTargetExtension3 {
762
	class FindReplaceTarget implements IFindReplaceTarget, IFindReplaceTargetExtension, IFindReplaceTargetExtension3, IFindReplaceTargetExtension4 {
758
763
759
		/** The range for this target. */
764
		/** The range for this target. */
760
		private FindReplaceRange fRange;
765
		private FindReplaceRange fRange;
Lines 997-1003 Link Here
997
				}
1002
				}
998
			}
1003
			}
999
		}
1004
		}
1005
1006
		/*
1007
		 * @see IFindReplaceTargetExtension4#highlightAll(String, boolean, boolean, boolean)
1008
		 * @since 3.4
1009
		 */
1010
		public int highlightAll(String findString, boolean caseSensitive,
1011
				boolean wholeWord, boolean regExSearch) {
1012
			int matchCount;
1013
			
1014
			if (fRange != null) {
1015
				IRegion range= fRange.getRange();
1016
				matchCount = TextViewer.this.highlightAllInRange(findString, caseSensitive, wholeWord, range.getOffset(), range.getLength(), regExSearch);
1017
			} else {
1018
				matchCount = TextViewer.this.highlightAll(findString, caseSensitive, wholeWord, regExSearch);
1019
			}
1020
			
1021
			return matchCount;
1022
		}
1023
1024
		/*
1025
		 * @see IFindReplaceTargetExtension4#clearHighlights()
1026
		 * @since 3.4
1027
		 */
1028
		public void clearHighlights() {
1029
			// TODO This removes annotations if target supports it. Remove highlights from non-supporting targets.
1030
			if(TextViewer.this instanceof SourceViewer){
1031
				AnnotationModel model = (AnnotationModel) ((SourceViewer) TextViewer.this).getAnnotationModel();
1032
				Iterator iter = model.getAnnotationIterator();
1033
				while(iter.hasNext()){
1034
					Annotation currentAnnotation = (Annotation) iter.next();
1035
					if(currentAnnotation.getType().equals("org.eclipse.jface.text.find")){ //$NON-NLS-1$
1036
						model.removeAnnotation(currentAnnotation);
1037
					}
1038
				}
1039
			}
1040
		}
1041
		
1000
	}
1042
	}
1043
	
1044
	
1045
	
1001
1046
1002
1047
1003
	/**
1048
	/**
Lines 5331-5335 Link Here
5331
	public void setTabsToSpacesConverter(IAutoEditStrategy converter) {
5376
	public void setTabsToSpacesConverter(IAutoEditStrategy converter) {
5332
		fTabsToSpacesConverter= converter;
5377
		fTabsToSpacesConverter= converter;
5333
	}
5378
	}
5379
	
5380
	/**
5381
	 * Returns whether this TextViewer is annotatible.
5382
	 * @return whether this TextViewer is annotatible
5383
	 * @since 3.4
5384
	 */
5385
	public boolean isAnnotatible(){
5386
		return (this instanceof ISourceViewer);
5387
	}
5388
	
5389
	/**
5390
	 * Adheres to the contract of {@link org.eclipse.jface.text.IFindReplaceTargetExtension4#highlightAll(String, boolean, boolean, boolean)}.
5391
	 *
5392
	 * @param findString the find string specification
5393
	 * @param caseSensitive <code>true</code> if case sensitive, <code>false</code> otherwise
5394
	 * @param wholeWord <code>true</code> if matches must be whole words, <code>false</code> otherwise
5395
	 * @param regExSearch <code>true</code> if <code>findString</code> is a regular expression, <code>false</code> otherwise
5396
	 * @return number of occurrences in range
5397
	 * @since 3.4
5398
	 */
5399
	protected int highlightAll(String findString, boolean caseSensitive,
5400
			boolean wholeWord, boolean regExSearch) {
5401
		int matchCounter = 0;
5402
		
5403
		try {
5404
5405
			int widgetOffset= 0;
5406
			int firstMatch = -1;
5407
			IRegion matchRegion;
5408
			FindReplaceDocumentAdapter adapter= getFindReplaceDocumentAdapter();
5409
			
5410
			while((matchRegion= adapter.find(widgetOffset, findString, true, caseSensitive, wholeWord, regExSearch))!=null){
5411
				int widgetPos= matchRegion.getOffset();
5412
				int length= matchRegion.getLength();
5413
				
5414
				if(matchCounter == 0) firstMatch = widgetPos;
5415
				else {
5416
					if(firstMatch == widgetPos)
5417
						return matchCounter;
5418
				}
5419
5420
				if(isAnnotatible()){
5421
					AnnotationModel model = (AnnotationModel) ((ISourceViewer) TextViewer.this).getAnnotationModel();
5422
					Annotation findAnnotation = new Annotation("org.eclipse.jface.text.find",true,adapter.subSequence(widgetPos, widgetPos+length).toString()); //$NON-NLS-1$
5423
					Position position = new Position(widgetPos,length);
5424
					model.addAnnotation(findAnnotation, position);
5425
				}
5426
				else {
5427
					// TODO Add raw highlighing for targets that don't support annotations
5428
//					Color highlight = new Color(getTextWidget().getDisplay(),255,0,0);
5429
//					setTextColor(highlight, widgetPos, length, false);
5430
					return 0;
5431
				}
5432
5433
				matchCounter++;
5434
				widgetOffset = widgetPos + length;
5435
			}
5436
5437
		} catch (BadLocationException x) {
5438
			if (TRACE_ERRORS)
5439
				System.out.println(JFaceTextMessages.getString("TextViewer.error.bad_location.findAndSelect")); //$NON-NLS-1$
5440
		}
5441
5442
		return matchCounter;
5443
		
5444
	}
5445
	
5446
	/**
5447
	 * Adheres to the contract of {@link org.eclipse.jface.text.IFindReplaceTargetExtension4#highlightAll(String, boolean, boolean, boolean)}.
5448
	 *
5449
	 * @param findString the find string specification
5450
	 * @param caseSensitive <code>true</code> if case sensitive, <code>false</code> otherwise
5451
	 * @param wholeWord <code>true</code> if matches must be whole words, <code>false</code> otherwise
5452
	 * @param rangeOffset the search scope offset
5453
	 * @param rangeLength the search scope length
5454
	 * @param regExSearch <code>true</code> if <code>findString</code> is a regular expression, <code>false</code> otherwise
5455
	 * @return number of occurrences in range
5456
	 * @since 3.4
5457
	 */
5458
	protected int highlightAllInRange(String findString, boolean caseSensitive,
5459
			boolean wholeWord, int rangeOffset, int rangeLength, boolean regExSearch){
5460
		int matchCounter = 0;
5461
5462
		try {
5463
5464
			int firstMatch = -1;
5465
			int widgetOffset= modelOffset2WidgetOffset(rangeOffset);
5466
			if (widgetOffset == -1)
5467
				return -1;
5468
5469
			FindReplaceDocumentAdapter adapter= getFindReplaceDocumentAdapter();
5470
			IRegion matchRegion;
5471
			int widgetPos= -1;
5472
			int length= 0;
5473
			while((matchRegion= adapter.find(widgetOffset, findString, true, caseSensitive, wholeWord, regExSearch)) != null) {
5474
				widgetPos= matchRegion.getOffset();
5475
				length= matchRegion.getLength();
5476
				
5477
				if(matchCounter == 0) firstMatch = widgetPos;
5478
				else {
5479
					if(firstMatch == widgetPos)
5480
						return matchCounter;
5481
				}
5482
5483
				int modelPos= widgetPos == -1 ? -1 : widgetOffset2ModelOffset(widgetPos);
5484
5485
				if (widgetPos != -1 && (modelPos < rangeOffset || modelPos + length > rangeOffset + rangeLength))
5486
					widgetPos= -1;
5487
5488
				if (widgetPos > -1) {
5489
5490
					if(isAnnotatible()){
5491
						AnnotationModel model = (AnnotationModel) ((ISourceViewer) TextViewer.this).getAnnotationModel();
5492
						Annotation findAnnotation = new Annotation("org.eclipse.jface.text.find",true,adapter.subSequence(widgetPos, widgetPos+length).toString()); //$NON-NLS-1$
5493
						Position position = new Position(widgetPos,length);
5494
						model.addAnnotation(findAnnotation, position);
5495
					}
5496
					else {
5497
						// TODO Add raw highlighing for targets that don't support annotations
5498
//						Color highlight = new Color(getTextWidget().getDisplay(),255,0,0);
5499
//						setTextColor(highlight, widgetPos, length, false);
5500
						return 0;
5501
					}
5502
5503
					matchCounter++;
5504
					
5505
					widgetOffset = widgetPos + length;
5506
				}
5507
				
5508
				else break;
5509
			}
5510
5511
5512
		} catch (BadLocationException x) {
5513
			if (TRACE_ERRORS)
5514
				System.out.println(JFaceTextMessages.getString("TextViewer.error.bad_location.findAndSelect")); //$NON-NLS-1$
5515
		}
5516
5517
		return matchCounter;
5518
	}
5334
5519
5335
}
5520
}
(-)META-INF/MANIFEST.MF (-19 / +93 lines)
Lines 1-37 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.jface.text
4
Bundle-SymbolicName: org.eclipse.jface.text;singleton:=true
5
Bundle-Version: 3.4.0.qualifier
5
Bundle-Version: 3.4.0.qualifier
6
Bundle-Vendor: %providerName
6
Bundle-Vendor: %providerName
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Export-Package: 
8
Export-Package: 
9
 org.eclipse.jface.contentassist,
9
 org.eclipse.jface.contentassist;
10
  uses:="org.eclipse.jface.text,
11
   org.eclipse.swt.events,
12
   org.eclipse.swt.custom,
13
   org.eclipse.swt.graphics,
14
   org.eclipse.jface.viewers,
15
   org.eclipse.swt.widgets,
16
   org.eclipse.jface.text.contentassist",
10
 org.eclipse.jface.contentassist.images,
17
 org.eclipse.jface.contentassist.images,
11
 org.eclipse.jface.internal.text;x-internal:=true,
18
 org.eclipse.jface.internal.text;x-internal:=true,
12
 org.eclipse.jface.internal.text.html;x-friends:="org.eclipse.ui.workbench.texteditor, org.eclipse.ui.editors, org.eclipse.jdt.debug.ui, org.eclipse.jdt.ui, org.eclipse.ant.ui",
19
 org.eclipse.jface.internal.text.html;x-friends:="org.eclipse.ui.workbench.texteditor,org.eclipse.ui.editors,org.eclipse.jdt.debug.ui,org.eclipse.jdt.ui,org.eclipse.ant.ui",
13
 org.eclipse.jface.internal.text.link.contentassist;x-internal:=true,
20
 org.eclipse.jface.internal.text.link.contentassist;x-internal:=true,
14
 org.eclipse.jface.internal.text.revisions;x-internal:=true,
21
 org.eclipse.jface.internal.text.revisions;x-internal:=true,
15
 org.eclipse.jface.internal.text.source;x-internal:=true,
22
 org.eclipse.jface.internal.text.source;x-internal:=true,
16
 org.eclipse.jface.text,
23
 org.eclipse.jface.text;
17
 org.eclipse.jface.text.contentassist,
24
  uses:="org.eclipse.jface.text.hyperlink,
18
 org.eclipse.jface.text.formatter,
25
   org.eclipse.core.runtime,
19
 org.eclipse.jface.text.hyperlink,
26
   org.eclipse.jface.text.source,
20
 org.eclipse.jface.text.information,
27
   org.eclipse.swt.events,
21
 org.eclipse.jface.text.link,
28
   org.eclipse.swt.custom,
22
 org.eclipse.jface.text.presentation,
29
   org.eclipse.jface.preference,
23
 org.eclipse.jface.text.quickassist,
30
   org.eclipse.core.commands.operations,
24
 org.eclipse.jface.text.reconciler,
31
   org.eclipse.swt.graphics,
25
 org.eclipse.jface.text.revisions,
32
   org.eclipse.jface.viewers,
26
 org.eclipse.jface.text.rules,
33
   org.eclipse.swt.widgets,
27
 org.eclipse.jface.text.source,
34
   org.eclipse.jface.dialogs",
28
 org.eclipse.jface.text.source.projection,
35
 org.eclipse.jface.text.contentassist;
36
  uses:="org.eclipse.jface.text,
37
   org.eclipse.core.runtime,
38
   org.eclipse.jface.contentassist,
39
   org.eclipse.swt.events,
40
   org.eclipse.swt.custom,
41
   org.eclipse.swt.graphics,
42
   org.eclipse.jface.bindings.keys,
43
   org.eclipse.swt.widgets,
44
   org.eclipse.jface.dialogs",
45
 org.eclipse.jface.text.formatter;uses:="org.eclipse.jface.text,org.eclipse.jface.preference",
46
 org.eclipse.jface.text.hyperlink;
47
  uses:="org.eclipse.jface.text,
48
   org.eclipse.jface.preference,
49
   org.eclipse.core.runtime,
50
   org.eclipse.swt.events,
51
   org.eclipse.swt.graphics,
52
   org.eclipse.jface.util,
53
   org.eclipse.swt.widgets",
54
 org.eclipse.jface.text.information;
55
  uses:="org.eclipse.jface.text,
56
   org.eclipse.swt.events,
57
   org.eclipse.swt.graphics,
58
   org.eclipse.swt.widgets",
59
 org.eclipse.jface.text.link;
60
  uses:="org.eclipse.jface.text,
61
   org.eclipse.jface.text.source,
62
   org.eclipse.swt.events,
63
   org.eclipse.swt.custom,
64
   org.eclipse.swt.widgets",
65
 org.eclipse.jface.text.presentation;uses:="org.eclipse.jface.text",
66
 org.eclipse.jface.text.quickassist;
67
  uses:="org.eclipse.jface.text,
68
   org.eclipse.jface.text.source,
69
   org.eclipse.swt.graphics,
70
   org.eclipse.jface.text.contentassist",
71
 org.eclipse.jface.text.reconciler;uses:="org.eclipse.jface.text,org.eclipse.core.runtime",
72
 org.eclipse.jface.text.revisions;
73
  uses:="org.eclipse.jface.text,
74
   org.eclipse.jface.text.source,
75
   org.eclipse.jface.text.information,
76
   org.eclipse.swt.graphics,
77
   org.eclipse.jface.viewers",
78
 org.eclipse.jface.text.rules;uses:="org.eclipse.jface.text,org.eclipse.jface.text.presentation",
79
 org.eclipse.jface.text.source;
80
  uses:="org.eclipse.jface.text.hyperlink,
81
   org.eclipse.jface.text,
82
   org.eclipse.jface.text.reconciler,
83
   org.eclipse.jface.text.information,
84
   org.eclipse.jface.text.formatter,
85
   org.eclipse.jface.text.revisions,
86
   org.eclipse.swt.events,
87
   org.eclipse.swt.custom,
88
   org.eclipse.jface.text.contentassist,
89
   org.eclipse.jface.text.presentation,
90
   org.eclipse.swt.graphics,
91
   org.eclipse.jface.viewers,
92
   org.eclipse.swt.widgets,
93
   org.eclipse.jface.text.quickassist",
94
 org.eclipse.jface.text.source.projection;
95
  uses:="org.eclipse.jface.text,
96
   org.eclipse.core.runtime,
97
   org.eclipse.jface.text.source,
98
   org.eclipse.jface.text.information,
99
   org.eclipse.swt.events,
100
   org.eclipse.swt.graphics,
101
   org.eclipse.swt.widgets",
29
 org.eclipse.jface.text.source.projection.images,
102
 org.eclipse.jface.text.source.projection.images,
30
 org.eclipse.jface.text.templates,
103
 org.eclipse.jface.text.templates;uses:="org.eclipse.jface.text,org.eclipse.swt.graphics,org.eclipse.jface.text.contentassist",
31
 org.eclipse.jface.text.templates.persistence
104
 org.eclipse.jface.text.templates.persistence;uses:="org.eclipse.jface.preference,org.eclipse.jface.text.templates"
32
Require-Bundle: 
105
Require-Bundle: 
33
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
106
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
34
 org.eclipse.text;bundle-version="[3.3.0,4.0.0)";visibility:=reexport,
107
 org.eclipse.text;bundle-version="[3.3.0,4.0.0)";visibility:=reexport,
35
 org.eclipse.jface;bundle-version="[3.3.0,4.0.0)"
108
 org.eclipse.jface;bundle-version="[3.3.0,4.0.0)",
109
 org.eclipse.ui
36
Bundle-RequiredExecutionEnvironment: J2SE-1.4
110
Bundle-RequiredExecutionEnvironment: J2SE-1.4
37
Import-Package: com.ibm.icu.text
111
Import-Package: com.ibm.icu.text
(-)plugin.properties (+3 lines)
Lines 10-12 Link Here
10
###############################################################################
10
###############################################################################
11
pluginName = JFace Text
11
pluginName = JFace Text
12
providerName = Eclipse.org
12
providerName = Eclipse.org
13
14
findSpecificationLabel = Highlight All
15
findMarkerName = Highlight All Marker
(-)build.properties (-1 / +4 lines)
Lines 12-18 Link Here
12
               .options,\
12
               .options,\
13
               .,\
13
               .,\
14
               about.html,\
14
               about.html,\
15
               META-INF/
15
               META-INF/,\
16
               icons/,\
17
               plugin.xml,\
18
               component.xml
16
19
17
src.includes = about.html
20
src.includes = about.html
18
21
(-)src/org/eclipse/jface/text/IFindReplaceTargetExtension4.java (+42 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Cagatay Calli - initial API and implementation (https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692)
10
 *******************************************************************************/
11
12
package org.eclipse.jface.text;
13
14
/**
15
 * Extension interface for {@link org.eclipse.jface.text.IFindReplaceTarget}.
16
 * <p>
17
 * Extends the find replace target to add "highlight all" functionality.
18
 *
19
 * @since 3.4
20
 */
21
public interface IFindReplaceTargetExtension4 {	
22
	/**
23
	 * Finds and highlights all occurrences of the user's findString. 
24
	 * Returns the number of all occurrences.
25
	 * 
26
	 * @param findString the string to search for
27
	 * @param caseSensitive should the search be case sensitive
28
	 * @param wholeWord does the search string represent a complete word
29
	 * @param regExSearch if <code>true</code> findString represents a regular expression
30
	 * @return number of occurrences
31
	 * 
32
	 * @since 3.4
33
	*/
34
	int highlightAll(String findString, boolean caseSensitive, boolean wholeWord, boolean regExSearch);
35
	
36
	/**
37
	 * Clears all highlights and corresponding annotations.
38
	 * 
39
	 * @since 3.4
40
	 */
41
	void clearHighlights();
42
}
(-)plugin.xml (+55 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
3
<plugin>
4
   <extension
5
         point="org.eclipse.ui.editors.annotationTypes">
6
      <type
7
            name="org.eclipse.jface.text.find"
8
            markerType="org.eclipse.jface.text.findMarker">
9
      </type>
10
   </extension>
11
   <extension
12
         point="org.eclipse.ui.ide.markerImageProviders">
13
      <imageprovider
14
            id="org.eclipse.jface.text.findMarkerProvider"
15
            markertype="org.eclipse.jface.text.findMarker">
16
      </imageprovider>
17
   </extension>
18
   <extension
19
         id="org.eclipse.jface.text.findMarker"
20
         name="%findMarkerName"
21
         point="org.eclipse.core.resources.markers">       
22
         <super type="org.eclipse.core.resources.textmarker" />
23
	      <persistent value="false" />
24
	      <attribute name="issueId" />
25
	      <attribute name="summary" />
26
	      <attribute name="description" />
27
	      <attribute name="message" />
28
   </extension>
29
   <extension
30
         point="org.eclipse.ui.editors.markerAnnotationSpecification">
31
      <specification
32
            annotationType="org.eclipse.jface.text.find"
33
            label="%findSpecificationLabel"
34
            icon="$nl$/icons/full/obj16/searchm_obj.gif"
35
            textPreferenceKey="findIndication"
36
            textPreferenceValue="true"
37
            highlightPreferenceKey="findIndicationHighlighting"
38
            highlightPreferenceValue="true"
39
            contributesToHeader="true"
40
            overviewRulerPreferenceKey="findIndicationInOverviewRuler"
41
            overviewRulerPreferenceValue="true"
42
            verticalRulerPreferenceKey="findIndicationInVerticalRuler"
43
            verticalRulerPreferenceValue="true"
44
            colorPreferenceKey="findIndicationColor"
45
            colorPreferenceValue="255,255,0"
46
            presentationLayer="3"
47
            showInNextPrevDropdownToolbarActionKey="showFindInNextPrevDropdownToolbarAction"
48
            showInNextPrevDropdownToolbarAction="true"
49
            isGoToNextNavigationTargetKey="isFindGoToNextNavigationTarget"
50
            isGoToNextNavigationTarget="true"
51
            isGoToPreviousNavigationTargetKey="isFindGoToPreviousNavigationTarget"
52
            isGoToPreviousNavigationTarget="true">
53
      </specification>
54
   </extension>
55
</plugin>

Return to bug 29692