Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2002-03-22 09:53:21 -0500
committercvs2svn2002-03-22 09:53:21 -0500
commit8e6a40f82f659b5eb9d18b570a6c7024302f4759 (patch)
tree152b0f508b06c51912c1f334f12c23b7384d036b
parenta106990bf0e544798a0668f49d21ef4f40c72d75 (diff)
downloadeclipse.platform.text-M5a.tar.gz
eclipse.platform.text-M5a.tar.xz
eclipse.platform.text-M5a.zip
This commit was manufactured by cvs2svn to create branch 'M5a'.M5a
Sprout from master 2002-03-22 14:53:15 UTC sarsenau '*** empty log message ***' Delete: org.eclipse.search/.classpath org.eclipse.search/.cvsignore org.eclipse.search/.vcm_meta org.eclipse.search/about.html org.eclipse.search/build.properties org.eclipse.search/buildnotes_search.html org.eclipse.search/doc/hglegal.htm org.eclipse.search/doc/ngibmcpy.gif org.eclipse.search/doc/org_eclipse_search.html org.eclipse.search/doc/org_eclipse_search_searchPages.html org.eclipse.search/doc/org_eclipse_search_searchResultSorters.html org.eclipse.search/icons/basic/clcl16/search_goto.gif org.eclipse.search/icons/basic/clcl16/search_history.gif org.eclipse.search/icons/basic/clcl16/search_next.gif org.eclipse.search/icons/basic/clcl16/search_prev.gif org.eclipse.search/icons/basic/clcl16/search_rem.gif org.eclipse.search/icons/basic/clcl16/search_remall.gif org.eclipse.search/icons/basic/clcl16/search_sortmatch.gif org.eclipse.search/icons/basic/clcl16/search_stop.gif org.eclipse.search/icons/basic/ctool16/search.gif org.eclipse.search/icons/basic/cview16/searchres.gif org.eclipse.search/icons/basic/dlcl16/search_goto.gif org.eclipse.search/icons/basic/dlcl16/search_history.gif org.eclipse.search/icons/basic/dlcl16/search_next.gif org.eclipse.search/icons/basic/dlcl16/search_prev.gif org.eclipse.search/icons/basic/dlcl16/search_rem.gif org.eclipse.search/icons/basic/dlcl16/search_remall.gif org.eclipse.search/icons/basic/dlcl16/search_sortmatch.gif org.eclipse.search/icons/basic/dlcl16/search_stop.gif org.eclipse.search/icons/basic/dtool16/search.gif org.eclipse.search/icons/basic/elcl16/search_goto.gif org.eclipse.search/icons/basic/elcl16/search_history.gif org.eclipse.search/icons/basic/elcl16/search_next.gif org.eclipse.search/icons/basic/elcl16/search_prev.gif org.eclipse.search/icons/basic/elcl16/search_rem.gif org.eclipse.search/icons/basic/elcl16/search_remall.gif org.eclipse.search/icons/basic/elcl16/search_sortmatch.gif org.eclipse.search/icons/basic/elcl16/search_stop.gif org.eclipse.search/icons/basic/etool16/search.gif org.eclipse.search/icons/basic/eview16/searchres.gif org.eclipse.search/icons/basic/obj16/searchm_obj.gif org.eclipse.search/icons/basic/obj16/tsearch_dpdn_obj.gif org.eclipse.search/icons/basic/obj16/tsearch_obj.gif org.eclipse.search/icons/full/clcl16/search_goto.gif org.eclipse.search/icons/full/clcl16/search_history.gif org.eclipse.search/icons/full/clcl16/search_next.gif org.eclipse.search/icons/full/clcl16/search_prev.gif org.eclipse.search/icons/full/clcl16/search_rem.gif org.eclipse.search/icons/full/clcl16/search_remall.gif org.eclipse.search/icons/full/clcl16/search_sortmatch.gif org.eclipse.search/icons/full/clcl16/search_stop.gif org.eclipse.search/icons/full/ctool16/search.gif org.eclipse.search/icons/full/cview16/searchres.gif org.eclipse.search/icons/full/dlcl16/search_goto.gif org.eclipse.search/icons/full/dlcl16/search_history.gif org.eclipse.search/icons/full/dlcl16/search_next.gif org.eclipse.search/icons/full/dlcl16/search_prev.gif org.eclipse.search/icons/full/dlcl16/search_rem.gif org.eclipse.search/icons/full/dlcl16/search_remall.gif org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif org.eclipse.search/icons/full/dlcl16/search_stop.gif org.eclipse.search/icons/full/dtool16/search.gif org.eclipse.search/icons/full/elcl16/search_goto.gif org.eclipse.search/icons/full/elcl16/search_history.gif org.eclipse.search/icons/full/elcl16/search_next.gif org.eclipse.search/icons/full/elcl16/search_prev.gif org.eclipse.search/icons/full/elcl16/search_rem.gif org.eclipse.search/icons/full/elcl16/search_remall.gif org.eclipse.search/icons/full/elcl16/search_sortmatch.gif org.eclipse.search/icons/full/elcl16/search_stop.gif org.eclipse.search/icons/full/etool16/search.gif org.eclipse.search/icons/full/eview16/searchres.gif org.eclipse.search/icons/full/obj16/searchm_obj.gif org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif org.eclipse.search/icons/full/obj16/tsearch_obj.gif org.eclipse.search/plugin.properties org.eclipse.search/plugin.xml org.eclipse.search/scripts/exportplugin.xml org.eclipse.search/search.jar org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSet.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetComparator.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetDialog.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.properties org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetReader.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetWriter.java org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java org.eclipse.search/search/org/eclipse/search/ui/IWorkingSet.java org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java org.eclipse.search/search/org/eclipse/search/ui/package.html
-rw-r--r--org.eclipse.search/.classpath11
-rw-r--r--org.eclipse.search/.cvsignore1
-rw-r--r--org.eclipse.search/.vcm_meta12
-rw-r--r--org.eclipse.search/about.html42
-rw-r--r--org.eclipse.search/build.properties6
-rw-r--r--org.eclipse.search/buildnotes_search.html245
-rw-r--r--org.eclipse.search/doc/hglegal.htm14
-rw-r--r--org.eclipse.search/doc/ngibmcpy.gifbin814 -> 0 bytes
-rw-r--r--org.eclipse.search/doc/org_eclipse_search.html34
-rw-r--r--org.eclipse.search/doc/org_eclipse_search_searchPages.html92
-rw-r--r--org.eclipse.search/doc/org_eclipse_search_searchResultSorters.html68
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_goto.gifbin134 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_history.gifbin165 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_next.gifbin88 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_prev.gifbin90 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_rem.gifbin77 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_remall.gifbin86 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_sortmatch.gifbin119 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/clcl16/search_stop.gifbin93 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/ctool16/search.gifbin118 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/cview16/searchres.gifbin118 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_goto.gifbin100 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_history.gifbin105 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_next.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_prev.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_rem.gifbin66 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_remall.gifbin75 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_sortmatch.gifbin90 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dlcl16/search_stop.gifbin87 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/dtool16/search.gifbin96 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_goto.gifbin125 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_history.gifbin108 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_next.gifbin86 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_prev.gifbin86 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_rem.gifbin77 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_remall.gifbin86 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_sortmatch.gifbin118 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/elcl16/search_stop.gifbin72 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/etool16/search.gifbin100 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/eview16/searchres.gifbin100 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/obj16/searchm_obj.gifbin89 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/obj16/tsearch_dpdn_obj.gifbin115 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/basic/obj16/tsearch_obj.gifbin172 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_goto.gifbin169 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_history.gifbin181 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_next.gifbin105 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_prev.gifbin132 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_rem.gifbin97 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_remall.gifbin117 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_sortmatch.gifbin160 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/clcl16/search_stop.gifbin163 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/ctool16/search.gifbin153 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/cview16/searchres.gifbin154 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_goto.gifbin97 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_history.gifbin103 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_next.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_prev.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_rem.gifbin66 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_remall.gifbin75 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_sortmatch.gifbin90 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_stop.gifbin91 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dtool16/search.gifbin94 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_goto.gifbin163 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_history.gifbin169 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_next.gifbin103 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_prev.gifbin105 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_rem.gifbin97 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_remall.gifbin111 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_sortmatch.gifbin158 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_stop.gifbin120 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/etool16/search.gifbin150 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/eview16/searchres.gifbin149 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/obj16/searchm_obj.gifbin136 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gifbin148 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/obj16/tsearch_obj.gifbin245 -> 0 bytes
-rw-r--r--org.eclipse.search/plugin.properties23
-rw-r--r--org.eclipse.search/plugin.xml105
-rw-r--r--org.eclipse.search/scripts/exportplugin.xml30
-rw-r--r--org.eclipse.search/search.jarbin330 -> 0 bytes
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java31
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java73
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java45
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java38
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java57
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java101
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java222
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java44
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java67
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java23
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java8
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java69
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java30
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java20
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java56
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java80
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java298
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java186
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java21
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java363
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java72
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java505
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java59
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties136
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java227
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java271
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java106
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java33
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java61
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java239
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java166
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java511
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java23
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java23
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java34
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java98
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java187
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java101
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java107
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java19
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java59
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java59
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java68
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java542
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java117
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java135
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java393
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java98
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java103
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java41
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java79
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java138
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java166
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java154
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java384
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java285
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSet.java217
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetComparator.java31
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetDialog.java297
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.java59
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.properties31
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetReader.java190
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java257
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetWriter.java136
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java102
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java23
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java41
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java121
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java44
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java138
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java60
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IWorkingSet.java35
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java186
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/package.html25
154 files changed, 0 insertions, 10336 deletions
diff --git a/org.eclipse.search/.classpath b/org.eclipse.search/.classpath
deleted file mode 100644
index 15ba3b97b..000000000
--- a/org.eclipse.search/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="search"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.apache.xerces"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.search/.cvsignore b/org.eclipse.search/.cvsignore
deleted file mode 100644
index 092357e47..000000000
--- a/org.eclipse.search/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.search/.vcm_meta b/org.eclipse.search/.vcm_meta
deleted file mode 100644
index 75a32922c..000000000
--- a/org.eclipse.search/.vcm_meta
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <reference project-name="org.apache.xerces"/>
- <reference project-name="org.eclipse.core.resources"/>
- <reference project-name="org.eclipse.ui"/>
- <reference project-name="org.eclipse.core.boot"/>
- <reference project-name="org.eclipse.core.runtime"/>
- <reference project-name="org.eclipse.swt"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
-</project-description>
diff --git a/org.eclipse.search/about.html b/org.eclipse.search/about.html
deleted file mode 100644
index 768324e89..000000000
--- a/org.eclipse.search/about.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-<title>About</title>
-<style type="text/css">
-p, table, td, th { font-family: arial, helvetica, geneva; font-size: 10pt}
-pre { font-family: "Courier New", Courier, mono; font-size: 10pt}
-h2 { font-family: arial, helvetica, geneva; font-size: 18pt; font-weight: bold ; line-height: 14px}
-code { font-family: "Courier New", Courier, mono; font-size: 10pt}
-sup { font-family: arial,helvetica,geneva; font-size: 10px}
-h3 { font-family: arial, helvetica, geneva; font-size: 14pt; font-weight: bold}
-li { font-family: arial, helvetica, geneva; font-size: 10pt}
-h1 { font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold}
-body { font-family: arial, helvetica, geneva; font-size: 10pt; clip: rect( ); margin-top: 5mm; margin-left: 3mm}
-</style>
-</head>
-<body lang="EN-US" link="blue" vlink="purple">
-<table border="0" cellspacing="5" cellpadding="2" width="100%" >
- <tr>
- <td align="LEFT" valign="TOP" colspan="2" bgcolor="#0080C0"><b><font color="#FFFFFF">About This Content</font></b></td>
- </tr>
- <tr>
- <td>
-<p>11th December, 2001</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in &quot;Content&quot;. Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-<a href="http://www.eclipse.org/legal/cpl-v05.html">Common Public License Version 0.5</a> &quot;CPL&quot;. For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL &quot;Other License&quot;, any modifications, enhancements and/or
-other code and/or documentation &quot;Modifications&quot; uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-</td></tr></table>
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.search/build.properties b/org.eclipse.search/build.properties
deleted file mode 100644
index a7d7e1e61..000000000
--- a/org.eclipse.search/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = plugin.xml,\
- about.html,\
- icons/,\
- plugin.properties,\
- *.jar
-source.search.jar = search/
diff --git a/org.eclipse.search/buildnotes_search.html b/org.eclipse.search/buildnotes_search.html
deleted file mode 100644
index 3a1397522..000000000
--- a/org.eclipse.search/buildnotes_search.html
+++ /dev/null
@@ -1,245 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html><head>
-
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
-
- <meta name="Author" content="IBM"><title>Eclipse Platform Release Notes - Search</title></head>
-
-<body>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
- Eclipse Build Input 20020326
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Text search also finds matches in dirty editors.<br></li>
-</ul>
-<h2>Problem Reports</h2>
-<a href="http://dev.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&amp;bug_status=CLOSED&amp;chfield=bug_status&amp;chfieldfrom=2002%2F03%2F19&amp;chfieldto=2002%2F03%2F26&amp;product=Platform&amp;component=Search&amp;cmdtype=doit&amp;&amp;order=Bug+Number">
- Click here</a>
-
- to see BRs which have been marked as RESOLVED or CLOSED between 2002/03/19
-and 2002/03/26.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
- Eclipse Build Input 20020226
-<h2> What's new in this drop</h2>
-<ul>
- <li>Previous file name patterns are now available through a combo box.</li>
- <li>The file name pattern is only derived the first time from the selection
-and after that the previous value is used to initialize the field.<br>
- </li>
-</ul>
-<h2>Problem Reports</h2>
-<a href="http://dev.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&amp;bug_status=CLOSED&amp;chfield=bug_status&amp;chfieldfrom=2002%2F02%2F14&amp;chfieldto=2002%2F02%2F26&amp;product=Platform&amp;component=Search&amp;cmdtype=doit&amp;&amp;order=Bug+Number">
- Click here</a>
- to see BRs which have been marked as RESOLVED or CLOSED between 2002/02/14
-and 2002/02/26.<br>
-<br>
-<hr size="1" width="100%"><br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Build Input 20020214
-<h2> What's new in this drop</h2>
-
-<ul>
- <li>Reuse of editors when stepping through search matches now managed
-by platform and no longer directly by the Search plug-in.<br>
- </li>
-
-</ul>
-
-<h2>Problem Reports</h2>
- <a href="http://dev.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&amp;bug_status=CLOSED&amp;chfield=bug_status&amp;chfieldfrom=2002%2F02%2F05&amp;chfieldto=2002%2F02%2F14&amp;product=Platform&amp;component=Search&amp;cmdtype=doit&amp;&amp;order=Bug+Number">
- Click here</a>
- to see BRs which have been marked as RESOLVED or CLOSED between 2002/02/05
-and 2002/02/14.<br>
- <br>
-
-<hr size="1" width="100%"><br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20020205
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8611">8611</a>
- NPE in text search with Compare to a Version editor open<br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=9007">9007</a>
- Working Set; OK button not disabled<br>
-
-<h2> Problem reports closed</h2>
-
-<hr size="1" width="100%"><br>
-
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20020129
-<h2>What's new in this drop</h2>
-
-<ul>
- <li>A new attribute called <i>showScopeSection</i> has been added to
- the markup language for Search pages. If this attribute is missing or set
- to <tt>false</tt> then the scope section is not shown in the Search dialog.
- To see the scope section this attribute has to be set to <tt>true</tt>
-. Plug-ins which add their own Search page and want to see the scope section
- will have to add the new attribute to their plugin.xml</li>
-
-</ul>
-
-<h3> API changes</h3>
-
-<ul>
- <li>Activation of the Search view has been moved from the dialog to
-the individual Search page. Plug-ins which want the Search page to appear
- when Search is invoked have to call <tt>SearchUI.activateSearchResultView()</tt><br>
- </li>
-
-</ul>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=7918">7918</a>
- Missing busy cursor in search dialog when flipping pages<br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=7919">7919</a>
- Search: scope section doesn't apply to Help search<br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8024">8024</a>
- SearchResultsView opens without calling SearchUI.activateSearchView<br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8025">8025</a>
- Scope section added to ISearchPage<br>
-
-<h2> Problem reports closed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8456">8456</a>
- Widget is disposed error in Search<br>
- <br>
- <br>
-
-<hr size="1" width="100%">
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20020122
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=7813">7813</a>
- NPE in SearchPageDescriptor.readExtensionScorePairs/StringTo<br>
-
-<h2> Problem reports closed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=4066">4066</a>
- Default extension in text search is often wrong (1GHFMPL)<br>
- <br>
-
-<hr size="1" width="100%">
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20011218
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
- APIs added for 2.0 are now flagged with <b>@since 2.0</b>.
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=6836">6836</a>
- Working Sets Dialog: Mnemonics, issues
-<hr size="1" width="100%">
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20011211
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5868">5868</a>
- Define working set does too much work in the UI thread <br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5620">5620</a>
- Search: control keys for navigating the list of search results
-
-<hr size="1" width="100%">
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20011206
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=6119">6119</a>
- cannot delete a working set <br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=6264">6264</a>
- Search results don't have initial selection
-<hr size="1" width="100%">
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Eclipse Integration Build 20011204
-<h2> What's new in this drop</h2>
-
-<h3> API changes</h3>
-
-<h3> API additions</h3>
-
-<h3> Other highlights</h3>
-
-<h2> Known deficiencies</h2>
-
-<h2> Problem reports fixed</h2>
- <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=3954">3954</a>
- Search dialog does not need parentheses around label (1GF86BN)
-<br>
- <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=6435">6435</a>
- Search again should move search to top of MRU list
-<hr size="1" width="100%">
-<h1> Eclipse Platform Build Notes<br>
- Search</h1>
- Note: Previous build notes have been included in <i>Eclipse Platform
- Build Notes - Java Development Tooling UI.</i><br>
- &nbsp;
-</body></html> \ No newline at end of file
diff --git a/org.eclipse.search/doc/hglegal.htm b/org.eclipse.search/doc/hglegal.htm
deleted file mode 100644
index b071dbdf4..000000000
--- a/org.eclipse.search/doc/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.search/doc/ngibmcpy.gif b/org.eclipse.search/doc/ngibmcpy.gif
deleted file mode 100644
index 360f8e998..000000000
--- a/org.eclipse.search/doc/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/doc/org_eclipse_search.html b/org.eclipse.search/doc/org_eclipse_search.html
deleted file mode 100644
index 61eb6e415..000000000
--- a/org.eclipse.search/doc/org_eclipse_search.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Search Infrastructure Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-IBM Eclipse Platform Search</h1></center>
-This document lists all of the extension points that the search plug-in makes
-available to tool developers.
-<p>All XML sub-elements defined in the individual extension point documents
-may appear more than once inside an extension element. For example, a <tt>org.eclipse.search.searchPages</tt>
-extension may contain several instances of <tt>page</tt> elements. Although
-making one extension per sub-element is not technically incorrect, we recommend
-grouping for consistent style. It can also improve platform startup time
-because there will be fewer extensions to process.
-<br>
-<hr WIDTH="100%">
-<h1>
-Extension Points</h1>
-The following extension points can be used to extend the capabilities
-of the search infrastructure:
-<ul>
-<li>
-<a href="org_eclipse_search_searchPages.html">org.eclipse.search.searchPages</a></li>
-<li>
-<a href="org_eclipse_search_searchResultSorters.html">org.eclipse.search.searchResultSorters</a></li>
-</ul>
-<a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/org.eclipse.search/doc/org_eclipse_search_searchPages.html b/org.eclipse.search/doc/org_eclipse_search_searchPages.html
deleted file mode 100644
index 6594ad9bd..000000000
--- a/org.eclipse.search/doc/org_eclipse_search_searchPages.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Search Infrastructure Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Search Pages</h1></center>
-<b><i>Identifier: </i></b>org.eclipse.search.searchPages
-<p><b><i>Description</i>: </b>This extension point allows a plug-in to register
-search pages for specialized searches. When the search action is performed on
-a resource, the search infrastructure locates the most specific registered search
-page for it.
-
-<p><b><i>Configuration Markup:</i></b>
-<p><tt>&nbsp;&nbsp; &lt;!ELEMENT page EMPTY&gt;</tt>
-<br><tt>&nbsp;&nbsp; &lt;!ATTLIST page</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeHint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tabPosition&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extensions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; showScopeSection&nbsp;CDATA #IMPLIED</tt>
-<ul>
-<li>
-<b>id</b> - a unique name that will be used to identify this search page</li>
-
-<li>
-<b>label</b> - a translatable label that will be used in the search page tab</li>
-
-<li>
-<b>class</b> - a name of the class that implements <tt>org.eclipse.search.ui.ISearchPage</tt>.
-We recommend subclassing <tt>org.eclipse.jface.dialogs.DialogPage</tt>.
-</li>
-
-<li>
-<b>icon</b> - a relative name of the image that will be used for all resources
-that match the specified extensions. If omitted, the
-search page's tab will only contain a label.</li>
-
-<li>
-<b>sizeHint</b> - a hint for the initial size of the page. This is a string
-containing the width and height separated by comma (e.g. "50, 60"). In the case
-this hint is omitted the page will be no larger than the other pages.</li>
-
-<li>
-<b>tabPosition</b> - an integer defining where the page is placed in the page book. The value does not define the absolute position but the position relative to the other pages. The ordering of pages is as follows:
- <ol>
- <li>if the tabPosition is not specified for a page then <tt>Integer.MAX_VALUE / 2</tt> is used</li>
- <li>the page with the lower value comes first. If the values are equal then the pages are are ordered alphabetically according to their labels</li>
- </ol>
-</li>
-
-<li>
-<b>extensions</b> - a comma separated list with file extensions on which the
-search page can operate. Each extension must also include a weight (0 meaning
-lowest weight) which enables the search infrastructure to find the best fitting
-page. The weight is separated from the extension by a colon.
-If a search page can search all possible resources then <tt>"*"</tt> can be used.</li>
-
-<li>
-<b>showScopeSection</b> - if this attribute is missing or set to <tt>"false"</tt> then the
-scope section is not shown in the Search dialog. To see the scope section this
-attribute has to be set to <tt>"true"</tt>. Plug-ins which add their own Search page and
-want to see the scope section have to add this to their plugin.xml.</li>
-
-</ul>
-<b><i>Examples:</i></b>
-<p>The following is an example of a search page extension definition:
-<p><tt>&nbsp;&nbsp; &lt;extension point="org.eclipse.search.searchPages"&gt;</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;page</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="org.eclipse.search.ui.text.TextSearchPage"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label="Text Search"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon="icons/full/obj16/tsearch_pref.gif"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeHint="250,160"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tabPosition="1"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extensions="*:1"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; showScopeSection="true"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="org.eclipse.search.ui.text.TextSearchPage"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/page&gt;</tt>
-<br><tt>&nbsp;&nbsp; &lt;/extension&gt;</tt>
-
-<p><b><i>Supplied Implementation: </i></b>The search infrastructure provides
- a search page for full-text search.
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/org.eclipse.search/doc/org_eclipse_search_searchResultSorters.html b/org.eclipse.search/doc/org_eclipse_search_searchResultSorters.html
deleted file mode 100644
index c3dcb0a48..000000000
--- a/org.eclipse.search/doc/org_eclipse_search_searchResultSorters.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
- <title>Search Infrastructure Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Result Sorters</h1></center>
-<b><i>Identifier: </i></b>org.eclipse.search.searchResultSorters
-<p><b><i>Description</i>: </b>This extension point allows a plug-in to
-contribute search result sorters to the search result view's <i>Sort</i>
-context menu.
-<p><b><i>Configuration Markup:</i></b>
-<p><tt>&nbsp;&nbsp; &lt;!ELEMENT page EMPTY&gt;</tt>
-<br><tt>&nbsp;&nbsp; &lt;!ATTLIST page</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pageId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tooltip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</tt>
-<ul>
-<li>
-<b>id</b> - a unique name that will be used to identify this search
-result sorter.</li>
-
-<li>
-<b>pageId</b> - the ID of a registered search page for which the sorter
-will be activated. "*" activates the sorter for all pages.</li>
-
-<li>
-<b>label</b> - a translatable label that will be used as the menu item's
-label.</li>
-
-<li>
-<b>tooltip</b> - a translatable text that will be used as the menu
-item's tool tip . If omitted, the menu item will have no tool tip.</li>
-
-<li>
-<b>icon</b> - a relative name of the image that will be shown in the
-context menu along with the label. If omitted, the menu entry will only
-contain a label.</li>
-
-<li>
-<b>class</b> - a name of the class that extends&nbsp;<tt>org.eclipse.jface.viewers.ViewerSorter</tt>.</li>
-</ul>
-<b><i>Examples:</i></b>
-<p><tt>The following is an example of a search page extension definition:</tt>
-<p><tt>&nbsp;&nbsp; &lt;extension point="org.eclipse.search.searchResultSorters"&gt;</tt>
-<br><tt>&nbsp;&nbsp;&nbsp; &lt;sorter</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="org.eclipse.search.internal.ui.FileNameSorter"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pageId="*"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label="%FileNameSorter.label"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tooltip="%FileNameSorter.tooltip"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon="icons/full/ecl16/search_sort.gif"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="org.eclipse.search.internal.ui.FileNameSorter"&gt;</tt>
-<br><tt>&nbsp;&nbsp;&nbsp; &lt;/sorter&gt;</tt>
-<br><tt>&nbsp;&nbsp; &lt;/extension&gt;</tt>
-
-<p><b><i>Supplied Implementation: </i></b>The search infrastructure
-provides a sorter that sorts the matches by the resource name.
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/org.eclipse.search/icons/basic/clcl16/search_goto.gif b/org.eclipse.search/icons/basic/clcl16/search_goto.gif
deleted file mode 100644
index b6232b72c..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_history.gif b/org.eclipse.search/icons/basic/clcl16/search_history.gif
deleted file mode 100644
index 0a7dd6c9c..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_next.gif b/org.eclipse.search/icons/basic/clcl16/search_next.gif
deleted file mode 100644
index 813a974c7..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_prev.gif b/org.eclipse.search/icons/basic/clcl16/search_prev.gif
deleted file mode 100644
index b3373b945..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_rem.gif b/org.eclipse.search/icons/basic/clcl16/search_rem.gif
deleted file mode 100644
index 61563b8a9..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_remall.gif b/org.eclipse.search/icons/basic/clcl16/search_remall.gif
deleted file mode 100644
index 331a968d3..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_sortmatch.gif b/org.eclipse.search/icons/basic/clcl16/search_sortmatch.gif
deleted file mode 100644
index 5baa5e378..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/clcl16/search_stop.gif b/org.eclipse.search/icons/basic/clcl16/search_stop.gif
deleted file mode 100644
index 218981e73..000000000
--- a/org.eclipse.search/icons/basic/clcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/ctool16/search.gif b/org.eclipse.search/icons/basic/ctool16/search.gif
deleted file mode 100644
index ff1bb3af7..000000000
--- a/org.eclipse.search/icons/basic/ctool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/cview16/searchres.gif b/org.eclipse.search/icons/basic/cview16/searchres.gif
deleted file mode 100644
index ff1bb3af7..000000000
--- a/org.eclipse.search/icons/basic/cview16/searchres.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_goto.gif b/org.eclipse.search/icons/basic/dlcl16/search_goto.gif
deleted file mode 100644
index 6139e97a6..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_history.gif b/org.eclipse.search/icons/basic/dlcl16/search_history.gif
deleted file mode 100644
index ceb60eb76..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_next.gif b/org.eclipse.search/icons/basic/dlcl16/search_next.gif
deleted file mode 100644
index 41480535e..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_prev.gif b/org.eclipse.search/icons/basic/dlcl16/search_prev.gif
deleted file mode 100644
index 2116582c8..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_rem.gif b/org.eclipse.search/icons/basic/dlcl16/search_rem.gif
deleted file mode 100644
index 8018dc49f..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_remall.gif b/org.eclipse.search/icons/basic/dlcl16/search_remall.gif
deleted file mode 100644
index b843059d8..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_sortmatch.gif b/org.eclipse.search/icons/basic/dlcl16/search_sortmatch.gif
deleted file mode 100644
index 35f03ccf3..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dlcl16/search_stop.gif b/org.eclipse.search/icons/basic/dlcl16/search_stop.gif
deleted file mode 100644
index 907f3a6b7..000000000
--- a/org.eclipse.search/icons/basic/dlcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/dtool16/search.gif b/org.eclipse.search/icons/basic/dtool16/search.gif
deleted file mode 100644
index c0475b751..000000000
--- a/org.eclipse.search/icons/basic/dtool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_goto.gif b/org.eclipse.search/icons/basic/elcl16/search_goto.gif
deleted file mode 100644
index b8e78bfce..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_history.gif b/org.eclipse.search/icons/basic/elcl16/search_history.gif
deleted file mode 100644
index fa99fe725..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_next.gif b/org.eclipse.search/icons/basic/elcl16/search_next.gif
deleted file mode 100644
index 92bbdf79c..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_prev.gif b/org.eclipse.search/icons/basic/elcl16/search_prev.gif
deleted file mode 100644
index 343a1eb26..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_rem.gif b/org.eclipse.search/icons/basic/elcl16/search_rem.gif
deleted file mode 100644
index 969bc69b8..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_remall.gif b/org.eclipse.search/icons/basic/elcl16/search_remall.gif
deleted file mode 100644
index fe84e9a25..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_sortmatch.gif b/org.eclipse.search/icons/basic/elcl16/search_sortmatch.gif
deleted file mode 100644
index 7c99ccb33..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/elcl16/search_stop.gif b/org.eclipse.search/icons/basic/elcl16/search_stop.gif
deleted file mode 100644
index aa7c6b18b..000000000
--- a/org.eclipse.search/icons/basic/elcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/etool16/search.gif b/org.eclipse.search/icons/basic/etool16/search.gif
deleted file mode 100644
index 4c675e2e3..000000000
--- a/org.eclipse.search/icons/basic/etool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/eview16/searchres.gif b/org.eclipse.search/icons/basic/eview16/searchres.gif
deleted file mode 100644
index 4c675e2e3..000000000
--- a/org.eclipse.search/icons/basic/eview16/searchres.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/obj16/searchm_obj.gif b/org.eclipse.search/icons/basic/obj16/searchm_obj.gif
deleted file mode 100644
index d9e77ee9c..000000000
--- a/org.eclipse.search/icons/basic/obj16/searchm_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/obj16/tsearch_dpdn_obj.gif b/org.eclipse.search/icons/basic/obj16/tsearch_dpdn_obj.gif
deleted file mode 100644
index 02699914e..000000000
--- a/org.eclipse.search/icons/basic/obj16/tsearch_dpdn_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/basic/obj16/tsearch_obj.gif b/org.eclipse.search/icons/basic/obj16/tsearch_obj.gif
deleted file mode 100644
index d7222c49c..000000000
--- a/org.eclipse.search/icons/basic/obj16/tsearch_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_goto.gif b/org.eclipse.search/icons/full/clcl16/search_goto.gif
deleted file mode 100644
index 80484787d..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_history.gif b/org.eclipse.search/icons/full/clcl16/search_history.gif
deleted file mode 100644
index 151fe137e..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_next.gif b/org.eclipse.search/icons/full/clcl16/search_next.gif
deleted file mode 100644
index 8392f3345..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_prev.gif b/org.eclipse.search/icons/full/clcl16/search_prev.gif
deleted file mode 100644
index 9b278e6fa..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_rem.gif b/org.eclipse.search/icons/full/clcl16/search_rem.gif
deleted file mode 100644
index 12a9167c5..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_remall.gif b/org.eclipse.search/icons/full/clcl16/search_remall.gif
deleted file mode 100644
index 2c069ab3f..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif
deleted file mode 100644
index 9ed470d02..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/clcl16/search_stop.gif b/org.eclipse.search/icons/full/clcl16/search_stop.gif
deleted file mode 100644
index 4eb53ec41..000000000
--- a/org.eclipse.search/icons/full/clcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/ctool16/search.gif b/org.eclipse.search/icons/full/ctool16/search.gif
deleted file mode 100644
index 6dc3ebefc..000000000
--- a/org.eclipse.search/icons/full/ctool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/cview16/searchres.gif b/org.eclipse.search/icons/full/cview16/searchres.gif
deleted file mode 100644
index b9aeb759c..000000000
--- a/org.eclipse.search/icons/full/cview16/searchres.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_goto.gif b/org.eclipse.search/icons/full/dlcl16/search_goto.gif
deleted file mode 100644
index 4d8cd04e4..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_history.gif b/org.eclipse.search/icons/full/dlcl16/search_history.gif
deleted file mode 100644
index ee26f79a8..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_next.gif b/org.eclipse.search/icons/full/dlcl16/search_next.gif
deleted file mode 100644
index 6cbeced26..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_prev.gif b/org.eclipse.search/icons/full/dlcl16/search_prev.gif
deleted file mode 100644
index a3441a062..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_rem.gif b/org.eclipse.search/icons/full/dlcl16/search_rem.gif
deleted file mode 100644
index 7e0ad4aed..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_remall.gif b/org.eclipse.search/icons/full/dlcl16/search_remall.gif
deleted file mode 100644
index 7ace43e8a..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif
deleted file mode 100644
index 8a47d61be..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dlcl16/search_stop.gif b/org.eclipse.search/icons/full/dlcl16/search_stop.gif
deleted file mode 100644
index 7f0f9b925..000000000
--- a/org.eclipse.search/icons/full/dlcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/dtool16/search.gif b/org.eclipse.search/icons/full/dtool16/search.gif
deleted file mode 100644
index 5fe80f3fc..000000000
--- a/org.eclipse.search/icons/full/dtool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_goto.gif b/org.eclipse.search/icons/full/elcl16/search_goto.gif
deleted file mode 100644
index d02e02805..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_goto.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_history.gif b/org.eclipse.search/icons/full/elcl16/search_history.gif
deleted file mode 100644
index d1e6b85ec..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_history.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_next.gif b/org.eclipse.search/icons/full/elcl16/search_next.gif
deleted file mode 100644
index 1d0b40adc..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_next.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_prev.gif b/org.eclipse.search/icons/full/elcl16/search_prev.gif
deleted file mode 100644
index 13729577c..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_prev.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_rem.gif b/org.eclipse.search/icons/full/elcl16/search_rem.gif
deleted file mode 100644
index 310510ee5..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_rem.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_remall.gif b/org.eclipse.search/icons/full/elcl16/search_remall.gif
deleted file mode 100644
index 33908b126..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_remall.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif
deleted file mode 100644
index 336c0ec3d..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/elcl16/search_stop.gif b/org.eclipse.search/icons/full/elcl16/search_stop.gif
deleted file mode 100644
index a519f44d4..000000000
--- a/org.eclipse.search/icons/full/elcl16/search_stop.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/etool16/search.gif b/org.eclipse.search/icons/full/etool16/search.gif
deleted file mode 100644
index 57ed3b4f6..000000000
--- a/org.eclipse.search/icons/full/etool16/search.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/eview16/searchres.gif b/org.eclipse.search/icons/full/eview16/searchres.gif
deleted file mode 100644
index 70c0f183e..000000000
--- a/org.eclipse.search/icons/full/eview16/searchres.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/obj16/searchm_obj.gif b/org.eclipse.search/icons/full/obj16/searchm_obj.gif
deleted file mode 100644
index 657b67e71..000000000
--- a/org.eclipse.search/icons/full/obj16/searchm_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif b/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif
deleted file mode 100644
index e6be56238..000000000
--- a/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/icons/full/obj16/tsearch_obj.gif b/org.eclipse.search/icons/full/obj16/tsearch_obj.gif
deleted file mode 100644
index 73ac91bdd..000000000
--- a/org.eclipse.search/icons/full/obj16/tsearch_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/plugin.properties b/org.eclipse.search/plugin.properties
deleted file mode 100644
index 42d0b4417..000000000
--- a/org.eclipse.search/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-pluginName = Search Support
-
-searchMarker = Search Marker
-
-searchPages = Search Pages
-searchResultSorters = Search Result Sorters
-
-search = Search
-textSearch = Text Search
-searchResultViewName = Search
-
-OpenSearchDialogAction.label = S&earch...@Ctrl+H
-OpenSearchDialogAction.tooltip = Search
-
-ResourcenameSorter.label = &Name
-ResourcenameSorter.tooltip = Sort by Resource Name
-ResourcePathSorter.label = &Path
-ResourcePathSorter.tooltip = Sort by Resource Path
diff --git a/org.eclipse.search/plugin.xml b/org.eclipse.search/plugin.xml
deleted file mode 100644
index 39f77e77e..000000000
--- a/org.eclipse.search/plugin.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- Search Plugin -->
-<!-- ======================================================================= -->
-<plugin
- name="%pluginName"
- id= "org.eclipse.search"
- version= "1.0"
- provider-name= "Object Technology International, Inc."
- class= "org.eclipse.search.internal.ui.SearchPlugin">
-
-<requires>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
-</requires>
-
-<runtime>
- <library name="search.jar" >
- <export name = "*"/>
- </library>
-</runtime>
-
-
-<!-- Search extension point definitions -->
-
-<extension-point name="%searchPages" id="searchPages"/>
-<extension-point name="%searchResultSorters" id="searchResultSorters"/>
-
-
-<!-- Extensions -->
-
-<extension id="searchmarker" point="org.eclipse.core.resources.markers" name="%searchMarker">
- <super type="org.eclipse.core.resources.textmarker"/>
- <attribute name="line"/>
-</extension>
-
-<extension
- point="org.eclipse.ui.markerImageProviders">
- <imageprovider
- id="org.eclipse.ui.searchMarkerProvider"
- markertype="org.eclipse.search.searchmarker"
- icon="icons/full/obj16/searchm_obj.gif">
- </imageprovider>
-</extension>
-
-<extension point="org.eclipse.ui.actionSets">
- <actionSet
- id="org.eclipse.search.searchActionSet"
- label="%search"
- visible="true">
- <action id="org.eclipse.search.ui.OpenSearchDialogAction"
- menubarPath="edit/find"
- toolbarPath="Normal/Search"
- label="%OpenSearchDialogAction.label"
- tooltip="%OpenSearchDialogAction.tooltip"
- icon="icons/full/ctool16/search.gif"
- class="org.eclipse.search.internal.ui.OpenSearchDialogAction"/>
- </actionSet>
-</extension>
-
-<extension point="org.eclipse.ui.views">
- <view
- id="org.eclipse.search.SearchResultView"
- name="%searchResultViewName"
- category="org.eclipse.ui"
- class="org.eclipse.search.internal.ui.SearchResultView"
- icon="icons/full/cview16/searchres.gif">
- </view>
-</extension>
-
-<extension point="org.eclipse.search.searchPages">
- <page
- id="org.eclipse.search.internal.ui.text.TextSearchPage"
- label="%textSearch"
- icon="icons/full/obj16/tsearch_obj.gif"
- sizeHint="250,160"
- tabPosition="1"
- extensions="*:1"
- showScopeSection="true"
- class="org.eclipse.search.internal.ui.text.TextSearchPage">
- </page>
-</extension>
-
-<extension point="org.eclipse.search.searchResultSorters">
- <sorter
- id="org.eclipse.search.internal.ui.ResourcenameSorter"
- pageId="org.eclipse.search.internal.ui.text.TextSearchPage"
- label="%ResourcenameSorter.label"
- tooltip="%ResourcenameSorter.tooltip"
- icon="icons/full/clcl16/search_sortmatch.gif"
- class="org.eclipse.search.internal.ui.text.ResourcenameSorter">
- </sorter>
- <sorter
- id="org.eclipse.search.internal.ui.ResourcePathSorter"
- pageId="org.eclipse.search.internal.ui.text.TextSearchPage"
- label="%ResourcePathSorter.label"
- tooltip="%ResourcePathSorter.tooltip"
- icon="icons/full/clcl16/search_sortmatch.gif"
- class="org.eclipse.search.internal.ui.text.ResourcePathSorter">
- </sorter>
-</extension>
-
-</plugin> \ No newline at end of file
diff --git a/org.eclipse.search/scripts/exportplugin.xml b/org.eclipse.search/scripts/exportplugin.xml
deleted file mode 100644
index c25c69a3a..000000000
--- a/org.eclipse.search/scripts/exportplugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<project name="org.eclipse.search" default="export" basedir="..">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="plugin" value="org.eclipse.search" />
- <property name="dest" value="${destdir}/${plugin}" />
- </target>
-
- <target name="build" depends="init">
- <incremental project="${plugin}" kind="incr"/>
- </target>
-
- <target name="export" depends="build">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/search.jar"
- basedir="bin"
- />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy todir="${dest}/icons">
- <fileset dir="icons" />
- </copy>
- <zip zipfile="${dest}/searchsrc.zip">
- <fileset dir="search" />
- </zip>
- </target>
-</project>
diff --git a/org.eclipse.search/search.jar b/org.eclipse.search/search.jar
deleted file mode 100644
index 83bc3a22e..000000000
--- a/org.eclipse.search/search.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java b/org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java
deleted file mode 100644
index 11d1af597..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * Defines a scope to which search results are limited.
- */
-public interface ISearchScope {
-
- /**
- * Checks whether the given element is enclosed by
- * this scope or not.
- *
- * @param element the resource to be checked
- * @return <code>true</code> if the resource is inside the search scope
- *
- */
- public boolean encloses(IResource element);
-
- /**
- * Returns a human readable description of this scope
- *
- * @return the description of this scope as <code>String</code>
- *
- */
- public String getDescription();
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java b/org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java
deleted file mode 100644
index f30cef30c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.util.Assert;
-
-/**
- * A default implementation of <code>ISearchScope</code>.
- */
-public class SearchScope implements ISearchScope {
-
- private List fElements;
- private String fDescription;
-
- public SearchScope(String description) {
- Assert.isNotNull(description);
- fDescription= description;
- fElements= new ArrayList(5);
- }
-
- public SearchScope(String description, IResource[] resources) {
- Assert.isNotNull(description);
- int resourceCount= resources.length;
- fDescription= description;
- fElements= new ArrayList(resourceCount + 5);
- for (int i= 0; i < resourceCount; i++)
- fElements.add(resources[i]);
- }
-
- /*
- * @see ISearchScope#add(IResource)
- */
- public void add(IResource element) {
- fElements.add(element);
- }
-
- /*
- * Implements method from ISearchScope
- */
- public boolean encloses(IResource element) {
- IPath elementPath= element.getFullPath();
- Iterator iter= elements();
- while (iter.hasNext()) {
- IResource resource= (IResource)iter.next();
- if (resource.getFullPath().isPrefixOf(elementPath))
- return true;
- }
- return false;
- }
-
- /*
- * Implements method from ISearchScope
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * Returns the search scope elements
- */
- protected Iterator elements() {
- return fElements.iterator();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java
deleted file mode 100644
index d960567e5..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.search.internal.core.ISearchScope;
-
-/**
- * The visitor that does the actual work.
- */
-public class AmountOfWorkCalculator extends TypedResourceVisitor {
- private ISearchScope fScope;
- private int fResult;
-
- protected boolean visitFile(IFile file) throws CoreException {
- if (fScope.encloses(file))
- fResult++;
- return true;
- }
-
- public int process(Collection projects, ISearchScope scope) throws CoreException {
- fResult= 0;
- fScope= scope;
-
- Iterator i= projects.iterator();
- while(i.hasNext()) {
- IProject project= (IProject)i.next();
- int save= fResult;
- project.accept(this);
- // Project doesn't contain any files that are in scope
- if (save == fResult)
- i.remove();
- }
-
- return fResult;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java
deleted file mode 100644
index dc34f294e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public interface ITextSearchResultCollector {
-
- /**
- * Returns the progress monitor used to setup and report progress.
- */
- public IProgressMonitor getProgressMonitor();
-
- /**
- * Called before the actual search starts.
- */
- public void aboutToStart() throws CoreException;
-
- /**
- * Accepts the given search result.
- * @param resource the resource in which the match has been found.
- * @param line the line containing the match
- * @param int start position from the beginning of the file. Start position
- * is zero based.
- * @param length the length of the match.
- * @param lineNumber the line number of the match.
- */
- public void accept(IResource resource, String line, int start, int length, int lineNumber) throws CoreException;
-
- /**
- * Called when the search has ended.
- */
- public void done() throws CoreException;
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java
deleted file mode 100644
index 555a23646..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.search.internal.core.ISearchScope;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-
-public class TextSearchEngine {
-
- /**
- * Search for the given pattern.
- */
- public void search(IWorkspace workspace, String pattern, String options, ISearchScope scope,
- ITextSearchResultCollector collector) throws CoreException {
-
- Assert.isNotNull(workspace);
- Assert.isNotNull(pattern);
- Assert.isNotNull(scope);
- Assert.isNotNull(collector);
-
- IProgressMonitor monitor= collector.getProgressMonitor();
-
- IProject[] projects= workspace.getRoot().getProjects();
- Collection openProjects= new ArrayList(10);
- for (int i= 0; i < projects.length; i++) {
- IProject project= projects[i];
- if (project.isOpen())
- openProjects.add(project);
- }
- if (!openProjects.isEmpty()) {
- int amountOfWork= (new AmountOfWorkCalculator()).process(openProjects, scope);
- try {
- monitor.beginTask(SearchMessages.getString("TextSearchEngine.scanning"), amountOfWork); //$NON-NLS-1$
- collector.aboutToStart();
- TextSearchVisitor visitor= new TextSearchVisitor(pattern, options,
- scope, collector);
- visitor.process(openProjects);
- } finally {
- monitor.done();
- collector.done();
- }
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java
deleted file mode 100644
index 73323c0a7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.search.internal.core.SearchScope;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.util.StringMatcher;
-
-/**
- * A special text search scope that take file extensions into account.
- */
-public class TextSearchScope extends SearchScope {
-
- private static class WorkspaceScope extends TextSearchScope {
-
- private WorkspaceScope() {
- super(SearchMessages.getString("WorkspaceScope")); //$NON-NLS-1$
- }
-
- public void add(IResource element) {
- // do nothing
- }
-
- /**
- * @see ISearchScope#encloses(Object)
- */
- public boolean encloses(IResource element) {
- if (element instanceof IFile && skipFile((IFile)element))
- return false;
- return true;
- }
- }
-
- private Set fExtensions= new HashSet(3);
-
- /**
- * Returns a new Workbench scope.
- */
- public static TextSearchScope newWorkspaceScope() {
- return new WorkspaceScope();
- }
-
- public TextSearchScope(String description) {
- super(description);
- }
-
- public TextSearchScope(String description, IResource[] resources) {
- super(description, resources);
- }
-
- /**
- * Adds an extension to the scope.
- */
- public void addExtension(String extension) {
- fExtensions.add(new StringMatcher(extension, false, false));
- }
- /**
- * Adds all string patterns contained in <code>extensions</code> to this
- * scope. The allowed pattern characters are <code>*</code> for any character
- * and <code>?</code> for one character.
- */
- public void addExtensions(Set extensions) {
- if (extensions == null)
- return;
- Iterator iter= extensions.iterator();
- while (iter.hasNext()) {
- Object obj= iter.next();
- if (obj instanceof String)
- addExtension((String)obj);
- }
- }
-
- /*
- * Implements method from ISearchScope
- */
- public boolean encloses(IResource element) {
- if (element instanceof IFile && skipFile((IFile)element))
- return false;
- return super.encloses(element);
- }
-
- boolean skipFile(IFile file) {
- if (file != null) {
- Iterator iter= fExtensions.iterator();
- while (iter.hasNext()) {
- if (((StringMatcher)iter.next()).match(file.getName()))
- return false;
- }
- }
- return true;
- }
-} \ No newline at end of file
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
deleted file mode 100644
index adaedb031..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.core.ISearchScope;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.StringMatcher;
-
-/**
- * The visitor that does the actual work.
- */
-public class TextSearchVisitor extends TypedResourceVisitor {
- protected static final int fgLF= '\n';
- protected static final int fgCR= '\r';
-
- private String fPattern;
- private ISearchScope fScope;
- private ITextSearchResultCollector fCollector;
- private String fOptions;
- private IEditorPart[] fDirtyEditors;
-
- private IProgressMonitor fProgressMonitor;
- private StringMatcher fMatcher;
- private String fErrorMessage;
-
- protected int fPushbackChar;
- protected boolean fPushback;
-
-
- public TextSearchVisitor(String pattern, String options, ISearchScope scope, ITextSearchResultCollector collector)
- throws CoreException {
- fPattern= pattern;
- 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);
- }
-
- public void process(Collection projects) throws CoreException {
- Iterator i= projects.iterator();
- while(i.hasNext()) {
- IProject project= (IProject)i.next();
- project.accept(this);
- }
- }
-
- /**
- * 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.
- */
- private IEditorPart[] getDirtyEditors() {
- Set inputs= new HashSet(7);
- List result= new ArrayList(0);
- IWorkbench workbench= SearchPlugin.getDefault().getWorkbench();
- IWorkbenchWindow[] windows= workbench.getWorkbenchWindows();
- 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].getEditors();
- for (int z= 0; z < editors.length; z++) {
- IEditorPart editor= editors[z];
- IEditorInput input= editor.getEditorInput();
- if (editor.isDirty() && !inputs.contains(input)) {
- inputs.add(input);
- result.add(editor);
- }
- }
- }
- }
- return (IEditorPart[])result.toArray(new IEditorPart[result.size()]);
- }
-
-
- protected boolean visitFile(IFile file) throws CoreException {
- if (! fScope.encloses(file))
- return false;
-
- try {
- BufferedReader reader= null;
- ITextEditor editor= findDirtyEditorFor(file);
- if (editor != null) {
- String s= editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
- reader= new BufferedReader(new StringReader(s));
- } else {
- InputStream stream= file.getContents(false);
- reader= new BufferedReader(new InputStreamReader(stream));
- }
- StringBuffer sb= new StringBuffer(100);
- int lineCounter= 1;
- int charCounter=0;
- boolean eof= false;
- try {
- while (!eof) {
- int eolStrLength= readLine(reader, sb);
- int lineLength= sb.length();
- int start= 0;
- eof= eolStrLength == -1;
- String line= sb.toString();
- StringMatcher.Position match;
- while (start < lineLength) {
- if ((match= fMatcher.find(line, start, lineLength)) != null) {
- start= charCounter + match.getStart();
- int length= match.getEnd() - match.getStart();
- fCollector.accept(file, line.trim(), start, length, lineCounter);
- start= match.getEnd();
- }
- else // no match in this line
- start= lineLength;
- }
- charCounter+= lineLength + eolStrLength;
- lineCounter++;
- }
- } finally {
- if (reader != null)
- reader.close();
- }
- } catch (IOException e) {
- String message= SearchMessages.getFormattedString("TextSearchVisitor.error", file.getFullPath()); //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR, SearchUI.PLUGIN_ID, Platform.PLUGIN_ERROR, message, e));
- }
- finally {
- fProgressMonitor.worked(1);
- if (fProgressMonitor.isCanceled())
- throw new OperationCanceledException(SearchMessages.getString("TextSearchVisitor.canceled")); //$NON-NLS-1$
- }
- return true;
- }
-
- private ITextEditor findDirtyEditorFor(IFile file) {
- int i= 0;
- while (i < fDirtyEditors.length) {
- IEditorPart dirtyEditor= fDirtyEditors[i];
- IEditorInput input= dirtyEditor.getEditorInput();
- if (input instanceof IFileEditorInput && dirtyEditor instanceof ITextEditor)
- if (((IFileEditorInput)input).getFile().equals(file))
- return (ITextEditor)dirtyEditor;
- i++;
- }
- return null;
- }
-
- protected int readLine(BufferedReader reader, StringBuffer sb) throws IOException {
- int ch= -1;
- sb.setLength(0);
- if (fPushback) {
- ch= fPushbackChar;
- fPushback= false;
- }
- else
- ch= reader.read();
- while (ch >= 0) {
- if (ch == fgLF)
- return 1;
- if (ch == fgCR) {
- ch= reader.read();
- if (ch == fgLF)
- return 2;
- else {
- fPushbackChar= ch;
- fPushback= true;
- return 1;
- }
- }
- sb.append((char)ch);
- ch= reader.read();
- }
- return -1;
- }
-
- /*
- * @see IResourceVisitor#visit(IResource)
- */
- public boolean visit(IResource resource) throws CoreException {
- fDirtyEditors= getDirtyEditors();
- return super.visit(resource);
- }
-}
-
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java
deleted file mode 100644
index 9929644f1..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.core.text;
-
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-public class TypedResourceVisitor implements IResourceVisitor {
-
- public boolean visit(IResource resource) throws CoreException {
- switch(resource.getType()) {
- case IResource.FILE:
- return visitFile((IFile)resource);
- case IResource.FOLDER:
- return visitFolder((IFolder)resource);
- case IResource.PROJECT:
- return visitProject((IProject)resource);
- default:
- Assert.isTrue(false, "unknown resource type"); //$NON-NLS-1$
- }
- return false;
- }
-
- protected boolean visitProject(IProject project) throws CoreException {
- return true;
- }
-
- protected boolean visitFolder(IFolder folder) throws CoreException {
- return true;
- }
-
- protected boolean visitFile(IFile file) throws CoreException {
- return true;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
deleted file mode 100644
index a4b7c28c4..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
- import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class CopyToClipboardAction extends Action {
-
- SearchResultLabelProvider fLabelProvider;
- SearchResultViewer fViewer;
-
- public CopyToClipboardAction(SearchResultViewer viewer) {
- Assert.isNotNull(viewer);
- Assert.isTrue(viewer.getLabelProvider() instanceof SearchResultLabelProvider);
- fLabelProvider= (SearchResultLabelProvider)viewer.getLabelProvider();
- fViewer= viewer;
- setText(SearchMessages.getString("CopyToClipboardAction.label")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("CopyToClipboardAction.tooltip")); //$NON-NLS-1$
- }
-
- /*
- * Implements method from IAction
- */
- public void run() {
- Shell shell= SearchPlugin.getActiveWorkbenchShell();
- if (shell == null)
- return;
-
- String lineDelim= System.getProperty("line.separator"); //$NON-NLS-1$
- StringBuffer buf= new StringBuffer();
- Iterator iter= getSelection();
- while (iter.hasNext()) {
- if (buf.length() > 0) {
- buf.append(lineDelim);
- }
- buf.append(fLabelProvider.getText(iter.next()));
- }
-
- if (buf.length() > 0)
- copyToClipbard(shell.getDisplay(), buf.toString());
- }
-
- private Iterator getSelection() {
- ISelection s= fViewer.getSelection();
- if (s instanceof IStructuredSelection)
- return ((IStructuredSelection)s).iterator();
- return Collections.EMPTY_LIST.iterator();
- }
-
- private void copyToClipbard(Display display, String str) {
- Clipboard clipboard = new Clipboard(display);
- clipboard.setContents(new String[] { str }, new Transfer[] { TextTransfer.getInstance()});
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java
deleted file mode 100644
index 575317c0d..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class GotoMarkerAction extends Action {
-
- private SearchResultViewer fViewer;
-
- public GotoMarkerAction(SearchResultViewer viewer) {
- super(SearchMessages.getString("SearchResultView.gotoMarker.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_GOTO);
- setToolTipText(SearchMessages.getString("SearchResultView.gotoMarker.tooltip")); //$NON-NLS-1$
- fViewer= viewer;
- }
-
- public void run() {
- fViewer.showResult();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java
deleted file mode 100644
index 8684ef93d..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java
+++ /dev/null
@@ -1,8 +0,0 @@
-/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.search.internal.ui; import org.eclipse.search.ui.SearchUI; public interface ISearchHelpContextIds {
-
- public static final String PREFIX= SearchUI.PLUGIN_ID + "."; //$NON-NLS-1$
-
- public static final String SEARCH_DIALOG= PREFIX + "search_dialog_context"; //$NON-NLS-1$
- public static final String TEXT_SEARCH_PAGE= PREFIX + "text_search_page_context"; //$NON-NLS-1$
- public static final String TYPE_FILTERING_DIALOG= PREFIX + "type_filtering_dialog_context"; //$NON-NLS-1$ public static final String SEARCH_VIEW= PREFIX + "search_view_context"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
deleted file mode 100644
index 3dc348ba3..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Opens the Search Dialog.
- */
-public class OpenSearchDialogAction extends Action implements IWorkbenchWindowActionDelegate {
- private IWorkbenchWindow fWindow;
-
- public OpenSearchDialogAction() {
- super(SearchMessages.getString("OpenSearchDialogAction.label")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_TOOL, SearchPluginImages.IMG_TOOL_SEARCH);
- setToolTipText(SearchMessages.getString("OpenSearchDialogAction.tooltip")); //$NON-NLS-1$
- }
-
- public void init(IWorkbenchWindow window) {
- fWindow= window;
- }
-
- public void run(IAction action) {
- run();
- }
-
- public void run() {
- if (getWindow().getActivePage() == null) {
- SearchPlugin.beep();
- return;
- }
- SearchDialog dialog= new SearchDialog(
- getWindow().getShell(),
- SearchPlugin.getWorkspace(),
- getSelection(),
- getEditorPart());
- dialog.open();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing since the action isn't selection dependent.
- }
-
- private ISelection getSelection() {
- return getWindow().getSelectionService().getSelection();
- }
-
- private IEditorPart getEditorPart() {
- return getWindow().getActivePage().getActiveEditor();
- }
-
- private IWorkbenchWindow getWindow() {
- if (fWindow == null)
- fWindow= SearchPlugin.getActiveWorkbenchWindow();
- return fWindow;
- }
-
- public void dispose() {
- fWindow= null;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java
deleted file mode 100644
index 4f70cf32c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.ui.SearchUI;
-
-class RemoveAllResultsAction extends Action {
-
- public RemoveAllResultsAction() {
- super(SearchMessages.getString("SearchResultView.removeAllResults.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_REM_ALL);
- setToolTipText(SearchMessages.getString("SearchResultView.removeAllResults.tooltip")); //$NON-NLS-1$
- }
-
- public void run() {
- try {
- SearchPlugin.getWorkspace().getRoot().deleteMarkers(SearchUI.SEARCH_MARKER, true, IResource.DEPTH_INFINITE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java
deleted file mode 100644
index d15a359bc..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class RemoveAllSearchesAction extends Action {
-
- public RemoveAllSearchesAction() {
- super(SearchMessages.getString("SearchResultView.removeAllSearches.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_REM_ALL);
- setToolTipText(SearchMessages.getString("SearchResultView.removeAllSearches.tooltip")); //$NON-NLS-1$
- }
-
- public void run() {
- SearchManager.getDefault().removeAllSearches();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java
deleted file mode 100644
index f4134a538..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-class RemoveMatchAction extends Action {
-
- private ISelectionProvider fSelectionProvider;
-
- public RemoveMatchAction(ISelectionProvider provider) {
- super(SearchMessages.getString("SearchResultView.removeMatch.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_REM);
- setToolTipText(SearchMessages.getString("SearchResultView.removeMatch.tooltip")); //$NON-NLS-1$
- fSelectionProvider= provider;
- }
-
- public void run() {
- IMarker[] markers= getMarkers(fSelectionProvider.getSelection());
- if (markers != null)
- try {
- SearchPlugin.getWorkspace().deleteMarkers(markers);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- private IMarker[] getMarkers(ISelection s) {
- if (! (s instanceof IStructuredSelection) || s.isEmpty())
- return null;
-
- IStructuredSelection selection= (IStructuredSelection)s;
- int size= selection.size();
- if (size != 1)
- return null;
- if (selection.getFirstElement() instanceof ISearchResultViewEntry) {
- IMarker marker= ((ISearchResultViewEntry)selection.getFirstElement()).getSelectedMarker();
- if (marker != null)
- return new IMarker[] {marker};
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java
deleted file mode 100644
index fd533d85a..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.Iterator;
-import java.util.ArrayList;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.swt.custom.BusyIndicator;
-
-class RemoveResultAction extends Action {
-
- private ISelectionProvider fSelectionProvider;
-
- public RemoveResultAction(ISelectionProvider provider) {
- fSelectionProvider= provider;
- if (getSelectedEntriesCount() > 1) {
- setText(SearchMessages.getString("SearchResultView.removeEntries.text")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("SearchResultView.removeEntries.tooltip")); //$NON-NLS-1$
- }
- else {
- setText(SearchMessages.getString("SearchResultView.removeEntry.text")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("SearchResultView.removeEntry.tooltip")); //$NON-NLS-1$
- }
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_REM);
- }
-
- public void run() {
- final IMarker[] markers= getMarkers(fSelectionProvider.getSelection());
- if (markers != null) {
- BusyIndicator.showWhile(SearchPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() {
- public void run() {
- try {
- SearchPlugin.getWorkspace().deleteMarkers(markers);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
- });
- }
- }
-
- private IMarker[] getMarkers(ISelection s) {
- if (! (s instanceof IStructuredSelection) || s.isEmpty())
- return null;
-
- IStructuredSelection selection= (IStructuredSelection)s;
- int size= selection.size();
- if (size <= 0)
- return null;
- ArrayList markers= new ArrayList(size * 3);
- int markerCount= 0;
- Iterator iter= selection.iterator();
- for(int i= 0; iter.hasNext(); i++) {
- SearchResultViewEntry entry= (SearchResultViewEntry)iter.next();
- markerCount += entry.getMatchCount();
- markers.addAll(entry.getMarkers());
- }
- return (IMarker[])markers.toArray(new IMarker[markerCount]);
- }
-
- protected int getSelectedEntriesCount() {
- ISelection s= fSelectionProvider.getSelection();
- if (s == null || s.isEmpty() || !(s instanceof IStructuredSelection))
- return 0;
- IStructuredSelection selection= (IStructuredSelection)s;
- return selection.size();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
deleted file mode 100644
index fbecbd79e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.Arrays;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-import org.eclipse.search.ui.ISearchPageContainer;
-import org.eclipse.search.ui.IWorkingSet;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.util.SWTUtil;
-
-public class ScopePart {
-
- // The possible scopes
- public static final int WORKSPACE_SCOPE= 0;
- public static final int SELECTION_SCOPE= 1;
- public static final int WORKING_SET_SCOPE= 2;
-
- private static String fgLRUsedWorkingSetName;
-
- // Settings store
- private static final String DIALOG_SETTINGS_KEY= "SearchDialog.ScopePart"; //$NON-NLS-1$
- private static final String STORE_LRU_WORKING_SET_NAME= "lastUsedWorkingSetName"; //$NON-NLS-1$
- private static IDialogSettings fgSettingsStore;
-
- private Group fPart;
-
- // Scope radio buttons
- private Button fUseWorkspace;
- private Button fUseSelection;
- private Button fUseWorkingSet;
-
-
- private int fScope;
- private Text fWorkingSetText;
- private IWorkingSet fWorkingSet;
-
- // Reference to its search page container (can be null)
- private ISearchPageContainer fSearchPageContainer;
-
- /**
- * Returns a new scope part with workspace as initial scope.
- * The part is not yet created.
- */
- public ScopePart() {
- this(WORKSPACE_SCOPE);
- }
-
- /**
- * Returns a new scope part with workspace as initial scope.
- * The part is not yet created.
- */
- public ScopePart(ISearchPageContainer searchPageContainer) {
- this(WORKSPACE_SCOPE);
- fSearchPageContainer= searchPageContainer;
- }
-
- /**
- * Returns a new scope part with an initial scope.
- * The part is not yet created.
- *
- * @see #createPart(Composite)
- * @param initialScope the initial scope
- */
- public ScopePart(int initialScope) {
- Assert.isLegal(initialScope >= 0 && initialScope <= 3);
- fScope= initialScope;
- fgSettingsStore= SearchPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS_KEY);
- if (fgSettingsStore == null)
- fgSettingsStore= SearchPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS_KEY);
- String lruWorkingSetName= fgSettingsStore.get(STORE_LRU_WORKING_SET_NAME);
- fWorkingSet= SearchUI.findWorkingSet(lruWorkingSetName);
- }
-
- /**
- * Returns a new scope part with an initial working set.
- * The part is not yet created.
- *
- * @see #createPart(Composite)
- * @param workingSet the initial working set
- */
- public ScopePart(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet);
- fScope= WORKING_SET_SCOPE;
- fWorkingSet= workingSet;
- }
-
- /**
- * Returns the scope selected in this part
- *
- * @return the selected scope
- */
- public int getSelectedScope() {
- return fScope;
- }
-
- /**
- * Sets the selected scope.
- * This method must only be called on a created part.
- *
- * @param scope the scope to be selected in this part
- */
- public void setSelectedScope(int scope) {
- Assert.isLegal(scope >= 0 && scope <= 3);
- Assert.isNotNull(fUseWorkspace);
- Assert.isNotNull(fUseSelection);
- Assert.isNotNull(fUseWorkingSet);
- fScope= scope;
- switch (fScope) {
- case WORKSPACE_SCOPE:
- fUseWorkspace.setSelection(true);
- fUseSelection.setSelection(false);
- fUseWorkingSet.setSelection(false);
- break;
- case SELECTION_SCOPE:
- fUseWorkspace.setSelection(false);
- fUseSelection.setSelection(true);
- fUseWorkingSet.setSelection(false);
- break;
- case WORKING_SET_SCOPE:
- fUseWorkspace.setSelection(false);
- fUseSelection.setSelection(false);
- fUseWorkingSet.setSelection(true);
- break;
- }
-
- updateSearchPageContainerActionPerformedEnablement();
- }
-
- private void updateSearchPageContainerActionPerformedEnablement() {
- if (fSearchPageContainer != null)
- fSearchPageContainer.setPerformActionEnabled(fScope != WORKING_SET_SCOPE || fWorkingSet != null);
- }
-
- /**
- * Returns the selected working set of this part.
- *
- * @return the selected working set or null
- * - if the scope is not WORKING_SET_SCOPE
- * - if there is no working set selected
- */
- public IWorkingSet getSelectedWorkingSet() {
- if (getSelectedScope() == WORKING_SET_SCOPE)
- return fWorkingSet;
- else
- return null;
- }
-
- /**
- * Sets the selected working set for this part.
- * This method must only be called on a created part.
- *
- * @param workingSet the working set to be selected
- */
- public void setSelectedWorkingSet(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet);
- setSelectedScope(WORKING_SET_SCOPE);
- String name= workingSet.getName();
- workingSet= SearchUI.findWorkingSet(name);
- if (workingSet != null) {
- fWorkingSet= workingSet;
- fgSettingsStore.put(STORE_LRU_WORKING_SET_NAME, workingSet.getName());
- } else {
- name= ""; //$NON-NLS-1$
- fWorkingSet= null;
- }
- if (fWorkingSetText != null)
- fWorkingSetText.setText(name);
- }
-
- /**
- * Creates this scope part.
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- */
- public Composite createPart(Composite parent) {
- fPart= new Group(parent, SWT.NONE);
- fPart.setText(SearchMessages.getString("ScopePart.group.text")); //$NON-NLS-1$
-
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
- fPart.setLayout(layout);
- fPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fUseWorkspace= new Button(fPart, SWT.RADIO);
- fUseWorkspace.setData(new Integer(WORKSPACE_SCOPE));
- fUseWorkspace.setText(SearchMessages.getString("ScopePart.workspaceScope.text")); //$NON-NLS-1$
-
- fUseSelection= new Button(fPart, SWT.RADIO);
- fUseSelection.setData(new Integer(SELECTION_SCOPE));
- fUseSelection.setText(SearchMessages.getString("ScopePart.selectedResourcesScope.text")); //$NON-NLS-1$
- ISelection selection= fSearchPageContainer.getSelection();
- fUseSelection.setEnabled(selection instanceof IStructuredSelection && !fSearchPageContainer.getSelection().isEmpty());
-
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan= 2;
- gd.horizontalIndent= 8;
- fUseSelection.setLayoutData(gd);
-
- fUseWorkingSet= new Button(fPart, SWT.RADIO);
- fUseWorkingSet.setData(new Integer(WORKING_SET_SCOPE));
- fUseWorkingSet.setText(SearchMessages.getString("ScopePart.workingSetScope.text")); //$NON-NLS-1$
- fWorkingSetText= new Text(fPart, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- Button chooseWorkingSet= new Button(fPart, SWT.PUSH);
- chooseWorkingSet.setLayoutData(new GridData());
- chooseWorkingSet.setText(SearchMessages.getString("ScopePart.workingSetChooseButton.text")); //$NON-NLS-1$
- SWTUtil.setButtonDimensionHint(chooseWorkingSet);
- chooseWorkingSet.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (handleChooseWorkingSet()) {
- setSelectedScope(WORKING_SET_SCOPE);
- }
- }
- });
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalIndent= 8;
- gd.widthHint= SWTUtil.convertWidthInCharsToPixels(30, fWorkingSetText);
- fWorkingSetText.setLayoutData(gd);
-
- // Add scope change listeners
- SelectionAdapter scopeChangedLister= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleScopeChanged(e);
- }
- };
- fUseWorkspace.addSelectionListener(scopeChangedLister);
- fUseSelection.addSelectionListener(scopeChangedLister);
- fUseWorkingSet.addSelectionListener(scopeChangedLister);
-
- // Set initial scope
- setSelectedScope(fScope);
-
- // Set initial working set
- if (fWorkingSet != null)
- fWorkingSetText.setText(fWorkingSet.getName());
-
- return fPart;
- }
-
- private void handleScopeChanged(SelectionEvent e) {
- Object source= e.getSource();
- if (source instanceof Button) {
- Button button= (Button)source;
- if (button.getSelection())
- setSelectedScope(((Integer)button.getData()).intValue());
- }
- }
-
- private boolean handleChooseWorkingSet() {
- SelectionDialog dialog= SearchUI.createWorkingSetDialog(fUseSelection.getShell());
- if (fWorkingSet != null)
- dialog.setInitialSelections(new IWorkingSet[] {fWorkingSet});
- if (dialog.open() == dialog.OK) {
- Object[] result= dialog.getResult();
- if (result.length == 1) {
- setSelectedWorkingSet((IWorkingSet)result[0]);
- return true;
- }
- fWorkingSetText.setText(""); //$NON-NLS-1$
- fWorkingSet= null;
- if (fScope == WORKING_SET_SCOPE)
- setSelectedScope(WORKSPACE_SCOPE);
- return false;
- } else {
- // test if selected working set has been removed
- if (!Arrays.asList(SearchUI.getWorkingSets()).contains(fWorkingSet)) {
- fWorkingSetText.setText(""); //$NON-NLS-1$
- fWorkingSet= null;
- updateSearchPageContainerActionPerformedEnablement();
- }
- }
- return false;
- }
-
- void setVisible(boolean state) {
- fPart.setVisible(state);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java
deleted file mode 100644
index 28cf73ee2..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IWorkspaceDescription;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.search.ui.IContextMenuContributor;
-import org.eclipse.search.ui.IGroupByKeyComputer;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-class Search extends Object {
- private String fPageId;
- private String fSingularLabel;
- private String fPluralLabelPattern;
- private ImageDescriptor fImageDescriptor;
- private ILabelProvider fLabelProvider;
- private ISelection fSelection;
- private ArrayList fResults;
- private IAction fGotoMarkerAction;
- private IContextMenuContributor fContextMenuContributor;
- private IGroupByKeyComputer fGroupByKeyComputer;
- private IRunnableWithProgress fOperation;
-
-
- public Search(String pageId, String singularLabel, String pluralLabelPattern, ILabelProvider labelProvider, ImageDescriptor imageDescriptor, IAction gotoMarkerAction, IContextMenuContributor contextMenuContributor, IGroupByKeyComputer groupByKeyComputer, IRunnableWithProgress operation) {
- fPageId= pageId;
- fSingularLabel= singularLabel;
- fPluralLabelPattern= pluralLabelPattern;
- fImageDescriptor= imageDescriptor;
- fLabelProvider= labelProvider;
- fGotoMarkerAction= gotoMarkerAction;
- fContextMenuContributor= contextMenuContributor;
- fGroupByKeyComputer= groupByKeyComputer;
- fOperation= operation;
-
- if (fPluralLabelPattern == null)
- fPluralLabelPattern= ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the full description of the search.
- * The description set by the client where
- * {0} will be replaced by the match count.
- */
- String getFullDescription() {
- if (fSingularLabel != null && getItemCount() == 1)
- return fSingularLabel;
-
- // try to replace "{0}" with the match count
- int i= fPluralLabelPattern.lastIndexOf("{0}"); //$NON-NLS-1$
- if (i < 0)
- return fPluralLabelPattern;
- else
- return fPluralLabelPattern.substring(0, i) + getItemCount()+ fPluralLabelPattern.substring(Math.min(i + 3, fPluralLabelPattern.length()));
- }
-
- /**
- * Returns a short description of the search.
- * Cuts off after 30 characters and adds ...
- * The description set by the client where
- * {0} will be replaced by the match count.
- */
- String getShortDescription() {
- String text= getFullDescription();
- int separatorPos= text.indexOf(" - "); //$NON-NLS-1$
- if (separatorPos < 1)
- return text.substring(0, Math.min(50, text.length())) + "..."; // use first 50 characters //$NON-NLS-1$
- if (separatorPos < 30)
- return text; // don't cut
- if (text.charAt(0) == '"') //$NON-NLS-1$
- return text.substring(0, Math.min(30, text.length())) + "...\" - " + text.substring(Math.min(separatorPos + 3, text.length())); //$NON-NLS-1$
- else
- return text.substring(0, Math.min(30, text.length())) + "... - " + text.substring(Math.min(separatorPos + 3, text.length())); //$NON-NLS-1$
- }
- /** Image used when search is displayed in a list */
- ImageDescriptor getImageDescriptor() {
- return fImageDescriptor;
- }
-
- int getItemCount() {
- int count= 0;
- Iterator iter= getResults().iterator();
- while (iter.hasNext())
- count += ((ISearchResultViewEntry)iter.next()).getMatchCount();
- return count;
- }
-
- List getResults() {
- if (fResults == null)
- return new ArrayList();
- return fResults;
- }
-
- ILabelProvider getLabelProvider() {
- return fLabelProvider;
- }
-
- void searchAgain() {
- if (fOperation == null)
- return;
- Shell shell= SearchPlugin.getActiveWorkbenchShell();
- IWorkspaceDescription workspaceDesc= SearchPlugin.getWorkspace().getDescription();
- boolean isAutoBuilding= workspaceDesc.isAutoBuilding();
- if (isAutoBuilding)
- // disable auto-build during search operation
- SearchPlugin.setAutoBuilding(false);
- try {
- new ProgressMonitorDialog(shell).run(true, true, fOperation);
- } catch (InvocationTargetException ex) {
- ExceptionHandler.handle(ex, shell, SearchMessages.getString("Search.Error.search.title"), SearchMessages.getString("Search.Error.search.message")); //$NON-NLS-2$ //$NON-NLS-1$
- } catch(InterruptedException e) {
- } finally {
- if (isAutoBuilding)
- // enable auto-building again
- SearchPlugin.setAutoBuilding(true);
- }
- }
-
- boolean isSameSearch(Search search) {
- return search != null && search.getOperation() == fOperation;
- }
-
- void backupMarkers() {
- Iterator iter= getResults().iterator();
- while (iter.hasNext()) {
- ((SearchResultViewEntry)iter.next()).backupMarkers();
- }
- }
-
- String getPageId() {
- return fPageId;
- }
-
- IGroupByKeyComputer getGroupByKeyComputer() {
- return fGroupByKeyComputer;
- }
-
- IRunnableWithProgress getOperation() {
- return fOperation;
- }
-
- IAction getGotoMarkerAction() {
- return fGotoMarkerAction;
- }
-
- IContextMenuContributor getContextMenuContributor() {
- return fContextMenuContributor;
- }
-
- public void removeResults() {
- fResults= null;
- }
-
- void setResults(ArrayList results) {
- Assert.isNotNull(results);
- fResults= results;
- }
-
- ISelection getSelection() {
- return fSelection;
- }
-
- void setSelection(ISelection selection) {
- fSelection= selection;
- }
-}
-
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java
deleted file mode 100644
index 6d3a658f9..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class SearchAgainAction extends Action {
-
- public SearchAgainAction() {
- super(SearchMessages.getString("SearchResultView.searchAgain.text")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("SearchResultView.searchAgain.tooltip")); //$NON-NLS-1$
- }
-
- public void run() {
- Search selected= SearchManager.getDefault().getCurrentSearch();
- if (selected != null)
- selected.searchAgain();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
deleted file mode 100644
index 6922f659b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IWorkspace;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-import org.eclipse.search.ui.ISearchPage;
-import org.eclipse.search.ui.ISearchPageContainer;
-import org.eclipse.search.ui.ISearchPageScoreComputer;
-import org.eclipse.search.ui.IWorkingSet;
-
-import org.eclipse.search.internal.ui.util.ExtendedDialogWindow;
-
-class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer {
-
- private class TabFolderLayout extends Layout {
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
-
- int x= 0;
- int y= 0;
- Control[] children= composite.getChildren();
- for (int i= 0; i < children.length; i++) {
- Point size= children[i].computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
- x= Math.max(x, size.x);
- y= Math.max(y, size.y);
- }
-
- Point minSize= getMinSize();
- x= Math.max(x, minSize.x);
- y= Math.max(y, minSize.y);
-
- if (wHint != SWT.DEFAULT)
- x= wHint;
- if (hHint != SWT.DEFAULT)
- y= hHint;
- return new Point(x, y);
- }
- protected void layout(Composite composite, boolean flushCache) {
- Rectangle rect= composite.getClientArea();
-
- Control[] children= composite.getChildren();
- for (int i= 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
- }
- }
-
- private IWorkspace fWorkspace;
- private ISearchPage fCurrentPage;
- private ISelection fSelection;
- private IEditorPart fEditorPart;
- private List fDescriptors;
- private Point fMinSize;
- private ScopePart fScopePart;
-
- public SearchDialog(Shell shell, IWorkspace workspace, ISelection selection, IEditorPart editor) {
- super(shell);
- Assert.isNotNull(workspace);
- fWorkspace= workspace;
- setPerformActionLabel(SearchMessages.getString("SearchDialog.performAction")); //$NON-NLS-1$
- fSelection= selection;
- fEditorPart= editor;
- fDescriptors= SearchPlugin.getDefault().getSearchPageDescriptors();
- }
-
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(SearchMessages.getString("SearchDialog.title")); //$NON-NLS-1$
- shell.setImage(SearchPluginImages.get(SearchPluginImages.IMG_TOOL_SEARCH));
- WorkbenchHelp.setHelp(shell, ISearchHelpContextIds.SEARCH_DIALOG);
- }
-
- public IWorkspace getWorkspace() {
- return fWorkspace;
- }
-
- public ISelection getSelection() {
- return fSelection;
- }
-
- public IEditorPart getEditorPart() {
- return fEditorPart;
- }
-
- //---- Page Handling -------------------------------------------------------
-
- /*
- * Overrides method from Window
- */
- public void create() {
- super.create();
- if (fCurrentPage != null)
- fCurrentPage.setVisible(true);
- }
-
- protected Control createPageArea(Composite parent) {
- int numPages= fDescriptors.size();
-
- if (numPages == 0) {
- Label label= new Label(parent, SWT.CENTER | SWT.WRAP);
- label.setText(SearchMessages.getString("SearchDialog.noSearchExtension")); //$NON-NLS-1$
- return label;
- }
-
- final int pageIndex= getPreferredPageIndex();
- boolean showScope= getDescriptorAt(pageIndex).showScopeSection();
-
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- fCurrentPage= getDescriptorAt(pageIndex).createObject();
- }
- });
-
- fCurrentPage.setContainer(this);
-
-
- // Create Search scope
- fScopePart= new ScopePart(this);
-
- if (numPages == 1) {
- Control control= getControl(fCurrentPage, parent);
- if (control instanceof Composite) {
- fScopePart.createPart((Composite)control);
- fScopePart.setVisible(showScope);
- }
- return control;
- }
- else {
- Composite border= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginWidth= 7;
- layout.marginHeight= 7;
- border.setLayout(layout);
-
- CTabFolder folder= new CTabFolder(border, SWT.BORDER | SWT.FLAT);
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
- folder.setLayout(new TabFolderLayout());
-
- for (int i= 0; i < numPages; i++) {
- SearchPageDescriptor descriptor= (SearchPageDescriptor)fDescriptors.get(i);
- final CTabItem item= new CTabItem(folder, SWT.NONE);
- item.setText(descriptor.getLabel());
- item.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- item.setData(null);
- if (item.getImage() != null)
- item.getImage().dispose();
- }
- });
- ImageDescriptor imageDesc= descriptor.getImage();
- if (imageDesc != null)
- item.setImage(imageDesc.createImage());
- item.setData(descriptor);
- if (i == pageIndex) {
- item.setControl(getControl(fCurrentPage, folder));
- item.setData(fCurrentPage);
- }
- }
-
- folder.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- turnToPage(event);
- }
- });
-
- folder.setSelection(pageIndex);
-
- // Search scope
- fScopePart.createPart(border);
- fScopePart.setVisible(showScope);
-
- return border;
- }
- }
-
- protected boolean performAction() {
- if (fCurrentPage == null)
- return true;
-
- boolean isAutoBuilding= SearchPlugin.getWorkspace().isAutoBuilding();
- if (isAutoBuilding)
- // disable auto-build during search operation
- SearchPlugin.setAutoBuilding(false);
- try {
- return fCurrentPage.performAction();
- } finally {
- if (isAutoBuilding)
- // enable auto-building again
- SearchPlugin.setAutoBuilding(true);
- }
- }
-
- private SearchPageDescriptor getDescriptorAt(int index) {
- return (SearchPageDescriptor)fDescriptors.get(index);
- }
-
- private Point getMinSize() {
- if (fMinSize != null)
- return fMinSize;
-
- int x= 0;
- int y= 0;
- int length= fDescriptors.size();
- for (int i= 0; i < length; i++) {
- Point size= getDescriptorAt(i).getPreferredSize();
- if (size.x != SWT.DEFAULT)
- x= Math.max(x, size.x);
- if (size.y != SWT.DEFAULT)
- y= Math.max(y, size.y);
- }
-
- fMinSize= new Point(x, y);
- return fMinSize;
- }
-
- private void turnToPage(SelectionEvent event) {
- final CTabItem item= (CTabItem)event.item;
- if (item.getControl() == null) {
- final SearchPageDescriptor descriptor= (SearchPageDescriptor)item.getData();
-
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- item.setData(descriptor.createObject());
- }
- });
-
- ISearchPage page= (ISearchPage)item.getData();
- page.setContainer(this);
-
- Control newControl= getControl(page, (Composite)event.widget);
- item.setControl(newControl);
- }
- if (item.getData() instanceof ISearchPage) {
- boolean showScope= getDescriptorAt(item.getParent().getSelectionIndex()).showScopeSection();
- fScopePart.setVisible(showScope);
- resizeDialogIfNeeded(item.getControl());
- fCurrentPage= (ISearchPage)item.getData();
- fCurrentPage.setVisible(true);
- }
- }
-
- private int getPreferredPageIndex() {
- Object element= null;
- if (fSelection instanceof IStructuredSelection)
- element= ((IStructuredSelection)fSelection).getFirstElement();
- if (element == null && fEditorPart != null) {
- element= fEditorPart.getEditorInput();
- if (element instanceof IFileEditorInput)
- element= ((IFileEditorInput)element).getFile();
- }
- int result= 0;
- int level= ISearchPageScoreComputer.LOWEST;
- int size= fDescriptors.size();
- for (int i= 0; i < size; i++) {
- SearchPageDescriptor descriptor= (SearchPageDescriptor)fDescriptors.get(i);
- int newLevel= descriptor.computeScore(element);
- if ( newLevel > level) {
- level= newLevel;
- result= i;
- }
- }
- return result;
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public IRunnableContext getRunnableContext() {
- return this;
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public int getSelectedScope() {
- return fScopePart.getSelectedScope();
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public IWorkingSet getSelectedWorkingSet() {
- return fScopePart.getSelectedWorkingSet();
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public void setSelectedScope(int scope) {
- fScopePart.setSelectedScope(scope);
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public boolean hasValidScope() {
- return getSelectedScope() != WORKING_SET_SCOPE || getSelectedWorkingSet() != null;
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public void setSelectedWorkingSet(IWorkingSet workingSet) {
- fScopePart.setSelectedWorkingSet(workingSet);
- }
-
- private Control getControl(ISearchPage page, Composite parent) {
- if (page.getControl() == null) {
- page.createControl(parent);
- }
- return page.getControl();
- }
-
- private void resizeDialogIfNeeded(Control newControl) {
- Point currentSize= fCurrentPage.getControl().getSize();
- Point newSize= newControl.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- if (mustResize(currentSize, newSize)) {
- Shell shell= getShell();
- shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
- }
- }
-
- private boolean mustResize(Point currentSize, Point newSize) {
- return currentSize.x < newSize.x || currentSize.y < newSize.y;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java
deleted file mode 100644
index 7b5f0b26e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-
-class SearchDropDownAction extends Action implements IMenuCreator {
-
-
- public static final int RESULTS_IN_DROP_DOWN= 10;
-
- private SearchResultViewer fViewer;
-
- public SearchDropDownAction(SearchResultViewer viewer) {
- fViewer= viewer;
- setText(SearchMessages.getString("SearchResultView.previousSearches.text")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("SearchResultView.previousSearches.tooltip")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_HISTORY);
- setMenuCreator(this);
- }
-
- public void dispose() {
- fViewer= null;
- }
-
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- public Menu getMenu(Control parent) {
- Menu menu= new Menu(parent);
- boolean checkedOne= false;
- Iterator iter= SearchManager.getDefault().getPreviousSearches().iterator();
- Search selected= SearchManager.getDefault().getCurrentSearch();
- int i= 0;
- while (iter.hasNext() && i++ < RESULTS_IN_DROP_DOWN) {
- Search search= (Search)iter.next();
- ShowSearchAction action= new ShowSearchAction(search);
- action.setChecked(search.equals(selected));
- if (search.equals(selected))
- checkedOne= true;
- addActionToMenu(menu, action);
- }
- if (iter.hasNext()) {
- new MenuItem(menu, SWT.SEPARATOR);
- Action others= new ShowSearchesAction();
- others.setChecked(!checkedOne);
- addActionToMenu(menu, others);
- }
- return menu;
- }
-
- protected void addActionToMenu(Menu parent, Action action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- public void run() {
- new ShowSearchesAction().run(true);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java
deleted file mode 100644
index 8ae0bbebf..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-import org.eclipse.search.ui.IGroupByKeyComputer;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-/**
- * Manage search results
- */
-public class SearchManager implements IResourceChangeListener {
-
- static final SearchManager fgDefault= new SearchManager();
-
- Search fCurrentSearch= null;
-
- private SearchManager() {
- SearchPlugin.getWorkspace().addResourceChangeListener(this);
- }
-
- private HashSet fListeners= new HashSet();
- private LinkedList fPreviousSearches= new LinkedList();
- private boolean fIsNewSearch= false;
-
- public static SearchManager getDefault() {
- return fgDefault;
- }
-
- /**
- * Returns the list with previous searches (ISearch).
- */
- LinkedList getPreviousSearches() {
- return fPreviousSearches;
- }
- /**
- * Returns the list with current (last) results
- */
- ArrayList getCurrentResults() {
- if (fCurrentSearch == null)
- return new ArrayList(0);
- else
- return (ArrayList)fCurrentSearch.getResults();
- }
-
- Search getCurrentSearch() {
- return fCurrentSearch;
- }
-
- void removeAllSearches() {
- SearchPlugin.getWorkspace().removeResourceChangeListener(this);
- WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(SearchMessages.getString("SearchManager.updating"), 100); //$NON-NLS-1$
- SearchPlugin.getWorkspace().getRoot().deleteMarkers(SearchUI.SEARCH_MARKER, true, IResource.DEPTH_INFINITE);
- monitor.worked(100);
- monitor.done();
- }
- };
- boolean isAutoBuilding= SearchPlugin.getWorkspace().isAutoBuilding();
- if (isAutoBuilding)
- // disable auto-build during search operation
- SearchPlugin.setAutoBuilding(false);
- try {
- ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
- dialog.run(true, true, op);
- } catch (InvocationTargetException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- } catch (InterruptedException e) {
- // Do nothing. Operation has been canceled.
- } finally {
- SearchPlugin.getWorkspace().addResourceChangeListener(this);
- if (isAutoBuilding)
- // enable auto-building again
- SearchPlugin.setAutoBuilding(true);
- }
-
- // clear searches
- fPreviousSearches= new LinkedList();
- fCurrentSearch= null;
-
- // update viewers
- Iterator iter= fListeners.iterator();
- while (iter.hasNext()) {
- SearchResultViewer viewer= (SearchResultViewer)iter.next();
- viewer.setInput(null);
- }
- }
-
- void setCurrentSearch(final Search search) {
- if (fCurrentSearch == search)
- return;
-
- SearchPlugin.getWorkspace().removeResourceChangeListener(this);
- WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
- internalSetCurrentSearch(search, monitor);
- }
- };
- boolean isAutoBuilding= SearchPlugin.getWorkspace().isAutoBuilding();
- if (isAutoBuilding)
- // disable auto-build during search operation
- SearchPlugin.setAutoBuilding(false);
- try {
- ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
- dialog.run(true, true, op);
- } catch (InvocationTargetException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.switchSearch.title"), SearchMessages.getString("Search.Error.switchSearch.message")); //$NON-NLS-2$ //$NON-NLS-1$
- } catch (InterruptedException e) {
- // Do nothing. Operation has been canceled.
- } finally {
- SearchPlugin.getWorkspace().addResourceChangeListener(this);
- if (isAutoBuilding)
- // enable auto-building again
- SearchPlugin.setAutoBuilding(true);
- }
-
- getPreviousSearches().remove(search);
- getPreviousSearches().addFirst(search);
- }
-
- void internalSetCurrentSearch(final Search search, IProgressMonitor monitor) {
- if (fCurrentSearch != null)
- fCurrentSearch.backupMarkers();
-
- final Search previousSearch= fCurrentSearch;
- fCurrentSearch= search;
- monitor.beginTask(SearchMessages.getString("SearchManager.updating"), getCurrentResults().size() + 20); //$NON-NLS-1$
-
- // remove current search markers
- try {
- SearchPlugin.getWorkspace().getRoot().deleteMarkers(SearchUI.SEARCH_MARKER, true, IResource.DEPTH_INFINITE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- monitor.worked(10);
-
- // add search markers
- Iterator iter= getCurrentResults().iterator();
- ArrayList emptyEntries= new ArrayList(10);
- boolean filesChanged= false;
- boolean filesDeleted= false;
- IGroupByKeyComputer groupByKeyComputer= getCurrentSearch().getGroupByKeyComputer();
- while (iter.hasNext()) {
- monitor.worked(1);
- SearchResultViewEntry entry= (SearchResultViewEntry)iter.next();
- Iterator attrPerMarkerIter= entry.getAttributesPerMarker().iterator();
- entry.clearMarkerList();
- if (entry.getResource() == null || !entry.getResource().exists()) {
- emptyEntries.add(entry);
- filesDeleted= true;
- continue;
- }
- while (attrPerMarkerIter.hasNext()) {
- IMarker newMarker= null;
- try {
- newMarker= entry.getResource().createMarker(SearchUI.SEARCH_MARKER);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createMarker.title"), SearchMessages.getString("Search.Error.createMarker.message")); //$NON-NLS-2$ //$NON-NLS-1$
- continue;
- }
- try {
- newMarker.setAttributes((Map)attrPerMarkerIter.next());
- if (groupByKeyComputer !=null && groupByKeyComputer.computeGroupByKey(newMarker) == null) {
- filesDeleted= true;
- newMarker.delete();
- continue;
- }
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.markerAttributeAccess.title"), SearchMessages.getString("Search.Error.markerAttributeAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- entry.add(newMarker);
- }
- if (entry.getMatchCount() == 0)
- emptyEntries.add(entry);
- else if (!filesChanged && entry.getResource().getModificationStamp() != entry.getModificationStamp())
- filesChanged= true;
- }
- getCurrentResults().removeAll(emptyEntries);
- monitor.worked(10);
-
- String warningMessage= null;
- Display display= getDisplay();
-
- if (filesChanged)
- warningMessage= SearchMessages.getString("SearchManager.resourceChanged"); //$NON-NLS-1$
- if (filesDeleted) {
- if (warningMessage == null)
- warningMessage= ""; //$NON-NLS-1$
- else
- warningMessage += "\n"; //$NON-NLS-1$
- warningMessage += SearchMessages.getString("SearchManager.resourceDeleted"); //$NON-NLS-1$
- }
- if (warningMessage != null) {
- if (display != null && !display.isDisposed()) {
- final String warningTitle= SearchMessages.getString("SearchManager.resourceChangedWarning"); //$NON-NLS-1$
- final String warningMsg= warningMessage;
- display.syncExec(new Runnable() {
- public void run() {
- MessageDialog.openWarning(getShell(), warningTitle, warningMsg);
- }
- });
- }
- }
-
- // update viewers
- iter= fListeners.iterator();
- if (display != null && !display.isDisposed()) {
- final Viewer visibleViewer= ((SearchResultView)SearchPlugin.getSearchResultView()).getViewer();
- while (iter.hasNext()) {
- final SearchResultViewer viewer= (SearchResultViewer)iter.next();
- viewer.setGotoMarkerAction(search.getGotoMarkerAction());
- viewer.setContextMenuTarget(search.getContextMenuContributor());
- display.syncExec(new Runnable() {
- public void run() {
- if (previousSearch != null && viewer == visibleViewer)
- previousSearch.setSelection(viewer.getSelection());
- viewer.setPageId(search.getPageId());
- viewer.setInput(getCurrentResults());
- viewer.setSelection(fCurrentSearch.getSelection(), true);
- if (viewer.getSelectedEntriesCount() == 0 && !getCurrentResults().isEmpty())
- viewer.setSelection(new StructuredSelection(getCurrentResults().get(0)));
- }
- });
- }
- }
- monitor.done();
- }
- /**
- * Returns the list with current (last) results
- */
- int getCurrentItemCount() {
- if (fCurrentSearch != null)
- return fCurrentSearch.getItemCount();
- else
- return 0;
- }
-
- void addNewSearch(Search newSearch) {
- // Clear the viewers
- Iterator iter= fListeners.iterator();
- Display display= getDisplay();
- if (display != null && !display.isDisposed()) {
- final Viewer visibleViewer= ((SearchResultView)SearchPlugin.getSearchResultView()).getViewer();
- while (iter.hasNext()) {
- final SearchResultViewer viewer= (SearchResultViewer)iter.next();
- display.syncExec(new Runnable() {
- public void run() {
- if (fCurrentSearch != null && viewer == visibleViewer)
- fCurrentSearch.setSelection(viewer.getSelection());
- viewer.handleRemoveAll();
- viewer.clearTitle();
-
- }
- });
- }
- }
-
- if (fCurrentSearch != null) {
- if (fCurrentSearch.isSameSearch(newSearch))
- getPreviousSearches().remove(fCurrentSearch);
- else
- fCurrentSearch.backupMarkers();
- }
- fCurrentSearch= newSearch;
- getPreviousSearches().addFirst(fCurrentSearch);
-
- // Remove the markers
- try {
- SearchPlugin.getWorkspace().getRoot().deleteMarkers(SearchUI.SEARCH_MARKER, true, IResource.DEPTH_INFINITE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.deleteMarkers.title"), SearchMessages.getString("Search.Error.deleteMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- void setCurrentResults(ArrayList results) {
- Assert.isNotNull(results);
- ((Search)getCurrentSearch()).setResults(results);
- if (results.isEmpty()) {
- // directly update because there will be no delta
- Display display= getDisplay();
- if (display == null || display.isDisposed())
- return;
- display.syncExec(new Runnable() {
- public void run() {
- handleNewSearchResult();
- }
- });
- }
- else
- fIsNewSearch= true;
- }
-
- //--- Change event handling -------------------------------------------------
-
- void addSearchChangeListener(SearchResultViewer viewer) {
- fListeners.add(viewer);
- }
-
- void removeSearchChangeListener(SearchResultViewer viewer) {
- Assert.isNotNull(viewer);
- fListeners.remove(viewer);
- }
-
- private final void handleSearchMarkersChanged(final IResourceChangeEvent event, IMarkerDelta[] markerDeltas) {
- if (fIsNewSearch) {
- fIsNewSearch= false;
- handleNewSearchResult();
- return;
- }
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).getControl().setRedraw(false);
-
- for (int i=0; i < markerDeltas.length; i++)
- handleSearchMarkerChanged(markerDeltas[i]);
-
- iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).getControl().setRedraw(true);
-
- }
-
- private void handleSearchMarkerChanged(IMarkerDelta markerDelta) {
- int kind= markerDelta.getKind();
- if ((kind & IResourceDelta.ADDED) != 0)
- handleAddMatch(markerDelta.getMarker());
- else if (((kind & IResourceDelta.REMOVED) != 0))
- handleRemoveMatch(markerDelta.getMarker());
- else if ((kind & IResourceDelta.CHANGED) != 0)
- handleUpdateMatch(markerDelta.getMarker());
- }
-
- private void handleRemoveAll() {
- if (fCurrentSearch != null)
- ((Search)fCurrentSearch).removeResults();
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleRemoveAll();
- }
-
- private void handleAddMatch(IMarker marker) {
- Object groupByKey= getCurrentSearch().getGroupByKeyComputer().computeGroupByKey(marker);
- SearchResultViewEntry entry= findEntry(groupByKey);
- if (entry == null) {
- entry= new SearchResultViewEntry(groupByKey, marker.getResource());
- getCurrentResults().add(entry);
- entry.add(marker);
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleAddMatch(entry);
- }
- else {
- entry.add(marker);
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleUpdateMatch(entry);
- }
- }
-
- private void handleNewSearchResult() {
- Iterator iter= fListeners.iterator();
- final Search search= getCurrentSearch();
- while (iter.hasNext()) {
- SearchResultViewer viewer= (SearchResultViewer)iter.next();
- viewer.setPageId(search.getPageId());
- viewer.setContextMenuTarget(search.getContextMenuContributor());
- viewer.setGotoMarkerAction(search.getGotoMarkerAction());
- viewer.setInput(getCurrentResults());
- }
- }
-
- private void handleRemoveMatch(IMarker marker) {
- SearchResultViewEntry entry= findEntry(marker);
- if (entry != null) {
- entry.remove(marker);
- if (entry.getMatchCount() == 0) {
- getCurrentResults().remove(entry);
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleRemoveMatch(entry);
- }
- else {
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleUpdateMatch(entry);
- }
- }
- }
-
- private void handleUpdateMatch(IMarker marker) {
- SearchResultViewEntry entry= findEntry(marker);
- if (entry != null) {
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleUpdateMatch(entry);
- }
- }
-
- private SearchResultViewEntry findEntry(IMarker marker) {
- Iterator entries= getCurrentResults().iterator();
- while (entries.hasNext()) {
- SearchResultViewEntry entry= (SearchResultViewEntry)entries.next();
- if (entry.contains(marker))
- return entry;
- }
- return null;
- }
-
- private SearchResultViewEntry findEntry(Object key) {
- if (key == null)
- return null;
- Iterator entries= getCurrentResults().iterator();
- while (entries.hasNext()) {
- SearchResultViewEntry entry= (SearchResultViewEntry)entries.next();
- if (key.equals(entry.getGroupByKey()))
- return entry;
- }
- return null;
- }
- /**
- * Received a resource event. Since the delta could be created in a
- * separate thread this methods post the event into the viewer's
- * display thread.
- */
- public final void resourceChanged(final IResourceChangeEvent event) {
- if (event == null)
- return;
-
- final IMarkerDelta[] markerDeltas= event.findMarkerDeltas(SearchUI.SEARCH_MARKER, true);
- if (markerDeltas == null || markerDeltas.length < 1)
- return;
-
- Display display= getDisplay();
- if (display == null || display.isDisposed())
- return;
-
- Runnable runnable= new Runnable() {
- public void run() {
- handleSearchMarkersChanged(event, markerDeltas);
- // update title and actions
- Iterator iter= fListeners.iterator();
- while (iter.hasNext()) {
- SearchResultViewer viewer= (SearchResultViewer)iter.next();
- viewer.enableActions();
- viewer.updateTitle();
- }
- }
- };
- display.syncExec(runnable);
- }
- /**
- * Find and return a valid display
- */
- private Display getDisplay() {
- Iterator iter= fListeners.iterator();
- while (iter.hasNext()) {
- Control control= ((Viewer)iter.next()).getControl();
- if (control != null && !control.isDisposed()) {
- Display display= control.getDisplay();
- if (display != null && !display.isDisposed())
- return display;
- }
- }
- return null;
- }
- /**
- * Find and return a valid shell
- */
- private Shell getShell() {
- return SearchPlugin.getActiveWorkbenchShell();
- }
-}
-
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java
deleted file mode 100644
index e22ebf00e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class SearchMessages {
-
- private static final String RESOURCE_BUNDLE= SearchMessages.class.getName();
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private SearchMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- */
- public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg == null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- */
- public static String getFormattedString(String key, Object[] args) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(format, args);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
deleted file mode 100644
index 085b0e65a..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
+++ /dev/null
@@ -1,136 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-SearchDialog.title= Search
-SearchDialog.performAction= &Search
-SearchDialog.noSearchExtension= No Search Extensions plugged into workbench
-
-SearchManager.resourceChangedWarning= Changed Resources
-SearchManager.resourceChanged= Some of the resources have changed. Matches might be at wrong positions.
-SearchManager.resourceDeleted= Some of the resources no longer exist. Corresponding matches are removed from the search results.
-SearchManager.updating= Updating...
-
-SearchResultView.title= Search
-SearchResultView.titleWithDescription= Search ({0})
-SearchResultView.matches= matches
-SearchResultView.removed_resource= <removed resource>
-SearchResultView.removeAllResults.text= Remove &All
-SearchResultView.removeAllResults.tooltip= Remove All Search Results
-SearchResultView.removeAllSearches.text= Remove &All
-SearchResultView.removeAllSearches.tooltip= Remove All Searches
-SearchResultView.searchAgain.text= &Search Again
-SearchResultView.searchAgain.tooltip= Search Again
-SearchResultView.previousSearches.text= Previous Search Results
-SearchResultView.previousSearches.tooltip= Previous Search Results
-SearchResultView.removeEntry.text= &Remove Entry
-SearchResultView.removeEntry.tooltip= Remove Entry
-SearchResultView.removeEntries.text= &Remove Entries
-SearchResultView.removeEntries.tooltip= Remove Entries
-SearchResultView.removeMatch.text= Remove &Match
-SearchResultView.removeMatch.tooltip= Remove Match
-SearchResultView.gotoMarker.text= &Go to File
-SearchResultView.gotoMarker.tooltip= Go to File
-SearchResultView.showNext.text= Next
-SearchResultView.showNext.tooltip= Show Next Match Ctrl+E
-SearchResultView.showPrev.text= Previous
-SearchResultView.showPrev.tooltip= Show Previous Match Ctrl+Shift+E
-
-SearchDialogClosingDialog.title= Search Dialog Closing
-SearchDialogClosingDialog.message= Dialog can not be closed due to an active operation. You must cancel the operation before you can close the dialog.
-
-Search.Error.search.title= Search Error
-Search.Error.search.message= An error occurred during the search operation
-
-Search.Error.setDescription.title= Search Error
-Search.Error.setDescription.message= Can not save workspace description
-
-Search.Error.openEditor.title= Search Error
-Search.Error.openEditor.message= Could not open the editor
-
-Search.Error.openResultView.title= Search Error
-Search.Error.openResultView.message= Could not open the search results view
-
-Search.Error.deleteMarkers.title= Search Error
-Search.Error.deleteMarkers.message= An error occurred during deletion of search markers
-
-Search.Error.createMarker.title=Search Error
-Search.Error.createMarker.message= Could not create the search marker
-
-Search.Error.markerAttributeAccess.title= Search Error
-Search.Error.markerAttributeAccess.message= An error occurred while accessing a marker attribute
-
-Search.Error.switchSearch.title= Search Error
-Search.Error.switchSearch.message= An error occurred while switching to a previous search result
-
-Search.Error.createSearchPage.title= Search Error
-Search.Error.createSearchPage.message= An error occurred while creating a search page
-
-Search.Error.createSorter.title= Search Error
-Search.Error.createSorter.message= An error occurred while creating a sorter
-
-Search.Error.incorrectIconLocation.message= Invalid icon location
-
-SearchResultCollector.match= 1 match
-SearchResultCollector.matches= {0} matches
-SearchResultCollector.done= Search done: {0}
-
-SearchPage.expression.label= Se&arch Expression
-SearchPage.expression.pattern= * = any string, ? = any character, \\ = escape for literals: * ? \\
-SearchPage.browse= &Browse...
-SearchPage.extensions= &Patterns:
-SearchPage.caseSensitive= &Case sensitive
-
-TextSearchEngine.scanning= Scanning...
-
-TextSearchVisitor.error= Error reading file during search: {0}
-TextSearchVisitor.canceled= Operation Canceled
-
-SortDropDownAction.label= S&ort By
-SortDropDownAction.tooltip= Sort By
-
-ShowOtherSearchesAction.label= &Other...
-ShowOtherSearchesAction.tooltip= Open Other Searches Dialog
-
-OtherSearchesDialog.title= Other Searches
-OtherSearchesDialog.message= &Select one of the searches
-
-PreviousSearchesDialog.title= Previous Searches
-PreviousSearchesDialog.message= &Select one of the searches
-
-# The first argument will be replaced by the pattern, the second by the scope
-TextSearchOperation.singularLabelPostfix= "{0}" - 1 Occurrence in {1}
-
-# The first argument will be replaced by the pattern, the second by the count and the last by the scope
-TextSearchOperation.pluralLabelPatternPostfix= "{0}" - {1} Occurrences in {2}
-
-TypedResourceVisitor.unknownResourceType= Unknown resource type
-
-OpenSearchDialogAction.label= Search
-OpenSearchDialogAction.tooltip= Search
-
-FileTypeEditor.typeDelimiter= ,
-
-FileLabelProvider.dashSeparated= {0} - {1}
-
-TypesFiltering.title= Select Types
-TypesFiltering.message = S&elect the types to scan.
-TypesFiltering.otherExtensions = &Other Patterns:
-TypesFiltering.selectAll= &Select All
-TypesFiltering.deselectAll= &Deselect All
-
-WorkspaceScope= Workspace
-WorkingSetScope= Working Set - {0}
-SelectionScope= Selection
-
-ScopePart.group.text=Scope
-ScopePart.selectedResourcesScope.text=Se&lected Resources
-ScopePart.workingSetChooseButton.text=C&hoose...
-ScopePart.workingSetScope.text=Wor&king Set:
-ScopePart.workspaceScope.text=&Workspace
-
-CopyToClipboardAction.label = Copy to Clip&board
-CopyToClipboardAction.tooltip = Copy to Clipboard
-
-ExceptionDialog.seeErrorLogMessage= See error log for more details
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java
deleted file mode 100644
index cdf76c5aa..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.StringConverter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.ui.ISearchPage;
-import org.eclipse.search.ui.ISearchPageScoreComputer;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-/**
- * Proxy that represents a search page.
- */
-class SearchPageDescriptor implements Comparable {
-
- public final static String PAGE_TAG= "page"; //$NON-NLS-1$
- private final static String ID_ATTRIBUTE= "id"; //$NON-NLS-1$
- private final static String ICON_ATTRIBUTE= "icon"; //$NON-NLS-1$
- private final static String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$
- private final static String LABEL_ATTRIBUTE= "label"; //$NON-NLS-1$
- private final static String SIZE_ATTRIBUTE= "sizeHint"; //$NON-NLS-1$
- private final static String TAB_POSITION_ATTRIBUTE= "tabPosition"; //$NON-NLS-1$
- private final static String EXTENSIONS_ATTRIBUTE= "extensions"; //$NON-NLS-1$
- private final static String SHOW_SCOPE_SECTION_ATTRIBUTE= "showScopeSection"; //$NON-NLS-1$
-
- public final static Point UNKNOWN_SIZE= new Point(SWT.DEFAULT, SWT.DEFAULT);
-
- private IConfigurationElement fElement;
-
- private static class ExtensionScorePair {
- public String extension;
- public int score;
- public ExtensionScorePair(String extension, int score) {
- this.extension= extension;
- this.score= score;
- }
- }
- private List fExtensionScorePairs;
- private int fWildcardScore= ISearchPageScoreComputer.UNKNOWN;
-
-
-
- /**
- * Creates a new search page node with the given configuration element.
- */
- public SearchPageDescriptor(IConfigurationElement element) {
- fElement= element;
- }
-
- /**
- * Creates a new search page from this node.
- */
- public ISearchPage createObject() {
- ISearchPage result= null;
- try {
- result= (ISearchPage)fElement.createExecutableExtension(CLASS_ATTRIBUTE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createSearchPage.title"), SearchMessages.getString("Search.Error.createSearchPage.message")); //$NON-NLS-2$ //$NON-NLS-1$
- } catch (ClassCastException ex) {
- ExceptionHandler.displayMessageDialog(ex, SearchMessages.getString("Search.Error.createSearchPage.title"), SearchMessages.getString("Search.Error.createSearchPage.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
- if (result != null) {
- result.setTitle(getLabel());
- }
- return result;
- }
-
- //---- XML Attribute accessors ---------------------------------------------
-
- /**
- * Returns the page's id.
- */
- public String getId() {
- return fElement.getAttribute(ID_ATTRIBUTE);
- }
-
- /**
- * Returns the page's image
- */
- public ImageDescriptor getImage() {
- String imageName= fElement.getAttribute(ICON_ATTRIBUTE);
- if (imageName == null)
- return null;
- URL url;
- try {
- url= new URL(fElement.getDeclaringExtension().getDeclaringPluginDescriptor().getInstallURL(), imageName);
- } catch (java.net.MalformedURLException ex) {
- ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.createSearchPage.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
- return ImageDescriptor.createFromURL(url);
- }
-
- /**
- * Returns the page's label.
- */
- public String getLabel() {
- return fElement.getAttribute(LABEL_ATTRIBUTE);
- }
-
- /**
- * Returns <code>true</code> if the scope section needs
- * to be shown in the dialog.
- */
- public boolean showScopeSection() {
- return Boolean.valueOf(fElement.getAttribute(SHOW_SCOPE_SECTION_ATTRIBUTE)).booleanValue();
- }
-
- /**
- * Returns the page's preferred size
- */
- public Point getPreferredSize() {
- return StringConverter.asPoint(
- fElement.getAttribute(SIZE_ATTRIBUTE), UNKNOWN_SIZE);
- }
- /**
- * Returns the page's tab position relative to the other tabs.
- * @return the tab position or <code>Integer.MAX_VALUE</code> if not defined in
- the plugins.xml file
- *
- */
- public int getTabPosition() {
- int position= Integer.MAX_VALUE / 2;
- String str= fElement.getAttribute(TAB_POSITION_ATTRIBUTE);
- if (str != null)
- try {
- position= Integer.parseInt(str);
- } catch (NumberFormatException ex) {
- ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.createSearchPage.message")); //$NON-NLS-2$ //$NON-NLS-1$
- // position is Integer.MAX_VALUE;
- }
- return position;
- }
-
- /*
- * Implements a method from IComparable
- */
- public int compareTo(Object o) {
- int myPos= getTabPosition();
- int objsPos= ((SearchPageDescriptor)o).getTabPosition();
- if (myPos == Integer.MAX_VALUE && objsPos == Integer.MAX_VALUE || myPos == objsPos)
- return getLabel().compareTo(((SearchPageDescriptor)o).getLabel());
- else
- return myPos - objsPos;
- }
-
- //---- Suitability tests ---------------------------------------------------
-
- /**
- * Returns the score for this page with the given input element.
- */
- public int computeScore(Object element) {
- if (element instanceof IFile) {
- String extension= ((IFile)element).getFileExtension();
- if (extension != null)
- return getScoreForFileExtension(extension);
- } else if (element instanceof IAdaptable) {
- ISearchPageScoreComputer tester=
- (ISearchPageScoreComputer)((IAdaptable)element).getAdapter(ISearchPageScoreComputer.class);
- if (tester != null)
- return tester.computeScore(getId(), element);
- } else if (element instanceof ISearchResultViewEntry) {
- ISearchResultViewEntry entry= (ISearchResultViewEntry)element;
- return computeScore(entry.getSelectedMarker());
- }
- if (fWildcardScore != ISearchPageScoreComputer.UNKNOWN)
- return fWildcardScore;
-
- return ISearchPageScoreComputer.LOWEST;
- }
-
- private int getScoreForFileExtension(String extension) {
- if (fExtensionScorePairs == null)
- readExtensionScorePairs();
-
- int size= fExtensionScorePairs.size();
- for (int i= 0; i < size; i++) {
- ExtensionScorePair p= (ExtensionScorePair)fExtensionScorePairs.get(i);
- if (extension.equals(p.extension))
- return p.score;
- }
- if (fWildcardScore != ISearchPageScoreComputer.UNKNOWN)
- return fWildcardScore;
-
- return ISearchPageScoreComputer.LOWEST;
- }
-
- private void readExtensionScorePairs() {
- fExtensionScorePairs= new ArrayList(3);
- String content= fElement.getAttribute(EXTENSIONS_ATTRIBUTE);
- if (content == null)
- return;
- StringTokenizer tokenizer= new StringTokenizer(content, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreElements()) {
- String token= tokenizer.nextToken().trim();
- int pos= token.indexOf(':');
- if (pos != -1) {
- String extension= token.substring(0, pos);
- int score= StringConverter.asInt(token.substring(pos+1), ISearchPageScoreComputer.UNKNOWN);
- if (extension.equals("*")) { //$NON-NLS-1$
- fWildcardScore= score;
- } else {
- fExtensionScorePairs.add(new ExtensionScorePair(extension, score));
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
deleted file mode 100644
index 41c632fc9..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.SearchUI;
-
-/**
- * The plug-in runtime class for Search plug-in
- */
-public class SearchPlugin extends AbstractUIPlugin {
-
- public static final String SEARCH_PAGE_EXTENSION_POINT= "searchPages"; //$NON-NLS-1$
- public static final String SORTER_EXTENSION_POINT= "searchResultSorters"; //$NON-NLS-1$
-
- private static SearchPlugin fgSearchPlugin;
-
- private List fPageDescriptors;
- private List fSorterDescriptors;
-
- public SearchPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- Assert.isTrue(fgSearchPlugin == null);
- fgSearchPlugin= this;
- }
-
- /**
- * Returns the search plugin instance.
- */
- public static SearchPlugin getDefault() {
- return fgSearchPlugin;
- }
-
- /**
- * Returns the active workbench window.
- * <code>null</code> if the active window is not a workbench window
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- IWorkbenchWindow window= fgSearchPlugin.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- final WindowRef windowRef= new WindowRef();
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- setActiveWorkbenchWindow(windowRef);
- }
- });
- return windowRef.window;
- }
- else
- return window;
- }
-
- private static class WindowRef {
- public IWorkbenchWindow window;
- }
-
- private static void setActiveWorkbenchWindow(WindowRef windowRef) {
- windowRef.window= null;
- Display display= Display.getCurrent();
- if (display == null)
- return;
- Control shell= display.getActiveShell();
- while (shell != null) {
- Object data= shell.getData();
- if (data instanceof IWorkbenchWindow) {
- windowRef.window= (IWorkbenchWindow)data;
- return;
- }
- shell= shell.getParent();
- }
- Shell shells[]= display.getShells();
- for (int i= 0; i < shells.length; i++) {
- Object data= shells[i].getData();
- if (data instanceof IWorkbenchWindow) {
- windowRef.window= (IWorkbenchWindow)data;
- return;
- }
- }
- }
-
- /**
- * Returns the shell of the active workbench window.
- */
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window= getActiveWorkbenchWindow();
- if (window != null)
- return window.getShell();
- return null;
- }
-
- /**
- * Beeps using the display of the active workbench window.
- */
- public static void beep() {
- getActiveWorkbenchShell().getDisplay().beep();
- }
-
- /**
- * Returns the active workbench window's currrent page.
- */
- public static IWorkbenchPage getActivePage() {
- return getActiveWorkbenchWindow().getActivePage();
- }
-
- /**
- * Returns the workbench from which this plugin has been loaded.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Activates the search result view in the active page.
- * This call has no effect, if the search result view is
- * already activated.
- *
- * @return <code>true</code> if the search result view could be activated
- */
- public static boolean activateSearchResultView() {
- try {
- return (getActivePage().showView(SearchUI.SEARCH_RESULT_VIEW_ID) != null);
- } catch (PartInitException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.openResultView.title"), SearchMessages.getString("Search.Error.openResultView.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return false;
- }
- }
-
- /**
- * Returns the search result view of the active workbench window. Returns <code>
- * null</code> if the active workbench window doesn't have any search result
- * view.
- */
- public static ISearchResultView getSearchResultView() {
- IViewPart part= getActivePage().findView(SearchUI.SEARCH_RESULT_VIEW_ID);
- if (part instanceof ISearchResultView)
- return (ISearchResultView) part;
- return null;
- }
-
- static void setAutoBuilding(boolean state) {
- IWorkspaceDescription workspaceDesc= getDefault().getWorkspace().getDescription();
- workspaceDesc.setAutoBuilding(state);
- try {
- getDefault().getWorkspace().setDescription(workspaceDesc);
- }
- catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.setDescription.title"), SearchMessages.getString("Search.Error.setDescription.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- /**
- * Shuts down this plug-in.
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- getWorkspace().removeResourceChangeListener(SearchManager.getDefault());
- fgSearchPlugin = null;
- }
-
- /**
- * Returns all search pages contributed to the workbench.
- */
- public List getSearchPageDescriptors() {
- if (fPageDescriptors == null) {
- IPluginRegistry registry= Platform.getPluginRegistry();
- IConfigurationElement[] elements= registry.getConfigurationElementsFor(SearchUI.PLUGIN_ID, SEARCH_PAGE_EXTENSION_POINT);
- fPageDescriptors= createSearchPageDescriptors(elements);
- }
- return fPageDescriptors;
- }
-
- /**
- * Creates all necessary search page nodes.
- */
- private List createSearchPageDescriptors(IConfigurationElement[] elements) {
- List result= new ArrayList(5);
- for (int i= 0; i < elements.length; i++) {
- IConfigurationElement element= elements[i];
- if (SearchPageDescriptor.PAGE_TAG.equals(element.getName())) {
- SearchPageDescriptor desc= new SearchPageDescriptor(element);
- result.add(desc);
- }
- }
- Collections.sort(result);
- return result;
- }
-
- /**
- * Returns all sorters contributed to the workbench.
- */
- public List getSorterDescriptors() {
- if (fSorterDescriptors == null) {
- IPluginRegistry registry= Platform.getPluginRegistry();
- IConfigurationElement[] elements= registry.getConfigurationElementsFor(SearchUI.PLUGIN_ID, SORTER_EXTENSION_POINT);
- fSorterDescriptors= createSorterDescriptors(elements);
- }
- return fSorterDescriptors;
- }
-
- /**
- * Creates all necessary sorter description nodes.
- */
- private List createSorterDescriptors(IConfigurationElement[] elements) {
- List result= new ArrayList(5);
- for (int i= 0; i < elements.length; i++) {
- IConfigurationElement element= elements[i];
- if (SorterDescriptor.SORTER_TAG.equals(element.getName()))
- result.add(new SorterDescriptor(element));
- }
- return result;
- }
-
- /**
- * Log status to platform log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Creates the Search plugin standard groups in a context menu.
- */
- public static void createStandardGroups(IMenuManager menu) {
- if (!menu.isEmpty())
- return;
- menu.add(new Separator(IContextMenuConstants.GROUP_NEW));
- menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
- menu.add(new GroupMarker(IContextMenuConstants.GROUP_OPEN));
- menu.add(new Separator(IContextMenuConstants.GROUP_SHOW));
- menu.add(new Separator(IContextMenuConstants.GROUP_BUILD));
- menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
- menu.add(new GroupMarker(IContextMenuConstants.GROUP_GENERATE));
- menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
- menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
- menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
- menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java
deleted file mode 100644
index 3a9a7ba75..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-/**
- * Bundle of all images used by the Search UI plugin.
- */
-public class SearchPluginImages {
-
- private static URL fgIconLocation;
-
- static {
- String pathSuffix= "icons/full/"; //$NON-NLS-1$
- try {
- fgIconLocation= new URL(SearchPlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix);
- } catch (MalformedURLException ex) {
- ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.incorrectIconLocation.message")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- // The plugin registry
- private final static ImageRegistry PLUGIN_REGISTRY= SearchPlugin.getDefault().getImageRegistry();
-
- public static final String T_OBJ= "obj16/"; //$NON-NLS-1$
- public static final String T_WIZBAN= "wizban/"; //$NON-NLS-1$
- public static final String T_LCL= "lcl16/"; //$NON-NLS-1$
- public static final String T_TOOL= "tool16/"; //$NON-NLS-1$
- public static final String T_VIEW= "view16/"; //$NON-NLS-1$
-
- private static final String NAME_PREFIX= "org.eclipse.search.ui."; //$NON-NLS-1$
- private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();
-
- // Define image names
- public static final String IMG_TOOL_SEARCH= NAME_PREFIX + "search.gif"; //$NON-NLS-1$
-
- public static final String IMG_LCL_SEARCH_STOP= NAME_PREFIX + "search_stop.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_REM= NAME_PREFIX + "search_rem.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_REM_ALL= NAME_PREFIX + "search_remall.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_NEXT= NAME_PREFIX + "search_next.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_PREV= NAME_PREFIX + "search_prev.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_GOTO= NAME_PREFIX + "search_goto.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_SORT= NAME_PREFIX + "search_sortmatch.gif"; //$NON-NLS-1$
- public static final String IMG_LCL_SEARCH_HISTORY= NAME_PREFIX + "search_history.gif"; //$NON-NLS-1$
-
- public static final String IMG_VIEW_SEARCHRES= NAME_PREFIX + "searchres.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_TSEARCH= NAME_PREFIX + "tsearch_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TSEARCH_DPDN= NAME_PREFIX + "tsearch_dpdn_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SEARCHMARKER= NAME_PREFIX + "searchm_obj.gif"; //$NON-NLS-1$
-
-
-
- // Define images
- public static final ImageDescriptor DESC_OBJ_TSEARCH= createManaged(T_OBJ, IMG_OBJ_TSEARCH);
- public static final ImageDescriptor DESC_OBJ_TSEARCH_DPDN= createManaged(T_OBJ, IMG_OBJ_TSEARCH_DPDN);
- public static final ImageDescriptor DESC_OBJ_SEARCHMARKER= createManaged(T_OBJ, IMG_OBJ_SEARCHMARKER);
-
- public static Image get(String key) {
- return PLUGIN_REGISTRY.get(key);
- }
-
- private static ImageDescriptor createManaged(String prefix, String name) {
- ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
- PLUGIN_REGISTRY.put(name, result);
- return result;
- }
-
- private static ImageDescriptor create(String prefix, String name) {
- return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
- }
-
- private static URL makeIconFileURL(String prefix, String name) {
- StringBuffer buffer= new StringBuffer(prefix);
- buffer.append(name);
- try {
- return new URL(fgIconLocation, buffer.toString());
- } catch (MalformedURLException ex) {
- ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.incorrectIconLocation.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Sets all available image descriptors for the given action.
- */
- public static void setImageDescriptors(IAction action, String type, String relPath) {
- relPath= relPath.substring(NAME_PREFIX_LENGTH);
- action.setDisabledImageDescriptor(create("d" + type, relPath)); //$NON-NLS-1$
- action.setHoverImageDescriptor(create("c" + type, relPath)); //$NON-NLS-1$
- action.setImageDescriptor(create("e" + type, relPath)); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java
deleted file mode 100644
index 2df3c2bc5..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-class SearchResultContentProvider implements IStructuredContentProvider {
-
- private static final Object[] fgEmptyArray= new Object[0];
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // Do nothing since the viewer listens to resource deltas
- }
-
- public void dispose() {
- }
-
- public boolean isDeleted(Object element) {
- return false;
- }
-
- public Object[] getElements(Object element) {
- if (element instanceof ArrayList)
- return ((ArrayList)element).toArray();
- else
- return fgEmptyArray;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java
deleted file mode 100644
index 5e6cba12d..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-class SearchResultLabelProvider extends DecoratingLabelProvider {
-
- private static final String MATCHES_POSTFIX= " " + SearchMessages.getString("SearchResultView.matches") + ")"; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- private static class MatchCountDecorator extends LabelProvider implements ILabelDecorator {
- /*
- * @see ILabelDecorator#decorateImage(Image, Object)
- */
- public Image decorateImage(Image image, Object element) {
- return null;
- }
-
- /*
- * @see ILabelDecorator#decorateText(String, Object)
- */
- public String decorateText(String text, Object element) {
- StringBuffer buf= new StringBuffer(text);
- int count= ((ISearchResultViewEntry)element).getMatchCount();
- if (count > 1) {
- buf.append(" ("); //$NON-NLS-1$
- buf.append(count);
- buf.append(MATCHES_POSTFIX);
- }
- return buf.toString();
- }
- }
-
- SearchResultLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
- super(provider, new MatchCountDecorator());
- }
-
- public String getText(Object element) {
- StringBuffer buf= new StringBuffer(getLabelProvider().getText(element));
- int count= ((ISearchResultViewEntry)element).getMatchCount();
- if (count > 1) {
- buf.append(" ("); //$NON-NLS-1$
- buf.append(count);
- buf.append(MATCHES_POSTFIX);
- }
- return buf.toString();
- }
-
- // Don't dispose since label providers are reused.
- public void dispose() {
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java
deleted file mode 100644
index 6cbf378ce..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.ViewPart;
-
-import org.eclipse.search.ui.IContextMenuContributor;
-import org.eclipse.search.ui.IGroupByKeyComputer;
-import org.eclipse.search.ui.ISearchResultView;
-
-public class SearchResultView extends ViewPart implements ISearchResultView {
-
- private static Map fgLabelProviders= new HashMap(5);;
-
- private SearchResultViewer fViewer;
- private Map fResponse;
- private IMemento fMemento;
-
- /*
- * Implements method from IViewPart.
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- fMemento= memento;
- }
-
- /*
- * Implements method from IViewPart.
- */
- public void saveState(IMemento memento) {
- if (fViewer == null) {
- // part has not been created
- if (fMemento != null) //Keep the old state;
- memento.putMemento(fMemento);
- return;
- }
- fViewer.saveState(memento);
- }
-
- /**
- * Creates the search list inner viewer.
- */
- public void createPartControl(Composite parent) {
- Assert.isTrue(fViewer == null);
- fViewer= new SearchResultViewer(this, parent);
- if (fMemento != null)
- fViewer.restoreState(fMemento);
- fMemento= null;
- SearchManager.getDefault().addSearchChangeListener(fViewer);
- Search search= SearchManager.getDefault().getCurrentSearch();
- if (search != null)
- fViewer.setPageId(search.getPageId());
- fViewer.setInput(SearchManager.getDefault().getCurrentResults());
- fillToolBar(getViewSite().getActionBars().getToolBarManager());
- getSite().setSelectionProvider(fViewer);
-
- WorkbenchHelp.setHelp(fViewer.getControl(), ISearchHelpContextIds.SEARCH_VIEW);
- }
-
- /**
- * Returns the search result viewer.
- */
- SearchResultViewer getViewer() {
- return fViewer;
- }
-
- //---- IWorkbenchPart ------------------------------------------------------
-
- public void setFocus() {
- fViewer.getControl().setFocus();
- }
-
- public void dispose() {
- if (fViewer != null) {
- SearchManager.getDefault().removeSearchChangeListener(fViewer);
- fViewer= null;
- }
- super.dispose();
- }
-
- protected void setTitle(String title) {
- super.setTitle(title);
- }
-
- protected void setTitleToolTip(String text) {
- super.setTitleToolTip(text);
- }
-
- //---- Adding Action to Toolbar -------------------------------------------
-
- private void fillToolBar(IToolBarManager tbm) {
- fViewer.fillToolBar(tbm);
- }
-
- ILabelProvider getLabelProvider(String pageId) {
- if (pageId != null)
- return (ILabelProvider)fgLabelProviders.get(pageId);
- return null;
- }
- public ILabelProvider getLabelProvider() {
- IBaseLabelProvider labelProvider= fViewer.getLabelProvider();
- if (labelProvider instanceof SearchResultLabelProvider)
- return ((SearchResultLabelProvider)labelProvider).getLabelProvider();
- else
- return null;
- }
-
- private void setContextMenuContributor(final IContextMenuContributor contributor) {
- // Make sure we are doing it in the right thread.
- getDisplay().syncExec(new Runnable() {
- public void run() {
- getViewer().setContextMenuTarget(contributor);
- }
- });
- }
-
- private void setGotoMarkerAction(final IAction gotoMarkerAction) {
- // Make sure we are doing it in the right thread.
- getDisplay().syncExec(new Runnable() {
- public void run() {
- getViewer().setGotoMarkerAction(gotoMarkerAction);
- }
- });
- }
-
- Display getDisplay() {
- return fViewer.getControl().getDisplay();
- }
-
- //---- ISearchResultView --------------------------------------------------
-
- /*
- * Implements method from ISearchResultView
- */
- public ISelection getSelection() {
- return fViewer.getSelection();
- }
-
- /**
- * Implements method from ISearchResultView
- * @deprecated As of build > 20011107, replaced by the new version with additonal parameter
- */
- public void searchStarted(
- String pageId,
- String label,
- ImageDescriptor imageDescriptor,
- IContextMenuContributor contributor,
- ILabelProvider labelProvider,
- IAction gotoAction,
- IGroupByKeyComputer groupByKeyComputer,
- IRunnableWithProgress operation) {
-
- searchStarted(pageId, null, label, imageDescriptor, contributor, labelProvider, gotoAction, groupByKeyComputer, operation);
- };
-
- /*
- * Implements method from ISearchResultView
- */
- public void searchStarted(
- String pageId,
- String singularLabel,
- String pluralLabelPattern,
- ImageDescriptor imageDescriptor,
- IContextMenuContributor contributor,
- ILabelProvider labelProvider,
- IAction gotoAction,
- IGroupByKeyComputer groupByKeyComputer,
- IRunnableWithProgress operation) {
-
-
- Assert.isNotNull(pageId);
- Assert.isNotNull(pluralLabelPattern);
- Assert.isNotNull(gotoAction);
-
- fResponse= new HashMap(500);
- setGotoMarkerAction(gotoAction);
-
- ILabelProvider oldLabelProvider= (ILabelProvider)fgLabelProviders.get(pageId);
- if (oldLabelProvider != null)
- oldLabelProvider.dispose();
- fgLabelProviders.put(pageId, labelProvider);
-
- SearchManager.getDefault().addNewSearch(
- new Search(
- pageId,
- singularLabel,
- pluralLabelPattern,
- null,
- imageDescriptor,
- fViewer.getGotoMarkerAction(),
- contributor,
- groupByKeyComputer,
- operation));
- };
-
- /*
- * Implements method from ISearchResultView
- */
- public void addMatch(String description, Object groupByKey, IResource resource, IMarker marker) {
- SearchResultViewEntry entry= (SearchResultViewEntry)fResponse.get(groupByKey);
- if (entry == null) {
- entry= new SearchResultViewEntry(groupByKey, resource);
- fResponse.put(groupByKey, entry);
- }
- entry.add(marker);
- }
-
- /*
- * Implements method from ISearchResultView
- */
- public void searchFinished() {
- SearchManager.getDefault().setCurrentResults(new ArrayList(fResponse.values()));
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java
deleted file mode 100644
index 39e8a79c0..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-/**
- * Represents an entry in the search result view
- */
-class SearchResultViewEntry implements ISearchResultViewEntry {
-
- private Object fGroupByKey= null;
- private IResource fResource= null;
- private IMarker fMarker= null;
- private ArrayList fMarkers= null;
- private ArrayList fAttributes;
- private int fSelectedMarkerIndex;
- private long fModificationStamp= IResource.NULL_STAMP;
-
- public SearchResultViewEntry(Object groupByKey, IResource resource) {
- fGroupByKey= groupByKey;
- fResource= resource;
- }
-
- //---- Accessors ------------------------------------------------
- public Object getGroupByKey() {
- return fGroupByKey;
- }
-
- void setGroupByKey(Object groupByKey) {
- fGroupByKey= groupByKey;
- }
-
- public IResource getResource() {
- return fResource;
- }
-
- public int getMatchCount() {
- if (fMarkers != null)
- return fMarkers.size();
- if (fMarkers == null && fMarker != null)
- return 1;
- return 0;
- }
-
- List getAttributesPerMarker() {
- if (fAttributes == null)
- return new ArrayList(0);
- return fAttributes;
- }
-
- long getModificationStamp() {
- return fModificationStamp;
- }
-
- void clearMarkerList() {
- fMarker= null;
- if (fMarkers != null)
- fMarkers.clear();
- }
-
- void add(IMarker marker) {
- if (fMarker == null) {
- fMarker= marker;
- if (fMarkers != null)
- fMarkers.add(marker);
- return;
- }
- if (fMarkers == null) {
- fMarkers= new ArrayList(10);
- addByStartpos(fMarkers, fMarker);
- }
- addByStartpos(fMarkers, marker);
- }
-
- void setSelectedMarkerIndex(int index) {
- fSelectedMarkerIndex= index;
- }
-
- public IMarker getSelectedMarker() {
- fSelectedMarkerIndex= Math.min(fSelectedMarkerIndex, getMatchCount() - 1);
- if (fMarkers == null && fMarker == null)
- return null;
- if (fMarkers != null && fSelectedMarkerIndex >= 0)
- return (IMarker)fMarkers.get(fSelectedMarkerIndex);
- return fMarker;
- }
-
- List getMarkers() {
- if (fMarkers == null && fMarker == null)
- return new ArrayList(0);
- else if (fMarkers == null && fMarker != null) {
- List markers= new ArrayList(1);
- markers.add(fMarker);
- return markers;
- }
- return fMarkers;
- }
-
- boolean contains(IMarker marker) {
- if (fMarkers == null && fMarker == null)
- return false;
- if (fMarkers == null)
- return fMarker.equals(marker);
- else
- return fMarkers.contains(marker);
- }
-
- void remove(IMarker marker) {
- if (marker == null)
- return;
-
- if (fMarkers == null) {
- if (fMarker != null && fMarker.equals(marker))
- fMarker= null;
- }
- else {
- fMarkers.remove(marker);
- if (fMarkers.size() == 1) {
- fMarker= (IMarker)fMarkers.get(0);
- fMarkers= null;
- }
- }
- }
-
- void backupMarkers() {
- if (fResource != null)
- fModificationStamp= fResource.getModificationStamp();
- List markers= getMarkers();
- fAttributes= new ArrayList(markers.size());
- Iterator iter= markers.iterator();
- while (iter.hasNext()) {
- IMarker marker= (IMarker)iter.next();
- Map attributes= null;
- try {
- attributes= marker.getAttributes();
- } catch (CoreException ex) {
- // don't backup corrupt marker
- continue;
- }
- fAttributes.add(attributes);
- }
- }
-
- private void addByStartpos(ArrayList markers, IMarker marker) {
- int startPos= marker.getAttribute(IMarker.CHAR_START, -1);
- int i= 0;
- int markerCount= markers.size();
- while (i < markerCount && startPos >= ((IMarker)markers.get(i)).getAttribute(IMarker.CHAR_START, -1))
- i++;
- markers.add(i, marker);
- if (i == 0)
- fMarker= marker;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
deleted file mode 100644
index 2e6b32a19..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.IContextMenuContributor;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.util.FileLabelProvider;
-
-
-/**
- * A special viewer to present search results. The viewer implements an
- * optimized adding and removing strategy. Furthermore it manages
- * contributions for search result types. For example the viewer's context
- * menu differs if the search result has been generated by a text or
- * a java search.
- */
-class SearchResultViewer extends TableViewer {
-
- private SearchResultView fOuterPart;
- private boolean fFirstTime= true;
- private ShowNextResultAction fShowNextResultAction;
- private ShowPreviousResultAction fShowPreviousResultAction;
- private GotoMarkerAction fGotoMarkerAction;
- private SearchAgainAction fSearchAgainAction;
- private RemoveAllSearchesAction fRemoveAllSearchesAction;
- private RemoveMatchAction fRemoveMatchAction;
- private SortDropDownAction fSortDropDownAction;
- private SearchDropDownAction fSearchDropDownAction;
- private CopyToClipboardAction fCopyToClipboardAction;
- private int fMarkerToShow;
- private boolean fHandleNextSelectionChangedEvent= true;
-
- /*
- * These static fields will go away when support for
- * multiple search will be implemented
- */
- private static IContextMenuContributor fgContextMenuContributor;
- private static IAction fgGotoMarkerAction;
-
- public SearchResultViewer(SearchResultView outerPart, Composite parent) {
- super(new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
-
- fOuterPart= outerPart;
- Assert.isNotNull(fOuterPart);
-
- setUseHashlookup(true);
- setContentProvider(new SearchResultContentProvider());
- setLabelProvider(new SearchResultLabelProvider(new FileLabelProvider(FileLabelProvider.SHOW_LABEL), PlatformUI.getWorkbench().getDecoratorManager()));
-
- boolean hasSearch= SearchManager.getDefault().getCurrentSearch() != null;
-
-
- fShowNextResultAction= new ShowNextResultAction(this);
- fShowNextResultAction.setEnabled(false);
- fShowPreviousResultAction= new ShowPreviousResultAction(this);
- fShowPreviousResultAction.setEnabled(false);
- fGotoMarkerAction= new GotoMarkerAction(this);
- fGotoMarkerAction.setEnabled(false);
- fRemoveMatchAction= new RemoveMatchAction(this);
- fRemoveMatchAction.setEnabled(false);
- fRemoveAllSearchesAction= new RemoveAllSearchesAction();
- fSearchAgainAction= new SearchAgainAction();
- fSearchAgainAction.setEnabled(hasSearch);
- fRemoveAllSearchesAction.setEnabled(hasSearch);
- fSortDropDownAction = new SortDropDownAction(this);
- fSortDropDownAction.setEnabled(getItemCount() > 0);
- fSearchDropDownAction= new SearchDropDownAction(this);
- fSearchDropDownAction.setEnabled(hasSearch);
- fCopyToClipboardAction= new CopyToClipboardAction(this);
-
- addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged(true);
- }
- }
- );
-
- getTable().addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {
- showResult();
- }
- });
-
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(
- new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- SearchPlugin.createStandardGroups(mgr);
- fillContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(getTable());
- getTable().setMenu(menu);
-
- // Register menu
- fOuterPart.getSite().registerContextMenu(menuMgr, this);
- }
-
- private void handleSelectionChanged(boolean updateMarkerToShow) {
-
- int selectionCount= getSelectedEntriesCount();
- boolean hasSingleSelection= selectionCount == 1;
- boolean hasElements= getItemCount() > 0;
- fShowNextResultAction.setEnabled(hasSingleSelection || (hasElements && selectionCount == 0));
- fShowPreviousResultAction.setEnabled(hasSingleSelection || (hasElements && selectionCount == 0));
- fGotoMarkerAction.setEnabled(hasSingleSelection);
- fRemoveMatchAction.setEnabled(hasSingleSelection);
- if (updateMarkerToShow && fHandleNextSelectionChangedEvent) {
- fMarkerToShow= -1;
- } else
- fHandleNextSelectionChangedEvent= true;
-
- if (!updateMarkerToShow)
- fHandleNextSelectionChangedEvent= false;
-
- String location= ""; //$NON-NLS-1$
- if (hasSingleSelection) {
- ISearchResultViewEntry entry= (ISearchResultViewEntry)getTable().getItem(getTable().getSelectionIndex()).getData();
- IPath path= entry.getResource().getFullPath();
- if (path != null)
- location= path.makeRelative().toString();
- }
- setStatusLineMessage(location);
-
- }
-
- void enableActions() {
- /*
- * Note: The check before each set operation reduces flickering
- */
- boolean state= getItemCount() > 0;
- if (state != fShowNextResultAction.isEnabled())
- fShowNextResultAction.setEnabled(state);
- if (state != fShowPreviousResultAction.isEnabled())
- fShowPreviousResultAction.setEnabled(state);
- if (state != fSortDropDownAction.isEnabled())
- fSortDropDownAction.setEnabled(state);
-
- state= SearchManager.getDefault().getCurrentSearch() != null;
- if (state != fRemoveAllSearchesAction.isEnabled())
- fRemoveAllSearchesAction.setEnabled(state);
- if (state != fSearchDropDownAction.isEnabled())
- fSearchDropDownAction.setEnabled(state);
- if (state != fSearchAgainAction.isEnabled())
- fSearchAgainAction.setEnabled(state);
-
- state= !getSelection().isEmpty();
- if (state != fGotoMarkerAction.isEnabled())
- fGotoMarkerAction.setEnabled(state);
- if (state != fRemoveMatchAction.isEnabled())
- fRemoveMatchAction.setEnabled(state);
- }
-
-
- protected void inputChanged(Object input, Object oldInput) {
- getTable().removeAll();
- super.inputChanged(input, oldInput);
- fMarkerToShow= -1;
- updateTitle();
- enableActions();
- if (getItemCount() > 0)
- selectResult(getTable(), 0);
- }
-
- protected int getSelectedEntriesCount() {
- ISelection s= getSelection();
- if (s == null || s.isEmpty() || !(s instanceof IStructuredSelection))
- return 0;
- IStructuredSelection selection= (IStructuredSelection)s;
- return selection.size();
- }
-
- //--- Contribution management -----------------------------------------------
-
-
- protected boolean enableRemoveMatchMenuItem() {
- if (getSelectedEntriesCount() != 1)
- return false;
- Table table= getTable();
- int index= table.getSelectionIndex();
- SearchResultViewEntry entry= null;
- if (index > -1)
- entry= (SearchResultViewEntry)table.getItem(index).getData();
- return (entry != null && entry.getMatchCount() > 1);
-
- }
-
- void fillContextMenu(IMenuManager menu) {
-
- if (fgContextMenuContributor != null)
- fgContextMenuContributor.fill(menu, this);
-
- if (!getSelection().isEmpty()) {
- menu.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, fCopyToClipboardAction);
- menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fGotoMarkerAction);
- if (enableRemoveMatchMenuItem())
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fRemoveMatchAction);
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new RemoveResultAction(this));
- }
-
- // If we have elements
- if (getItemCount() > 0)
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new RemoveAllResultsAction());
-
- menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSearchAgainAction);
- menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSortDropDownAction);
-
-
- }
-
-
- IAction getGotoMarkerAction() {
- // null as return value is covered (no action will take place)
- return fgGotoMarkerAction;
- }
-
- void setGotoMarkerAction(IAction gotoMarkerAction) {
- fgGotoMarkerAction= gotoMarkerAction;
- }
-
-
- void setContextMenuTarget(IContextMenuContributor contributor) {
- fgContextMenuContributor= contributor;
- }
-
-
- void setPageId(String pageId) {
- fSortDropDownAction.setPageId(pageId);
- ILabelProvider labelProvider= fOuterPart.getLabelProvider(pageId);
- if (labelProvider != null)
- internalSetLabelProvider(labelProvider);
- }
-
- void fillToolBar(IToolBarManager tbm) {
- tbm.add(fShowNextResultAction);
- tbm.add(fShowPreviousResultAction);
- tbm.add(fGotoMarkerAction);
- tbm.add(fRemoveMatchAction);
- tbm.add(new Separator());
- tbm.add(new OpenSearchDialogAction());
- tbm.add(fRemoveAllSearchesAction);
- tbm.add(fSearchDropDownAction);
-
- // need to hook F5 to table
- getTable().addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.F5) {
- fSearchAgainAction.run();
- return; // performance
- }
- if (e.character == SWT.DEL) {
- new RemoveResultAction(SearchResultViewer.this).run();
- return; // performance
- }
- if (e.stateMask == SWT.CTRL && e.character == 'E'-0x40) {
- showNextResult();
- return; // performance
- }
- if (e.stateMask == (SWT.CTRL | SWT.SHIFT) && e.character == 'E'-0x40) {
- showPreviousResult();
- return; // performance
- }
- }
- });
- }
-
- int getItemCount() {
- return SearchManager.getDefault().getCurrentItemCount();
- }
-
- void internalSetLabelProvider(ILabelProvider provider) {
- setLabelProvider(new SearchResultLabelProvider(provider, PlatformUI.getWorkbench().getDecoratorManager()));
- }
-
- /**
- * Makes the first marker of the current result entry
- * visible in an editor. If no result
- * is visible, this method does nothing.
- */
- public void showResult() {
- Table table= getTable();
- if (!canDoShowResult(table))
- return;
-
-
- int index= table.getSelectionIndex();
- if (index < 0)
- return;
- SearchResultViewEntry entry= (SearchResultViewEntry)getTable().getItem(index).getData();
-
-
- fMarkerToShow= 0;
- entry.setSelectedMarkerIndex(0);
- openCurrentSelection();
- }
-
-
- /**
- * Makes the next result (marker) visible in an editor. If no result
- * is visible, this method makes the first result visible.
- */
- public void showNextResult() {
- Table table= getTable();
- if (!canDoShowResult(table))
- return;
-
- int index= table.getSelectionIndex();
- SearchResultViewEntry entry= null;
- if (index > -1)
- entry= (SearchResultViewEntry)table.getItem(index).getData();
-
-
- fMarkerToShow++;
- if (entry == null || fMarkerToShow >= entry.getMatchCount()) {
- // move selection
- if (index == -1) {
- index= 0;
- } else {
- index++;
- if (index >= table.getItemCount())
- index= 0;
- }
- fMarkerToShow= 0;
- entry= (SearchResultViewEntry)getTable().getItem(index).getData();
- selectResult(table, index);
- }
- entry.setSelectedMarkerIndex(fMarkerToShow);
- openCurrentSelection();
- }
-
-
- /**
- * Makes the previous result (marker) visible. If there isn't any
- * visible result, this method makes the last result visible.
- */
- public void showPreviousResult() {
- Table table= getTable();
- if (!canDoShowResult(table))
- return;
-
- int index= table.getSelectionIndex();
- SearchResultViewEntry entry;
-
-
- fMarkerToShow--;
- if (fMarkerToShow >= 0)
- entry= (SearchResultViewEntry)getTable().getItem(getTable().getSelectionIndex()).getData();
- else {
- // move selection
- int count= table.getItemCount();
- if (index == -1) {
- index= count - 1;
- } else {
- index--;
- if (index < 0)
- index= count - 1;
- }
- entry= (SearchResultViewEntry)getTable().getItem(index).getData();
- fMarkerToShow= entry.getMatchCount() - 1;
- selectResult(table, index);
- }
- entry.setSelectedMarkerIndex(fMarkerToShow);
- openCurrentSelection();
- }
-
- private boolean canDoShowResult(Table table) {
- if (table == null || getItemCount() == 0)
- return false;
- return true;
- }
-
- private void selectResult(Table table, int index) {
- table.setSelection(index);
- table.showSelection();
- handleSelectionChanged(false);
- }
-
- private void openCurrentSelection() {
- IAction action= getGotoMarkerAction();
- if (action != null)
- action.run();
- }
-
- /**
- * Update the title
- */
- protected void updateTitle() {
- boolean hasCurrentSearch= SearchManager.getDefault().getCurrentSearch() != null;
- String title;
- if (hasCurrentSearch) {
- String description= SearchManager.getDefault().getCurrentSearch().getFullDescription();
- title= SearchMessages.getFormattedString("SearchResultView.titleWithDescription", description); //$NON-NLS-1$
- } else
- title= SearchMessages.getString("SearchResultView.title"); //$NON-NLS-1$
- if (title == null || !title.equals(fOuterPart.getTitle()))
- fOuterPart.setTitle(title);
- }
-
- /**
- * Clear the title
- */
- protected void clearTitle() {
- String title= SearchMessages.getString("SearchResultView.title"); //$NON-NLS-1$
- if (title == null || !title.equals(fOuterPart.getTitle()))
- fOuterPart.setTitle(title);
- }
-
- /**
- * Sets the message text to be displayed on the status line.
- * The image on the status line is cleared.
- */
- private void setStatusLineMessage(String message) {
- fOuterPart.getViewSite().getActionBars().getStatusLineManager().setMessage(message);
- }
-
-
- protected void handleDispose(DisposeEvent event) {
- Menu menu= getTable().getMenu();
- if (menu != null)
- menu.dispose();
- super.handleDispose(event);
- }
-
- //--- Change event handling -------------------------------------------------
-
- /**
- * Handle a single add.
- */
- protected void handleAddMatch(ISearchResultViewEntry entry) {
- insert(entry, -1);
- }
-
- /**
- * Handle a single remove.
- */
- protected void handleRemoveMatch(ISearchResultViewEntry entry) {
- Widget item= findItem(entry);
- if (entry.getMatchCount() == 0) {
- if (item instanceof TableItem) {
- TableItem ti= (TableItem)item;
- disassociate(ti);
- ti.dispose();
- }
- }
- else
- updateItem(item, entry);
- }
-
- /**
- * Handle remove all.
- */
- protected void handleRemoveAll() {
- setInput(null);
- }
-
- /**
- * Handle an update of an entry.
- */
- protected void handleUpdateMatch(ISearchResultViewEntry entry) {
- Widget item= findItem(entry);
- updateItem(item, entry);
- }
-
- //--- Persistency -------------------------------------------------
-
- void restoreState(IMemento memento) {
- fSortDropDownAction.restoreState(memento);
- }
-
- void saveState(IMemento memento) {
- fSortDropDownAction.saveState(memento);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java
deleted file mode 100644
index c23f4f791..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class ShowNextResultAction extends Action {
-
- private SearchResultViewer fViewer;
-
- public ShowNextResultAction(SearchResultViewer viewer) {
- super(SearchMessages.getString("SearchResultView.showNext.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_NEXT);
- setToolTipText(SearchMessages.getString("SearchResultView.showNext.tooltip")); //$NON-NLS-1$
- fViewer= viewer;
- }
-
- public void run() {
- fViewer.showNextResult();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java
deleted file mode 100644
index 2d722ceb7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class ShowPreviousResultAction extends Action {
-
- private SearchResultViewer fViewer;
-
- public ShowPreviousResultAction(SearchResultViewer viewer) {
- super(SearchMessages.getString("SearchResultView.showPrev.text")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_PREV);
- setToolTipText(SearchMessages.getString("SearchResultView.showPrev.tooltip")); //$NON-NLS-1$
- fViewer= viewer;
- }
-
- public void run() {
- fViewer.showPreviousResult();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java
deleted file mode 100644
index 33c3574ff..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.core.resources.IMarker;
-
-class ShowSearchAction extends Action {
- private Search fSearch;
- private IMarker[] fMarkerArrayTemplate= new IMarker[0];
-
- /**
- * Create a new instance of this class
- */
- public ShowSearchAction(Search search) {
- fSearch= search;
- String desc= search.getShortDescription();
- setText(desc);
- setToolTipText(desc);
- setImageDescriptor(search.getImageDescriptor());
- }
- /**
- * Invoke the resource wizard selection wizard
- *
- * @param browser org.eclipse.jface.parts.Window
- */
- public void run() {
- if (fSearch != SearchManager.getDefault().getCurrentSearch())
- SearchManager.getDefault().setCurrentSearch(fSearch);
- }
-}
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
deleted file mode 100644
index f31acf1b1..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.LabelProvider;
-
-import org.eclipse.search.internal.ui.util.ListDialog;
-
-/**
- * Invoke the resource creation wizard selection Wizard.
- * This action will retarget to the active view.
- */
-class ShowSearchesAction extends Action {
-
- private static final LabelProvider fgLabelProvider= new LabelProvider() {
- public String getText(Object element) {
- if (!(element instanceof ShowSearchAction))
- return ""; //$NON-NLS-1$
- return ((ShowSearchAction)element).getText();
- }
- public Image getImage(Object element) {
- if (!(element instanceof ShowSearchAction))
- return null;
- return ((ShowSearchAction)element).getImageDescriptor().createImage();
- }
- };
-
- /**
- * Create a new instance of this class
- */
- public ShowSearchesAction() {
- super(SearchMessages.getString("ShowOtherSearchesAction.label")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("ShowOtherSearchesAction.tooltip")); //$NON-NLS-1$
- }
- /*
- * Overrides method from Action
- */
- public void run() {
- run(false);
- }
-
- public void run(boolean showAll) {
- Iterator iter= SearchManager.getDefault().getPreviousSearches().iterator();
- int cutOffSize;
- if (showAll)
- cutOffSize= 0;
- else
- cutOffSize= SearchDropDownAction.RESULTS_IN_DROP_DOWN;
- int size= SearchManager.getDefault().getPreviousSearches().size() - cutOffSize;
- Search selectedSearch= SearchManager.getDefault().getCurrentSearch();
- Action selectedAction = null;
- ArrayList input= new ArrayList(size);
- int i= 0;
- while (iter.hasNext()) {
- Search search= (Search)iter.next();
- if (i++ < cutOffSize)
- continue;
- Action action= new ShowSearchAction(search);
- input.add(action);
- if (selectedSearch == search)
- selectedAction= action;
- }
-
- // Open a list dialog.
- String title;
- String message;
- if (showAll) {
- title= SearchMessages.getString("PreviousSearchesDialog.title"); //$NON-NLS-1$
- message= SearchMessages.getString("PreviousSearchesDialog.message"); //$NON-NLS-1$
- }
- else {
- 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);
- if (selectedAction != null) {
- Object[] selected= new Object[1];
- selected[0]= selectedAction;
- dlg.setInitialSelections(selected);
- }
- if (dlg.open() == dlg.OK) {
- List result= Arrays.asList(dlg.getResult());
- if (result != null && result.size() == 1) {
- ((ShowSearchAction)result.get(0)).run();
- }
- }
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java
deleted file mode 100644
index 2ab96522e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-import org.eclipse.ui.IMemento;
-
-/**
- * Drop down action that holds the currently registered sort actions.
- */
-class SortDropDownAction extends Action implements IMenuCreator {
-
- // Persistance tags.
- private static final String TAG_SORTERS= "sorters"; //$NON-NLS-1$
- private static final String TAG_DEFAULT_SORTERS= "defaultSorters"; //$NON-NLS-1$
- private static final String TAG_ELEMENT= "element"; //$NON-NLS-1$
- private static final String TAG_PAGE_ID= "pageId"; //$NON-NLS-1$
- private static final String TAG_SORTER_ID= "sorterId"; //$NON-NLS-1$
-
- private static Map fgLastCheckedForType= new HashMap(5);;
-
- private SearchResultViewer fViewer;
- private String fPageId;
- private Menu fMenu;
- private String fCheckedId;
- private Map fLastCheckedForType;
-
- public SortDropDownAction(SearchResultViewer viewer) {
- super(SearchMessages.getString("SortDropDownAction.label")); //$NON-NLS-1$
- SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_LCL, SearchPluginImages.IMG_LCL_SEARCH_SORT);
- fViewer= viewer;
- setToolTipText(SearchMessages.getString("SortDropDownAction.tooltip")); //$NON-NLS-1$
- setMenuCreator(this);
- fLastCheckedForType= new HashMap(5);
- }
-
- public void dispose() {
- fViewer= null;
- fPageId= null;
- fLastCheckedForType= null;
- }
-
- public Menu getMenu(Control parent) {
- return null;
- }
-
- void setPageId(String pageId) {
- fPageId= pageId;
- SorterDescriptor sorterDesc= (SorterDescriptor)fLastCheckedForType.get(pageId);
- if (sorterDesc == null)
- sorterDesc= (SorterDescriptor)fgLastCheckedForType.get(pageId);
- if (sorterDesc == null)
- sorterDesc= findSorter(fPageId);
- if (sorterDesc != null) {
- setChecked(sorterDesc);
- fViewer.setSorter(sorterDesc.createObject());
- }
- }
-
- public Menu getMenu(final Menu parent) {
- boolean hasEntries= false;
- Menu menu= new Menu(parent);
- Iterator iter= SearchPlugin.getDefault().getSorterDescriptors().iterator();
- while (iter.hasNext()) {
- Object value= fLastCheckedForType.get(fPageId);
- final String checkedId;
- if (value instanceof SorterDescriptor)
- checkedId= ((SorterDescriptor)value).getId();
- else
- checkedId= ""; //$NON-NLS-1$
-
- final SorterDescriptor sorterDesc= (SorterDescriptor) iter.next();
- if (!sorterDesc.getPageId().equals(fPageId) && !sorterDesc.getPageId().equals("*")) //$NON-NLS-1$
- continue;
- final ViewerSorter sorter= sorterDesc.createObject();
- if (sorter != null) {
- final Action action= new Action() {
- public void run() {
- if (!checkedId.equals(sorterDesc.getId())) {
- SortDropDownAction.this.setChecked(sorterDesc);
- BusyIndicator.showWhile(parent.getDisplay(), new Runnable() {
- public void run() {
- fViewer.setSorter(sorter);
- }
- });
- }
- }
- };
- action.setText(sorterDesc.getLabel());
- action.setImageDescriptor(sorterDesc.getImage());
- action.setToolTipText(sorterDesc.getToolTipText());
- action.setChecked(checkedId.equals(sorterDesc.getId()));
- addActionToMenu(menu, action);
- hasEntries= true;
- }
- }
- setEnabled(hasEntries);
- return menu;
- }
-
- protected void addActionToMenu(Menu parent, Action action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- public void run() {
- // nothing to do
- }
-
- private SorterDescriptor findSorter(String pageId) {
- Iterator iter= SearchPlugin.getDefault().getSorterDescriptors().iterator();
- while (iter.hasNext()) {
- SorterDescriptor sorterDesc= (SorterDescriptor)iter.next();
- if (sorterDesc.getPageId().equals(pageId) || sorterDesc.getPageId().equals("*")) //$NON-NLS-1$
- return sorterDesc;
- }
- return null;
- }
-
- private SorterDescriptor getSorter(String sorterId) {
- Iterator iter= SearchPlugin.getDefault().getSorterDescriptors().iterator();
- while (iter.hasNext()) {
- SorterDescriptor sorterDesc= (SorterDescriptor)iter.next();
- if (sorterDesc.getId().equals(sorterId))
- return sorterDesc;
- }
- return null;
- }
-
- private void setChecked(SorterDescriptor sorterDesc) {
- fLastCheckedForType.put(fPageId, sorterDesc);
- fgLastCheckedForType.put(fPageId, sorterDesc);
- }
-
- //--- Persistency -------------------------------------------------
-
- void restoreState(IMemento memento) {
- if (fLastCheckedForType.isEmpty())
- restoreState(memento, fLastCheckedForType, TAG_SORTERS);
- if (fgLastCheckedForType.isEmpty())
- restoreState(memento, fgLastCheckedForType, TAG_DEFAULT_SORTERS);
- }
-
- private void restoreState(IMemento memento, Map map, String mapName) {
- memento= memento.getChild(mapName);
- if (memento == null)
- return;
- IMemento[] mementoElements= memento.getChildren(TAG_ELEMENT);
- for (int i= 0; i < mementoElements.length; i++) {
- String pageId= mementoElements[i].getString(TAG_PAGE_ID);
- String sorterId= mementoElements[i].getString(TAG_SORTER_ID);
- SorterDescriptor sorterDesc= getSorter(sorterId);
- if (sorterDesc != null)
- map.put(pageId, sorterDesc);
- }
- }
-
- void saveState(IMemento memento) {
- saveState(memento, fgLastCheckedForType, TAG_DEFAULT_SORTERS);
- saveState(memento, fLastCheckedForType, TAG_SORTERS);
- }
-
- private void saveState(IMemento memento, Map map, String mapName) {
- Iterator iter= map.entrySet().iterator();
- memento= memento.createChild(mapName);
- while (iter.hasNext()) {
- IMemento mementoElement= memento.createChild(TAG_ELEMENT);
- Map.Entry entry= (Map.Entry)iter.next();
- mementoElement.putString(TAG_PAGE_ID, (String)entry.getKey());
- mementoElement.putString(TAG_SORTER_ID, ((SorterDescriptor)entry.getValue()).getId());
- }
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java
deleted file mode 100644
index 63a569c35..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-/**
- * Proxy that represents a sorter.
- */
-class SorterDescriptor {
-
- public final static String SORTER_TAG= "sorter"; //$NON-NLS-1$
- private final static String ID_ATTRIBUTE= "id"; //$NON-NLS-1$
- private final static String PAGE_ID_ATTRIBUTE= "pageId"; //$NON-NLS-1$
- private final static String ICON_ATTRIBUTE= "icon"; //$NON-NLS-1$
- private final static String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$
- private final static String LABEL_ATTRIBUTE= "label"; //$NON-NLS-1$
- private final static String TOOLTIP_ATTRIBUTE= "tooltip"; //$NON-NLS-1$
-
- private IConfigurationElement fElement;
-
- /**
- * Creates a new sorter node with the given configuration element.
- */
- public SorterDescriptor(IConfigurationElement element) {
- fElement= element;
- }
-
- /**
- * Creates a new sorter from this node.
- */
- public ViewerSorter createObject() {
- try {
- return (ViewerSorter)fElement.createExecutableExtension(CLASS_ATTRIBUTE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- } catch (ClassCastException ex) {
- ExceptionHandler.displayMessageDialog(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
- }
-
- //---- XML Attribute accessors ---------------------------------------------
-
- /**
- * Returns the sorter's id.
- */
- public String getId() {
- return fElement.getAttribute(ID_ATTRIBUTE);
- }
-
- /**
- * Returns the sorter's image
- */
- public ImageDescriptor getImage() {
- String imageName= fElement.getAttribute(ICON_ATTRIBUTE);
- if (imageName == null)
- return null;
- URL url;
- try {
- url= new URL(fElement.getDeclaringExtension().getDeclaringPluginDescriptor().getInstallURL(), imageName);
- } catch (java.net.MalformedURLException ex) {
- ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
- return ImageDescriptor.createFromURL(url);
- }
-
- /**
- * Returns the sorter's label.
- */
- public String getLabel() {
- return fElement.getAttribute(LABEL_ATTRIBUTE);
- }
-
- /**
- * Returns the sorter's preferred size
- */
- public String getToolTipText() {
- return fElement.getAttribute(TOOLTIP_ATTRIBUTE);
- }
-
- /**
- * Returns the sorter's preferred size
- */
- public String getPageId() {
- return fElement.getAttribute(PAGE_ID_ATTRIBUTE);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java
deleted file mode 100644
index 38c1cd93e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-class GotoMarkerAction extends Action {
-
- private IEditorPart fEditor;
-
- public void run() {
- ISearchResultView view= SearchUI.getSearchResultView();
- ISelection selection= view.getSelection();
- Object element= null;
- if (selection instanceof IStructuredSelection)
- element= ((IStructuredSelection)selection).getFirstElement();
- if (element instanceof ISearchResultViewEntry) {
- ISearchResultViewEntry entry= (ISearchResultViewEntry)element;
- show(entry.getSelectedMarker());
- }
- }
-
- private void show(IMarker marker) {
- if (SearchUI.reuseEditor())
- showWithReuse(marker);
- else
- showWithoutReuse(marker);
- }
-
- private void showWithReuse(IMarker marker) {
- IWorkbenchPage page= SearchPlugin.getActivePage();
- IResource resource= marker.getResource();
- if (page == null || !(resource instanceof IFile))
- return;
-
- IEditorInput input= new FileEditorInput((IFile)resource);
- String editorId= null;
- IEditorDescriptor desc= SearchPlugin.getDefault().getWorkbench().getEditorRegistry().getDefaultEditor((IFile)resource);
- if (desc == null)
- editorId= SearchPlugin.getDefault().getWorkbench().getEditorRegistry().getDefaultEditor().getId();
- else
- editorId= desc.getId();
-
- IEditorPart editor= null;
- IEditorPart[] editorParts= page.getEditors();
- for (int i= 0; i < editorParts.length; i++) {
- IEditorPart part= editorParts[i];
- if (input.equals(part.getEditorInput())) {
- editor= part;
- break;
- }
- }
- if (editor == null) {
- if (fEditor != null && !fEditor.isDirty())
- page.closeEditor(fEditor, false);
- try {
- editor= page.openEditor(input, editorId, false);
- } catch (PartInitException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.openEditor.title"), SearchMessages.getString("Search.Error.openEditor.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return;
- }
-
- } else {
- page.bringToTop(editor);
- }
- if (editor != null) {
- editor.gotoMarker(marker);
- fEditor= editor;
- }
- }
-
- private void showWithoutReuse(IMarker marker) {
- IWorkbenchPage page= SearchPlugin.getActivePage();
- if (page == null)
- return;
-
- try {
- page.openEditor(marker, false);
- } catch (PartInitException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.openEditor.title"), SearchMessages.getString("Search.Error.openEditor.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return;
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java
deleted file mode 100644
index d33db3f91..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.core.resources.IMarker;
-
-import org.eclipse.search.ui.IGroupByKeyComputer;
-
-class GroupByKeyComputer implements IGroupByKeyComputer {
-
- public Object computeGroupByKey(IMarker marker) {
- if (marker == null)
- return null;
- else
- return marker.getResource();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java
deleted file mode 100644
index 2893a7e35..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-import org.eclipse.search.internal.ui.util.FileLabelProvider;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-/**
- * Sorts the search result viewer by the resource path.
- */
-public class ResourcePathSorter extends ViewerSorter {
-
- /*
- * Overrides method from ViewerSorter
- */
- public int compare(Viewer viewer, Object e1, Object e2) {
- String name1= null;
- String name2= null;
-
- if (e1 instanceof ISearchResultViewEntry)
- name1= ((ISearchResultViewEntry)e1).getResource().getFullPath().toString();
- if (e2 instanceof ISearchResultViewEntry)
- name2= ((ISearchResultViewEntry)e2).getResource().getFullPath().toString();
- if (name1 == null)
- name1= ""; //$NON-NLS-1$
- if (name2 == null)
- name2= ""; //$NON-NLS-1$
- return getCollator().compare(name1, name2);
- }
-
- /*
- * Overrides method from ViewerSorter
- */
- public boolean isSorterProperty(Object element, String property) {
- return true;
- }
-
- /*
- * Overrides method from ViewerSorter
- */
- public void sort(Viewer viewer, Object[] elements) {
- // Set label provider to show "resource - path"
- ISearchResultView view= SearchUI.getSearchResultView();
- if (view != null) {
- ILabelProvider labelProvider= view.getLabelProvider();
- if (labelProvider instanceof FileLabelProvider)
- ((FileLabelProvider)labelProvider).setOrder(FileLabelProvider.SHOW_PATH_LABEL);
- }
- super.sort(viewer, elements);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java
deleted file mode 100644
index e6fec02c4..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-import org.eclipse.search.internal.ui.util.FileLabelProvider;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-/**
- * Sorts the search result viewer by the resource name.
- */
-public class ResourcenameSorter extends ViewerSorter {
-
- /*
- * Overrides method from ViewerSorter
- */
- public int compare(Viewer viewer, Object e1, Object e2) {
- String name1= null;
- String name2= null;
-
- if (e1 instanceof ISearchResultViewEntry)
- name1= ((ISearchResultViewEntry)e1).getResource().getName();
- if (e2 instanceof ISearchResultViewEntry)
- name2= ((ISearchResultViewEntry)e2).getResource().getName();
- if (name1 == null)
- name1= ""; //$NON-NLS-1$
- if (name2 == null)
- name2= ""; //$NON-NLS-1$
- return getCollator().compare(name1, name2);
- }
-
- /*
- * Overrides method from ViewerSorter
- */
- public boolean isSorterProperty(Object element, String property) {
- return true;
- }
-
- /*
- * Overrides method from ViewerSorter
- */
- public void sort(Viewer viewer, Object[] elements) {
- // Set label provider to show "resource - path"
- ISearchResultView view= SearchUI.getSearchResultView();
- if (view != null) {
- ILabelProvider labelProvider= view.getLabelProvider();
- if (labelProvider instanceof FileLabelProvider)
- ((FileLabelProvider)labelProvider).setOrder(FileLabelProvider.SHOW_LABEL_PATH);
- }
- super.sort(viewer, elements);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java
deleted file mode 100644
index 4c33134c3..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-import org.eclipse.search.internal.core.ISearchScope;
-import org.eclipse.search.internal.core.text.TextSearchEngine;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.SearchPluginImages;
-
-/**
- * An operation to perform a regular text search.
- */
-public class TextSearchOperation extends WorkspaceModifyOperation {
-
- public static final int NO_PRIORITY_CHANGE= -1;
-
- private IWorkspace fWorkspace;
- private String fPattern;
- private String fOptions;
- private ISearchScope fScope;
- private TextSearchResultCollector fCollector;
-
- /**
- * Creates a new text search operation.
- */
- public TextSearchOperation(IWorkspace workspace, String pattern, String options,
- ISearchScope scope, TextSearchResultCollector collector) {
- Assert.isNotNull(collector);
- fWorkspace= workspace;
- fPattern= pattern;
- fOptions= options;
- fScope= scope;
- fCollector= collector;
- fCollector.setOperation(this);
- }
-
- /**
- * The actual algorithm.
- */
- protected void execute(IProgressMonitor monitor) throws CoreException {
- fCollector.setProgressMonitor(monitor);
- TextSearchEngine engine= new TextSearchEngine();
- engine.search(fWorkspace, fPattern, fOptions, fScope, fCollector);
- }
-
- String getSingularLabel() {
- return SearchMessages.getFormattedString("TextSearchOperation.singularLabelPostfix", new String[] {fPattern, fScope.getDescription()}); //$NON-NLS-2$ //$NON-NLS-1$
- }
-
- String getPluralLabelPattern() {
- return SearchMessages.getFormattedString("TextSearchOperation.pluralLabelPatternPostfix", new String[] {fPattern, "{0}", fScope.getDescription()}); //$NON-NLS-2$ //$NON-NLS-1$
- }
-
- ImageDescriptor getImageDescriptor() {
- return SearchPluginImages.DESC_OBJ_TSEARCH_DPDN;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java
deleted file mode 100644
index ed5c2c403..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-import org.eclipse.search.ui.ISearchPage;
-import org.eclipse.search.ui.ISearchPageContainer;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.IWorkingSet;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.core.text.TextSearchScope;
-import org.eclipse.search.internal.ui.ISearchHelpContextIds;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-import org.eclipse.search.internal.ui.util.FileTypeEditor;
-import org.eclipse.search.internal.ui.util.RowLayouter;
-import org.eclipse.search.internal.ui.util.SWTUtil;
-
-public class TextSearchPage extends DialogPage implements ISearchPage {
-
- public static final String EXTENSION_POINT_ID= "org.eclipse.search.internal.ui.text.TextSearchPage"; //$NON-NLS-1$
-
- // Dialog store id constants
- private final static String PAGE_NAME= "TextSearchPage"; //$NON-NLS-1$
- private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; //$NON-NLS-1$
-
- private static List fgPreviousSearchPatterns= new ArrayList(20);
-
- private IDialogSettings fDialogSettings;
- private boolean fFirstTime= true;
- private boolean fIsCaseSensitive;
-
- private Combo fPattern;
- private Button fIgnoreCase;
- private Combo fExtensions;
-
- private ISearchPageContainer fContainer;
- private FileTypeEditor fFileTypeEditor;
-
-
- private static class SearchPatternData {
- boolean ignoreCase;
- String pattern;
- Set extensions;
- int scope;
- IWorkingSet workingSet;
-
- public SearchPatternData(String pattern, boolean ignoreCase, Set extensions, int scope, IWorkingSet workingSet) {
- this.ignoreCase= ignoreCase;
- this.pattern= pattern;
- this.extensions= extensions;
- this.scope= scope;
- this.workingSet= workingSet;
- }
- }
- //---- Action Handling ------------------------------------------------
-
- public boolean performAction() {
-
- SearchUI.activateSearchResultView();
-
- SearchPatternData patternData= getPatternData();
- if (patternData.pattern == null || patternData.pattern.length() == 0)
- return true;
-
- // Setup search scope
- TextSearchScope scope= null;
- switch (getContainer().getSelectedScope()) {
- case ISearchPageContainer.WORKSPACE_SCOPE:
- scope= TextSearchScope.newWorkspaceScope();
- break;
- case ISearchPageContainer.SELECTION_SCOPE:
- scope= getSelectedResourcesScope();
- break;
- case ISearchPageContainer.WORKING_SET_SCOPE:
- IWorkingSet workingSet= getContainer().getSelectedWorkingSet();
- String desc= SearchMessages.getFormattedString("WorkingSetScope", workingSet.getName()); //$NON-NLS-1$
- scope= new TextSearchScope(desc, workingSet.getResources());
- }
- scope.addExtensions(patternData.extensions);
-
- TextSearchResultCollector collector= new TextSearchResultCollector();
-
- TextSearchOperation op= new TextSearchOperation(
- SearchPlugin.getWorkspace(),
- patternData.pattern,
- getSearchOptions(),
- scope,
- collector);
-
- IRunnableContext context= null;
- context= getContainer().getRunnableContext();
-
- Shell shell= fPattern.getShell();
- if (context == null)
- context= new ProgressMonitorDialog(shell);
-
- try {
- context.run(true, true, op);
- } catch (InvocationTargetException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.search.title"),SearchMessages.getString("Search.Error.search.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return false;
- } catch (InterruptedException e) {
- return false;
- }
- return true;
- }
-
- private String getPattern() {
- return fPattern.getText();
- }
-
- /**
- * Return search pattern data and update previous searches.
- * An existing entry will be updated.
- */
- private SearchPatternData getPatternData() {
- String pattern= getPattern();
- SearchPatternData match= null;
- int i= 0;
- int size= fgPreviousSearchPatterns.size();
- while (match == null && i < size) {
- match= (SearchPatternData) fgPreviousSearchPatterns.get(i);
- i++;
- if (!pattern.equals(match.pattern))
- match= null;
- };
- if (match == null) {
- match= new SearchPatternData(
- pattern,
- ignoreCase(),
- getExtensions(),
- getContainer().getSelectedScope(),
- getContainer().getSelectedWorkingSet());
- fgPreviousSearchPatterns.add(match);
- }
- else {
- match.ignoreCase= ignoreCase();
- match.extensions= getExtensions();
- match.scope= getContainer().getSelectedScope();
- match.workingSet= getContainer().getSelectedWorkingSet();
- };
- return match;
- }
-
- private String[] getPreviousExtensions() {
- List extensions= new ArrayList(fgPreviousSearchPatterns.size());
- for (int i= fgPreviousSearchPatterns.size() -1 ; i >= 0; i--) {
- SearchPatternData data= (SearchPatternData)fgPreviousSearchPatterns.get(i);
- String text= FileTypeEditor.typesToString(data.extensions);
- if (!extensions.contains(text))
- extensions.add(text);
- }
- return (String[])extensions.toArray(new String[extensions.size()]);
- }
-
- private String[] getPreviousSearchPatterns() {
- int size= fgPreviousSearchPatterns.size();
- String [] patterns= new String[size];
- for (int i= 0; i < size; i++)
- patterns[i]= ((SearchPatternData) fgPreviousSearchPatterns.get(size - 1 - i)).pattern;
- return patterns;
- }
-
- private String getSearchOptions() {
- StringBuffer result= new StringBuffer();
- if (!ignoreCase())
- result.append("i"); //$NON-NLS-1$
- return result.toString();
- }
-
- private Display getTargetDisplay() {
- return fPattern.getDisplay();
- }
-
- private Set getExtensions() {
- return fFileTypeEditor.getFileTypes();
- }
-
- private boolean ignoreCase() {
- return fIgnoreCase.getSelection();
- }
-
- /*
- * Implements method from IDialogPage
- */
- public void setVisible(boolean visible) {
- if (visible && fPattern != null) {
- if (fFirstTime) {
- fFirstTime= false;
- // Set item and text here to prevent page from resizing
- fPattern.setItems(getPreviousSearchPatterns());
- fExtensions.setItems(getPreviousExtensions());
- initializePatternControl();
- }
- fPattern.setFocus();
- getContainer().setPerformActionEnabled(fPattern.getText().length() > 0 && getContainer().hasValidScope());
- }
- super.setVisible(visible);
- }
-
- //---- Widget creation ------------------------------------------------
-
- /**
- * Creates the page's content.
- */
- public void createControl(Composite parent) {
- readConfiguration();
-
- GridLayout layout;
- GridData gd;
- Label label;
- RowLayouter layouter;
- Composite result= new Composite(parent, SWT.NONE);
- result.setLayout(new GridLayout());
-
- // Search Expression
- Group group= new Group(result, SWT.NONE);
- group.setText(SearchMessages.getString("SearchPage.expression.label")); //$NON-NLS-1$
- layout= new GridLayout();
- layout.numColumns= 2;
- group.setLayout(layout);
- layouter= new RowLayouter(2);
- layouter.setDefaultSpan();
-
- // Pattern combo
- fPattern= new Combo(group, SWT.SINGLE | SWT.BORDER);
- // Not done here to prevent page from resizing
- // fPattern.setItems(getPreviousSearchPatterns());
- fPattern.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleWidgetSelected();
- }
- });
- fPattern.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- getContainer().setPerformActionEnabled(getPattern().length() > 0 && getContainer().hasValidScope());
- }
- });
-
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint= convertWidthInCharsToPixels(30);
- fPattern.setLayoutData(gd);
-
- layouter.perform( new Control[] { fPattern }, 0);
-
- label= new Label(group, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.expression.pattern")); //$NON-NLS-1$
- fIgnoreCase= new Button(group, SWT.CHECK);
- fIgnoreCase.setText(SearchMessages.getString("SearchPage.caseSensitive")); //$NON-NLS-1$
- gd= new GridData(); gd.horizontalAlignment= gd.END;
- fIgnoreCase.setLayoutData(gd);
- layouter.perform( new Control[] {label, fIgnoreCase}, -1);
- fIgnoreCase.setSelection(!fIsCaseSensitive);
- fIgnoreCase.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fIsCaseSensitive= !fIgnoreCase.getSelection();
- writeConfiguration();
- }
- });
-
- Control control= makeExtensionEditor(group);
- layouter.perform( new Control[] { control }, 0);
-
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- setControl(result);
-
- WorkbenchHelp.setHelp(result, ISearchHelpContextIds.TEXT_SEARCH_PAGE);
- }
-
- private void handleWidgetSelected() {
- if (fPattern.getSelectionIndex() < 0)
- return;
- int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex();
- SearchPatternData patternData= (SearchPatternData) fgPreviousSearchPatterns.get(index);
- fIgnoreCase.setSelection(patternData.ignoreCase);
- fPattern.setText(patternData.pattern);
- fFileTypeEditor.setFileTypes(patternData.extensions);
- if (patternData.workingSet != null)
- getContainer().setSelectedWorkingSet(patternData.workingSet);
- else
- getContainer().setSelectedScope(patternData.scope);
- }
-
- private void initializePatternControl() {
- ISelection selection= getSelection();
- String text= ""; //$NON-NLS-1$
- String extension= null; //$NON-NLS-1$
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection= (ITextSelection)getSelection();
- text= textSelection.getText();
- } else {
- IResource resource= null;
- Object item= null;
- if (selection instanceof IStructuredSelection)
- item= ((IStructuredSelection)selection).getFirstElement();
- if (item instanceof IResource) {
- resource= (IResource)item;
- text= resource.getName();
- }
- else if (item instanceof ISearchResultViewEntry) {
- IMarker marker= (IMarker)((ISearchResultViewEntry)item).getSelectedMarker();
- resource= marker.getResource();
- try {
- text= (String)marker.getAttribute(SearchUI.LINE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.markerAttributeAccess.title"), SearchMessages.getString("Search.Error.markerAttributeAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$
- text= ""; //$NON-NLS-1$
- }
- } else if (item instanceof IAdaptable) {
- Object adapter= ((IAdaptable)item).getAdapter(IWorkbenchAdapter.class);
- if (adapter instanceof IWorkbenchAdapter)
- text= ((IWorkbenchAdapter)adapter).getLabel(item);
-
- adapter= ((IAdaptable)item).getAdapter(IResource.class);
- if (adapter instanceof IResource) {
- resource= (IResource)adapter;
- if (text == null) // keep text, if provided by workbench adapter
- text= resource.getName();
- }
- }
- if (resource instanceof IFile ) {
- extension= resource.getFileExtension();
- if (extension == null)
- extension= resource.getName();
- else
- extension= "*." + extension; //$NON-NLS-1$
- }
- else
- extension= "*"; //$NON-NLS-1$
- }
- fPattern.setText(insertEscapeChars(text));
-
- if (getPreviousExtensions().length > 0)
- fExtensions.setText(getPreviousExtensions()[0]);
- else {
- if (extension == null)
- extension= getExtensionFromEditor();
- if (extension != null)
- fExtensions.setText(extension);
- }
- }
-
- private String insertEscapeChars(String text) {
- if (text == null || text.equals("")) //$NON-NLS-1$
- return ""; //$NON-NLS-1$
- StringBuffer sbIn= new StringBuffer(text);
- BufferedReader reader= new BufferedReader(new StringReader(text));
- int lengthOfFirstLine= 0;
- try {
- lengthOfFirstLine= reader.readLine().length();
- } catch (IOException ex) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer sbOut= new StringBuffer(lengthOfFirstLine + 5);
- int i= 0;
- while (i < lengthOfFirstLine) {
- char ch= sbIn.charAt(i);
- if (ch == '*' || ch == '?' || ch == '\\')
- sbOut.append("\\"); //$NON-NLS-1$
- sbOut.append(ch);
- i= i+1;
- };
- return sbOut.toString();
- }
-
- private String getExtensionFromEditor() {
- IEditorPart ep= SearchPlugin.getActivePage().getActiveEditor();
- if (ep != null) {
- Object elem= ep.getEditorInput();
- if (elem instanceof IFileEditorInput) {
- String extension= ((IFileEditorInput)elem).getFile().getFileExtension();
- if (extension == null)
- return ((IFileEditorInput)elem).getFile().getName();
- else
- return "*." + extension; //$NON-NLS-1$
- }
- }
- return null;
- }
-
- private Composite makeExtensionEditor(Composite parent) {
- Composite result= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginWidth= 0; layout.marginHeight= 0;
- layout.numColumns= 3;
- result.setLayout(layout);
-
- Label label= new Label(result, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.extensions")); //$NON-NLS-1$
-
-// fExtensions= new Text(result, SWT.LEFT | SWT.BORDER);
- fExtensions= new Combo(result, SWT.SINGLE | SWT.BORDER);
-// fExtensions.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent e) {
-// handleWidgetSelected();
-// }
-// });
-
-
- GridData gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint= convertWidthInCharsToPixels(30);
- fExtensions.setLayoutData(gd);
-
- Button button= new Button(result, SWT.PUSH);
- button.setText(SearchMessages.getString("SearchPage.browse")); //$NON-NLS-1$
- button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- SWTUtil.setButtonDimensionHint(button);
-
- fFileTypeEditor= new FileTypeEditor(
- SearchPlugin.getDefault().getWorkbench().getEditorRegistry(),
- fExtensions, button);
-
- return result;
- }
-
- public boolean isValid() {
- return true;
- }
-
- /**
- * Sets the search page's container.
- */
- public void setContainer(ISearchPageContainer container) {
- fContainer= container;
- }
-
- /**
- * Returns the search page's container.
- */
- private ISearchPageContainer getContainer() {
- return fContainer;
- }
-
- /**
- * Returns the current active selection.
- */
- private ISelection getSelection() {
- return fContainer.getSelection();
- }
-
- private TextSearchScope getSelectedResourcesScope() {
- TextSearchScope scope= new TextSearchScope(SearchMessages.getString("SelectionScope")); //$NON-NLS-1$
- if (getSelection() instanceof IStructuredSelection && !getSelection().isEmpty()) {
- Iterator iter= ((IStructuredSelection)getSelection()).iterator();
- while (iter.hasNext()) {
- Object selection= iter.next();
-
- //Unpack search result entry
- if (selection instanceof ISearchResultViewEntry)
- selection= ((ISearchResultViewEntry)selection).getGroupByKey();
-
- if (selection instanceof IResource)
- scope.add((IResource)selection);
- else if (selection instanceof IAdaptable) {
- IResource resource= (IResource)((IAdaptable)selection).getAdapter(IResource.class);
- if (resource != null)
- scope.add(resource);
- }
- }
- }
- return scope;
- }
-
- //--------------- Configuration handling --------------
-
- /**
- * Returns the page settings for this Java search page.
- *
- * @return the page settings to be used
- */
- private IDialogSettings getDialogSettings() {
- IDialogSettings settings= SearchPlugin.getDefault().getDialogSettings();
- fDialogSettings= settings.getSection(PAGE_NAME);
- if (fDialogSettings == null)
- fDialogSettings= settings.addNewSection(PAGE_NAME);
- return fDialogSettings;
- }
-
- /**
- * Initializes itself from the stored page settings.
- */
- private void readConfiguration() {
- IDialogSettings s= getDialogSettings();
- fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE);
- }
-
- /**
- * Stores it current configuration in the dialog store.
- */
- private void writeConfiguration() {
- IDialogSettings s= getDialogSettings();
- s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java
deleted file mode 100644
index 17ddcb3e0..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.text;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.search.internal.core.text.ITextSearchResultCollector;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.FileLabelProvider;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.SearchUI;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-public class TextSearchResultCollector implements ITextSearchResultCollector {
-
- private static final String MATCH= SearchMessages.getString("SearchResultCollector.match"); //$NON-NLS-1$
- private static final String MATCHES= SearchMessages.getString("SearchResultCollector.matches"); //$NON-NLS-1$
- private static final String DONE= SearchMessages.getString("SearchResultCollector.done"); //$NON-NLS-1$
-
- private IProgressMonitor fMonitor;
- private ISearchResultView fView;
- private TextSearchOperation fOperation;
- private int fMatchCount= 0;
- private Integer[] fMessageFormatArgs= new Integer[1];
-
- /**
- * Returns the progress monitor used to setup and report progress.
- */
- public IProgressMonitor getProgressMonitor() {
- return fMonitor;
- }
-
- void setProgressMonitor(IProgressMonitor pm) {
- fMonitor= pm;
- }
-
- /**
- * Called before the actual search starts.
- */
- public void aboutToStart() throws CoreException {
- fView= SearchUI.getSearchResultView();
- fMatchCount= 0;
- if (fView != null) {
- fView.searchStarted(
- TextSearchPage.EXTENSION_POINT_ID,
- fOperation.getSingularLabel(),
- fOperation.getPluralLabelPattern(),
- fOperation.getImageDescriptor(),
- null,
- new FileLabelProvider(FileLabelProvider.SHOW_LABEL_PATH),
- new GotoMarkerAction(),
- new GroupByKeyComputer(),
- fOperation);
- }
- }
-
- /**
- * Accepts the given search result.
- */
- public void accept(final IResource resource, String line, int start, int length, final int lineNumber) throws CoreException {
- IMarker marker= resource.createMarker(SearchUI.SEARCH_MARKER);
- HashMap attributes= new HashMap(4);
- attributes.put(SearchUI.LINE, line);
- attributes.put(IMarker.CHAR_START, new Integer(start));
- attributes.put(IMarker.CHAR_END, new Integer(start + length));
- attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
- marker.setAttributes(attributes);
-
- String description= resource.getFullPath().lastSegment();
- if (description == null)
- description= ""; //$NON-NLS-1$
-
- fView.addMatch(description, resource, resource, marker);
-
- fMatchCount++;
- if (!getProgressMonitor().isCanceled())
- getProgressMonitor().subTask(getFormattedMatchesString(fMatchCount));
-
- }
-
- /**
- * Called when the search has ended.
- */
- public void done() {
- if (!getProgressMonitor().isCanceled()) {
- String matchesString= getFormattedMatchesString(fMatchCount);
- getProgressMonitor().setTaskName(MessageFormat.format(DONE, new String[]{matchesString}));
- }
-
- if (fView != null)
- fView.searchFinished();
-
- // Cut no longer unused references because the collector might be re-used
- fView= null;
- fMonitor= null;
- }
-
- void setOperation(TextSearchOperation operation) {
- fOperation= operation;
- }
-
- private String getFormattedMatchesString(int count) {
- if (fMatchCount == 1)
- return MATCH;
- fMessageFormatArgs[0]= new Integer(count);
- return MessageFormat.format(MATCHES, fMessageFormatArgs);
-
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java
deleted file mode 100644
index ffae686aa..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.io.StringWriter;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.ui.SearchUI;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-/**
- * The default exception handler shows an error dialog when one of its handle methods
- * is called. If the passed exception is a <code>CoreException</code> an error dialog
- * pops up showing the exception's status information. For a <code>InvocationTargetException</code>
- * a normal message dialog pops up showing the exception's message. Additionally the exception
- * is written to the platform log.
- */
-public class ExceptionHandler {
-
- private static ExceptionHandler fgInstance= new ExceptionHandler();
-
- /**
- * Logs the given exception using the platform's logging mechanism. The exception is
- * logged as an error with the error code <code>JavaStatusConstants.INTERNAL_ERROR</code>.
- */
- public static void log(Throwable t, String message) {
- SearchPlugin.log(new Status(IStatus.ERROR, SearchUI.PLUGIN_ID, IStatus.ERROR, message, t));
- }
-
- /**
- * Handles the given <code>CoreException</code>. The workbench shell is used as a parent
- * for the dialog window.
- *
- * @param e the <code>CoreException</code> to be handled
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(CoreException e, String title, String message) {
- handle(e, SearchPlugin.getActiveWorkbenchShell(), title, message);
- }
-
- /**
- * Handles the given <code>CoreException</code>.
- *
- * @param e the <code>CoreException</code> to be handled
- * @param parent the dialog window's parent shell
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(CoreException e, Shell parent, String title, String message) {
- fgInstance.perform(e, parent, title, message);
- }
-
- /**
- * Handles the given <code>InvocationTargetException</code>. The workbench shell is used
- * as a parent for the dialog window.
- *
- * @param e the <code>InvocationTargetException</code> to be handled
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(InvocationTargetException e, String title, String message) {
- handle(e, SearchPlugin.getActiveWorkbenchShell(), title, message);
- }
-
- /**
- * Handles the given <code>InvocationTargetException</code>.
- *
- * @param e the <code>InvocationTargetException</code> to be handled
- * @param parent the dialog window's parent shell
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(InvocationTargetException e, Shell parent, String title, String message) {
- fgInstance.perform(e, parent, title, message);
- }
-
- //---- Hooks for subclasses to control exception handling ------------------------------------
-
- protected void perform(CoreException e, Shell shell, String title, String message) {
- IStatus status= e.getStatus();
- if (status != null) {
- ErrorDialog.openError(shell, title, message, status);
- } else {
- displayMessageDialog(e, e.getMessage(), shell, title, message);
- }
- }
-
- protected void perform(InvocationTargetException e, Shell shell, String title, String message) {
- Throwable target= e.getTargetException();
- if (target instanceof CoreException) {
- perform((CoreException)target, shell, title, message);
- } else {
- if (e.getMessage() != null && e.getMessage().length() > 0) {
- displayMessageDialog(e, e.getMessage(), shell, title, message);
- } else {
- displayMessageDialog(e, target.getMessage(), shell, title, message);
- }
- }
- }
-
- //---- Helper methods -----------------------------------------------------------------------
-
- public static void displayMessageDialog(Throwable t, Shell shell, String title, String message) {
- fgInstance.displayMessageDialog(t, t.getMessage(), shell, title, message);
- }
-
- public static void displayMessageDialog(Throwable t, String title, String message) {
- displayMessageDialog(t, SearchPlugin.getActiveWorkbenchShell(), title, message);
- }
-
- private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) {
- StringWriter msg= new StringWriter();
- if (message != null) {
- msg.write(message);
- msg.write("\n\n"); //$NON-NLS-1$
- }
- if (exceptionMessage == null || exceptionMessage.length() == 0)
- msg.write(SearchMessages.getString("ExceptionDialog.seeErrorLogMessage")); //$NON-NLS-1$
- else
- msg.write(exceptionMessage);
- MessageDialog.openError(shell, title, msg.toString());
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java
deleted file mode 100644
index 2757d5fc2..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-
-public abstract class ExtendedDialogWindow extends Dialog implements IRunnableContext {
-
- private Control fContents;
- private Button fCancelButton;
- private Button fSearchButton;
-
- private MessageLine fMessageLine;
- private String fPerformActionLabel= JFaceResources.getString("finish"); //$NON-NLS-1$
-
- // The number of long running operation executed from the dialog.
- private long fActiveRunningOperations;
- private boolean fOperationCancelableState;
-
- // The progress monitor
- private ProgressMonitorPart fProgressMonitorPart;
- private MessageDialog fWindowClosingDialog;
- private static int PROGRESS_INDICATOR_HEIGHT= 12;
- private static final String FOCUS_CONTROL= "focusControl"; //$NON-NLS-1$
- private Cursor fWaitCursor;
- private Cursor fArrowCursor;
-
-
- public ExtendedDialogWindow(Shell shell) {
- super(shell);
- }
-
- //---- Hooks to reimplement in subclasses -----------------------------------
-
- /**
- * Hook called when the user has pressed the button to perform
- * the dialog's action. If the method returns <code>false</code>
- * the dialog stays open. Otherwise the dialog is going to be closed.
- */
- protected boolean performAction() {
- return true;
- }
-
- /**
- * Hook called when the user has pressed the button to cancel
- * the dialog. If the method returns <code>false</code> the dialog
- * stays open. Otherwise the dialog is going to be closed.
- */
- protected boolean performCancel() {
- return true;
- }
-
- //---- UI creation ----------------------------------------------------------
-
- /**
- * Create the page area.
- */
- protected abstract Control createPageArea(Composite parent);
-
- /**
- * Creates and returns the contents of the dialog's
- * button bar.
- *
- * Subclasses may override.
- *
- * @param parent the parent composite to contain the button bar
- * @return the button bar control
- */
- protected Control createButtonBar(Composite parent) {
- Composite composite= new Composite(parent, SWT.NULL);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fMessageLine= new MessageLine(composite);
- fMessageLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fMessageLine.setMessage(""); //$NON-NLS-1$
-
- return super.createButtonBar(composite);
- }
-
- /**
- * Add buttons to the dialog's button bar.
- *
- * Subclasses may override.
- *
- * @param parent the button bar composite
- */
- protected void createButtonsForButtonBar(Composite parent) {
-
- fSearchButton= createButton(parent, IDialogConstants.FINISH_ID, fPerformActionLabel, true);
- fCancelButton= createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- /**
- * Creates the layout of the extended dialog window.
- */
- protected Control createDialogArea(Composite parent) {
- Composite result= new Composite(parent, SWT.NULL);
- GridLayout layout= new GridLayout();
- layout.marginWidth= 0;
- layout.marginHeight= 0;
- layout.horizontalSpacing= 0;
- layout.verticalSpacing= 0;
- result.setLayout(layout);
- result.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fContents= createPageArea(result);
-
- // Insert a progress monitor
- GridLayout pmlayout= new GridLayout();
- pmlayout.numColumns= 1;
- fProgressMonitorPart= new ProgressMonitorPart(result, pmlayout, SWT.DEFAULT);
- fProgressMonitorPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fProgressMonitorPart.setVisible(false);
-
-
- Label separator= new Label(result, SWT.SEPARATOR | SWT.HORIZONTAL);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- return result;
- }
-
-
- protected void buttonPressed(int buttonId) {
- switch (buttonId) {
- case IDialogConstants.FINISH_ID:
- if (performAction())
- close();
- break;
- case IDialogConstants.CANCEL_ID:
- if (fActiveRunningOperations == 0)
- close();
- break;
- }
- }
-
- //---- Setters and Getters --------------------------------------------------
-
- /**
- * Sets the label text of the perform action button.
- */
- public void setPerformActionLabel(String label) {
- fPerformActionLabel= label;
- }
-
- /**
- * Set the enable state of the perform action button.
- */
- public void setPerformActionEnabled(boolean state) {
- if (fSearchButton != null)
- fSearchButton.setEnabled(state);
- }
-
- //---- Operation stuff ------------------------------------------------------
-
- /**
- * Runs the given <code>IRunnableWithProgress</code> with the progress monitor for this
- * wizard dialog.
- * @param fork if true, it is run in a separate thread
- * @param cancelable specifies whether to enable the cancel button or not
- * @param runnable the runnable to run
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- // The operation can only be canceled if it is executed in a separate thread.
- // Otherwise the UI is blocked anyway.
- Object state= null;
- try {
- fActiveRunningOperations++;
- state= aboutToStart(fork && cancelable);
- ModalContext.run(runnable, fork, getProgressMonitor(), getShell().getDisplay());
- } finally {
- if (state != null)
- stopped(state);
- fActiveRunningOperations--;
- }
- }
-
- /**
- * Returns the progress monitor. If the wizard dialog doesn't
- * have a progress monitor <code>null</code> is returned.
- */
- protected IProgressMonitor getProgressMonitor() {
- return fProgressMonitorPart;
- }
-
- /**
- * About to start a long running operation tiggered through
- * the wizard. So show the progress monitor and disable
- * the wizard.
- * @return The saved UI state.
- */
- protected synchronized Object aboutToStart(boolean enableCancelButton) {
- HashMap savedState= null;
- fOperationCancelableState= enableCancelButton;
- Shell shell= getShell();
- if (shell != null) {
- Display d= shell.getDisplay();
-
- // Save focus control
- Control focusControl= d.getFocusControl();
- if (focusControl != null && focusControl.getShell() != shell)
- focusControl= null;
-
- // Set the busy cursor to all shells.
- fWaitCursor= new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(d, fWaitCursor);
-
- // Set the arrow cursor to the cancel component.
- fArrowCursor= new Cursor(d, SWT.CURSOR_ARROW);
- fCancelButton.setCursor(fArrowCursor);
-
- // Deactivate shell
- savedState= saveUIState(enableCancelButton);
- if (focusControl != null)
- savedState.put(FOCUS_CONTROL, focusControl);
-
- // Attach the progress monitor part to the cancel button
- fProgressMonitorPart.attachToCancelComponent(fCancelButton);
- fProgressMonitorPart.setVisible(true);
- }
-
- return savedState;
- }
-
- /**
- * A long running operation triggered through the wizard
- * was stopped either by user input or by normal end.
- * @param savedState The saveState returned by <code>aboutToStart</code>.
- * @see #aboutToStart(boolean)
- */
- protected synchronized void stopped(Object savedState) {
- Assert.isTrue( savedState instanceof HashMap);
- Shell shell= getShell();
- if (shell != null) {
-
- fProgressMonitorPart.setVisible(false);
- fProgressMonitorPart.removeFromCancelComponent(fCancelButton);
-
- HashMap state= (HashMap)savedState;
- restoreUIState(state);
-
- setDisplayCursor(shell.getDisplay(), null);
- fCancelButton.setCursor(null);
- fWaitCursor.dispose();
- fWaitCursor= null;
- fArrowCursor.dispose();
- fArrowCursor= null;
- Control focusControl= (Control)state.get(FOCUS_CONTROL);
- if (focusControl != null && ! focusControl.isDisposed())
- focusControl.setFocus();
- }
- }
-
- private void asyncSetOperationCancelButtonEnabled(final boolean b) {
- Shell shell= getShell();
- if (shell != null) {
- shell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- setOperationCancelButtonEnabled(b);
- }
- });
- }
- }
-
- private void setOperationCancelButtonEnabled(boolean b) {
- if (fActiveRunningOperations > 0) {
- fCancelButton.setEnabled(b);
- }
- }
-
- private void setDisplayCursor(Display d, Cursor c) {
- Shell[] shells= d.getShells();
- for (int i= 0; i < shells.length; i++)
- shells[i].setCursor(c);
- }
-
- //---- UI state save and restoring ---------------------------------------------
-
- private void restoreUIState(HashMap state) {
- restoreEnableState(fCancelButton, state, "cancel"); //$NON-NLS-1$
- restoreEnableState(fSearchButton, state, "search"); //$NON-NLS-1$
- ControlEnableState pageState= (ControlEnableState)state.get("tabForm"); //$NON-NLS-1$
- pageState.restore();
- }
-
- /**
- * Restores the enable state of the given control.
- * @private
- */
- protected void restoreEnableState(Control w, HashMap h, String key) {
- if (!w.isDisposed()) {
- Boolean b= (Boolean)h.get(key);
- if (b != null)
- w.setEnabled(b.booleanValue());
- }
- }
-
- private HashMap saveUIState(boolean keepCancelEnabled) {
- HashMap savedState= new HashMap(10);
- saveEnableStateAndSet(fCancelButton, savedState, "cancel", keepCancelEnabled); //$NON-NLS-1$
- saveEnableStateAndSet(fSearchButton, savedState, "search", false); //$NON-NLS-1$
- savedState.put("tabForm", ControlEnableState.disable(fContents)); //$NON-NLS-1$
-
- return savedState;
- }
-
- private void saveEnableStateAndSet(Control w, HashMap h, String key, boolean enabled) {
- if (!w.isDisposed()) {
- h.put(key, new Boolean(w.isEnabled()));
- w.setEnabled(enabled);
- }
- }
-
- protected void handleShellCloseEvent() {
- if (okToClose())
- super.handleShellCloseEvent();
- }
-
- /**
- * The dialog is going to be closed. Check if there is a running
- * operation. If so, post an alert saying that the wizard can't
- * be closed.
- */
- public boolean okToClose() {
- if (fActiveRunningOperations > 0) {
- synchronized (this) {
- fWindowClosingDialog= createClosingDialog();
- }
- fWindowClosingDialog.open();
- synchronized (this) {
- fWindowClosingDialog= null;
- }
- return false;
- }
- return true;
- }
-
- private MessageDialog createClosingDialog() {
- MessageDialog result=
- new MessageDialog(
- getShell(),
- SearchMessages.getString("SearchDialogClosingDialog.title"), //$NON-NLS-1$
- null,
- SearchMessages.getString("SearchDialogClosingDialog.message"), //$NON-NLS-1$
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- return result;
- }
-
- /**
- * Returns the cancel component that is to be used to cancel
- * a long running operation.
- */
- protected Control getCancelComponent() {
- return fCancelButton;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java
deleted file mode 100644
index 5dbe8edc6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.SearchMessages;
-
-
-public class FileLabelProvider extends DecoratingLabelProvider {
-
- public static final int SHOW_LABEL= 1;
- public static final int SHOW_LABEL_PATH= 2;
- public static final int SHOW_PATH_LABEL= 3;
- public static final int SHOW_PATH= 4;
-
- private static final String fgSeparatorFormat= SearchMessages.getString("FileLabelProvider.dashSeparated"); //$NON-NLS-1$
-
- private int fOrder;
- private String[] fArgs= new String[2];
-
- public FileLabelProvider(int orderFlag) {
- super(new WorkbenchLabelProvider(), getDecoratorManager());
- fOrder= orderFlag;
- }
-
- public void setOrder(int orderFlag) {
- fOrder= orderFlag;
- }
-
- public String getText(Object element) {
- if (!(element instanceof ISearchResultViewEntry))
- return ""; //$NON-NLS-1$
-
- IResource resource= ((ISearchResultViewEntry) element).getResource();
- String text= null;
-
- if (resource == null || !resource.exists())
- text= SearchMessages.getString("SearchResultView.removed_resource"); //$NON-NLS-1$
-
- else {
- IPath path= resource.getFullPath().removeLastSegments(1);
- if (path.getDevice() == null)
- path= path.makeRelative();
- if (fOrder == SHOW_LABEL || fOrder == SHOW_LABEL_PATH) {
- text= getLabelProvider().getText(resource);
- if (path != null && fOrder == SHOW_LABEL_PATH) {
- fArgs[0]= text;
- fArgs[1]= path.toString();
- text= MessageFormat.format(fgSeparatorFormat, fArgs);
- }
- } else {
- if (path != null)
- text= path.toString();
- else
- text= ""; //$NON-NLS-1$
- if (fOrder == SHOW_PATH_LABEL) {
- fArgs[0]= text;
- fArgs[1]= getLabelProvider().getText(resource);
- text= MessageFormat.format(fgSeparatorFormat, fArgs);
- }
- }
- }
-
- // Do the decoration
- if (getLabelDecorator() != null) {
- String decorated= getLabelDecorator().decorateText(text, element);
- if (decorated != null)
- return decorated;
- }
- return text;
- }
-
- public Image getImage(Object element) {
- if (!(element instanceof ISearchResultViewEntry))
- return null; //$NON-NLS-1$
- return super.getImage(((ISearchResultViewEntry) element).getResource());
- }
-
- private static ILabelDecorator getDecoratorManager() {
- return PlatformUI.getWorkbench().getDecoratorManager();
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java
deleted file mode 100644
index b69297c4f..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Widget;
-
-import org.eclipse.ui.IEditorRegistry;
-
-import org.eclipse.search.internal.ui.SearchMessages;
-
-public class FileTypeEditor extends SelectionAdapter implements DisposeListener, SelectionListener {
-
- private Combo fTextField;
- private Button fBrowseButton;
- private IEditorRegistry fResourceEditorRegistry;
-
- final static String TYPE_DELIMITER= SearchMessages.getString("FileTypeEditor.typeDelimiter"); //$NON-NLS-1$
-
- public FileTypeEditor(IEditorRegistry registry, Combo textField, Button browseButton) {
- fResourceEditorRegistry= registry;
- fTextField= textField;
- fBrowseButton= browseButton;
-
- fTextField.addDisposeListener(this);
- fBrowseButton.addDisposeListener(this);
- fBrowseButton.addSelectionListener(this);
- }
-
- public void widgetDisposed(DisposeEvent event) {
- Widget widget= event.widget;
- if (widget == fTextField)
- fTextField= null;
- else if (widget == fBrowseButton)
- fBrowseButton= null;
- }
-
- public void widgetSelected(SelectionEvent event) {
- if (event.widget == fBrowseButton)
- handleBrowseButton();
- }
-
- public void widgetDoubleSelected(SelectionEvent event) {
- }
- /**
- * Answer a collection of the currently-specified resource types
- *
- * @return java.util.Vector
- */
- public Set getFileTypes() {
- Set result= new HashSet();
- StringTokenizer tokenizer= new StringTokenizer(fTextField.getText(), TYPE_DELIMITER);
-
- while (tokenizer.hasMoreTokens()) {
- String currentExtension= tokenizer.nextToken().trim();
- result.add(currentExtension);
- }
- return result;
- }
- /**
- * Populate self's import types field based upon the passed types collection
- *
- * @param types java.util.Vector
- */
- public void setFileTypes(Set types) {
- fTextField.setText(typesToString(types));
- }
- protected void handleBrowseButton() {
- TypeFilteringDialog dialog= new TypeFilteringDialog(fTextField.getShell(), getFileTypes());
- if (dialog.open() == dialog.OK) {
- setFileTypes(new HashSet(Arrays.asList(dialog.getResult())));
- }
- }
-
- public static String typesToString(Set types) {
- StringBuffer result= new StringBuffer();
- Iterator typesIter= types.iterator();
- boolean first= true;
- while (typesIter.hasNext()) {
- if (!first) {
- result.append(TYPE_DELIMITER);
- result.append(" "); //$NON-NLS-1$
- } else
- first= false;
- result.append(typesIter.next());
- }
- return result.toString();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java
deleted file mode 100644
index c1e5f6a72..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * A specialized content provider to show a list of editor parts.
- */
-public class ListContentProvider implements IStructuredContentProvider {
- List fContents;
-
- public ListContentProvider() {
- }
-
- public Object[] getElements(Object input) {
- if (fContents != null && fContents == input)
- return fContents.toArray();
- return new Object[0];
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput instanceof List)
- fContents= (List)newInput;
- else
- fContents= null;
- // we use a fixed set.
- }
-
- public void dispose() {
- }
-
- public boolean isDeleted(Object o) {
- return fContents != null && !fContents.contains(o);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java
deleted file mode 100644
index db007ea57..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-/**
- * Dialog that shows a list of items with icon and label.
- */
-public class ListDialog extends SelectionDialog {
- private IStructuredContentProvider fContentProvider;
- private ILabelProvider fLabelProvider;
- private Object fInput;
- private TableViewer fViewer;
-
- public ListDialog(Shell parent, Object input, String title, String message, IStructuredContentProvider sp, ILabelProvider lp) {
- super(parent);
- setTitle(title);
- setMessage(message);
- fInput= input;
- fContentProvider= sp;
- fLabelProvider= lp;
- }
- /*
- * Overrides method from Dialog
- */
- protected Control createDialogArea(Composite container) {
- Composite parent= (Composite) super.createDialogArea(container);
- createMessageArea(parent);
- fViewer= new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- fViewer.setContentProvider(fContentProvider);
-
- final Table table= fViewer.getTable();
- table.addMouseListener(new MouseAdapter() {
- public void mouseDoubleClick(MouseEvent e) {
- okPressed();
- }
- });
- fViewer.setLabelProvider(fLabelProvider);
- fViewer.setInput(fInput);
- if (getInitialSelections() != null)
- fViewer.setSelection(new StructuredSelection(getInitialSelections()));
- GridData gd= new GridData(GridData.FILL_BOTH);
- gd.heightHint= convertHeightInCharsToPixels(15);
- gd.widthHint= convertWidthInCharsToPixels(50);
- table.setLayoutData(gd);
- return table;
- }
- /*
- * Overrides method from Dialog
- */
- protected void okPressed() {
- // Build a list of selected children.
- ISelection selection= fViewer.getSelection();
- if (selection instanceof IStructuredSelection)
- setResult(((IStructuredSelection)fViewer.getSelection()).toList());
- super.okPressed();
- }
-}
-
-
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java
deleted file mode 100644
index f5264821c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A message line. It distinguishs between "normal" messages and errors.
- * Setting an error message hides a currently displayed message until
- * <code>clearErrorMessage</code> is called.
- */
-public class MessageLine extends CLabel {
-
- private String fMessageText;
- private String fErrorText;
-
- private Color fDefaultColor;
- private RGB fErrorRGB;
- private Color fErrorColor;
-
- private static RGB fgErrorRGB= new RGB(200, 0, 0);
-
- /**
- * Creates a new message line as a child of the given parent.
- * Error message will be shown with in the rgb color 200,0,0.
- */
- public MessageLine(Composite parent) {
- this(parent, SWT.LEFT);
- }
-
- /**
- * Creates a new message line as a child of the parent and with the given SWT stylebits.
- * Error message will be shown with in the rgb color 200,0,0.
- */
- public MessageLine(Composite parent, int style) {
- super(parent, style);
- fDefaultColor= getForeground();
- fErrorRGB= fgErrorRGB;
- }
-
- /**
- * Creates a new message line as a child of the parent and with the given SWT stylebits.
- * Error message will be shown with in the given rgb color.
- */
- public MessageLine(Composite parent, int style, RGB errorRGB) {
- super(parent, style);
- fDefaultColor= getForeground();
- fErrorRGB= errorRGB;
- }
-
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage() {
- setErrorMessage(null);
- }
-
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage() {
- setMessage(null);
- }
-
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage() {
- return fErrorText;
- }
-
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null</code> is returned.
- */
- public String getMessage() {
- return fMessageText;
- }
-
- /**
- * Sets the default error color used by all message lines.
- * Note: a call to this method only affects newly created MessageLines not existing ones.
- */
- public static void setDefaultErrorColor(RGB color) {
- fgErrorRGB= color;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message) {
- fErrorText= message;
-
- if (message == null) {
- setMessage(fMessageText);
- } else {
- if (fErrorColor == null) {
- fErrorColor= new Color(getDisplay(), fErrorRGB);
- addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- getErrorColor().dispose();
- }
- });
- }
- setForeground(fErrorColor);
- setText(message);
- }
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message) {
- fMessageText= message;
- if (message == null)
- message= ""; //$NON-NLS-1$
- if (fErrorText == null) {
- setForeground(fDefaultColor);
- setText(message);
- }
- }
-
- protected Color getErrorColor() {
- return fErrorColor;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java
deleted file mode 100644
index 3c1ffdb18..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-
-import org.eclipse.jface.util.Assert;
-
-public class RowLayouter {
-
- public int spanHorizontalAlignment= -1;
- public int spanGrabExcessHorizontalSpace= -1;
- public int spanHorizontalSpan= -1;
- public int spanHorizontalIndent= -1;
- public int spanWidthHint= -1;
-
- public int spanVerticalAlignment= -1;
- public int spanGrabExcessVerticalSpace= -1;
- public int spanVerticalSpan= -1;
- public int spanHeightHint= -1;
-
- private int fNumColumns;
- private boolean fOrder;
- private Control fLastControl;
- private GridData[] fDefaultGridDatas= new GridData[4];
-
- public RowLayouter(int numColumns) {
- this(numColumns, false);
- }
-
- public RowLayouter(int numColumns, boolean order) {
- fNumColumns= numColumns;
- fOrder= order;
- }
-
- public void setDefaultSpan() {
- spanHorizontalAlignment= GridData.FILL;
- spanGrabExcessHorizontalSpace= 1;
- }
-
- public void perform(Control c1) {
- perform(new Control[] {c1}, 0);
- }
-
- public void perform(Control c1, Control c2, int span) {
- perform(new Control[] {c1, c2}, span);
- }
-
- public void perform(Control c1, Control c2, Control c3, int span) {
- perform(new Control[] {c1, c2, c3}, span);
- }
-
- public void perform(Control[] controls, int spanColumn) {
- int numColumns= numColumns();
- Assert.isTrue(controls.length <= numColumns);
- order(controls);
- int gridIndex= 0;
- for (int i= 0; i < controls.length; i++) {
- Control control= controls[i];
- GridData gd= (GridData)control.getLayoutData();
- if (gd == null)
- gd= getGridData(gridIndex);
-
- if (i == spanColumn) {
- int span= numColumns - (controls.length - 1);
- gridIndex+= span;
- if (gd == null)
- gd= new GridData();
- applyDelta(gd);
- gd.horizontalSpan= span;
- } else {
- gridIndex++;
- }
- control.setLayoutData(gd);
- }
- }
-
- private void applyDelta(GridData gd) {
- if (spanHorizontalAlignment != -1)
- gd.horizontalAlignment= spanHorizontalAlignment;
-
- if (spanGrabExcessHorizontalSpace != -1) {
- if (spanGrabExcessHorizontalSpace == 0)
- gd.grabExcessHorizontalSpace= false;
- else
- gd.grabExcessHorizontalSpace= true;
- }
-
-
- if (spanHorizontalSpan != -1)
- gd.horizontalSpan= spanHorizontalSpan;
-
- if (spanHorizontalIndent != -1)
- gd.horizontalIndent= spanHorizontalIndent;
-
- if (spanWidthHint != -1)
- gd.widthHint= spanWidthHint;
-
- if (spanVerticalAlignment != -1)
- gd.verticalAlignment= spanVerticalAlignment;
-
- if (spanGrabExcessVerticalSpace != -1) {
- if (spanGrabExcessVerticalSpace == 0)
- gd.grabExcessVerticalSpace= false;
- else
- gd.grabExcessVerticalSpace= true;
- }
-
- if (spanVerticalSpan != -1)
- gd.verticalSpan= spanVerticalSpan;
-
- if (spanHeightHint != -1)
- gd.heightHint= spanHeightHint;
- }
- public void setDefaultGridData(GridData gd, int index) {
- if (index >= fDefaultGridDatas.length) {
- GridData[] newDatas= new GridData[index + 4];
- System.arraycopy(fDefaultGridDatas, 0, newDatas, 0, fDefaultGridDatas.length);
- fDefaultGridDatas= newDatas;
- }
- fDefaultGridDatas[index]= gd;
- }
-
- public GridData getGridData(int index) {
- if (index > fDefaultGridDatas.length)
- return null;
-
- return cloneGridData(fDefaultGridDatas[index]);
- }
-
- public int numColumns() {
- return fNumColumns;
- }
-
- protected void order(Control[] controls) {
- if (!fOrder)
- return;
-
- for (int i= 0; i < controls.length; i++) {
- Control control= controls[i];
- control.moveBelow(fLastControl);
- fLastControl= control;
- }
- }
-
- protected GridData cloneGridData(GridData gd) {
- if (gd == null)
- return null;
-
- GridData result= new GridData();
- result.horizontalAlignment= gd.horizontalAlignment;
- result.grabExcessHorizontalSpace= gd.grabExcessHorizontalSpace;
- result.horizontalSpan= gd.horizontalSpan;
- result.horizontalIndent= gd.horizontalIndent;
- result.widthHint= gd.widthHint;
-
- result.verticalAlignment= gd.verticalAlignment;
- result.grabExcessVerticalSpace= gd.grabExcessVerticalSpace;
- result.verticalSpan= gd.verticalSpan;
- result.heightHint= gd.heightHint;
- return result;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java
deleted file mode 100644
index 1023af02e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DragSource;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.util.Assert;
-
-/**
- * Utility class to simplify access to some SWT resources.
- */
-public class SWTUtil {
-
- /**
- * Returns the standard display to be used. The method first checks, if
- * the thread calling this method has an associated disaply. If so, this
- * display is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display;
- display= Display.getCurrent();
- if (display == null)
- display= Display.getDefault();
- return display;
- }
-
- /**
- * Returns the shell for the given widget. If the widget doesn't represent
- * a SWT object that manage a shell, <code>null</code> is returned.
- *
- * @return the shell for the given widget
- */
- public static Shell getShell(Widget widget) {
- if (widget instanceof Control)
- return ((Control)widget).getShell();
- if (widget instanceof Caret)
- return ((Caret)widget).getParent().getShell();
- if (widget instanceof DragSource)
- return ((DragSource)widget).getControl().getShell();
- if (widget instanceof DropTarget)
- return ((DropTarget)widget).getControl().getShell();
- if (widget instanceof Menu)
- return ((Menu)widget).getParent().getShell();
- if (widget instanceof ScrollBar)
- return ((ScrollBar)widget).getParent().getShell();
-
- return null;
- }
-
- private static double fgHorizontalDialogUnitSize= 0.0;
- private static double fgVerticalDialogUnitSize= 0.0;
-
- private static void initializeDialogUnits(Control control) {
- GC gc= new GC(control);
- gc.setFont(control.getFont());
- int averageWidth= gc.getFontMetrics().getAverageCharWidth();
- int height = gc.getFontMetrics().getHeight();
- gc.dispose();
-
- fgHorizontalDialogUnitSize = averageWidth * 0.25;
- fgVerticalDialogUnitSize = height * 0.125;
- }
-
- /**
- * @see DialogPage#convertHeightInCharsToPixels
- */
- private static int convertHeightInCharsToPixels(int chars) {
- return convertVerticalDLUsToPixels(chars * 8);
- }
-
- /**
- * @see DialogPage#convertHorizontalDLUsToPixels
- */
- private static int convertHorizontalDLUsToPixels(int dlus) {
- return (int)Math.round(dlus * fgHorizontalDialogUnitSize);
- }
-
- /**
- * @see DialogPage#convertVerticalDLUsToPixels
- */
- private static int convertVerticalDLUsToPixels(int dlus) {
- return (int)Math.round(dlus * fgVerticalDialogUnitSize);
- }
-
- /**
- * @see DialogPage#convertWidthInCharsToPixels
- */
- private static int convertWidthInCharsToPixels(int chars) {
- return convertHorizontalDLUsToPixels(chars * 4);
- }
-
- /**
- * @see DialogPage#convertWidthInCharsToPixels
- */
- public static int convertWidthInCharsToPixels(int chars, Text text) {
- if (fgHorizontalDialogUnitSize == 0.0)
- initializeDialogUnits(text);
- return convertHorizontalDLUsToPixels(chars * 4);
- }
-
- /**
- * Returns a width hint for a button control.
- */
- public static int getButtonWidthHint(Button button) {
- if (fgHorizontalDialogUnitSize == 0.0) {
- initializeDialogUnits(button);
- }
- int widthHint= convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- /**
- * Returns a height hint for a button control.
- */
- public static int getButtonHeigthHint(Button button) {
- if (fgHorizontalDialogUnitSize == 0.0) {
- initializeDialogUnits(button);
- }
- return convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- }
-
- /**
- * Sets width and height hint for the button control.
- * <b>Note:</b> This is a NOP if the button's layout data is not
- * an instance of <code>GridData</code>.
- *
- * @param the button for which to set the dimension hint
- */
- public static void setButtonDimensionHint(Button button) {
- Assert.isNotNull(button);
- Object gd= button.getLayoutData();
- if (gd instanceof GridData) {
- ((GridData)gd).heightHint= SWTUtil.getButtonHeigthHint(button);
- ((GridData)gd).widthHint= SWTUtil.getButtonWidthHint(button);
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java
deleted file mode 100644
index 42e3c0313..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.util.*;
-
-/**
- * A string pattern matcher, suppporting * and ? wildcards.
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound= 0;
-
-
- protected static final char fSingleWildCard= '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start= start;
- this.end= end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern which may contain * for 0 and many characters and
- * ? for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern the pattern to match text against
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase= ignoreCase;
- fIgnoreWildCards= ignoreWildCards;
- fPattern= pattern;
- fLength= pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
- /**
- * Find the first occurrence of the pattern between <code>start</code)(inclusive)
- * and <code>end</code>(exclusive).
- * @param <code>text</code>, the String object to search in
- * @param <code>start</code>, the starting index of the search range, inclusive
- * @param <code>end</code>, the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null)
- throw new IllegalArgumentException();
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x= posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount= fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos= start;
- int matchStart= -1;
- int i;
- for (i= 0; i < segCount && curPos < end; ++i) {
- String current= fSegments[i];
- int nextMatch= regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart= nextMatch;
- curPos= nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
- /**
- * match the given <code>text</code> with the pattern
- * @return true if matched eitherwise false
- * @param <code>text</code>, a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in the
- * <code>text</code>, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param String <code>text</code>, a String object that contains the substring to match
- * @param int <code>start<code> marks the starting position (inclusive) of the substring
- * @param int <code>end<code> marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- } else {
- ++i;
- tCurPos= tCurPos + segLength;
- }
- }
-
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments= new String[1];
- fSegments[0]= fPattern;
- fBound= fLength;
- }
- /**
- * Parses the given pattern into segments seperated by wildcard '*' characters.
- * @param p, a String object that is a simple regular expression with * and/or ?
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar= true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar= true;
- }
- }
-
- Vector temp= new Vector();
-
- int pos= 0;
- StringBuffer buf= new StringBuffer();
- while (pos < fLength) {
- char c= fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next= fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments= new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param <code>text</code>, a string which contains no wildcard
- * @param <code>start</code>, the starting index in the text for search, inclusive
- * @param <code>end</code>, the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max= end - fLength;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param <code>text</code>, a simple regular expression that may only contain '?'(s)
- * @param <code>start</code>, the starting index in the text for search, inclusive
- * @param <code>end</code>, the stopping point of search, exclusive
- * @param <code>p</code>, a simple regular expression that may contains '?'
- * @param <code>caseIgnored</code>, wether the pattern is not casesensitive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen= p.length();
-
- int max= end - plen;
- for (int i= start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
- /**
- *
- * @return boolean
- * @param <code>text</code>, a String to match
- * @param <code>start</code>, int that indicates the starting index of match, inclusive
- * @param <code>end</code> int that indicates the ending index of match, exclusive
- * @param <code>p</code>, String, String, a simple regular expression that may contain '?'
- * @param <code>ignoreCase</code>, boolean indicating wether code>p</code> is case sensitive
- */
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar= text.charAt(tStart++);
- char pchar= p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar))
- continue;
- // comparing after converting to upper case doesn't handle all cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar))
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param <code>text</code>, the string to match
- * @param <code>start</code>, the starting index in the text for search, inclusive
- * @param <code>end</code>, the stopping point of search, exclusive
- * @param code>p</code>, a string that has no wildcard
- * @param <code>ignoreCase</code>, boolean indicating wether code>p</code> is case sensitive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen= p.length();
- int max= end - plen;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java
deleted file mode 100644
index e26d0f2b6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.ui.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-
-import org.eclipse.ui.IFileEditorMapping;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.FileEditorMappingContentProvider;
-import org.eclipse.ui.dialogs.FileEditorMappingLabelProvider;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-import org.eclipse.search.internal.ui.ISearchHelpContextIds;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-/**
- * The TypeFilteringDialog is a SelectionDialog that allows the user to select a file editor.
- * XXX: Workbench should offer this dialog (public API), see: 1GIYHMY: ITPUI:WINNT - DCR: TypeFilteringDialog should be public API
- */
-public class TypeFilteringDialog extends SelectionDialog {
- private Button fAddTypesButton;
-
- private Collection fInitialSelections;
-
- // the visual selection widget group
- private CheckboxTableViewer fListViewer;
-
- // sizing constants
- private final static int SIZING_SELECTION_WIDGET_HEIGHT= 250;
- private final static int SIZING_SELECTION_WIDGET_WIDTH= 300;
-
- private Text fUserDefinedText;
-
- private IFileEditorMapping[] fCurrentInput;
- /**
- * Creates a type selection dialog using the supplied entries. Set the initial selections to those
- * whose extensions match the preselections.
- */
- public TypeFilteringDialog(Shell parentShell, Collection preselections) {
- super(parentShell);
- setTitle(SearchMessages.getString("TypesFiltering.title")); //$NON-NLS-1$
- fInitialSelections= preselections;
- setMessage(SearchMessages.getString("TypesFiltering.message")); //$NON-NLS-1$
- }
-
- /**
- * Add the selection and deselection buttons to the dialog.
- * @param composite org.eclipse.swt.widgets.Composite
- */
- private void addSelectionButtons(Composite composite) {
-
- Composite buttonComposite= new Composite(composite, SWT.RIGHT);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- buttonComposite.setLayout(layout);
- GridData data =
- new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace= true;
- composite.setData(data);
-
- Button selectButton =
- createButton(
- buttonComposite,
- IDialogConstants.SELECT_ALL_ID,
- SearchMessages.getString("TypesFiltering.selectAll"), //$NON-NLS-1$
- false);
-
- SelectionListener listener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- getListViewer().setAllChecked(true);
- }
- };
- selectButton.addSelectionListener(listener);
-
- Button deselectButton =
- createButton(
- buttonComposite,
- IDialogConstants.DESELECT_ALL_ID,
- SearchMessages.getString("TypesFiltering.deselectAll"), //$NON-NLS-1$
- false);
-
- listener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- getListViewer().setAllChecked(false);
-
- }
- };
- deselectButton.addSelectionListener(listener);
-
- }
-
- /**
- * Add the currently-specified extensions.
- */
- private void addUserDefinedEntries(List result) {
-
- StringTokenizer tokenizer =
- new StringTokenizer(fUserDefinedText.getText(), FileTypeEditor.TYPE_DELIMITER);
-
- //Allow the *. and . prefix and strip out the extension
- while (tokenizer.hasMoreTokens()) {
- String currentExtension= tokenizer.nextToken().trim();
- if (!currentExtension.equals("")) //$NON-NLS-1$
- result.add(currentExtension);
- }
- }
-
- /**
- * Visually checks the previously-specified elements in this dialog's list
- * viewer.
- */
- private void checkInitialSelections() {
-
- IFileEditorMapping editorMappings[] =
- PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
- ArrayList selectedMappings= new ArrayList();
-
- for (int i= 0; i < editorMappings.length; i++) {
- IFileEditorMapping mapping= editorMappings[i];
- if (fInitialSelections.contains(mapping.getLabel())) {
- fListViewer.setChecked(mapping, true);
- selectedMappings.add(mapping.getLabel());
- }
- }
-
- //Now add in the ones not selected to the user defined list
- Iterator initialIterator= fInitialSelections.iterator();
- StringBuffer entries= new StringBuffer();
- boolean first= true;
- while (initialIterator.hasNext()) {
- String nextExtension= (String)initialIterator.next();
- if (!selectedMappings.contains(nextExtension)) {
- if (!first) {
- entries.append(FileTypeEditor.TYPE_DELIMITER);
- entries.append(" "); //$NON-NLS-1$
- }
- first= false;
- entries.append(nextExtension);
- }
- }
- fUserDefinedText.setText(entries.toString());
- }
-
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- WorkbenchHelp.setHelp(shell, ISearchHelpContextIds.TYPE_FILTERING_DIALOG);
- }
-
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite= (Composite)super.createDialogArea(parent);
-
- createMessageArea(composite);
-
- fListViewer= CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.heightHint= SIZING_SELECTION_WIDGET_HEIGHT;
- data.widthHint= SIZING_SELECTION_WIDGET_WIDTH;
- fListViewer.getTable().setLayoutData(data);
-
- fListViewer.setLabelProvider(FileEditorMappingLabelProvider.INSTANCE);
- fListViewer.setContentProvider(FileEditorMappingContentProvider.INSTANCE);
-
- addSelectionButtons(composite);
-
- createUserEntryGroup(composite);
-
- initializeViewer();
-
- // initialize page
- if (fInitialSelections != null && !fInitialSelections.isEmpty())
- checkInitialSelections();
-
- return composite;
- }
-
- /**
- * Create the group that shows the user defined entries for the dialog.
- * @param parent the parent this is being created in.
- */
- private void createUserEntryGroup(Composite parent) {
-
- // destination specification group
- Composite userDefinedGroup= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- userDefinedGroup.setLayout(layout);
- userDefinedGroup.setLayoutData(
- new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
-
- new Label(userDefinedGroup, SWT.NONE).setText(
- SearchMessages.getString("TypesFiltering.otherExtensions")); //$NON-NLS-1$
-
- // user defined entry field
- fUserDefinedText= new Text(userDefinedGroup, SWT.SINGLE | SWT.BORDER);
- GridData data =
- new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- fUserDefinedText.setLayoutData(data);
- }
-
- /**
- * Return the input to the dialog.
- */
- private IFileEditorMapping[] getInput() {
-
- //Filter the mappings to be just those with a wildcard extension
- if (fCurrentInput == null) {
- List wildcardEditors= new ArrayList();
- IFileEditorMapping[] allMappings =
- PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
- for (int i= 0; i < allMappings.length; i++) {
- if (allMappings[i].getName().equals("*")) //$NON-NLS-1$
- wildcardEditors.add(allMappings[i]);
- }
- fCurrentInput= new IFileEditorMapping[wildcardEditors.size()];
- wildcardEditors.toArray(fCurrentInput);
- }
-
- return fCurrentInput;
- }
-
- /**
- * Initializes this dialog's viewer after it has been laid out.
- */
- private void initializeViewer() {
- fListViewer.setInput(getInput());
- }
-
- /**
- * The <code>ListSelectionDialog</code> implementation of this
- * <code>Dialog</code> method builds a list of the selected elements for later
- * retrieval by the client and closes this dialog.
- */
- protected void okPressed() {
-
- // Get the input children.
- IFileEditorMapping[] children= getInput();
-
- List list= new ArrayList();
-
- // Build a list of selected children.
- for (int i= 0; i < children.length; ++i) {
- IFileEditorMapping element= children[i];
- if (fListViewer.getChecked(element))
- list.add(element.getLabel());
- }
-
- addUserDefinedEntries(list);
- setResult(list);
- super.okPressed();
- }
-
- protected CheckboxTableViewer getListViewer() {
- return fListViewer;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSet.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSet.java
deleted file mode 100644
index 252304ab3..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSet.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.jface.util.Assert;
-
-import org.xml.sax.SAXException;
-
-import org.eclipse.search.ui.IWorkingSet;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-public class WorkingSet implements IWorkingSet {
-
- private static SortedSet fgWorkingSets= new TreeSet(new WorkingSetComparator());
-
-
- // XML tags
- static String TAG_WORKINGSETS= "workingsets"; //$NON-NLS-1$
- static String TAG_WORKINGSET= "workingset"; //$NON-NLS-1$
- static String TAG_NAME= "name"; //$NON-NLS-1$
- static String TAG_CONTENTS= "contents"; //$NON-NLS-1$
- static String TAG_FILE= "file"; //$NON-NLS-1$
- static String TAG_FOLDER= "folder"; //$NON-NLS-1$
- static String TAG_PATH= "path"; //$NON-NLS-1$
- static String TAG_PROJECT= "project"; //$NON-NLS-1$
-
- // Persistency
- static String STORE_NAME= "workingsets.xml"; //$NON-NLS-1$
- static {
- restore();
- }
-
- String fName;
- Set fElements; // of IResources
-
- WorkingSet(String name, Object[] elements) {
- Assert.isNotNull(name, "name must not be null"); //$NON-NLS-1$
- fName= name;
- setResources(elements, true);
- }
-
- void setResources(Object[] elements) {
- setResources(elements, false);
- }
-
- private void setResources(Object[] elements, boolean internal) {
- Assert.isNotNull(elements, "IPath array must not be null"); //$NON-NLS-1$
- fElements= new HashSet(elements.length);
- for (int i= 0; i < elements.length; i++) {
- Assert.isTrue(elements[i] instanceof IResource);
- Assert.isTrue(!fElements.contains(elements[i]), "elements must only contain each element once"); //$NON-NLS-1$
- fElements.add(elements[i]);
- }
- if (!internal)
- saveWorkingSets();
- }
-
- /*
- * @see IWorkingSet#getName()
- */
- public String getName() {
- return fName;
- }
-
- void setName(String name) {
- Assert.isNotNull(name, "name must not be null"); //$NON-NLS-1$
- fName= name;
- saveWorkingSets();
- }
-
- /*
- * @see IWorkingSet#getResources()
- */
- public IResource[] getResources() {
- return (IResource[])fElements.toArray(new IResource[fElements.size()]);
- }
-
- public boolean equals (Object o) {
- return (o instanceof IWorkingSet) && ((IWorkingSet)o).getName().equals(getName());
- }
-
- public int hashCode() {
- return fName.hashCode();
- }
-
- /**
- * Returns all working sets for the workspace.
- *
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @return an array of IWorkingSet
- */
- public static IWorkingSet[] getWorkingSets() {
- return (IWorkingSet[])fgWorkingSets.toArray(new IWorkingSet[fgWorkingSets.size()]);
- }
-
- /**
- * Finds a working set by name.
- *
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @param name the name the working set
- * @return the working set with the given name or <code>null</code> if not found
- */
- public static IWorkingSet find(String name) {
- if (name == null || fgWorkingSets == null)
- return null;
-
- Iterator iter= fgWorkingSets.iterator();
- while (iter.hasNext()) {
- IWorkingSet workingSet= (IWorkingSet)iter.next();
- if (name.equals(workingSet.getName()))
- return workingSet;
- }
- return null;
- }
-
- /**
- * Removes the working set from the workspace.
- * This is a NOP if the working set does not exist in the workspace.
- */
- static void remove(IWorkingSet workingSet) {
- fgWorkingSets.remove(workingSet);
- saveWorkingSets();
- }
-
- /**
- * Adds the working set to the workspace.
- * The working set must not exist yet.
- */
- static void add(IWorkingSet workingSet) {
- Assert.isTrue(!fgWorkingSets.contains(workingSet), "working set already registered"); //$NON-NLS-1$
- fgWorkingSets.add(workingSet);
- saveWorkingSets();
- }
-
- //--- Persistency -----------------------------------------------
-
- private static void restore() {
- WorkingSetReader reader= null;
- IWorkingSet[] workingSets= null;
- try {
- File file= SearchPlugin.getDefault().getStateLocation().append(STORE_NAME).toFile();
- if (!file.exists())
- return;
- reader= new WorkingSetReader(new BufferedInputStream(new FileInputStream(file)));
- workingSets= reader.readXML();
- } catch (IOException ex) {
- String message= WorkingSetMessages.getFormattedString("WorkingSet.error.readingFile", ex.getMessage()); //$NON-NLS-1$
- ExceptionHandler.log(ex, message);
- } catch (SAXException ex) {
- String message= WorkingSetMessages.getFormattedString("WorkingSet.error.badXmlFormat", ex.getMessage()); //$NON-NLS-1$
- ExceptionHandler.log(ex, message);
- } finally {
- try {
- if (reader != null)
- reader.close();
- }
- catch (IOException ex) {
- String message= WorkingSetMessages.getFormattedString("WorkingSet.error.close", ex.getMessage()); //$NON-NLS-1$
- ExceptionHandler.log(ex, message);
- }
- }
- if (workingSets != null)
- for (int i= 0; i < workingSets.length; i++)
- WorkingSet.add(workingSets[i]);
- }
-
- private static void saveWorkingSets() {
- WorkingSetWriter writer= null;
- try {
- File file= SearchPlugin.getDefault().getStateLocation().append(STORE_NAME).toFile();
- writer= new WorkingSetWriter(new BufferedOutputStream(new FileOutputStream(file)));
- writer.writeXML(SearchUI.getWorkingSets());
- } catch (IOException ex) {
- String message= WorkingSetMessages.getFormattedString("WorkingSet.error.readingFile", ex.getMessage()); //$NON-NLS-1$
- ExceptionHandler.log(ex, message);
- } finally {
- if (writer != null)
- try {
- writer.close();
- } catch (IOException ex) {
- String message= WorkingSetMessages.getFormattedString("WorkingSet.error.readingFile", ex.getMessage()); //$NON-NLS-1$
- ExceptionHandler.log(ex, message);
- }
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetComparator.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetComparator.java
deleted file mode 100644
index d4b792323..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetComparator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.text.Collator;
-import java.util.Comparator;
-
-import org.eclipse.search.ui.IWorkingSet;
-
-class WorkingSetComparator implements Comparator {
-
- private Collator fCollator= Collator.getInstance();
-
- /*
- * @see Comparator#compare(Object, Object)
- */
- public int compare(Object o1, Object o2) {
- String name1= null;
- String name2= null;
-
- if (o1 instanceof IWorkingSet)
- name1= ((IWorkingSet)o1).getName();
-
- if (o2 instanceof IWorkingSet)
- name2= ((IWorkingSet)o2).getName();
-
- return fCollator.compare(name1, name2);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetDialog.java
deleted file mode 100644
index cae6330b4..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetDialog.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.model.WorkbenchViewerSorter;
-
-import org.eclipse.search.ui.IWorkingSet;
-
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-
-class WorkingSetDialog extends InputDialog {
-
- private static class WorkingSetNameInputValidator implements IInputValidator {
-
- private String fInitalName;
- private boolean fFirstCheck= true;
- private CheckboxTreeViewer fTree;
-
- public WorkingSetNameInputValidator(String initialName) {
- Assert.isNotNull(initialName, "initial name must not be null"); //$NON-NLS-1$
- fInitalName= initialName;
- }
-
- private void setTree(CheckboxTreeViewer tree) {
- fTree= tree;
- }
-
- public String isValid(String newText) {
- if (newText == null || newText.equals("")) { //$NON-NLS-1$
- if (fInitalName.equals("") && fFirstCheck) { //$NON-NLS-1$
- fFirstCheck= false;
- return " "; //$NON-NLS-1$
- }
- return WorkingSetMessages.getString("WorkingSetDialog.warning.nameMustNotBeEmpty"); //$NON-NLS-1$
- }
- if (!newText.equals(fInitalName)) {
- IWorkingSet[] workingSets= WorkingSet.getWorkingSets();
- for (int i= 0; i < workingSets.length; i++) {
- if (newText.equals(workingSets[i].getName()))
- return WorkingSetMessages.getString("WorkingSetDialog.warning.workingSetExists"); //$NON-NLS-1$
- }
- }
-
- if (fTree.getCheckedElements().length == 0)
- return WorkingSetMessages.getString("WorkingSetDialog.warning.resourceMustBeChecked"); //$NON-NLS-1$
-
- return null;
- }
- }
-
- // Widgets constants
- private final static int SIZING_SELECTION_WIDGET_WIDTH= 50;
- private final static int SIZING_SELECTION_WIDGET_HEIGHT= 200;
-
- private IWorkingSet fWorkingSet;
- private CheckboxTreeViewer fTree;
-
- WorkingSetDialog(Shell parentShell) {
- this(parentShell, ""); //$NON-NLS-1$
- }
-
- WorkingSetDialog(Shell parentShell, IWorkingSet workingSet) {
- this(parentShell, workingSet.getName());
- fWorkingSet= workingSet;
- }
-
- private WorkingSetDialog(Shell parentShell, String initialSelection) {
- super(parentShell, WorkingSetMessages.getString("WorkingSetDialog.title"), WorkingSetMessages.getString("WorkingSetDialog.message"), initialSelection, new WorkingSetNameInputValidator(initialSelection)); //$NON-NLS-2$ //$NON-NLS-1$
- }
-
- /*
- * Overrides method from Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite= (Composite)super.createDialogArea(parent);
-
- fTree= new CheckboxTreeViewer(composite);
- fTree.setUseHashlookup(true);
- fTree.setContentProvider(new WorkbenchContentProvider());
- fTree.setLabelProvider(createLabelProvider());
- fTree.setInput(SearchPlugin.getWorkspace().getRoot());
- fTree.setSorter(new WorkbenchViewerSorter());
-
- GridData gd= new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL);
- gd.heightHint= SIZING_SELECTION_WIDGET_HEIGHT;
- gd.widthHint= SIZING_SELECTION_WIDGET_WIDTH;
- fTree.getControl().setLayoutData(gd);
-
- fTree.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- handleCheckStateChange(event);
- }
- });
-
- fTree.addTreeListener(new ITreeViewerListener() {
- public void treeCollapsed(TreeExpansionEvent event) {
- }
- public void treeExpanded(TreeExpansionEvent event) {
- final Object element= event.getElement();
- if (!fTree.getGrayed(element))
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- setSubtreeChecked((IContainer)element, fTree.getChecked(element), false);
- }
- });
- }
- });
-
- initializeCheckedState();
- ((WorkingSetNameInputValidator)getValidator()).setTree(fTree);
- disableClosedProjects();
-
- return composite;
- }
-
- private ILabelProvider createLabelProvider() {
- ILabelDecorator decorationMgr= PlatformUI.getWorkbench().getDecoratorManager();
- return new DecoratingLabelProvider(new WorkbenchLabelProvider(), decorationMgr);
- }
-
- private void disableClosedProjects() {
- IProject[] projects= SearchPlugin.getWorkspace().getRoot().getProjects();
- for (int i= 0; i < projects.length; i++) {
- if (!projects[i].isOpen())
- fTree.setGrayed(projects[i], true);
- }
- }
-
- /*
- * Overrides method from Dialog
- */
- protected void okPressed() {
- ArrayList resources= new ArrayList(10);
- findCheckedResources(resources, (IContainer)fTree.getInput());
- if (fWorkingSet == null)
- fWorkingSet= new WorkingSet(getText().getText(), resources.toArray());
- else if (fWorkingSet instanceof WorkingSet) {
- // Add not accessible resources
- IResource[] oldResources= fWorkingSet.getResources();
- for (int i= 0; i < oldResources.length; i++)
- if (!oldResources[i].isAccessible())
- resources.add(oldResources[i]);
-
- ((WorkingSet)fWorkingSet).setName(getText().getText());
- ((WorkingSet)fWorkingSet).setResources(resources.toArray());
- }
- super.okPressed();
- }
-
- IWorkingSet getWorkingSet() {
- return fWorkingSet;
- }
-
- private void findCheckedResources(List checkedResources, IContainer container) {
- IResource[] resources= null;
- try {
- resources= container.members();
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, getShell(), WorkingSetMessages.getString("WorkingSetDialog.error"), WorkingSetMessages.getString("WorkingSetDialog.error.updateCheckedState")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- for (int i= 0; i < resources.length; i++) {
- if (fTree.getGrayed(resources[i]))
- findCheckedResources(checkedResources, (IContainer)resources[i]);
- else if (fTree.getChecked(resources[i]))
- checkedResources.add(resources[i]);
- }
- }
-
- //--- Checked state handling --------------------------
-
- void handleCheckStateChange(final CheckStateChangedEvent event) {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- IResource resource= (IResource)event.getElement();
- if (!resource.isAccessible()) {
- MessageDialog.openInformation(getShell(), WorkingSetMessages.getString("WorkingSetDialog.projectClosedDialog.title"), WorkingSetMessages.getString("WorkingSetDialog.projectClosedDialog.message")); //$NON-NLS-2$ //$NON-NLS-1$
- fTree.setChecked(resource, false);
- fTree.setGrayed(resource, true);
- return;
- }
- boolean state= event.getChecked();
- fTree.setGrayed(resource, false);
- if (resource instanceof IContainer)
- setSubtreeChecked((IContainer)resource, state, true);
-
- updateParentState(resource, state);
- }
- });
-
- String errorMessage= getValidator().isValid(getText().getText());
- if (errorMessage == null)
- errorMessage= "";
- getErrorMessageLabel().setText(errorMessage);
- getOkButton().setEnabled(errorMessage.length() == 0);
- }
-
- private void setSubtreeChecked(IContainer container, boolean state, boolean checkExpandedState) {
- if (!container.isAccessible() || !fTree.getExpandedState(container) && checkExpandedState)
- return;
-
- IResource[] members= null;
- try {
- members= container.members();
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, getShell(), WorkingSetMessages.getString("WorkingSetDialog.error"), WorkingSetMessages.getString("WorkingSetDialog.error.updateCheckedState")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- for (int i= members.length - 1; i >= 0; i--) {
- IResource element= members[i];
- if (state) {
- fTree.setChecked(element, true);
- fTree.setGrayed(element, false);
- }
- else
- fTree.setGrayChecked(element, false);
- if (element instanceof IContainer)
- setSubtreeChecked((IContainer)element, state, true);
- }
- }
-
- private void updateParentState(IResource child, boolean baseChildState) {
-
- if (child == null || child.getParent() == null || !child.isAccessible())
- return;
-
- IContainer parent= child.getParent();
- boolean allSameState= true;
- IResource[] members= null;
- try {
- members= parent.members();
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, getShell(), WorkingSetMessages.getString("WorkingSetDialog.error"), WorkingSetMessages.getString("WorkingSetDialog.error.updateCheckedState")); //$NON-NLS-2$ //$NON-NLS-1$
- }
- for (int i= members.length -1; i >= 0; i--) {
- if (fTree.getChecked(members[i]) != baseChildState || fTree.getGrayed(members[i])) {
- allSameState= false;
- break;
- }
- }
-
- fTree.setGrayed(parent, !allSameState);
- fTree.setChecked(parent, !allSameState || baseChildState);
-
- updateParentState(parent, baseChildState);
- }
-
- private void initializeCheckedState() {
- if (fWorkingSet == null)
- return;
-
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- IResource[] resources= fWorkingSet.getResources();
- fTree.setCheckedElements(resources);
- for (int i= 0; i < resources.length; i++) {
- if (resources[i] instanceof IContainer)
- setSubtreeChecked((IContainer)resources[i], true, true);
- updateParentState(resources[i], true);
- }
- }
- });
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.java
deleted file mode 100644
index 0afda2e0b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class WorkingSetMessages {
-
- private static final String RESOURCE_BUNDLE= WorkingSetMessages.class.getName();
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private WorkingSetMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- */
- public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg == null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- */
- public static String getFormattedString(String key, Object[] args) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(format, args);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.properties b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.properties
deleted file mode 100644
index 1833ecc5c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetMessages.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-WorkingSet.error.readingFile= Error reading: {0}
-WorkingSet.error.badXmlFormat= Bad XML format: {0}
-WorkingSet.error.close= Unable to close the XML file: {0}
-
-WorkingSetReader.error.badFormat= Bad format
-WorkingSetReader.warnings= JAR Package Reader Warnings
-WorkingSetReader.error.tagNameNotFound= Bad format: Tag 'name' not found
-WorkingSetReader.error.tagPathNotFound= Bad format: Tag 'path' not found
-
-WorkingSetWriter.error.couldNotGetXmlBuilder = Could not get XML builder
-
-WorkingSetDialog.title= Working Set
-WorkingSetDialog.message= Define the working set name:
-WorkingSetDialog.warning.nameMustNotBeEmpty= The name must not be empty.
-WorkingSetDialog.warning.workingSetExists= A working set with that name already exists.
-WorkingSetDialog.warning.resourceMustBeChecked= At least one resource must be checked.
-WorkingSetDialog.error= Error
-WorkingSetDialog.error.updateCheckedState= Error during update of checked state
-WorkingSetDialog.projectClosedDialog.message= A closed project can not be modified
-WorkingSetDialog.projectClosedDialog.title= Working Set Change
-
-WorkingSetSelectionDialog.title= Working Sets
-WorkingSetSelectionDialog.message= Select a working set:
-WorkingSetSelectionDialog.detailsButton.label= &Details...
-WorkingSetSelectionDialog.newButton.label= &New...
-WorkingSetSelectionDialog.removeButton.label= &Remove
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetReader.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetReader.java
deleted file mode 100644
index 278ac747d..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetReader.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.util.Assert;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import org.eclipse.search.ui.IWorkingSet;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.SearchPlugin;
-
-/**
- * Reads data from an InputStream and returns the working sets
- */
-public class WorkingSetReader extends Object {
-
- protected InputStream fInputStream;
-
- private MultiStatus fWarnings;
-
- /**
- * Reads a working sets from the underlying stream.
- * It is the clients responsiblity to close the stream.
- **/
- public WorkingSetReader(InputStream inputStream) {
- Assert.isNotNull(inputStream);
- fInputStream= new BufferedInputStream(inputStream);
- fWarnings= new MultiStatus(SearchUI.PLUGIN_ID, 0, WorkingSetMessages.getString("WorkingSetReader.warnings"), null); //$NON-NLS-1$
- }
-
- /**
- * Hook for possible subclasses
- **/
- protected WorkingSetReader() {
- }
-
- /**
- * Closes this stream.
- * It is the clients responsiblity to close the stream.
- *
- * @exception IOException
- */
- public void close() throws IOException {
- if (fInputStream != null)
- fInputStream.close();
- }
-
- public IWorkingSet[] readXML() throws IOException, SAXException {
- DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- DocumentBuilder parser= null;
- try {
- parser= factory.newDocumentBuilder();
- } catch (ParserConfigurationException ex) {
- throw new IOException(ex.getMessage());
- } finally {
- // Note: Above code is ok since clients are responsible to close the stream
- }
- Element xml= parser.parse(new InputSource(fInputStream)).getDocumentElement();
- if (!xml.getNodeName().equals(WorkingSet.TAG_WORKINGSETS))
- throw new IOException(WorkingSetMessages.getString("WorkingSetReader.error.badFormat")); //$NON-NLS-1$
-
- NodeList topLevelElements= xml.getChildNodes();
- Set workingSets= new HashSet(5);
- for (int i= 0; i < topLevelElements.getLength(); i++) {
- Node node= topLevelElements.item(i);
- if (node.getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element element= (Element)node;
- String workingSetName= element.getAttribute(WorkingSet.TAG_NAME);
- Set resources= new HashSet(5);
- if (element.getNodeName().equals(WorkingSet.TAG_WORKINGSET))
- readWorkingSetTag(resources, element.getChildNodes());
- workingSets.add(new WorkingSet(workingSetName, resources.toArray()));
- }
- return (IWorkingSet[]) workingSets.toArray(new IWorkingSet[workingSets.size()]);
- }
-
- private void readWorkingSetTag(Set resources, NodeList nodes) throws IOException {
- for (int j= 0; j < nodes.getLength(); j++) {
- Node node= nodes.item(j);
- if (node.getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element element= (Element)node;
- if (element.getNodeName().equals(WorkingSet.TAG_CONTENTS))
- readContentsTag(resources, element.getChildNodes());
- }
- }
-
- private void readContentsTag(Set resources, NodeList contents) throws IOException {
- for (int k= 0; k < contents.getLength(); k++) {
- Node node= contents.item(k);
- if (node.getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element element= (Element)node;
- if (element.getNodeName().equals(WorkingSet.TAG_FILE))
- addFile(resources, element);
- else if (element.getNodeName().equals(WorkingSet.TAG_FOLDER))
- addFolder(resources ,element);
- else if (element.getNodeName().equals(WorkingSet.TAG_PROJECT))
- addProject(resources ,element);
- }
- }
-
- private void addFile(Set selectedElements, Element element) throws IOException {
- IPath path= getPath(element);
- if (path != null) {
- IFile file= SearchPlugin.getWorkspace().getRoot().getFile(path);
- if (file != null)
- selectedElements.add(file);
- }
- }
-
- private void addFolder(Set selectedElements, Element element) throws IOException {
- IPath path= getPath(element);
- if (path != null) {
- IFolder folder= SearchPlugin.getWorkspace().getRoot().getFolder(path);
- if (folder != null)
- selectedElements.add(folder);
- }
- }
-
- private void addProject(Set selectedElements, Element element) throws IOException {
- String name= element.getAttribute(WorkingSet.TAG_NAME); //$NON-NLS-1$
- if (name.equals("")) //$NON-NLS-1$
- throw new IOException(WorkingSetMessages.getString("WorkingSetReader.error.tagNameNotFound")); //$NON-NLS-1$
- IProject project= SearchPlugin.getWorkspace().getRoot().getProject(name);
- if (project != null)
- selectedElements.add(project);
- }
-
- private IPath getPath(Element element) throws IOException {
- String pathString= element.getAttribute(WorkingSet.TAG_PATH);
- if (pathString.equals("")) //$NON-NLS-1$
- throw new IOException(WorkingSetMessages.getString("WorkingSetReader.error.tagPathNotFound")); //$NON-NLS-1$
- return new Path(element.getAttribute(WorkingSet.TAG_PATH));
- }
-
-
- /**
- * Returns the warnings of this operation. If there are no
- * warnings, a status object with IStatus.OK is returned.
- *
- * @return the status of this operation
- */
- public IStatus getWarnings() {
- if (fWarnings.getChildren().length == 0)
- return new Status(IStatus.OK, SearchUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- else
- return fWarnings;
- }
-
- /**
- * Adds a new warning to the list with the passed information.
- * Normally the export operation continues after a warning.
- *
- * @param message the message
- * @param exception the throwable that caused the warning, or <code>null</code>
- */
- protected void addWarning(String message, Throwable error) {
- fWarnings.add(new Status(IStatus.WARNING, SearchUI.PLUGIN_ID, 0, message, error));
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java
deleted file mode 100644
index a78728dce..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.model.WorkbenchViewerSorter;
-
-import org.eclipse.search.ui.IWorkingSet;
-
-import org.eclipse.search.internal.ui.util.ListContentProvider;
-
-public class WorkingSetSelectionDialog extends SelectionDialog {
-
- private static class WorkingSetLabelProvider extends LabelProvider {
- public String getText(Object workingSet) {
- Assert.isTrue(workingSet instanceof IWorkingSet);
- return ((IWorkingSet)workingSet).getName();
- }
-
-// public Image getImage(Object workingSet) {
-// return null;
-// }
- }
-
- // sizing constants
- private final static int SIZING_SELECTION_WIDGET_HEIGHT= 200;
- private final static int SIZING_SELECTION_WIDGET_WIDTH= 50;
-
- // Providers for populating this dialog
- private ILabelProvider fLabelProvider;
- private IStructuredContentProvider fContentProvider;
-
- // The visual selection widget group
- private TableViewer fListViewer;
-
- // Modify buttons
- private Button fNewButton;
- private Button fDetailsButton;
- private Button fRemoveButton;
-
- private IWorkingSet fResult;
-
- /**
- * Creates a working set selection dialog.
- *
- * @param parentShell the parent shell
- */
- public WorkingSetSelectionDialog(Shell parentShell) {
- super(parentShell);
- setTitle(WorkingSetMessages.getString("WorkingSetSelectionDialog.title")); //$NON-NLS-1$;
- fContentProvider= new ListContentProvider();
- fLabelProvider= new WorkingSetLabelProvider();
- setMessage(WorkingSetMessages.getString("WorkingSetSelectionDialog.message")); //$NON-NLS-1$
-
- }
-
- /**
- * Add the modify buttons to the dialog.
- */
- private void addModifyButtons(Composite composite) {
-
- Composite buttonComposite= new Composite(composite, SWT.RIGHT);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- buttonComposite.setLayout(layout);
- GridData data =
- new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace= true;
- composite.setData(data);
-
- int id= IDialogConstants.CLIENT_ID + 1;
- fNewButton= createButton(buttonComposite, id++, WorkingSetMessages.getString("WorkingSetSelectionDialog.newButton.label"), false); //$NON-NLS-1$
- fNewButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WorkingSetDialog dlg= new WorkingSetDialog(getShell());
- if (dlg.open() == dlg.OK) {
- fListViewer.add(dlg.getWorkingSet());
- fListViewer.setSelection(new StructuredSelection(dlg.getWorkingSet()), true);
- WorkingSet.add(dlg.getWorkingSet());
- }
- }
- });
-
- fDetailsButton= createButton(buttonComposite, id++, WorkingSetMessages.getString("WorkingSetSelectionDialog.detailsButton.label"), false); //$NON-NLS-1$
- fDetailsButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WorkingSetDialog dlg= new WorkingSetDialog(getShell(), getWorkingSet());
- if (dlg.open() == dlg.OK)
- fListViewer.update(dlg.getWorkingSet(), null);
- }
- });
-
- fRemoveButton= createButton(buttonComposite, id++, WorkingSetMessages.getString("WorkingSetSelectionDialog.removeButton.label"), false); //$NON-NLS-1$
- fRemoveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- removeSelectedWorkingSets();
- }
- });
- }
-
- /**
- * Visually checks the previously-specified elements in this dialog's list
- * viewer.
- */
- private void checkInitialSelections() {
- fListViewer.setSelection(new StructuredSelection(getInitialSelections()), true);
- }
-
- /*
- * Overrides method from Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- // XXX: Needs help
-// WorkbenchHelp.setHelp(shell, new Object[] {IHelpContextIds.LIST_SELECTION_DIALOG});
- }
-
- /*
- * Overrides method from Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite= (Composite)super.createDialogArea(parent);
-
- createMessageArea(composite);
-
- fListViewer= new TableViewer(composite, SWT.BORDER | SWT.MULTI);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.heightHint= SIZING_SELECTION_WIDGET_HEIGHT;
- data.widthHint= SIZING_SELECTION_WIDGET_WIDTH;
- fListViewer.getTable().setLayoutData(data);
-
- fListViewer.setLabelProvider(fLabelProvider);
- fListViewer.setContentProvider(fContentProvider);
- fListViewer.setSorter(new WorkbenchViewerSorter());
-
- fListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged();
- }
- });
-
- fListViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- okPressed();
- }
- });
-
- addModifyButtons(composite);
- initializeViewer();
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Control control= super.createContents(parent);
- if (getInitialSelections() != null && !getInitialSelections().isEmpty())
- checkInitialSelections();
- updateButtonAvailability();
-
- return control;
- }
-
- /**
- * Initializes this dialog's viewer after it has been laid out.
- */
- private void initializeViewer() {
- fListViewer.setInput(Arrays.asList(WorkingSet.getWorkingSets()));
- }
-
- /*
- * Overrides method from Dialog
- */
- protected void okPressed() {
- List result= new ArrayList(1);
- fResult= getSelectedWorkingSet();
- if (fResult != null)
- result.add(fResult);
- setResult(result);
- super.okPressed();
- }
-
- private void handleSelectionChanged() {
- updateButtonAvailability();
- fResult= getSelectedWorkingSet();
- }
-
- private void updateButtonAvailability() {
- ISelection selection= fListViewer.getSelection();
- boolean hasSelection= selection != null && !selection.isEmpty();
- fRemoveButton.setEnabled(hasSelection);
- boolean hasSingleSelection= hasSelection;
- if (hasSelection && selection instanceof IStructuredSelection)
- hasSingleSelection= ((IStructuredSelection)selection).size() == 1;
- fDetailsButton.setEnabled(hasSingleSelection);
- getOkButton().setEnabled(hasSingleSelection || !hasSelection);
- }
-
- private void removeSelectedWorkingSets() {
- ISelection selection= fListViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- Iterator iter= ((IStructuredSelection)selection).iterator();
- while (iter.hasNext())
- WorkingSet.remove(((IWorkingSet)iter.next()));
- fListViewer.remove(((IStructuredSelection)selection).toArray());
- }
- }
-
- /**
- * Returns the selected working set, or <code>null</code> if
- * the selection was canceled.
- *
- * @return the selected <code>IWorkingSet</code> or <code>null</code> if Cancel was pressed
- */
- private IWorkingSet getWorkingSet() {
- return fResult;
- }
-
-
- private IWorkingSet getSelectedWorkingSet() {
- ISelection selection= fListViewer.getSelection();
- if (selection instanceof IStructuredSelection)
- return (IWorkingSet)((IStructuredSelection)selection).getFirstElement();
- return null;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetWriter.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetWriter.java
deleted file mode 100644
index b7fe2ae11..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetWriter.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.internal.workingsets;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.jface.util.Assert;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import org.eclipse.search.ui.IWorkingSet;
-
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.Serializer;
-import org.apache.xml.serialize.SerializerFactory;
-
-/**
- * Writes working sets to an underlying OutputStream
- */
-public class WorkingSetWriter extends Object {
-
- protected OutputStream fOutputStream;
-
- /**
- * Create a WorkingSetWriter on the given output stream.
- * It is the clients responsibility to close the output stream.
- **/
- public WorkingSetWriter(OutputStream outputStream) {
- Assert.isNotNull(outputStream);
- fOutputStream= new BufferedOutputStream(outputStream);
- }
-
- /**
- * Hook for possible subclasses
- **/
- protected WorkingSetWriter() {
- }
-
- /**
- * Writes an XML representation of the working set
- * to to the underlying stream.
- *
- * @exception IOException if writing to the underlying stream fails
- */
- public void writeXML(IWorkingSet[] workingSets) throws IOException {
- Assert.isNotNull(workingSets);
- DocumentBuilder docBuilder= null;
- DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
- factory.setValidating(true);
- try {
- docBuilder= factory.newDocumentBuilder();
- } catch (ParserConfigurationException ex) {
- throw new IOException(WorkingSetMessages.getString("WorkingSetWriter.error.couldNotGetXmlBuilder")); //$NON-NLS-1$
- }
- Document document= docBuilder.newDocument();
-
- // Root node for this working set
- Element xmlRoot= document.createElement(WorkingSet.TAG_WORKINGSETS);
- document.appendChild(xmlRoot);
-
- // Write each working set
- for (int i= 0; i < workingSets.length; i++)
- writeXML(workingSets[i], xmlRoot, document);
-
- // Write the document to the stream
- OutputFormat format= new OutputFormat();
- format.setIndenting(true);
- SerializerFactory serializerFactory= SerializerFactory.getSerializerFactory(Method.XML);
- Serializer serializer= serializerFactory.makeSerializer(fOutputStream, format);
- serializer.asDOMSerializer().serialize(document);
- }
-
- /**
- * Writes an XML representation of the working set
- * to the given XML element
- */
- public void writeXML(IWorkingSet workingSet, Element xmlRoot, Document document) {
- Assert.isNotNull(workingSet);
- Assert.isNotNull(document);
-
- // Root node for this working set
- Element xml= document.createElement(WorkingSet.TAG_WORKINGSET);
- xmlRoot.appendChild(xml);
-
- // Name
- xml.setAttribute(WorkingSet.TAG_NAME, workingSet.getName());
-
- // Contents
- Element contents= document.createElement(WorkingSet.TAG_CONTENTS);
- xml.appendChild(contents);
- IResource[] resources= workingSet.getResources();
- for (int i= 0; i < resources.length; i++)
- add(resources[i], contents, document);
- }
-
- /**
- * Closes this stream.
- * It is the client's responsibility to close the stream.
- *
- * @exception IOException
- */
- public void close() throws IOException {
- if (fOutputStream != null)
- fOutputStream.close();
- }
-
- private void add(IResource resource, Element parent, Document document) {
- Element element= null;
- if (resource.getType() == IResource.PROJECT) {
- element= document.createElement(WorkingSet.TAG_PROJECT);
- parent.appendChild(element);
- element.setAttribute(WorkingSet.TAG_NAME, resource.getName());
- return;
- }
- if (resource.getType() == IResource.FILE)
- element= document.createElement(WorkingSet.TAG_FILE);
- else if (resource.getType() == IResource.FOLDER)
- element= document.createElement(WorkingSet.TAG_FOLDER);
- parent.appendChild(element);
- element.setAttribute(WorkingSet.TAG_PATH, resource.getFullPath().toString()); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java b/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java
deleted file mode 100644
index c6a33ef14..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * Constants for menu groups used in context menus for Search views and editors.
- * <p>
- * This interface declares constants only; it is not intended to be implemented.
- * </p>
- *
- * @since 2.0
- */
-public interface IContextMenuConstants {
-
- /**
- * Pop-up menu: name of group for goto actions (value <code>"group.open"</code>).
- * <p>
- * Examples for open actions are:
- * <ul>
- * <li>Go Into</li>
- * <li>Go To</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_GOTO= "group.goto"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for open actions (value <code>"group.open"</code>).
- * <p>
- * Examples for open actions are:
- * <ul>
- * <li>Open To</li>
- * <li>Open With</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_OPEN= "group.open"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for show actions (value <code>"group.show"</code>).
- * <p>
- * Examples for show actions are:
- * <ul>
- * <li>Show in Navigator</li>
- * <li>Show in Type Hierarchy</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_SHOW= "group.show"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for new actions (value <code>"group.new"</code>).
- * <p>
- * Examples for new actions are:
- * <ul>
- * <li>Create new class</li>
- * <li>Create new interface</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_NEW= "group.new"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for build actions (value <code>"group.build"</code>).
- */
- public static final String GROUP_BUILD= "group.build"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for reorganize actions (value <code>"group.reorganize"</code>).
- */
- public static final String GROUP_REORGANIZE= IWorkbenchActionConstants.GROUP_REORGANIZE;
-
- /**
- * Pop-up menu: name of group for code generation or refactoring actions (
- * value <code>"group.generate"</code>).
- */
- public static final String GROUP_GENERATE= "group.generate"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for search actions (value <code>"group.search"</code>).
- */
- public static final String GROUP_SEARCH= "group.search"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for additional actions (value <code>"group.additions"</code>).
- */
- public static final String GROUP_ADDITIONS= "additions"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for viewer setup actions (value <code>"group.viewerSetup"</code>).
- */
- public static final String GROUP_VIEWER_SETUP= "group.viewerSetup"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: name of group for properties actions (value <code>"group.properties"</code>).
- */
- public static final String GROUP_PROPERTIES= "group.properties"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java b/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java
deleted file mode 100644
index 6690a107f..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IInputSelectionProvider;
-
-/**
- * Specify how clients can add menu items
- * to the context menu of the search result view.
- * A class that contributes context menu items
- * must implement this interface and pass an
- * instance of itself to the search result view.
- *
- * @see ISearchResultView#searchStarted
- */
-public interface IContextMenuContributor {
-
- /**
- * Contributes menu items to the given context menu appropriate for the
- * given selection.
- *
- * @param menu the menu to which the items are added
- * @param inputProvider the selection and input provider
- */
- public void fill(IMenuManager menu, IInputSelectionProvider inputProvider);
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java b/org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java
deleted file mode 100644
index 106177457..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.core.resources.IMarker;
-
-/**
- * Computes the key by which the markers in the search result view
- * are grouped.
- */
-public interface IGroupByKeyComputer {
-
- /**
- * Computes and returns key by which the given marker is grouped.
- *
- * @param marker the marker for which the key must be computed
- * @return an object that will be used as the key for that marker,
- * <code>null</code> if the marker seems to be invalid
- */
- public Object computeGroupByKey(IMarker marker);
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java b/org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java
deleted file mode 100644
index 1938efd54..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.jface.dialogs.IDialogPage;
-
-/**
- * Defines a page inside the search dialog.
- * Clients can contribute their own search page to the
- * dialog by implementing this interface, typically as a subclass
- * of <code>DialogPage</code>.
- * <p>
- * The search dialog calls the <code>performAction</code> method when the Search
- * button is pressed.
- * <p>
- *
- * @see org.eclipse.jface.dialogs.IDialogPage
- * @see org.eclipse.jface.dialogs.DialogPage
- */
-public interface ISearchPage extends IDialogPage {
-
- /**
- * Performs the action for this page.
- * The search dialog calls this method when the Search
- * button is pressed.
- *
- * @return <code>true</code> if the dialog can be closed after execution
- */
- public boolean performAction();
-
- /**
- * Sets the container of this page.
- * The search dialog calls this method to initialize this page.
- * Implementations may store the reference to the container.
- *
- * @param container the container for this page
- */
- public void setContainer(ISearchPageContainer container);
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java b/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java
deleted file mode 100644
index fa4c7dfb9..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * Offers client access to the search dialog.
- * A search page can enable or disable the dialog's action
- * button and get an operation context to perform the action.
- * The dialog itself cannot be accessed directly.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface ISearchPageContainer {
-
- /**
- * Workspace scope (value <code>0</code>).
- *
- * @since 2.0
- */
- public static final int WORKSPACE_SCOPE= 0;
-
- /**
- * Selection scope (value <code>1</code>).
- *
- * @since 2.0
- */
- public static final int SELECTION_SCOPE= 1;
-
- /**
- * Working set scope (value <code>2</code>).
- *
- * @since 2.0
- */
- public static final int WORKING_SET_SCOPE= 2;
-
- /**
- * Returns the selection with which this container was opened.
- *
- * @return the selection passed to this container when it was opened
- */
- public ISelection getSelection();
-
- /**
- * Returns the context for the search operation.
- * This context allows progress to be shown inside the search dialog.
- *
- * @return the <code>IRunnableContext</code> for the search operation
- */
- public IRunnableContext getRunnableContext();
-
- /**
- * Sets the enable state of the perform action button
- * of this container.
- *
- * @param state <code>true</code> to enable the button which performs the action
- */
- public void setPerformActionEnabled(boolean state);
-
-
- /**
- * Returns search container's selected scope.
- * The scope is WORKSPACE_SCOPE, SELECTION_SCOPE or WORKING_SET_SCOPE.
- *
- * @return the selected scope
- * @since 2.0
- */
- public int getSelectedScope();
-
- /**
- * Sets the selected scope of this search page container.
- * The scope is WORKSPACE_SCOPE, SELECTION_SCOPE or WORKING_SET_SCOPE.
- *
- * @return the selected scope
- * @since 2.0
- */
- public void setSelectedScope(int scope);
-
- /**
- * Tells whether a valid scope is selected.
- *
- * @return a <code>true</code> if a valid scope is selected in this search page container
- * @since 2.0
- */
- public boolean hasValidScope();
-
- /**
- * Returns the selected working set of this container.
- * <p>
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @return the selected IWorkingSet or <code>null</code> if the scope is not WORKING_SET_SCOPE
- * @since 2.0
- */
- public IWorkingSet getSelectedWorkingSet();
-
- /**
- * Sets the selected working set of this container.
- * <p>
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @param workingSet the IWorkingSet to be selected
- * @since 2.0
- */
- public void setSelectedWorkingSet(IWorkingSet workingSet);
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java b/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java
deleted file mode 100644
index dd6a12b3b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-/**
- * Computes a score that is used by the search dialog
- * to find the best fitting page for a selection when opened.
- * The score has no upper limit but must be at least
- * <code>LOWEST</code>. Higher values means the page is better
- * suited for the given selection input.
- * <p>
- * For example, a Java-specific search page score computer could test
- * if the page is a Java search page and returns high scores
- * for Java elements as selection input.
- * </p>
- */
-public interface ISearchPageScoreComputer {
-
- /**
- * Invalid score value indicating a score is unknown or undecided.
- */
- public static final int UNKNOWN= -1;
-
- /**
- * Lowest possible valid score.
- */
- public static final int LOWEST= 0;
-
- /**
- * Computes and returns a score indicating how good the page with the given
- * id can handle the given input element.
- * The search page id appears as the <code>id</code> attribute of the
- * <code>&lt;page&gt;</code> element contributed to the
- * search pages extension point (<code>"org.eclipse.search.searchPages"</code>).
- *
- * @param pageId the string id of the page for which the score is computed
- * @param input the object based on which the page should open
- * @return a score higher or equal to <code>LOWEST</code>, or
- * <code>UNKNOWN</code> if this computer cannot decide
- */
- public int computeScore(String pageId, Object input);
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java b/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java
deleted file mode 100644
index 5f7c56f81..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Provides client access to the search result view.
- * Each element in the view is a <code>ISearchResultViewEntry</code>,
- * which groups markers based on the <code>groupByKey</code> provided
- * by the client each time when adding a match. If every match should
- * show up in the search result view then the match itself can be used
- * as key.
- * <p>
- * The search result view has id <code>"org.eclipse.search.SearchResultView"</code>.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface ISearchResultView extends IViewPart {
-
- /**
- * Returns the current selection of the search result view
- *
- * @return the current selection of the search result view
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection
- */
- public ISelection getSelection();
-
- /**
- * Informs the view that a search has started.
- * Provides all necessary information to create an entry in the search result
- * view.
- * If every match should show up in the search result view then the match
- * itself can be used as key.
- *
- * @param pageId the id of the search page which started the search
- * @param label the label to be used for this search occurrence
- * @param imageDescriptor the image descriptor to be used for this search occurrence,
- * or <code>null</code> if this search should not have an image
- * @param contributor the context menu contributor
- * or <code>null</code> if no context menu is contributed
- * @param labelProvider the label provider used by this search result view
- * or <code>null</code> if the default provider should be used.
- * The default label provider shows the resource name and the corresponding image.
- * @param gotoAction the action used by the view to go to a marker
- * @param groupByKeyComputer the computer used by the view to compute the key for a marker
- * @param operation the runnable used by the view to repeat the search
- * @deprecated As of build > 20011107, replaced by the new version with additonal parameter
- */
- public void searchStarted(
- String pageId,
- String label,
- ImageDescriptor imageDescriptor,
- IContextMenuContributor contributor,
- ILabelProvider labelProvider,
- IAction gotoAction,
- IGroupByKeyComputer groupByKeyComputer,
- IRunnableWithProgress operation);
-
- /**
- * Informs the view that a search has started.
- * Provides all necessary information to create an entry in the search result
- * view.
- * If every match should show up in the search result view then the match
- * itself can be used as key.
- *
- * @param pageId the id of the search page which started the search
- * @param singularLabel the label to be used for this search occurrence
- * if there is one match
- * or <code>null</code> if the pluralLabelPattern should be used
- * @param pluralLabelPattern the label pattern to be used for this search occurrence
- * if there are more than one matches or none.
- * This string may contain {0} which will be replace by the match count
- * @param imageDescriptor the image descriptor to be used for this search occurrence,
- * or <code>null</code> if this search should not have an image
- * @param contributor the context menu contributor
- * or <code>null</code> if no context menu is contributed
- * @param labelProvider the label provider used by this search result view
- * or <code>null</code> if the default provider should be used.
- * The default label provider shows the resource name and the corresponding image.
- * @param gotoAction the action used by the view to go to a marker
- * @param groupByKeyComputer the computer used by the view to compute the key for a marker
- * @param operation the runnable used by the view to repeat the search
- * @since 2.0
- */
- public void searchStarted(
- String pageId,
- String singularLabel,
- String pluralLabelPattern,
- ImageDescriptor imageDescriptor,
- IContextMenuContributor contributor,
- ILabelProvider labelProvider,
- IAction gotoAction,
- IGroupByKeyComputer groupByKeyComputer,
- IRunnableWithProgress operation);
-
- /**
- * Informs the view that the search has finished.
- * This method must also be called in case of the search
- * fails or has been canceled.
- */
- public void searchFinished();
-
- /**
- * Informs the view that a match has been found.
- * Provides all necessary information to create a search result entry in this
- * view.
- * <p>
- * Note: It is the clients responsibility to create the marker for this match.
- * </p>
- *
- * @param description the text description of the match
- * @param groupByKey the <code>Object</code> by which this match is grouped
- * @param marker the marker for this match
- * @param resource the marker's resource passed for optimization
- */
- public void addMatch(String description, Object groupByKey, IResource resource, IMarker marker);
-
- /**
- * Returns the label provider of a search result view.
- *
- * @return the label provider of a search result view or <code>null</code>
- * @since 2.0
- */
- public ILabelProvider getLabelProvider();
-} \ No newline at end of file
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java b/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java
deleted file mode 100644
index 8b97e8d18..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-
-/**
- * Specifies a search result view entry.
- * This entry provides information about the markers
- * it groups by a client defined key. Each entry in the search
- * result view corresponds to a different key.
- * <p>
- * The UI allows stepping through this entry's markers grouped by the key.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface ISearchResultViewEntry {
-
- /**
- * Returns the key by which this entry's markers
- * are logically grouped. A line in a text could be such a key.
- * Clients supply this key as a parameter to <code>ISearchResultView.addMatch</code>.
- *
- * @return the common resource of this entry's markers
- * @see ISearchResultView#addMatch
- */
- public Object getGroupByKey();
-
- /**
- * Returns the resource to which this entry's markers are attached.
- * This is a convenience method for <code>getSelectedMarker().getResource()</code>.
- *
- * @return the common resource of this entry's markers
- */
- public IResource getResource();
-
- /**
- * Returns the number of markers grouped by this entry.
- *
- * @return the number of markers
- */
- public int getMatchCount();
-
- /**
- * Returns the selected marker of this entry, or the first one
- * if no marker is selected.
- * A search results view entry can group markers
- * which the UI allows the user to step through them while
- * this entry remains selected.
- *
- * @return the selected marker inside this entry, or
- * <code>null</code> if the entry has no markers
- */
- public IMarker getSelectedMarker();
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/IWorkingSet.java b/org.eclipse.search/search/org/eclipse/search/ui/IWorkingSet.java
deleted file mode 100644
index d9dd39df1..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IWorkingSet.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * <p>
- * This interface is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @since 2.0
- */
-public interface IWorkingSet {
-
- /**
- * Returns the name of the working set.
- *
- * @return the name of the working set as <code>String</code>
- */
- public String getName();
-
- /**
- * Returns the resources that are contained in this working set.
- *
- * @return the working set's resources as array of <code>IResource</code>
- */
- public IResource[] getResources();
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java b/org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java
deleted file mode 100644
index dff183c10..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.search.ui;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.SearchPluginImages;
-import org.eclipse.search.internal.workingsets.WorkingSet;
-import org.eclipse.search.internal.workingsets.WorkingSetSelectionDialog;
-
-/**
- * The central class for access to the Search Plug-in's User Interface.
- * This class cannot be instantiated; all functionality is provided by
- * static methods.
- *
- * Features provided:
- * <ul>
- * <li>convenient access to the search result view of the active workbench
- * window.</li>
- * </ul>
- *
- * @see ISearchResultView
- */
-public final class SearchUI {
-
- /**
- * Search Plug-in Id (value <code>"org.eclipse.search"</code>).
- */
- public static final String PLUGIN_ID= "org.eclipse.search"; //$NON-NLS-1$
-
- /**
- * Search marker type (value <code>"org.eclipse.search.searchmarker"</code>).
- *
- * @see org.eclipse.core.resources.IMarker
- */
- public static final String SEARCH_MARKER= PLUGIN_ID + ".searchmarker"; //$NON-NLS-1$
-
- /**
- * Line marker attribute (value <code>"line"</code>)
- * The value of the marker attribute is the line which contains the text search match.
- *
- * @see org.eclipse.core.resources.IMarker#getAttribute
- */
- public static final String LINE= "line"; //$NON-NLS-1$
-
- /**
- * Id of the Search result view
- * (value <code>"org.eclipse.search.SearchResultView"</code>).
- */
- public static final String SEARCH_RESULT_VIEW_ID= PLUGIN_ID + ".SearchResultView"; //$NON-NLS-1$
-
- /**
- * Id of the Search action set
- * (value <code>"org.eclipse.search.searchActionSet"</code>).
- *
- * @since 2.0
- */
- public static final String ACTION_SET_ID= PLUGIN_ID + ".searchActionSet"; //$NON-NLS-1$
-
- /**
- * Activates the search result view in the active page of the
- * active workbench window. This call has no effect (but returns <code>true</code>
- * if the search result view is already activated.
- *
- * @return <code>true</code> if the search result view could be activated
- */
- public static boolean activateSearchResultView() {
- return SearchPlugin.activateSearchResultView();
- }
-
- /**
- * Returns the search result view of the active page of the
- * active workbench window.
- *
- * @return the search result view or <code>null</code>
- * if there is no active search result view
- */
- public static ISearchResultView getSearchResultView() {
- return SearchPlugin.getSearchResultView();
- }
-
- /**
- * Returns the shared search marker image.
- * Normally, editors show this icon in their vertical ruler.
- * This image is owned by the search UI plug-in and must not be disposed
- * by clients.
- *
- * @return the shared image
- */
- public static Image getSearchMarkerImage() {
- return SearchPluginImages.get(SearchPluginImages.IMG_OBJ_SEARCHMARKER);
- }
-
- /**
- * Creates a selection dialog that lists all working sets and allows to
- * add and edit working sets.
- * The caller is responsible for opening the dialog with <code>Window.open</code>,
- * and subsequently extracting the selected working sets (of type
- * <code>IWorkingSet</code>) via <code>SelectionDialog.getResult</code>.
- * <p>
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @param parent the parent shell of the dialog to be created
- * @return a new selection dialog or <code>null</code> if none available
- * @since 2.0
- */
- public static SelectionDialog createWorkingSetDialog(Shell parent) {
- return new WorkingSetSelectionDialog(parent);
- }
-
- /**
- * Returns all working sets for the workspace.
- *
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @return an array of IWorkingSet
- * @since 2.0
- */
- public static IWorkingSet[] getWorkingSets() {
- return WorkingSet.getWorkingSets();
- }
-
- /**
- * Returns a working set by name.
- *
- * This method is for internal use only due to issue below. Once
- * the issues is solved there will be an official API.
- * </p>
- * <p>
- * [Issue: Working set must be provided by platform.]
- * </p>
- *
- * @param name the name the working set
- * @return the working set with the given name or <code>null</code> if not found
- * @since 2.0
- */
- public static IWorkingSet findWorkingSet(String name) {
- return WorkingSet.find(name);
- }
-
- /**
- * Returns the preference whether editors should be reused
- * when showing search results.
- *
- * The goto action can decide to use or ignore this preference.
- *
- * <p>
- * [Issue: Work in progress - not yet stable.]
- * </p>
- * <p>
- * [Issue: Always returns <code>true</code> yet due to bug 6784.]
- * </p>
- * <p>
- * [Issue: Bug is now fixed and method. But because it is not yet clear if
- * old style should be supported. Therefore returning <code>false</code>]
- * </p>
- *
- * @return <code>true</code> if editors should be reused for showing search results
- * @since 2.0
- */
- public static boolean reuseEditor() {
- return false;
- }
-
- /**
- * Block instantiation.
- */
- private SearchUI() {
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/ui/package.html b/org.eclipse.search/search/org/eclipse/search/ui/package.html
deleted file mode 100644
index 406d2d567..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/package.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-Provides classes and interfaces for search pages.
-New search dialog pages can be contributed via a plug-in extension point.
-This package provides the interfaces and classes to implement these dialog
-pages and offers hooks to populate the search result view.
-<h2>
-Package Specification</h2>
-Each search dialog page must implement <tt>ISearchPage</tt>. A search page
-has access to its container (<tt>ISearchPageContainer</tt>) to modify search
-dialog properties. The class <tt>SearchUI</tt> can activate the search
-results view and provide access to the active search results view (<tt>ISearchResultView</tt>).
-<p>It is the clients responsibility to create a marker for each match and
-then report the match to the search result view together with a key (<tt>groupByKey</tt>).
-Each key corresponds to a search result view entry (<tt>ISearchResultViewEntry</tt>)
-which allows to step through the markers grouped by the key.
-</body>
-</html>

Back to the top