This commit was manufactured by cvs2svn to create tag 'R2_1_1'.

Sprout from master 2003-03-27 17:56:39 UTC Dani Megert <dmegert> 'Updated copyright to 2003'
Cherrypick from master 2003-04-23 13:33:50 UTC Kai Maetzel <kmaetzel> '*** empty log message ***':
    org.eclipse.text/src/org/eclipse/jface/text/IDocument.java
Cherrypick from R2_1_maintenance 2003-05-07 14:14:12 UTC Dani Megert <dmegert> 'Fixed bug 37224':
    org.eclipse.search/plugin.xml
    org.eclipse.search/scripts/exportplugin.xml
    org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
    org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
diff --git a/org.eclipse.search/plugin.xml b/org.eclipse.search/plugin.xml
index e7a58b3..432bbc7 100644
--- a/org.eclipse.search/plugin.xml
+++ b/org.eclipse.search/plugin.xml
@@ -7,7 +7,7 @@
 	name="%pluginName"
 	
 	id="org.eclipse.search"
-	version="2.1.0"
+	version="2.1.1"
 	provider-name="%providerName"
 	class="org.eclipse.search.internal.ui.SearchPlugin">
 
diff --git a/org.eclipse.search/scripts/exportplugin.xml b/org.eclipse.search/scripts/exportplugin.xml
index fafcb59..c98cd1b 100644
--- a/org.eclipse.search/scripts/exportplugin.xml
+++ b/org.eclipse.search/scripts/exportplugin.xml
@@ -3,7 +3,7 @@
 		<tstamp/>
 		<property name="destdir" value="../../plugin-export" />
 		<property name="plugin"  value="org.eclipse.search" />
-		<property name="version"  value="_2.1.0" />
+		<property name="version"  value="_2.1.1" />
 		<property name="dest"  value="${destdir}/${plugin}${version}" />
 	</target>
 
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
index 38805f4..521b7a1 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
@@ -37,6 +37,7 @@
 
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
@@ -60,8 +61,7 @@
 	private String fPattern;
 	private ISearchScope fScope;
 	private ITextSearchResultCollector fCollector;
-	private String fOptions;
-	private IEditorPart[] fDirtyEditors;
+	private IEditorPart[] fEditors;
 		
 	private IProgressMonitor fProgressMonitor;
 	private StringMatcher fMatcher;
@@ -81,11 +81,6 @@
 		fScope= scope;
 		fCollector= collector;
 		fPushback= false;
-		if (options != null)
-			fOptions= options;
-		else
-			fOptions= "";	 //$NON-NLS-1$
-
 		fProgressMonitor= collector.getProgressMonitor();
 		fMatcher= new StringMatcher(pattern, options.indexOf('i') != -1, false);
 		fNumberOfScannedFiles= 0;
@@ -109,9 +104,9 @@
 	 * Returns an array of all editors that have an unsaved content. If the identical content is 
 	 * presented in more than one editor, only one of those editor parts is part of the result.
 	 * 
-	 * @return an array of all dirty editor parts.
+	 * @return an array of all editor parts.
 	 */
-	public static IEditorPart[] getDirtyEditors() {
+	public static IEditorPart[] getEditors() {
 		Set inputs= new HashSet();
 		List result= new ArrayList(0);
 		IWorkbench workbench= SearchPlugin.getDefault().getWorkbench();
@@ -119,13 +114,16 @@
 		for (int i= 0; i < windows.length; i++) {
 			IWorkbenchPage[] pages= windows[i].getPages();
 			for (int x= 0; x < pages.length; x++) {
-				IEditorPart[] editors= pages[x].getDirtyEditors();
-				for (int z= 0; z < editors.length; z++) {
-					IEditorPart ep= editors[z];
-					IEditorInput input= ep.getEditorInput();
-					if (!inputs.contains(input)) {
-						inputs.add(input);
-						result.add(ep);
+				// see bug 37224
+				IEditorReference[] editorRefs= pages[x].getEditorReferences();
+				for (int z= 0; z < editorRefs.length; z++) {
+					IEditorPart ep= editorRefs[z].getEditor(false);
+					if (ep != null) {
+						IEditorInput input= ep.getEditorInput();
+						if (!inputs.contains(input)) {
+							inputs.add(input);
+							result.add(ep);
+						}
 					}
 				}
 			}
@@ -150,7 +148,7 @@
 		IFile file= (IFile)proxy.requestResource();
 		try {
 			BufferedReader reader= null;
-			ITextEditor editor= findDirtyEditorFor(file);
+			ITextEditor editor= findEditorFor(file);
 			if (editor != null) {
 				String s= editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
 				reader= new BufferedReader(new StringReader(s));
@@ -213,14 +211,14 @@
 			throw new OperationCanceledException(SearchMessages.getString("TextSearchVisitor.canceled")); //$NON-NLS-1$
 	}
 
-	private ITextEditor findDirtyEditorFor(IFile file) {
+	private ITextEditor findEditorFor(IFile file) {
 		int i= 0;
-		while (i < fDirtyEditors.length) {
-			IEditorPart dirtyEditor= fDirtyEditors[i];
-			IEditorInput input= dirtyEditor.getEditorInput();
-			if (input instanceof IFileEditorInput && dirtyEditor instanceof ITextEditor)
+		while (i < fEditors.length) {
+			IEditorPart editor= fEditors[i];
+			IEditorInput input= editor.getEditorInput();
+			if (input instanceof IFileEditorInput && editor instanceof ITextEditor)
 				if (((IFileEditorInput)input).getFile().equals(file))
-					return (ITextEditor)dirtyEditor;
+					return (ITextEditor)editor;
 			i++;
 		}
 		return null;
@@ -257,7 +255,7 @@
 	 * @see IResourceProxyVisitor#visit(IResourceProxy)
 	 */
 	public boolean visit(IResourceProxy proxy) {
-		fDirtyEditors= getDirtyEditors();
+		fEditors= getEditors();
 		return super.visit(proxy);
 	}
 }
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
index 5705c94..8dec8a3 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
@@ -18,6 +18,7 @@
 import org.eclipse.swt.graphics.Image;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.LabelProvider;
 
 import org.eclipse.search.internal.ui.util.ListDialog;
@@ -28,7 +29,10 @@
  */
 class ShowSearchesAction extends Action {
 
-	private static final LabelProvider fgLabelProvider= new LabelProvider() {
+	private static final class SearchesLabelProvider extends LabelProvider {
+		
+		private ArrayList fImages= new ArrayList();
+		
 		public String getText(Object element) {
 			if (!(element instanceof ShowSearchAction))
 				return ""; //$NON-NLS-1$
@@ -37,7 +41,23 @@
 		public Image getImage(Object element) {
 			if (!(element instanceof ShowSearchAction))
 				return null;
-			return ((ShowSearchAction)element).getImageDescriptor().createImage();
+
+			ImageDescriptor imageDescriptor= ((ShowSearchAction)element).getImageDescriptor(); 
+			if (imageDescriptor == null)
+				return null;
+			
+			Image image= imageDescriptor.createImage();
+			fImages.add(image);
+
+			return image;
+		}
+		
+		public void dispose() {
+			Iterator iter= fImages.iterator();
+			while (iter.hasNext())
+				((Image)iter.next()).dispose();
+				
+			fImages= null;
 		}
 	};
 
@@ -88,7 +108,7 @@
 			title= SearchMessages.getString("OtherSearchesDialog.title"); //$NON-NLS-1$
 			message= SearchMessages.getString("OtherSearchesDialog.message"); //$NON-NLS-1$
 		}		
-		ListDialog dlg= new ListDialog(SearchPlugin.getActiveWorkbenchShell(),input, title, message, new SearchResultContentProvider(), fgLabelProvider);
+		ListDialog dlg= new ListDialog(SearchPlugin.getActiveWorkbenchShell(),input, title, message, new SearchResultContentProvider(), new SearchesLabelProvider());
 		if (selectedAction != null) {
 			Object[] selected= new Object[1];
 			selected[0]= selectedAction;
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java
index a6aa535..5cad2a1 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java
@@ -44,7 +44,7 @@
  * updated on every document manipulation and ensured to be up-to-date when the document
  * listeners are informed. A document uses an <code>IDocumentPartitioner</code> to 
  * manage its partitions. A document may be unpartitioned which happens when there is no
- * partitioner. In this case, the document is considered as one singloe partition of a
+ * partitioner. In this case, the document is considered as one single partition of a
  * default type. The default type is specified by this interface. If a document change
  * changes the document's partitioning all registered partitioning listeners are
  * informed exactly once.<p>