Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2003-03-27 14:42:24 +0000
committercvs2svn2003-03-27 14:42:24 +0000
commitc0abc72720269f872d33d1430379375560605ced (patch)
tree4ef07a2c1d10649a21724e77d186bdbcf2e7ca9f
parent2f321dfe2dfeef1094431c604adb8a27f3eec4e3 (diff)
downloadeclipse.platform.text-rich_client_platform_01.tar.gz
eclipse.platform.text-rich_client_platform_01.tar.xz
eclipse.platform.text-rich_client_platform_01.zip
This commit was manufactured by cvs2svn to create branchrich_client_platform_01
'rich_client_platform_01'. Sprout from master 2003-03-27 14:42:22 UTC Kai Maetzel <kmaetzel> 'JavaDoc' Delete: org.eclipse.search/.classpath org.eclipse.search/.cvsignore org.eclipse.search/.project org.eclipse.search/about.html org.eclipse.search/build.properties org.eclipse.search/buildnotes_search.html org.eclipse.search/hglegal2003.htm 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/ngibmcpy2003.gif org.eclipse.search/old_buildnotes_search_2_0.html org.eclipse.search/plugin.properties org.eclipse.search/plugin.xml org.eclipse.search/schema/searchPages.exsd org.eclipse.search/schema/searchResultSorters.exsd org.eclipse.search/scripts/exportplugin.xml 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/OpenFileSearchPageAction.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/RemovePotentialMatchesAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.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/SearchPreferencePage.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/SearchResultViewEntryAdapterFactory.java org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.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/WorkingSetComparator.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/ReplaceAction.java org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.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/TextSearchActionGroup.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/ComboFieldEditor.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/ui/IActionGroupFactory.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/SearchUI.java org.eclipse.search/search/org/eclipse/search/ui/package.html org.eclipse.ui.examples.javaeditor/.classpath org.eclipse.ui.examples.javaeditor/.cvsignore org.eclipse.ui.examples.javaeditor/.project org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentProvider.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorEnvironment.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaPartitionScanner.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gif org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java org.eclipse.ui.examples.javaeditor/about.html org.eclipse.ui.examples.javaeditor/build.properties org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gif org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gif org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html org.eclipse.ui.examples.javaeditor/icons/obj16/java.gif org.eclipse.ui.examples.javaeditor/plugin.properties org.eclipse.ui.examples.javaeditor/plugin.xml
-rw-r--r--org.eclipse.search/.classpath11
-rw-r--r--org.eclipse.search/.cvsignore1
-rw-r--r--org.eclipse.search/.project34
-rw-r--r--org.eclipse.search/about.html30
-rw-r--r--org.eclipse.search/build.properties18
-rw-r--r--org.eclipse.search/buildnotes_search.html3403
-rw-r--r--org.eclipse.search/hglegal2003.htm14
-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.gifbin179 -> 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.gifbin177 -> 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/ngibmcpy2003.gifbin1101 -> 0 bytes
-rw-r--r--org.eclipse.search/old_buildnotes_search_2_0.html925
-rw-r--r--org.eclipse.search/plugin.properties47
-rw-r--r--org.eclipse.search/plugin.xml194
-rw-r--r--org.eclipse.search/schema/searchPages.exsd219
-rw-r--r--org.eclipse.search/schema/searchResultSorters.exsd165
-rw-r--r--org.eclipse.search/scripts/exportplugin.xml31
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java96
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java61
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java44
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java76
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java163
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java264
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java67
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java89
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java33
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenFileSearchPageAction.java61
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java84
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java26
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java26
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java60
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java75
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java96
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.java163
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java387
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java213
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java27
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java546
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java86
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java533
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java65
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties210
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java323
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java347
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java111
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java209
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java39
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java72
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java325
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java198
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntryAdapterFactory.java52
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java694
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.java43
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java104
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java218
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java106
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/WorkingSetComparator.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java143
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java25
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java224
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java379
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java65
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java65
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java139
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java89
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java585
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java139
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ComboFieldEditor.java186
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java143
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java355
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java132
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java109
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java47
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java125
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java144
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java172
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java151
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java394
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java291
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IActionGroupFactory.java40
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java114
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java35
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java47
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java115
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java50
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java184
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java66
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java183
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/package.html25
-rw-r--r--org.eclipse.ui.examples.javaeditor/.classpath10
-rw-r--r--org.eclipse.ui.examples.javaeditor/.cvsignore1
-rw-r--r--org.eclipse.ui.examples.javaeditor/.project32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java90
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java38
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java237
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentProvider.java63
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java148
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorEnvironment.java73
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java36
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties39
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java144
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java45
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java52
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java268
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java69
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java111
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java237
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaPartitionScanner.java104
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java68
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java80
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gifbin125 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java58
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java27
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java34
-rw-r--r--org.eclipse.ui.examples.javaeditor/about.html30
-rw-r--r--org.eclipse.ui.examples.javaeditor/build.properties21
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm14
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm13
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gifbin1045 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html236
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/obj16/java.gifbin140 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.properties21
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.xml40
160 files changed, 0 insertions, 19143 deletions
diff --git a/org.eclipse.search/.classpath b/org.eclipse.search/.classpath
deleted file mode 100644
index ca3a06817..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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.search/.cvsignore b/org.eclipse.search/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.search/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.search/.project b/org.eclipse.search/.project
deleted file mode 100644
index f1aac357f..000000000
--- a/org.eclipse.search/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.search</name>
- <comment></comment>
- <projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.search/about.html b/org.eclipse.search/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/org.eclipse.search/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</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
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-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>
-
-</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 b4d9c8eed..000000000
--- a/org.eclipse.search/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- about.html,\
- icons/,\
- plugin.properties,\
- *.jar
-src.includes = about.html,\
- schema/
-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 7822f778b..000000000
--- a/org.eclipse.search/buildnotes_search.html
+++ /dev/null
@@ -1,3403 +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 20030227
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F20&amp;chfieldto=2003%2F02%2F27&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 2003/02/20 and 2003/02/27.<br>
-<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030220
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F18&amp;chfieldto=2003%2F02%2F20&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 2003/02/18 and 2003/02/20.<br>
-<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030218
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F13&amp;chfieldto=2003%2F02%2F18&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 2003/02/13 and 2003/02/18.<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030213
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F11&amp;chfieldto=2003%2F02%2F13&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 2003/02/11 and 2003/02/13.<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030211
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F07&amp;chfieldto=2003%2F02%2F11&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 2003/02/07 and 2003/02/11.<br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030206
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F02%2F05&amp;chfieldto=2003%2F02%2F06&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 2003/02/05 and 2003/02/06.<br>
-
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030205
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F01%2F28&amp;chfieldto=2003%2F02%2F05&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 2003/01/28 and 2003/02/05.<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030128
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F01%2F21&amp;chfieldto=2003%2F01%2F28&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 2003/01/21 and 2003/01/28.<br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030121
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F01%2F14&amp;chfieldto=2003%2F01%2F21&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 2003/01/14 and 2003/01/21.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030114
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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=2003%2F01%2F07&amp;chfieldto=2003%2F01%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 2003/01/07 and 2003/01/14.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20030107
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F12%2F16&amp;chfieldto=2003%2F01%2F07&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/12/16 and 2003/01/07.<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021216
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F12%2F13&amp;chfieldto=2002%2F12%2F16&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/12/13 and 2002/12/16.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021213
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F12%2F10&amp;chfieldto=2002%2F12%2F13&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/12/10 and 2002/12/13.<br>
-<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021210
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F11%2F26&amp;chfieldto=2002%2F12%2F10&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/11/26 and 2002/12/10.<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021126
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F11%2F19&amp;chfieldto=2002%2F11%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/11/19 and 2002/11/26.<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021119
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F11%2F13&amp;chfieldto=2002%2F11%2F19&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/11/13 and 2002/11/19.
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021113
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F11%2F12&amp;chfieldto=2002%2F11%2F13&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/11/12 and 2002/11/13.
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021112
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F10%2F29&amp;chfieldto=2002%2F11%2F12&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/10/29 and 2002/11/12.
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021029
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li>A default perspective can be configured for the Search view.<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%2F10%2F15&amp;chfieldto=2002%2F10%2F29&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/10/15 and 2002/10/29.<br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021015
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F10%2F08&amp;chfieldto=2002%2F10%2F15&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/10/08 and 2002/10/15.<br>
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021008
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F10%2F01&amp;chfieldto=2002%2F10%2F08&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/10/01 and 2002/10/08.<br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20021001
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-
-<ul>
-<li><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%2F09%2F19&amp;chfieldto=2002%2F10%2F01&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/09/19 and 2002/10/01.<br>
-<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020919
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-
-<ul>
-<li>Added "openWith" context menu<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%2F09%2F10&amp;chfieldto=2002%2F09%2F20&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/09/10 and 2002/09/19.<br>
-<br>
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020910
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-
-<ul>
-<li><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%2F09%2F03&amp;chfieldto=2002%2F09%2F10&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/09/03 and 2002/09/10.<br>
-<br>
-
-<br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020903
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-
-<ul>
-<li><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%2F08%2F27&amp;chfieldto=2002%2F09%2F03&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/08/27 and 2002/09/03.<br>
-<br>
-
-<br>
-
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020827
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-
-<ul>
-<li><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%2F08%2F20&amp;chfieldto=2002%2F08%2F27&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/08/20 and 2002/08/27.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020820
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-
-<ul>
-<li>Search view supports select all<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%2F08%2F13&amp;chfieldto=2002%2F08%2F20&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/08/13 and 2002/08/20.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020813
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-
-<ul>
-<li><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%2F07%2F23&amp;chfieldto=2002%2F08%2F13&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/07/23 and 2002/08/13.<br>
-
-<br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020723
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-
-<ul>
-
-<li>Removed all 2.0 build notes. They can be found in <a href="buildnotes_search_2_0.html">buildnotes_search_2_0.html</a><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%2F06%2F29&amp;chfieldto=2002%2F07%2F23&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/06/29 and 2002/07/23.<br>
-
-<br>
-
-<br>
-
-<a href="hglegal2003.htm"><img src="ngibmcpy2003.gif" border="0" height="14" width="324" alt="Copyright IBM Corporation and others 2000, 2003."></a>
-<br>
-
-<br>
-
-<br>
-
-<br>
-
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-</body></html>
diff --git a/org.eclipse.search/hglegal2003.htm b/org.eclipse.search/hglegal2003.htm
deleted file mode 100644
index 47c8540c8..000000000
--- a/org.eclipse.search/hglegal2003.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">
- <LINK REL="stylesheet" HREF="book.css" CHARSET="ISO-8859-1" TYPE="text/css">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.
-</body>
-</html>
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 8b39ab3b8..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 7425e604f..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/ngibmcpy2003.gif b/org.eclipse.search/ngibmcpy2003.gif
deleted file mode 100644
index c786e43e1..000000000
--- a/org.eclipse.search/ngibmcpy2003.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.search/old_buildnotes_search_2_0.html b/org.eclipse.search/old_buildnotes_search_2_0.html
deleted file mode 100644
index d36c4a794..000000000
--- a/org.eclipse.search/old_buildnotes_search_2_0.html
+++ /dev/null
@@ -1,925 +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 20020618
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Reverted File/Text search back to only ignore derived resoureces<br></li><li>Removed dependency on Team Support Core 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%2F06%2F06&amp;chfieldto=2002%2F06%2F18&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/06/06 and 2002/06/18.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020606
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Reverted File/Text search back to only ignore derived resoureces<br>
-</li><li>Removed dependency on Team Support Core 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%2F05%2F31&amp;chfieldto=2002%2F06%2F06&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/05/31 and 2002/06/06.<br>
-<br>
-<hr size="1" width="100%"><br>
-
-
-
-
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020531
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>File search ignores derived and to be ignored resource (see Team preference page)</li><li>Text search ignores binary files<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%2F05%2F28&amp;chfieldto=2002%2F05%2F31&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/05/28 and 2002/05/31.<br>
-<br>
-<hr size="1" width="100%">
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020528
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F05%2F21&amp;chfieldto=2002%2F05%2F28&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/05/21 and 2002/05/28.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020521
-
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F05%2F18&amp;chfieldto=2002%2F05%2F21&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/05/18 and 2002/05/21.<br>
-<br>
-<hr size="1" width="100%">
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020518
-
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Global menu for Search actions</li><li>Replace is now available on text search results<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%2F05%2F14&amp;chfieldto=2002%2F05%2F18&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/05/14 and 2002/05/18.<br>
-<br>
-<hr size="1" width="100%">
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020514
-
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F05%2F08&amp;chfieldto=2002%2F05%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/05/08 and 2002/05/14.<br>
-<br>
-<hr size="1" width="100%"><br>
-
-
-
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020508
-
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>The visible search pages can be configured in the Search dialog.<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%2F04%2F30&amp;chfieldto=2002%2F05%2F08&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/04/30 and 2002/05/08.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020430
-
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Removed the deprecated working set API</li><li>Search dialog no longer reserves space for scope for all pages but only those that require it<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%2F04%2F23&amp;chfieldto=2002%2F04%2F30&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/04/23 and 2002/04/30.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020423
-
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F04%2F19&amp;chfieldto=2002%2F04%2F23&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/04/18 and 2002/04/23.<br>
-<br>
-<hr size="1" width="100%">
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
-
-
- Eclipse Build Input 20020418
-
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F04%2F16&amp;chfieldto=2002%2F04%2F19&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/04/16 and 2002/04/18.<br>
-<br>
-<hr size="1" width="100%">
-
-
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
- Eclipse Build Input 20020416
-
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li>Search no longer uses its own implementation of working sets but takes
-advantage of the workbench working set support. As a consequence you will
-have to redefine your existing working sets.<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%2F04%2F11&amp;chfieldto=2002%2F04%2F17&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/04/11 and 2002/04/16.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
-
-
- Eclipse Build Input 20020411
-
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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%2F04%2F09&amp;chfieldto=2002%2F04%2F12&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/04/09
-and 2002/04/11.<br>
-<br>
-<hr size="1" width="100%"><br>
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
-
-
- Eclipse Build Input 20020409
-
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><i>Text Search</i> has been changed to <i>File Search</i> and now allows to search for files with a given file name pattern.<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%2F04%2F02&amp;chfieldto=2002%2F04%2F09&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/04/02
-and 2002/04/09.<br>
-<br>
-<hr size="1" width="100%"><br>
-
-<h1>Eclipse Platform Build Notes<br>
- Search</h1>
-
-
- Eclipse Build Input 20020402
-
-
-<h2> What's new in this drop</h2>
-<ul>
-<li><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/26
-and 2002/04/02.<br>
-<br>
-<hr size="1" width="100%"><br>
-
-
-<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%2F26&amp;chfieldto=2002%2F04%2F02&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/plugin.properties b/org.eclipse.search/plugin.properties
deleted file mode 100644
index f8e4c8ba3..000000000
--- a/org.eclipse.search/plugin.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-pluginName= Search Support
-providerName= Eclipse.org
-
-searchMarker= Search Marker
-
-searchPages= Search Pages
-searchResultSorters= Search Result Sorters
-
-search= Search
-
-searchMenu.label= Se&arch
-openFileSearchPageAction.label= &File...
-
-openSearchDialogAction.label= Se&arch...
-openSearchDialogAction.tooltip= Search
-
-fileSearch= File Search
-searchResultViewName= Search
-
-ResourcenameSorter.label= &Name
-ResourcenameSorter.tooltip= Sort by Resource Name
-ResourcePathSorter.label= &Path
-ResourcePathSorter.tooltip= Sort by Resource Path
-
-SearchPreferencePage.label= Search
-
-ActionDefinition.openSearchDialog.name= Open Search Dialog
-ActionDefinition.openSearchDialog.description= Open the Search dialog
-
-ActionDefinition.openFileSearchPage.name= File Search
-ActionDefinition.openFileSearchPage.description= Open the Search dialog\'s file search page
-
-SearchMarkerPreference.label= Search Results
-
-searchCategory.name= Search
-searchCategory.description= Search command category
diff --git a/org.eclipse.search/plugin.xml b/org.eclipse.search/plugin.xml
deleted file mode 100644
index e7a58b3d9..000000000
--- a/org.eclipse.search/plugin.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- Search Plugin -->
-<!-- ======================================================================= -->
-<plugin
- name="%pluginName"
-
- id="org.eclipse.search"
- version="2.1.0"
- provider-name="%providerName"
- 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 = "*"/>
- <packages prefixes="org.eclipse.search.ui,org.eclipse.search.internal"/>
- </library>
- </runtime>
-
-
- <!-- Search extension point definitions -->
-
- <extension-point name="%searchPages" id="searchPages" schema="schema/searchPages.exsd"/>
- <extension-point name="%searchResultSorters" id="searchResultSorters" schema="schema/searchResultSorters.exsd"/>
-
-
- <!-- Extensions -->
-
- <extension point="org.eclipse.core.resources.markers" id="searchmarker" name="%searchMarker">
- <super type="org.eclipse.core.resources.textmarker"/>
- <attribute name="line"/>
- <attribute name="potentialMatch"/>
- </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>
-
- <!-- commands and their bindings -->
- <extension point="org.eclipse.ui.commands">
- <category
- name="%searchCategory.name"
- description="%searchCategory.description"
- id="org.eclipse.search.ui.category.search"
- />
-
- <command
- category="org.eclipse.search.ui.category.search"
- id="org.eclipse.search.ui.openSearchDialog"
- name= "%ActionDefinition.openSearchDialog.name"
- description="%ActionDefinition.openSearchDialog.description"
- />
- <keyBinding
- string="Ctrl+H"
- scope="org.eclipse.ui.globalScope"
- command="org.eclipse.search.ui.openSearchDialog"
- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"
- />
-
- <command
- category="org.eclipse.search.ui.category.search"
- id="org.eclipse.search.ui.openFileSearchPage"
- name= "%ActionDefinition.openFileSearchPage.name"
- description="%ActionDefinition.openFileSearchPage.description"
- />
- <keyBinding
- string=""
- scope="org.eclipse.ui.globalScope"
- command="org.eclipse.search.ui.openFileSearchPage"
- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"
- />
- </extension>
-
- <!-- action sets -->
- <extension point="org.eclipse.ui.actionSets">
- <actionSet
- id="org.eclipse.search.searchActionSet"
- label="%search"
- visible="true">
-
- <!-- =================================================================== -->
- <!-- Search Menu -->
- <!-- =================================================================== -->
-
- <menu
- id="org.eclipse.search.menu"
- label="%searchMenu.label"
- path="navigate">
- <groupMarker name="internalDialogGroup"/> <!-- not to be used by clients -->
- <groupMarker name="dialogGroup"/> <!-- to be used by clients -->
- <separator name="contextMenuActionsGroup"/>
- </menu>
-
- <!-- dialog group -->
- <action id="org.eclipse.search.OpenFileSearchPage"
- definitionId="org.eclipse.search.ui.openFileSearchPage"
- menubarPath="org.eclipse.search.menu/internalDialogGroup"
- label="%openFileSearchPageAction.label"
- icon="icons/full/obj16/tsearch_obj.gif"
- helpContextId="file_search_action_context"
- class="org.eclipse.search.internal.ui.OpenFileSearchPageAction"/>
-
- <action id="org.eclipse.search.OpenSearchDialog"
- definitionId="org.eclipse.search.ui.openSearchDialog"
- toolbarPath="Normal/Search"
- menubarPath="org.eclipse.search.menu/internalDialogGroup"
- label="%openSearchDialogAction.label"
- tooltip="%openSearchDialogAction.tooltip"
- icon="icons/full/ctool16/search.gif"
- helpContextId="open_search_dialog_action_context"
- 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="%fileSearch"
- 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>
-
- <extension
- point="org.eclipse.ui.preferencePages">
- <page name="%SearchPreferencePage.label"
- id="org.eclipse.search.preferences.SearchPreferencePage"
- class="org.eclipse.search.internal.ui.SearchPreferencePage"
- category="org.eclipse.ui.preferencePages.Workbench">
- </page>
- </extension>
-
- <extension
- point="org.eclipse.ui.workbench.texteditor.markerAnnotationSpecification">
- <specification
- annotationType="org.eclipse.search.results"
- label="%SearchMarkerPreference.label"
- markerType="org.eclipse.search.searchmarker"
- textPreferenceKey="searchResultIndication"
- textPreferenceValue="true"
- overviewRulerPreferenceKey="searchResultIndicationInOverviewRuler"
- overviewRulerPreferenceValue="true"
- colorPreferenceKey="searchResultIndicationColor"
- colorPreferenceValue="192,192,192"
- presentationLayer="3">
- </specification>
- </extension>
-
-</plugin> \ No newline at end of file
diff --git a/org.eclipse.search/schema/searchPages.exsd b/org.eclipse.search/schema/searchPages.exsd
deleted file mode 100644
index 04bc053e8..000000000
--- a/org.eclipse.search/schema/searchPages.exsd
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.search">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.search" id="searchPages" name="Search Pages"/>
- </appInfo>
- <documentation>
- 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.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="page" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="page">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="label" icon="icon"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique name that will be used to identify this
-search page
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- a translatable label that will be used in the search
-page tab
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- a name of the class. We recommend subclassing
-&lt;samp&gt;org.eclipse.jface.dialogs.DialogPage&lt;/samp&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jface.dialogs.DialogPage:org.eclipse.search.ui.ISearchPage"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- a relative name of the image that will be used
-for all resources that match the specified extensions.
-If omitted, the search page&apos;s tab will only contain a label.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="sizeHint" type="string">
- <annotation>
- <documentation>
- a hint for the initial size of the page. This is a string
-containing the width and height separated by
-comma (e.g. &quot;50, 60&quot;). In the case this hint is
-omitted the page will be no larger than the other pages.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="tabPosition" type="string">
- <annotation>
- <documentation>
- 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:
-&lt;ol&gt;
-&lt;li&gt;
-if neither page defines the tab position then they are
-ordered alphabetically according to their labels
-&lt;/li&gt;
-&lt;li&gt;
-if both pages have the tab position specified then the
-page with the lower value comes first. If the values
-are equal then the pages are treated as if the values
-would not exist (see 1.)
-&lt;/li&gt;
-&lt;li&gt;
-if only one page has the value specified then this
-page comes first
-&lt;/ol&gt;
- </documentation>
- </annotation>
- </attribute>
- <attribute name="extensions" type="string">
- <annotation>
- <documentation>
- 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 &quot;*&quot; can be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="showScopeSection" type="boolean">
- <annotation>
- <documentation>
- If this attribute is missing or set to &quot;false&quot;, then the scope section is not shown in the Search dialog.
-To see the scope section, this attribute has to be set to &quot;true&quot;.
-Plug-ins which add their own Search page and want to see the scope section have to add this to their plugin.xml.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="enabled" type="boolean">
- <annotation>
- <documentation>
- If this attribute is missing or set to &quot;false&quot;, then the page is not initially shown in the Search dialog.
-The page can be activated by the user via the &quot;Customize...&quot; button on the Search dialog.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a search page extension
-definition:
-
-&lt;p&gt;
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.search.searchPages&quot;&gt;
- &lt;page
- id=&quot;org.eclipse.search.ui.text.TextSearchPage&quot;
- label=&quot;Text Search&quot;
- icon=&quot;icons/full/obj16/tsearch_pref.gif&quot;
- sizeHint=&quot;250,160&quot;
- tabPosition=&quot;1&quot;
- extensions=&quot;*:1&quot;
- showScopeSection=&quot;true&quot;
- class=&quot;org.eclipse.search.ui.text.TextSearchPage&quot;&gt;
- &lt;/page&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- The search infrastructure provides a search page
-for full-text search.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &lt;p&gt;
-&lt;a href=&quot;hglegal.htm&quot;&gt;
- &lt;img SRC=&quot;ngibmcpy.gif&quot;
- ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
- BORDER=0 height=14 width=324&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.search/schema/searchResultSorters.exsd b/org.eclipse.search/schema/searchResultSorters.exsd
deleted file mode 100644
index 724411fed..000000000
--- a/org.eclipse.search/schema/searchResultSorters.exsd
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.search">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.search" id="searchResultSorters" name="Result Sorters"/>
- </appInfo>
- <documentation>
- This extension point allows a plug-in to contribute
-search result sorters to the search result view's Sort
-context menu.
- </documentation>
-</annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="sorter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="sorter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="label" icon="icon"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique name that will be used to identify this search result sorter.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pageId" type="string" use="required">
- <annotation>
- <documentation>
- the ID of a registered search page for which the
-sorter will be activated. "*" activates the sorter
-for all pages.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- a translatable label that will be used as the
-menu item's label.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="tooltip" type="string">
- <annotation>
- <documentation>
- a translatable text that will be used as the menu
-item's tool tip . If omitted, the menu item will
-have no tool tip.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- 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.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- a name of the class that extends &lt;samp&gt;org.eclipse.jface.viewers.ViewerSorter&lt;/samp&gt;
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.ViewerSorter"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a search page extension definition:
-&lt;p&gt;
-&lt;pre&gt;
- &lt;extension point="org.eclipse.search.searchResultSorters"&gt;
- &lt;sorter
- id="org.eclipse.search.internal.ui.FileNameSorter"
- pageId="*"
- label="%FileNameSorter.label"
- tooltip="%FilenNameSorter.tooltip"
- icon="icons/full/ecl16/search_sort.gif"
- class="org.eclipse.search.internal.ui.FileNameSorter"&gt;
- &lt;/sorter&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- The search infrastructure provides a sorter that sorts
-the matches by the resource name.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &lt;p&gt;
-&lt;a href="hglegal.htm"&gt;
- &lt;img SRC="ngibmcpy.gif"
- ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
- BORDER=0 height=14 width=324&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.search/scripts/exportplugin.xml b/org.eclipse.search/scripts/exportplugin.xml
deleted file mode 100644
index fafcb59d0..000000000
--- a/org.eclipse.search/scripts/exportplugin.xml
+++ /dev/null
@@ -1,31 +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="version" value="_2.1.0" />
- <property name="dest" value="${destdir}/${plugin}${version}" />
- </target>
-
- <target name="build" depends="init">
- <eclipse.incrementalBuild 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/org/eclipse/search/internal/core/ISearchScope.java b/org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java
deleted file mode 100644
index 1400e4a06..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core;
-
-import org.eclipse.core.resources.IResourceProxy;
-
-/**
- * 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 proxy to be checked
- * @return <code>true</code> if the resource is inside the search scope
- *
- */
- public boolean encloses(IResourceProxy element);
-
- /**
- * Returns a human readable description of this scope
- *
- * @return the description of this scope as <code>String</code>
- *
- */
- public String getDescription();
-}
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 c2ee4b63a..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-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(IResourceProxy proxy) {
- IPath elementPath= proxy.requestFullPath();
- 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();
- }
-
- /**
- * Implements method from ISearchScope
- *
- * @deprecated as of 2.1 use @link #encloses(IResourceProxy)
- */
- 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;
- }
-}
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 5a2000923..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core.text;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.MultiStatus;
-
-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;
-
- AmountOfWorkCalculator(MultiStatus status) {
- super(status);
- }
-
- protected boolean visitFile(IResourceProxy proxy) throws CoreException {
- if (fScope.encloses(proxy) && !proxy.isDerived())
- fResult++;
- return true;
- }
-
- public int process(Collection projects, ISearchScope scope) {
- fResult= 0;
- fScope= scope;
-
- Iterator i= projects.iterator();
- while(i.hasNext()) {
- IProject project= (IProject)i.next();
- int save= fResult;
- try {
- project.accept(this, IResource.NONE);
- } catch (CoreException ex) {
- addToStatus(ex);
- }
- // 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 e2caed1e5..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core.text;
-
-import org.eclipse.core.resources.IResourceProxy;
-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 proxy the resource proxy 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(IResourceProxy proxy, String line, int start, int length, int lineNumber) throws CoreException;
-
- /**
- * Called when the search has ended.
- */
- public void done() throws CoreException;
-}
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 93cc3a0c4..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core.text;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-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.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.core.ISearchScope;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-public class TextSearchEngine {
-
- /**
- * Search for the given pattern.
- */
- public IStatus search(IWorkspace workspace, String pattern, String options, ISearchScope scope, ITextSearchResultCollector collector) {
- 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);
- }
- String message= SearchMessages.getString("TextSearchEngine.statusMessage"); //$NON-NLS-1$
- MultiStatus status= new MultiStatus(SearchUI.PLUGIN_ID, IStatus.OK, message, null);
- if (!openProjects.isEmpty()) {
- int amountOfWork= (new AmountOfWorkCalculator(status)).process(openProjects, scope);
- try {
- monitor.beginTask("", amountOfWork); //$NON-NLS-1$
- if (amountOfWork > 0) {
- Integer[] args= new Integer[] {new Integer(1), new Integer(amountOfWork)};
- monitor.setTaskName(SearchMessages.getFormattedString("TextSearchEngine.scanning", args)); //$NON-NLS-1$
- }
- collector.aboutToStart();
- TextSearchVisitor visitor= new TextSearchVisitor(pattern, options, scope, collector, status, amountOfWork);
- visitor.process(openProjects);
- } catch (CoreException ex) {
- status.add(ex.getStatus());
- } finally {
- monitor.done();
- try {
- collector.done();
- } catch (CoreException ex) {
- status.add(ex.getStatus());
- }
- }
- }
- return status;
- }
-}
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 b39efca6a..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core.text;
-
-import java.util.Arrays;
-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.core.resources.IResourceProxy;
-import org.eclipse.core.runtime.IAdaptable;
-
-import org.eclipse.ui.IWorkingSet;
-
-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(IResourceProxy proxy) {
- if (proxy.getType() == IResource.FILE && skipFile(proxy))
- 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);
- }
-
- public TextSearchScope(String description, IAdaptable[] elements) {
- super(description, convertToResources(elements));
-
- }
-
- public TextSearchScope(String description, IWorkingSet[] workingSets) {
- super(description, convertToResources(getElements(workingSets)));
- }
-
- private static IResource[] convertToResources(IAdaptable[] elements) {
- int length= elements.length;
- Set resources= new HashSet(length);
- for (int i= 0; i < length; i++) {
- IResource resource= (IResource)elements[i].getAdapter(IResource.class);
- if (resource != null)
- resources.add(resource);
- }
- return (IResource[])resources.toArray(new IResource[resources.size()]);
- }
-
- private static IAdaptable[] getElements(IWorkingSet[] workingSets) {
- int length= workingSets.length;
- Set elements= new HashSet(length);
- for (int i= 0; i < length; i++) {
- elements.addAll(Arrays.asList(workingSets[i].getElements()));
- }
- return (IAdaptable[])elements.toArray(new IAdaptable[elements.size()]);
- }
-
- /**
- * Adds an extension to the scope.
- */
- public void addExtension(String extension) {
- fExtensions.add(new StringMatcher(extension, true, 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(IResourceProxy proxy) {
- if (proxy.getType() == IResource.FILE && skipFile(proxy))
- return false;
- return super.encloses(proxy);
- }
-
- boolean skipFile(IResourceProxy proxy) {
- if (proxy != null) {
- Iterator iter= fExtensions.iterator();
- while (iter.hasNext()) {
- if (((StringMatcher)iter.next()).match(proxy.getName()))
- return false;
- }
- }
- return true;
- }
-
- /**
- * Implements method from ISearchScope
- *
- * @deprecated As of 2.1, replaced by {@link #encloses(IResourceProxy)}
- */
- public boolean encloses(IResource element) {
- if (element.getType() == IResource.FILE && 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;
- }
-}
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 38805f40e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.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.resources.IResourceProxy;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-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 Integer[] fMessageFormatArgs;
-
- private int fNumberOfScannedFiles;
- private int fNumberOfFilesToScan;
- private long fLastUpdateTime;
-
- protected int fPushbackChar;
- protected boolean fPushback;
-
-
- public TextSearchVisitor(String pattern, String options, ISearchScope scope, ITextSearchResultCollector collector, MultiStatus status, int fileCount) {
- super(status);
- 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);
- fNumberOfScannedFiles= 0;
- fNumberOfFilesToScan= fileCount;
- fMessageFormatArgs= new Integer[] { new Integer(0), new Integer(fileCount) };
- }
-
- public void process(Collection projects) {
- Iterator i= projects.iterator();
- while(i.hasNext()) {
- IProject project= (IProject)i.next();
- try {
- project.accept(this, IResource.NONE);
- } catch (CoreException ex) {
- addToStatus(ex);
- }
- }
- }
-
- /**
- * 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.
- */
- public static IEditorPart[] getDirtyEditors() {
- Set inputs= new HashSet();
- 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].getDirtyEditors();
- for (int z= 0; z < editors.length; z++) {
- IEditorPart ep= editors[z];
- IEditorInput input= ep.getEditorInput();
- if (!inputs.contains(input)) {
- inputs.add(input);
- result.add(ep);
- }
- }
- }
- }
- return (IEditorPart[])result.toArray(new IEditorPart[result.size()]);
- }
-
-
- protected boolean visitFile(IResourceProxy proxy) throws CoreException {
- if (! fScope.encloses(proxy))
- return false;
-
- // Exclude to derived resources
- if (proxy.isDerived())
- return false;
-
- if (fPattern.length() == 0) {
- fCollector.accept(proxy, "", -1, 0, -1); //$NON-NLS-1$
- updateProgressMonitor();
- return true;
- }
- IFile file= (IFile)proxy.requestResource();
- 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, ResourcesPlugin.getEncoding()));
- }
- int lineCounter= 1;
- int charCounter=0;
- boolean eof= false;
- try {
- while (!eof) {
- StringBuffer sb= new StringBuffer(200);
- 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(proxy, line.trim(), start, length, lineCounter);
- start= match.getEnd();
- }
- else // no match in this line
- start= lineLength;
- }
- charCounter+= lineLength + eolStrLength;
- lineCounter++;
- if (fProgressMonitor.isCanceled())
- throw new OperationCanceledException(SearchMessages.getString("TextSearchVisitor.canceled")); //$NON-NLS-1$
- }
- } 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 {
- updateProgressMonitor();
- }
- return true;
- }
-
- private void updateProgressMonitor() {
- fNumberOfScannedFiles++;
- if (fNumberOfScannedFiles < fNumberOfFilesToScan) {
- if (System.currentTimeMillis() - fLastUpdateTime > 1000) {
- fMessageFormatArgs[0]= new Integer(fNumberOfScannedFiles+1);
- fProgressMonitor.setTaskName(SearchMessages.getFormattedString("TextSearchVisitor.scanning", fMessageFormatArgs)); //$NON-NLS-1$
- fLastUpdateTime= System.currentTimeMillis();
- }
- }
- fProgressMonitor.worked(1);
- if (fProgressMonitor.isCanceled())
- throw new OperationCanceledException(SearchMessages.getString("TextSearchVisitor.canceled")); //$NON-NLS-1$
- }
-
- 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;
- 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 IResourceProxyVisitor#visit(IResourceProxy)
- */
- public boolean visit(IResourceProxy proxy) {
- fDirtyEditors= getDirtyEditors();
- return super.visit(proxy);
- }
-}
-
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 6188516cf..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.core.text;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.MultiStatus;
-
-import org.eclipse.jface.util.Assert;
-
-public class TypedResourceVisitor implements IResourceProxyVisitor {
-
- private MultiStatus fStatus;
-
- TypedResourceVisitor(MultiStatus status) {
- Assert.isNotNull(status);
- fStatus= status;
- }
-
- protected boolean visitFile(IResourceProxy proxy) throws CoreException {
- return true;
- }
-
- protected boolean visitProject(IResourceProxy proxy) throws CoreException {
- return true;
- }
-
- protected boolean visitFolder(IResourceProxy proxy) throws CoreException {
- return true;
- }
-
- protected void addToStatus(CoreException ex) {
- fStatus.add(ex.getStatus());
- }
-
- /*
- * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy)
- */
- public boolean visit(IResourceProxy proxy) {
- try {
- switch(proxy.getType()) {
- case IResource.FILE:
- return visitFile(proxy);
- case IResource.FOLDER:
- return visitFolder(proxy);
- case IResource.PROJECT:
- return visitProject(proxy);
- default:
- Assert.isTrue(false, "unknown resource type"); //$NON-NLS-1$
- }
- return false;
- } catch (CoreException ex) {
- addToStatus(ex);
- return false;
- }
- }
-}
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 b1b4770b7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class CopyToClipboardAction extends Action {
-
- private SearchResultViewer fViewer;
-
- public CopyToClipboardAction(SearchResultViewer viewer) {
- Assert.isNotNull(viewer);
- 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;
-
- ILabelProvider labelProvider= (ILabelProvider)fViewer.getLabelProvider();
- 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(labelProvider.getText(iter.next()));
- }
-
- if (buf.length() > 0) {
- Clipboard clipboard= new Clipboard(shell.getDisplay());
- try {
- copyToClipbard(clipboard, buf.toString(), shell);
- } finally {
- clipboard.dispose();
- }
- }
- }
-
- private Iterator getSelection() {
- ISelection s= fViewer.getSelection();
- if (s instanceof IStructuredSelection)
- return ((IStructuredSelection)s).iterator();
- return Collections.EMPTY_LIST.iterator();
- }
-
- private void copyToClipbard(Clipboard clipboard, String str, Shell shell) {
- try {
- clipboard.setContents(new String[] { str }, new Transfer[] { TextTransfer.getInstance() });
- } catch (SWTError ex) {
- if (ex.code != DND.ERROR_CANNOT_SET_CLIPBOARD)
- throw ex;
- String title= SearchMessages.getString("CopyToClipboardAction.error.title"); //$NON-NLS-1$
- String message= SearchMessages.getString("CopyToClipboardAction.error.message"); //$NON-NLS-1$
- if (MessageDialog.openQuestion(shell, title, message))
- copyToClipbard(clipboard, str, shell);
- }
- }
-}
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 3050af6c7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
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 9fde0e98e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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$
-
- public static final String SEARCH_PREFERENCE_PAGE= PREFIX + "search_preference_page_context"; //$NON-NLS-1$
-
- public static final String SELECT_ALL_ACTION = PREFIX + "select_all_action_context"; //$NON-NLS-1$
-
- public static final String SEARCH_ACTION = PREFIX + "search_action_context"; //$NON-NLS-1$
-
- public static final String FILE_SEARCH_ACTION= PREFIX + "file_search_action_context"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenFileSearchPageAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenFileSearchPageAction.java
deleted file mode 100644
index 1c4f4ee55..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenFileSearchPageAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-import org.eclipse.search.ui.SearchUI;
-
-/**
- * Opens the Search Dialog.
- */
-public class OpenFileSearchPageAction implements IWorkbenchWindowActionDelegate {
-
- private static final String TEXT_SEARCH_PAGE_ID= "org.eclipse.search.internal.ui.text.TextSearchPage"; //$NON-NLS-1$
-
- private IWorkbenchWindow fWindow;
-
- public OpenFileSearchPageAction() {
- }
-
- public void init(IWorkbenchWindow window) {
- fWindow= window;
- }
-
- public void run(IAction action) {
- if (fWindow == null || fWindow.getActivePage() == null) {
- SearchPlugin.beep();
- logErrorMessage("Could not open the search dialog - for some reason the window handle was null"); //$NON-NLS-1$
- return;
- }
- SearchUI.openSearchDialog(fWindow, TEXT_SEARCH_PAGE_ID); //$NON-NLS-1$
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing since the action isn't selection dependent.
- }
-
- public void dispose() {
- fWindow= null;
- }
-
- public static void logErrorMessage(String message) {
- IStatus status= new Status(IStatus.ERROR, SearchUI.PLUGIN_ID, IStatus.ERROR, message, null);
- SearchPlugin.log(status);
- }
-}
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 ce38d4da8..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- private String fPageId;
-
- 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 OpenSearchDialogAction(IWorkbenchWindow window, String pageId) {
- this();
- fPageId= pageId;
- fWindow= window;
- }
-
- 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(),
- fPageId);
- 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 08ffc5be6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-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() {
- SearchManager.getDefault().removeAllResults();
- }
-}
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 178ccbab8..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
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 98abd6ac7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-
-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.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-class RemoveMatchAction extends Action {
-
- private ISelectionProvider fSelectionProvider;
-
- public RemoveMatchAction(ISelectionProvider provider) {
- super(SearchMessages.getString("SearchResultView.removeMatch.text")); //$NON-NLS-1$
- 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;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java
deleted file mode 100644
index 7ba3a082b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-import org.eclipse.ui.IWorkbenchSite;
-
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-class RemovePotentialMatchesAction extends Action {
-
- IWorkbenchSite fSite;
-
- public RemovePotentialMatchesAction(IWorkbenchSite site) {
- super(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatches.text")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatches.tooltip")); //$NON-NLS-1$
- fSite= site;
- }
-
- public void run() {
- IMarker[] markers= getMarkers();
- 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$
- }
- else {
- String title= SearchMessages.getString("RemovePotentialMatchesAction.dialog.title"); //$NON-NLS-1$
- String message= SearchMessages.getString("RemovePotentialMatchesAction.dialog.message"); //$NON-NLS-1$
- MessageDialog.openInformation(fSite.getShell(), title, message);
- }
-
- // action only makes sense once
- setEnabled(false);
- }
-
- private IMarker[] getMarkers() {
- IMarker[] markers;
- try {
- markers= SearchPlugin.getWorkspace().getRoot().findMarkers(SearchUI.SEARCH_MARKER, true, IResource.DEPTH_INFINITE);
- } catch (CoreException ex) {
- ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.findMarkers.title"), SearchMessages.getString("Search.Error.findMarkers.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- }
-
- ArrayList potentialMatches= new ArrayList(markers.length);
- for (int i= 0; i < markers.length; i++) {
- if (markers[i].getAttribute(SearchUI.POTENTIAL_MATCH, false))
- potentialMatches.add(markers[i]);
- }
- if (potentialMatches.size() == 0)
- return null;
-
- return (IMarker[])potentialMatches.toArray(new IMarker[potentialMatches.size()]);
- }
-}
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 4922292bd..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.swt.custom.BusyIndicator;
-
-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.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-class RemoveResultAction extends Action {
-
- private ISelectionProvider fSelectionProvider;
-
- public RemoveResultAction(ISelectionProvider provider, boolean stringsDependOnMatchCount) {
- fSelectionProvider= provider;
- if (!stringsDependOnMatchCount || usePluralLabel()) {
- 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]);
- }
-
- private boolean usePluralLabel() {
- ISelection s= fSelectionProvider.getSelection();
- if (s == null || s.isEmpty() || !(s instanceof IStructuredSelection))
- return false;
- IStructuredSelection selection= (IStructuredSelection)s;
-
- if (selection.size() != 1)
- return true;
-
- Object firstElement= selection.getFirstElement();
- if (firstElement instanceof ISearchResultViewEntry)
- return ((ISearchResultViewEntry)firstElement).getMatchCount() > 1;
- else
- return false;
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.java
deleted file mode 100644
index 3019eb396..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.core.resources.IResource;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Item;
-
-import org.eclipse.jface.viewers.ContentViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-/**
- * Helper class for updating error markers and other decorators that work on resources.
- * Items are mapped to their element's underlying resource.
- * Method <code>resourceChanged</code> updates all items that are affected from the changed
- * elements.
- */
-class ResourceToItemsMapper {
-
- private static final int NUMBER_LIST_REUSE= 10;
-
- // map from resource to item
- private HashMap fResourceToItem;
- private Stack fReuseLists;
-
- private ContentViewer fContentViewer;
-
- public ResourceToItemsMapper(ContentViewer viewer) {
- fResourceToItem= new HashMap();
- fReuseLists= new Stack();
-
- fContentViewer= viewer;
- }
-
- /**
- * Must be called from the UI thread.
- */
- public void resourceChanged(IResource changedResource) {
- Object obj= fResourceToItem.get(changedResource);
- if (obj == null) {
- // not mapped
- } else if (obj instanceof Item) {
- updateItem((Item) obj);
- } else { // List of Items
- List list= (List) obj;
- for (int k= 0; k < list.size(); k++) {
- updateItem((Item) list.get(k));
- }
- }
- }
-
- private void updateItem(Item item) {
- if (!item.isDisposed()) { // defensive code
- ILabelProvider lprovider= (ILabelProvider) fContentViewer.getLabelProvider();
-
- Object data= item.getData();
-
- String oldText= item.getText();
- String text= lprovider.getText(data);
- if (text != null && !text.equals(oldText)) {
- item.setText(text);
- }
-
- Image oldImage= item.getImage();
- Image image= lprovider.getImage(data);
- if (image != null && !image.equals(oldImage)) {
- item.setImage(image);
- }
- }
- }
-
- /**
- * Adds a new item to the map.
- * @param element Element to map
- * @param item The item used for the element
- */
- public void addToMap(Object element, Item item) {
- IResource resource= ((ISearchResultViewEntry)element).getResource();
- if (resource != null) {
- Object existingMapping= fResourceToItem.get(resource);
- if (existingMapping == null) {
- fResourceToItem.put(resource, item);
- } else if (existingMapping instanceof Item) {
- if (existingMapping != item) {
- List list= getNewList();
- list.add(existingMapping);
- list.add(item);
- fResourceToItem.put(resource, list);
- }
- } else { // List
- List list= (List) existingMapping;
- if (!list.contains(item)) {
- list.add(item);
- }
- }
- }
- }
-
- /**
- * Removes an element from the map.
- */
- public void removeFromMap(Object element, Item item) {
- IResource resource= ((ISearchResultViewEntry)element).getResource();
- if (resource != null) {
- Object existingMapping= fResourceToItem.get(resource);
- if (existingMapping == null) {
- return;
- } else if (existingMapping instanceof Item) {
- fResourceToItem.remove(resource);
- } else { // List
- List list= (List) existingMapping;
- list.remove(item);
- if (list.isEmpty()) {
- fResourceToItem.remove(list);
- releaseList(list);
- }
- }
- }
- }
-
- private List getNewList() {
- if (!fReuseLists.isEmpty()) {
- return (List) fReuseLists.pop();
- }
- return new ArrayList(2);
- }
-
- private void releaseList(List list) {
- if (fReuseLists.size() < NUMBER_LIST_REUSE) {
- fReuseLists.push(list);
- }
- }
-
- /**
- * Clears the map.
- */
- public void clearMap() {
- fResourceToItem.clear();
- }
-
- /**
- * Clears the map.
- */
- public boolean isEmpty() {
- return fResourceToItem.isEmpty();
- }
-}
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 2cdd66107..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-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.jface.window.Window;
-
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-
-import org.eclipse.search.ui.ISearchPageContainer;
-
-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;
-
- // Settings store
- private static final String DIALOG_SETTINGS_KEY= "SearchDialog.ScopePart"; //$NON-NLS-1$
- private static final String STORE_SCOPE= "scope"; //$NON-NLS-1$
- private static final String STORE_LRU_WORKING_SET_NAME= "lastUsedWorkingSetName"; //$NON-NLS-1$
- private static final String STORE_LRU_WORKING_SET_NAMES= "lastUsedWorkingSetNames"; //$NON-NLS-1$
- private static IDialogSettings fgSettingsStore;
-
- static {
- fgSettingsStore= SearchPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS_KEY);
- if (fgSettingsStore == null)
- fgSettingsStore= SearchPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS_KEY);
- }
-
- private Group fPart;
-
- // Scope radio buttons
- private Button fUseWorkspace;
- private Button fUseSelection;
- private Button fUseWorkingSet;
-
-
- private int fScope;
- private Text fWorkingSetText;
- private IWorkingSet[] fWorkingSets;
-
- // 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(getStoredScope());
- fSearchPageContainer= searchPageContainer;
- }
-
- private static int getStoredScope() {
- int scope;
- try {
- scope= fgSettingsStore.getInt(STORE_SCOPE);
- } catch (NumberFormatException ex) {
- scope= WORKSPACE_SCOPE;
- }
- if (scope != WORKING_SET_SCOPE && scope != SELECTION_SCOPE && scope != WORKSPACE_SCOPE)
- scope= WORKSPACE_SCOPE;
- return scope;
- }
-
- /**
- * 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;
- restoreState();
- }
-
- private void restoreState() {
- String[] lruWorkingSetNames= fgSettingsStore.getArray(STORE_LRU_WORKING_SET_NAMES);
- if (lruWorkingSetNames != null) {
- Set existingWorkingSets= new HashSet(lruWorkingSetNames.length);
- for (int i= 0; i < lruWorkingSetNames.length; i++) {
- String name= lruWorkingSetNames[i];
- IWorkingSet workingSet= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(name);
- if (workingSet != null)
- existingWorkingSets.add(workingSet);
- }
- if (!existingWorkingSets.isEmpty())
- fWorkingSets= (IWorkingSet[])existingWorkingSets.toArray(new IWorkingSet[existingWorkingSets.size()]);
- }
- else {
- // Backward compatibility
- String workingSetName= fgSettingsStore.get(STORE_LRU_WORKING_SET_NAME);
- if (workingSetName != null) {
- IWorkingSet workingSet= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName);
- if (workingSet != null) {
- fWorkingSets= new IWorkingSet[] { workingSet };
- saveState();
- }
- }
- }
- }
-
- /**
- * 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[] workingSets) {
- Assert.isNotNull(workingSets);
- fScope= WORKING_SET_SCOPE;
- fWorkingSets= workingSets;
- }
-
- /**
- * 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();
- fgSettingsStore.put(STORE_SCOPE, fScope);
- }
-
- private void updateSearchPageContainerActionPerformedEnablement() {
- boolean newState= fScope != WORKING_SET_SCOPE || fWorkingSets != null;
- if (fSearchPageContainer instanceof SearchDialog)
- ((SearchDialog)fSearchPageContainer).setPerformActionEnabledFromScopePart(newState);
- else if (fSearchPageContainer != null)
- fSearchPageContainer.setPerformActionEnabled(newState);
- }
-
- /**
- * 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[] getSelectedWorkingSets() {
- if (getSelectedScope() == WORKING_SET_SCOPE)
- return fWorkingSets;
- 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 setSelectedWorkingSets(IWorkingSet[] workingSets) {
- Assert.isNotNull(workingSets);
- setSelectedScope(WORKING_SET_SCOPE);
- fWorkingSets= null;
- Set existingWorkingSets= new HashSet(workingSets.length);
- for (int i= 0; i < workingSets.length; i++) {
- String name= workingSets[i].getName();
- IWorkingSet workingSet= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(name);
- if (workingSet != null)
- existingWorkingSets.add(workingSet);
- }
- if (!existingWorkingSets.isEmpty())
- fWorkingSets= (IWorkingSet[])existingWorkingSets.toArray(new IWorkingSet[existingWorkingSets.size()]);
-
- saveState();
-
- if (fWorkingSetText != null)
- fWorkingSetText.setText(toString(fWorkingSets));
- }
-
- /**
- * Saves the last recently used working sets,
- * if any.
- */
- private void saveState() {
- if (fWorkingSets != null && fWorkingSets.length > 0) {
- String[] existingWorkingSetNames= new String[fWorkingSets.length];
- for (int i= 0; i < existingWorkingSetNames.length; i++)
- existingWorkingSetNames[i]= fWorkingSets[i].getName();
- fgSettingsStore.put(STORE_LRU_WORKING_SET_NAMES, existingWorkingSetNames);
- }
- }
-
- /**
- * 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 (fWorkingSets != null)
- fWorkingSetText.setText(toString(fWorkingSets));
-
- 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() {
- IWorkingSetSelectionDialog dialog= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(fUseSelection.getShell(), true);
-
- if (fWorkingSets != null)
- dialog.setSelection(fWorkingSets);
- if (dialog.open() == Window.OK) {
- Object[] result= dialog.getSelection();
- if (result.length > 0) {
- setSelectedWorkingSets((IWorkingSet[])result);
- return true;
- }
- fWorkingSetText.setText(""); //$NON-NLS-1$
- fWorkingSets= null;
- if (fScope == WORKING_SET_SCOPE)
- setSelectedScope(WORKSPACE_SCOPE);
- return false;
- } else {
- // test if selected working set has been removed
- if (!Arrays.asList(PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets()).contains(fWorkingSets)) {
- fWorkingSetText.setText(""); //$NON-NLS-1$
- fWorkingSets= null;
- updateSearchPageContainerActionPerformedEnablement();
- }
- }
- return false;
- }
-
- void setVisible(boolean state) {
- fPart.setVisible(state);
- }
-
- public static String toString(IWorkingSet[] workingSets) {
- String result= ""; //$NON-NLS-1$
- if (workingSets != null && workingSets.length > 0) {
- Arrays.sort(workingSets, new WorkingSetComparator());
- boolean firstFound= false;
- for (int i= 0; i < workingSets.length; i++) {
- String workingSetName= workingSets[i].getName();
- if (firstFound)
- result= SearchMessages.getFormattedString("ScopePart.workingSetConcatenation", new String[] {result, workingSetName}); //$NON-NLS-1$
- else {
- result= workingSetName;
- firstFound= true;
- }
- }
- }
- return result;
- }
-}
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 231f2da71..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.IActionGroupFactory;
-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;
-
-public 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 IActionGroupFactory fActionGroupFactory;
- private IGroupByKeyComputer fGroupByKeyComputer;
- private IRunnableWithProgress fOperation;
-
-
- public Search(String pageId, String singularLabel, String pluralLabelPattern, ILabelProvider labelProvider, ImageDescriptor imageDescriptor, IAction gotoMarkerAction, IActionGroupFactory groupFactory, IGroupByKeyComputer groupByKeyComputer, IRunnableWithProgress operation) {
- fPageId= pageId;
- fSingularLabel= singularLabel;
- fPluralLabelPattern= pluralLabelPattern;
- fImageDescriptor= imageDescriptor;
- fLabelProvider= labelProvider;
- fGotoMarkerAction= gotoMarkerAction;
- fActionGroupFactory= groupFactory;
- fGroupByKeyComputer= groupByKeyComputer;
- fOperation= operation;
-
- if (fPluralLabelPattern == null)
- fPluralLabelPattern= ""; //$NON-NLS-1$
- }
-
- 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;
- }
-
- public IRunnableWithProgress getOperation() {
- return fOperation;
- }
-
- IAction getGotoMarkerAction() {
- return fGotoMarkerAction;
- }
-
- IContextMenuContributor getContextMenuContributor() {
- return fContextMenuContributor;
- }
-
- IActionGroupFactory getActionGroupFactory() {
- return fActionGroupFactory;
- }
-
- 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 304d838c7..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
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 4f5dbaa48..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-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.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.graphics.Image;
-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.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.Layout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-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.internal.ui.util.ExtendedDialogWindow;
-import org.eclipse.search.internal.ui.util.ListContentProvider;
-import org.eclipse.search.internal.ui.util.SWTUtil;
-
-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 String fInitialPageId;
- private int fCurrentIndex;
- private ISelection fSelection;
- private IEditorPart fEditorPart;
- private List fDescriptors;
- private Point fMinSize;
- private ScopePart[] fScopeParts;
- private boolean fPageStateIgnoringScopePart;
- Button fCustomizeButton;
-
- public SearchDialog(Shell shell, IWorkspace workspace, ISelection selection, IEditorPart editor, String pageId) {
- super(shell);
- Assert.isNotNull(workspace);
- fWorkspace= workspace;
- setPerformActionLabel(SearchMessages.getString("SearchDialog.performAction")); //$NON-NLS-1$
- fSelection= selection;
- fEditorPart= editor;
- fDescriptors= SearchPlugin.getDefault().getEnabledSearchPageDescriptors(pageId);
- fInitialPageId= pageId;
- }
-
- /* (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);
- }
-
- private void handleCustomizePressed() {
- List input= SearchPlugin.getDefault().getSearchPageDescriptors();
- final ArrayList createdImages= new ArrayList(input.size());
- ILabelProvider labelProvider= new LabelProvider() {
- public String getText(Object element) {
- if (element instanceof SearchPageDescriptor) {
- String label= ((SearchPageDescriptor)element).getLabel();
- int i= label.indexOf('&');
- while (i >= 0) {
- if (i < label.length())
- label= label.substring(0, i) + label.substring(i+1);
- else
- label.substring(0, i);
- i= label.indexOf('&');
- }
- return label;
- } else
- return null;
- }
- public Image getImage(Object element) {
- if (element instanceof SearchPageDescriptor) {
- ImageDescriptor imageDesc= ((SearchPageDescriptor)element).getImage();
- if (imageDesc == null)
- return null;
- Image image= imageDesc.createImage();
- if (image != null)
- createdImages.add(image);
- return image;
- } else
- return null;
- }
- };
-
- String message= SearchMessages.getString("SearchPageSelectionDialog.message"); //$NON-NLS-1$
-
- ListSelectionDialog dialog= new ListSelectionDialog(getShell(), input, new ListContentProvider(), labelProvider, message) {
- public void create() {
- super.create();
- final CheckboxTableViewer viewer= getViewer();
- final Button okButton= this.getOkButton();
- viewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- okButton.setEnabled(viewer.getCheckedElements().length > 0);
- }
- });
- SelectionListener listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- okButton.setEnabled(viewer.getCheckedElements().length > 0);
- }
- };
- this.getButton(IDialogConstants.SELECT_ALL_ID).addSelectionListener(listener);
- this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener);
- }
- };
- dialog.setTitle(SearchMessages.getString("SearchPageSelectionDialog.title")); //$NON-NLS-1$
- dialog.setInitialSelections(SearchPlugin.getDefault().getEnabledSearchPageDescriptors(fInitialPageId).toArray());
- if (dialog.open() == ListSelectionDialog.OK) {
- SearchPageDescriptor.setEnabled(dialog.getResult());
- Display display= getShell().getDisplay();
- close();
- if (display != null && !display.isDisposed()) {
- display.asyncExec(
- new Runnable() {
- public void run() {
- new OpenSearchDialogAction().run();
- }
- });
- }
- }
- destroyImages(createdImages);
- }
-
- private void destroyImages(List images) {
- Iterator iter= images.iterator();
- while (iter.hasNext()) {
- Image image= (Image)iter.next();
- if (image != null && !image.isDisposed())
- image.dispose();
- }
- }
-
- protected Control createPageArea(Composite parent) {
- int numPages= fDescriptors.size();
- fScopeParts= new ScopePart[numPages];
-
- if (numPages == 0) {
- Label label= new Label(parent, SWT.CENTER | SWT.WRAP);
- label.setText(SearchMessages.getString("SearchDialog.noSearchExtension")); //$NON-NLS-1$
- return label;
- }
-
- fCurrentIndex= getPreferredPageIndex();
-
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- fCurrentPage= getDescriptorAt(fCurrentIndex).createObject();
- }
- });
-
- fCurrentPage.setContainer(this);
-
- if (numPages == 1)
- return getControl(fCurrentPage, parent, 0);
- else {
- Composite border= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginWidth= 7;
- layout.marginHeight= 7;
- border.setLayout(layout);
-
- TabFolder folder= new TabFolder(border, SWT.NONE);
- 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 TabItem item= new TabItem(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 == fCurrentIndex) {
- item.setControl(getControl(fCurrentPage, folder, i));
- item.setData(fCurrentPage);
- }
- }
-
- folder.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- turnToPage(event);
- }
- });
-
- folder.setSelection(fCurrentIndex);
-
- return border;
- }
- }
-
- protected Control createButtonBar(Composite parent) {
- Composite composite= new Composite(parent, SWT.NULL);
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
-
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fCustomizeButton= new Button(composite, SWT.NONE);
- fCustomizeButton.setText(SearchMessages.getString("SearchDialog.customize")); //$NON-NLS-1$
- GridData gd= new GridData();
- gd.horizontalIndent= 2 * new GridLayout().marginWidth;
- fCustomizeButton.setLayoutData(gd);
- SWTUtil.setButtonDimensionHint(fCustomizeButton);
- fCustomizeButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleCustomizePressed();
- }
- });
-
- Label filler= new Label(composite, SWT.NONE);
- filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
-
- Control result= super.createButtonBar(composite);
- getButton(IDialogConstants.FINISH_ID).setEnabled(fDescriptors.size() > 0);
- applyDialogFont(result);
- return result;
- }
-
- 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 {
- fCustomizeButton.setEnabled(false);
- return fCurrentPage.performAction();
- } finally {
- fCustomizeButton.setEnabled(true);
- 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 TabItem item= (TabItem)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.getParent().getSelectionIndex());
- item.setControl(newControl);
- }
- if (item.getData() instanceof ISearchPage) {
- fCurrentPage= (ISearchPage)item.getData();
- fCurrentIndex= item.getParent().getSelectionIndex();
- resizeDialogIfNeeded(item.getControl());
- 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);
- if (fInitialPageId != null && fInitialPageId.equals(descriptor.getId()))
- return 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() {
- if (fScopeParts[fCurrentIndex] == null)
- // safe code - should not happen
- return ScopePart.WORKSPACE_SCOPE;
- else
- return fScopeParts[fCurrentIndex].getSelectedScope();
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public IWorkingSet[] getSelectedWorkingSets() {
- if (fScopeParts[fCurrentIndex] == null)
- // safe code - should not happen
- return null;
- else
- return fScopeParts[fCurrentIndex].getSelectedWorkingSets();
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public void setSelectedScope(int scope) {
- if (fScopeParts[fCurrentIndex] != null)
- fScopeParts[fCurrentIndex].setSelectedScope(scope);
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public boolean hasValidScope() {
- return getSelectedScope() != WORKING_SET_SCOPE || getSelectedWorkingSets() != null;
- }
-
- /*
- * Implements method from ISearchPageContainer
- */
- public void setSelectedWorkingSets(IWorkingSet[] workingSets) {
- if (fScopeParts[fCurrentIndex] != null)
- fScopeParts[fCurrentIndex].setSelectedWorkingSets(workingSets);
- }
-
- /*
- * Overrides method from ExtendedDialogWindow
- */
- public void setPerformActionEnabled(boolean state) {
- super.setPerformActionEnabled(state);
- fPageStateIgnoringScopePart= state;
- setPerformActionEnabledFromScopePart(hasValidScope());
- }
-
- /**
- * Set the enable state of the perform action button.
- * <p>
- * Note: This is a special method to be called only from the ScopePart
- * </p>
- */
- public void setPerformActionEnabledFromScopePart(boolean state) {
- if (fPageStateIgnoringScopePart)
- super.setPerformActionEnabled(state);
- }
-
- private Control getControl(ISearchPage page, Composite parent, int index) {
- if (page.getControl() == null) {
- // Page wrapper
- Composite pageWrapper= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- pageWrapper.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- layout.marginWidth= 0;
- layout.marginHeight= 0;
- pageWrapper.setLayout(layout);
-
- // The page itself
- page.createControl(pageWrapper);
-
- // Search scope
- boolean showScope= getDescriptorAt(index).showScopeSection();
- if (showScope) {
- Composite c= new Composite(pageWrapper, SWT.NONE);
- layout= new GridLayout();
- c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- c.setLayout(layout);
- fScopeParts[index]= new ScopePart(this);
- Control part= fScopeParts[index].createPart(c);
- applyDialogFont(part);
- fScopeParts[index].setVisible(true);
- }
- }
- return page.getControl().getParent();
- }
-
- 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;
- }
-}
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 584625ef2..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- private Menu fMenu;
-
- 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() {
- if (fMenu != null)
- fMenu.dispose();
-
- fViewer= null;
- }
-
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- public Menu getMenu(Control parent) {
- if (fMenu != null)
- fMenu.dispose();
-
- fMenu= 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(fMenu, action);
- }
- new MenuItem(fMenu, SWT.SEPARATOR);
- if (iter.hasNext()) {
- Action others= new ShowSearchesAction();
- others.setChecked(!checkedOne);
- addActionToMenu(fMenu, others);
- }
- addActionToMenu(fMenu, new RemoveAllSearchesAction());
- return fMenu;
- }
-
- 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 bd8160f78..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.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;
- private boolean fIsRemoveAll= 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();
- }
-
- public 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.setContextMenuTarget(null);
- viewer.setActionGroupFactory(null);
- 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(entry.getMarkerType());
- } 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();
- display.syncExec(new Runnable() {
- public void run() {
- if (previousSearch != null && viewer == visibleViewer)
- previousSearch.setSelection(viewer.getSelection());
- viewer.setInput(null);
- viewer.setPageId(search.getPageId());
- viewer.setGotoMarkerAction(search.getGotoMarkerAction());
- viewer.setContextMenuTarget(search.getContextMenuContributor());
- viewer.setActionGroupFactory(null);
- viewer.setInput(getCurrentResults());
- viewer.setActionGroupFactory(search.getActionGroupFactory());
- viewer.setSelection(fCurrentSearch.getSelection(), true);
- }
- });
- }
- }
- monitor.done();
- }
-
- /**
- * Returns the number of matches
- */
- int getCurrentItemCount() {
- if (fCurrentSearch != null)
- return fCurrentSearch.getItemCount();
- else
- return 0;
- }
-
- void removeAllResults() {
- fIsRemoveAll= true;
- 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$
- fIsRemoveAll= false;
- }
- }
-
- 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;
- }
- if (fIsRemoveAll) {
- handleRemoveAll();
- fIsRemoveAll= false;
- 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, false);
- }
- }
-
- private void handleNewSearchResult() {
- Iterator iter= fListeners.iterator();
- final Search search= getCurrentSearch();
- while (iter.hasNext()) {
- SearchResultViewer viewer= (SearchResultViewer)iter.next();
- viewer.setPageId(search.getPageId());
- viewer.setGotoMarkerAction(search.getGotoMarkerAction());
- viewer.setContextMenuTarget(search.getContextMenuContributor());
- viewer.setActionGroupFactory(null);
- viewer.setInput(getCurrentResults());
- viewer.setActionGroupFactory(search.getActionGroupFactory());
- }
- }
-
- 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, true);
- }
- }
- }
-
- private void handleUpdateMatch(IMarker marker) {
- SearchResultViewEntry entry= findEntry(marker);
- if (entry != null) {
- Iterator iter= fListeners.iterator();
- while (iter.hasNext())
- ((SearchResultViewer)iter.next()).handleUpdateMatch(entry, false);
- }
- }
-
- 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 2f9d75ec6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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 e655d57b0..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
+++ /dev/null
@@ -1,210 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-SearchDialog.title= Search
-SearchDialog.performAction= &Search
-SearchDialog.customize= Customi&ze...
-SearchDialog.noSearchExtension= No Search Extensions plugged into workbench or all search pages disabled.
-
-SearchPageSelectionDialog.title= Search Page Selection
-SearchPageSelectionDialog.message= S&elect from the pages shown in the dialog:
-
-SearchManager.resourceChangedWarning= Changed Resources
-SearchManager.resourceChanged= Some resources have changed. The positions of matches may have changed.
-SearchManager.resourceDeleted= Some resources no longer exist. Corresponding matches have been 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 Matches
-SearchResultView.removeAllResults.tooltip= Remove All Matches
-SearchResultView.removeAllSearches.text= &Clear History
-SearchResultView.removeAllSearches.tooltip= Clear the search result history
-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 Selected Match
-SearchResultView.removeEntry.tooltip= Remove Selected Match
-SearchResultView.removeEntries.text= &Remove Selected Matches
-SearchResultView.removeEntries.tooltip= Remove Selected Matches
-SearchResultView.removeMatch.text= Remove Current &Match
-SearchResultView.removeMatch.tooltip= Remove Current Match
-SearchResultView.gotoMarker.text= &Go to File
-SearchResultView.gotoMarker.tooltip= Go to File
-SearchResultView.showNext.text= Next Match
-SearchResultView.showNext.tooltip= Show Next Match
-SearchResultView.showPrev.text= Previous Match
-SearchResultView.showPrev.tooltip= Show Previous Match
-
-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.
-
-SearchPlugin.internal_error= Internal Error
-
-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.findMarkers.title= Search Error
-Search.Error.findMarkers.message= An error occurred while gathering the 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
-
-Search.Problems.title= Text Search Problems
-
-SearchResultCollector.match= 1 match
-SearchResultCollector.matches= {0} matches
-SearchResultCollector.done= Search done: {0}.
-
-SearchPage.containingText.text= C&ontaining text:
-SearchPage.containingText.hint= (* = any string, ? = any character, \\ = escape for literals: * ? \\)
-SearchPage.browse= &Browse...
-SearchPage.fileNamePatterns.text= File name &patterns:
-SearchPage.fileNamePatterns.hint= The patterns are separated by comma (* = any string, ? = any character)
-SearchPage.caseSensitive= Case sens&itive
-
-TextSearchEngine.scanning= Scanning file {0} of {1}...
-TextSearchEngine.statusMessage= Problems encountered during text search.
-
-TextSearchVisitor.scanning= Scanning file {0} of {1}...
-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 argument will be replaced by the scope
-FileSearchOperation.singularLabelPostfix= 1 File in {0}
-
-# 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}
-
-# The first argument will be replaced by the count and the second by the scope
-FileSearchOperation.pluralLabelPatternPostfix= {0} Files in {1}
-
-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=Selecte&d Resources
-ScopePart.workingSetChooseButton.text=C&hoose...
-ScopePart.workingSetScope.text=Wor&king Set:
-ScopePart.workspaceScope.text=&Workspace
-
-# Concatenate two working set names e.g. "Source, Lib"
-ScopePart.workingSetConcatenation= {0}, {1}
-
-CopyToClipboardAction.label = Copy to Clip&board
-CopyToClipboardAction.tooltip = Copy to Clipboard
-CopyToClipboardAction.error.title= Problem Copying to Clipboard
-CopyToClipboardAction.error.message= There was a problem when accessing the system clipboard. Retry?
-
-ExceptionDialog.seeErrorLogMessage= See error log for more details
-
-SearchPreferencePage.emphasizePotentialMatches= &Emphasize inexact matches
-SearchPreferencePage.potentialMatchFgColor= &Foreground color for inexact matches:
-SearchPreferencePage.reuseEditor= &Reuse editors to show matches
-SearchPreferencePage.defaultPerspective= Default &perspective for the Search view:
-SearchPreferencePage.defaultPerspective.none= None
-SearchPreferencePage.ignorePotentialMatches= &Ignore inexact matches
-
-ReplaceAction.label_all= Re&place...
-ReplaceAction.label_selected= Rep&lace Selected...
-ReplaceAction.error.only_on_text_search= Replace is only available on text search.
-ReplaceAction.error.unable_to_perform= Replace operation can\'t be performed.
-ReplaceAction.error.changed_file= The content of the following file has changed. Please redo the search to ensure that all matches are correct.
-ReplaceAction.error.changed_files= The content of the following files have changed. Please redo the search to ensure that all matches are correct.
-ReplaceAction.error.opened_file= The following file is open in an editor that the replace operation cannot handle. Please close the editor.
-ReplaceAction.error.opened_files= The following files are open in editors that the replace operation cannot handle. Please close the editors.
-ReplaceAction.error.not_file= The following resource is not a file and cannot be handled. Please exclude it from the replace operation.
-ReplaceAction.error.not_files= The following resources are not files and cannot be handled. Please exclude them from the replace operation.
-ReplaceAction.dialog.title= Replace
-
-ReplaceDialog.replace_label= Replace:
-ReplaceDialog.with_label= &With:
-ReplaceDialog.replace_next= Re&place/Next
-ReplaceDialog.replace= &Replace
-ReplaceDialog.next= &Next
-ReplaceDialog.close= &Close
-ReplaceDialog.save_changes=Automatically &save changes
-ReplaceDialog.dialog.title= Replace
-ReplaceDialog.error.unexpected_exception=Unexpected exception during replace operation.
-ReplaceDialog.error.different_content= File content differs from search result.
-ReplaceDialog.error.reenable_auto_build_failed=Couldn\'t reactivate auto building.
-ReplaceDialog.error.auto_building= Couldn\'t disable auto building.
-ReplaceDialog.error.no_matches= Couldn\'t find first match.
-ReplaceDialog.error.no_file_for_marker=Current match is not associated with a file. It is not possible to open an editor.
-ReplaceDialog.error.unable_to_open_text_editor=It is not possible to open the built-in text editor for file ''{0}''.
-
-SelectAllAction.label= Select A&ll
-SelectAllAction.tooltip= Select All
-
-RemovePotentialMatchesAction.removePotentialMatches.text= Remove Inexact Matches
-RemovePotentialMatchesAction.removePotentialMatches.tooltip= Remove all inexact matches
-RemovePotentialMatchesAction.dialog.title= Remove Inexact Matches
-RemovePotentialMatchesAction.dialog.message= The current search result does not contain inexact matches.
-
-OpenWithMenu.label= Open Wit&h
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 78fc557a8..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.StringConverter;
-
-import org.eclipse.search.ui.ISearchPage;
-import org.eclipse.search.ui.ISearchPageScoreComputer;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-/**
- * 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$
- private final static String ENABLED_ATTRIBUTE= "enabled"; //$NON-NLS-1$
-
- public final static Point UNKNOWN_SIZE= new Point(SWT.DEFAULT, SWT.DEFAULT);
-
- // dialog store id constants
- private final static String SECTION_ID= "Search"; //$NON-NLS-1$
- private final static String STORE_ENABLED_PAGE_IDS= SECTION_ID + ".enabledPageIds"; //$NON-NLS-1$
- private final static String STORE_PROCESSED_PAGE_IDS= SECTION_ID + ".processedPageIds"; //$NON-NLS-1$
-
- private static List fgEnabledPageIds;
-
- 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-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 <code>true</code> if the page is initially
- * shown in the Search dialog.
- *
- * This attribute is optional and defaults to <code>true</code>.
- */
- public boolean isInitiallyEnabled() {
- String strVal= fElement.getAttribute(ENABLED_ATTRIBUTE);
- return strVal == null || Boolean.valueOf(strVal).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-1$
- // position is Integer.MAX_VALUE;
- }
- return position;
- }
-
- boolean isEnabled() {
- return getEnabledPageIds().contains(getId());
- }
-
- static void setEnabled(Object[] enabledDescriptors) {
- fgEnabledPageIds= new ArrayList(5);
- for (int i= 0; i < enabledDescriptors.length; i++) {
- if (enabledDescriptors[i] instanceof SearchPageDescriptor)
- fgEnabledPageIds.add(((SearchPageDescriptor)enabledDescriptors[i]).getId());
- }
- storeEnabledPageIds();
- }
-
- private static List getEnabledPageIds() {
- if (fgEnabledPageIds == null) {
- List descriptors= SearchPlugin.getDefault().getSearchPageDescriptors();
-
- String[] enabledPageIds= getDialogSettings().getArray(STORE_ENABLED_PAGE_IDS);
- if (enabledPageIds == null)
- fgEnabledPageIds= new ArrayList(descriptors.size());
- else
- fgEnabledPageIds= new ArrayList(Arrays.asList(enabledPageIds));
-
-
- List processedPageIds;
- String[] processedPageIdsArr= getDialogSettings().getArray(STORE_PROCESSED_PAGE_IDS);
- if (processedPageIdsArr == null)
- processedPageIds= new ArrayList(descriptors.size());
- else
- processedPageIds= new ArrayList(Arrays.asList(processedPageIdsArr));
-
- // Enable pages based on contribution
- Iterator iter= descriptors.iterator();
- while (iter.hasNext()) {
- SearchPageDescriptor desc= (SearchPageDescriptor)iter.next();
- if (processedPageIds.contains(desc.getId()))
- continue;
-
- processedPageIds.add(desc.getId());
- if (desc.isInitiallyEnabled())
- fgEnabledPageIds.add(desc.getId());
- }
-
- getDialogSettings().put(STORE_PROCESSED_PAGE_IDS, (String[])processedPageIds.toArray(new String[processedPageIds.size()]));
- storeEnabledPageIds();
- }
- return fgEnabledPageIds;
- }
-
- private static void storeEnabledPageIds() {
- getDialogSettings().put(STORE_ENABLED_PAGE_IDS, (String[])fgEnabledPageIds.toArray(new String[fgEnabledPageIds.size()]));
- SearchPlugin.getDefault().savePluginPreferences();
- }
-
- private static IDialogSettings getDialogSettings() {
- IDialogSettings settings= SearchPlugin.getDefault().getDialogSettings();
- IDialogSettings section= settings.getSection(SECTION_ID);
- if (section == null)
- // create new section
- section= settings.addNewSection(SECTION_ID);
- return section;
- }
-
- /*
- * 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 IAdaptable) {
- IResource resource= (IResource)((IAdaptable)element).getAdapter(IResource.class);
- if (resource != null && resource.getType() == IResource.FILE) {
- String extension= ((IFile)resource).getFileExtension();
- if (extension != null)
- return getScoreForFileExtension(extension);
- } else {
- 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));
- }
- }
- }
- }
-}
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 8a0c618d8..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-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.IAdapterManager;
-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.core.runtime.Status;
-
-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.preference.IPreferenceStore;
-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.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-/**
- * 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$
-
- /** Status code describing an internal error */
- public static final int INTERNAL_ERROR= 1;
-
- private static SearchPlugin fgSearchPlugin;
-
- private List fPageDescriptors;
- private List fSorterDescriptors;
-
- private SearchResultViewEntryAdapterFactory fSearchResultViewEntryAdapterFactory;
-
- public SearchPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- Assert.isTrue(fgSearchPlugin == null);
- fgSearchPlugin= this;
- }
-
- /**
- * Returns the search plugin instance.
- */
- public static SearchPlugin getDefault() {
- return fgSearchPlugin;
- }
-
- /*
- * Overrides AbstractUIPlugin#initializeDefaultPreferences
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
- SearchPreferencePage.initDefaults(store);
- }
-
- /**
- * 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() {
-
- String defaultPerspectiveId= SearchUI.getDefaultPerspectiveId();
- if (defaultPerspectiveId != null) {
- IWorkbenchWindow window= window= getActiveWorkbenchWindow();
- if (window != null && window.getShell() != null && !window.getShell().isDisposed()) {
- try {
- PlatformUI.getWorkbench().showPerspective(defaultPerspectiveId, window);
- } catch (WorkbenchException ex) {
- // show view in current perspective
- }
- }
- }
-
- 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= getWorkspace().getDescription();
- workspaceDesc.setAutoBuilding(state);
- try {
- 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$
- }
- }
-
-
- public void startup() throws CoreException {
- super.startup();
- registerAdapters();
- }
-
- /**
- * Shuts down this plug-in.
- */
- public void shutdown() throws CoreException {
- unregisterAdapters();
- getWorkspace().removeResourceChangeListener(SearchManager.getDefault());
- super.shutdown();
- 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;
- }
-
- /**
- * Returns all search pages contributed to the workbench.
- */
- public List getEnabledSearchPageDescriptors(String pageId) {
- Iterator iter= getSearchPageDescriptors().iterator();
- List enabledDescriptors= new ArrayList(5);
- while (iter.hasNext()) {
- SearchPageDescriptor desc= (SearchPageDescriptor)iter.next();
- if (desc.isEnabled() || desc.getId().equals(pageId))
- enabledDescriptors.add(desc);
- }
- return enabledDescriptors;
- }
-
- /**
- * 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);
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, SearchUI.PLUGIN_ID, INTERNAL_ERROR, SearchMessages.getString("SearchPlugin.internal_error"), e)); //$NON-NLS-1$
- }
-
- /**
- * 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 Separator(IContextMenuConstants.GROUP_REMOVE_MATCHES));
- 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));
- }
-
- private void registerAdapters() {
- IAdapterManager manager= Platform.getAdapterManager();
- fSearchResultViewEntryAdapterFactory= new SearchResultViewEntryAdapterFactory();
- manager.registerAdapters(fSearchResultViewEntryAdapterFactory, ISearchResultViewEntry.class);
- }
-
- private void unregisterAdapters() {
- IAdapterManager manager= Platform.getAdapterManager();
- manager.unregisterAdapters(fSearchResultViewEntryAdapterFactory);
- }
-}
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 54331cc6b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.swt.graphics.Image;
-
-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-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-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/SearchPreferencePage.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
deleted file mode 100644
index 8df06ac24..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.ColorFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-import org.eclipse.search.internal.ui.util.ComboFieldEditor;
-
-/*
- * The page for setting the Search preferences.
- */
-public class SearchPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- public static final String IGNORE_POTENTIAL_MATCHES= "org.eclipse.search.potentialMatch.ignore"; //$NON-NLS-1$
- public static final String EMPHASIZE_POTENTIAL_MATCHES= "org.eclipse.search.potentialMatch.emphasize"; //$NON-NLS-1$
- public static final String POTENTIAL_MATCH_FG_COLOR= "org.eclipse.search.potentialMatch.fgColor"; //$NON-NLS-1$
- public static final String REUSE_EDITOR= "org.eclipse.search.reuseEditor"; //$NON-NLS-1$
- public static final String DEFAULT_PERSPECTIVE= "org.eclipse.search.defaultPerspective"; //$NON-NLS-1$
- private static final String NO_DEFAULT_PERSPECTIVE= "org.eclipse.search.defaultPerspective.none"; //$NON-NLS-1$
-
- private ColorFieldEditor fColorEditor;
- private BooleanFieldEditor fEmphasizedCheckbox;
- private BooleanFieldEditor fIgnorePotentialMatchesCheckbox;
-
-
- private static class PerspectiveDescriptorComparator implements Comparator {
- /*
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- if (o1 instanceof IPerspectiveDescriptor && o2 instanceof IPerspectiveDescriptor) {
- String id1= ((IPerspectiveDescriptor)o1).getLabel();
- String id2= ((IPerspectiveDescriptor)o2).getLabel();
- return Collator.getInstance().compare(id1, id2);
- }
- return 0;
- }
- }
-
-
-
- public SearchPreferencePage() {
- super(GRID);
- setPreferenceStore(SearchPlugin.getDefault().getPreferenceStore());
- }
-
- public static void initDefaults(IPreferenceStore store) {
- RGB gray= new RGB(85, 85, 85);
- store.setDefault(EMPHASIZE_POTENTIAL_MATCHES, true);
- store.setDefault(IGNORE_POTENTIAL_MATCHES, false);
- PreferenceConverter.setDefault(store, POTENTIAL_MATCH_FG_COLOR, gray);
- store.setDefault(REUSE_EDITOR, false);
- store.setDefault(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE);
- }
-
- public static boolean isEditorReused() {
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(REUSE_EDITOR);
- }
-
- public static String getDefaultPerspectiveId() {
- handleDeletedPerspectives();
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- String id= store.getString(DEFAULT_PERSPECTIVE);
- if (id == null || id.length() == 0 || id.equals(NO_DEFAULT_PERSPECTIVE))
- return null;
- else if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) {
- store.putValue(DEFAULT_PERSPECTIVE, id);
- return null;
- }
- return id;
- }
-
- public static boolean arePotentialMatchesIgnored() {
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(IGNORE_POTENTIAL_MATCHES);
- }
-
- public static boolean arePotentialMatchesEmphasized() {
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(EMPHASIZE_POTENTIAL_MATCHES);
- }
-
- public static RGB getPotentialMatchForegroundColor() {
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- return PreferenceConverter.getColor(store, POTENTIAL_MATCH_FG_COLOR);
- }
-
- public void createControl(Composite parent) {
- super.createControl(parent);
- WorkbenchHelp.setHelp(getControl(), ISearchHelpContextIds.SEARCH_PREFERENCE_PAGE);
- }
-
- protected void createFieldEditors() {
- BooleanFieldEditor boolEditor= new BooleanFieldEditor(
- REUSE_EDITOR,
- SearchMessages.getString("SearchPreferencePage.reuseEditor"), //$NON-NLS-1$
- getFieldEditorParent()
- );
- addField(boolEditor);
-
- fIgnorePotentialMatchesCheckbox= new BooleanFieldEditor(
- IGNORE_POTENTIAL_MATCHES,
- SearchMessages.getString("SearchPreferencePage.ignorePotentialMatches"), //$NON-NLS-1$
- getFieldEditorParent());
- addField(fIgnorePotentialMatchesCheckbox);
-
- fEmphasizedCheckbox= new BooleanFieldEditor(
- EMPHASIZE_POTENTIAL_MATCHES,
- SearchMessages.getString("SearchPreferencePage.emphasizePotentialMatches"), //$NON-NLS-1$
- getFieldEditorParent());
- addField(fEmphasizedCheckbox);
-
- fColorEditor= new ColorFieldEditor(
- POTENTIAL_MATCH_FG_COLOR,
- SearchMessages.getString("SearchPreferencePage.potentialMatchFgColor"), //$NON-NLS-1$
- getFieldEditorParent()
- );
- addField(fColorEditor);
-
- fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored(), getFieldEditorParent());
- fColorEditor.setEnabled(!arePotentialMatchesIgnored() && arePotentialMatchesEmphasized(), getFieldEditorParent());
-
- handleDeletedPerspectives();
- String[][] perspectiveNamesAndIds = getPerspectiveNamesAndIds();
- ComboFieldEditor comboEditor= new ComboFieldEditor(
- DEFAULT_PERSPECTIVE,
- SearchMessages.getString("SearchPreferencePage.defaultPerspective"), //$NON-NLS-1$
- perspectiveNamesAndIds,
- getFieldEditorParent());
- addField(comboEditor);
- }
-
- public void setVisible(boolean state) {
- handleDeletedPerspectives();
- super.setVisible(state);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- boolean arePotentialMatchesIgnored= fIgnorePotentialMatchesCheckbox.getBooleanValue();
- fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored, getFieldEditorParent());
- fColorEditor.setEnabled(!arePotentialMatchesIgnored && fEmphasizedCheckbox.getBooleanValue(), getFieldEditorParent());
- }
-
- public void init(IWorkbench workbench) {
- }
-
- protected void performDefaults() {
- super.performDefaults();
- boolean arePotentialMatchesIgnored= fIgnorePotentialMatchesCheckbox.getBooleanValue();
- fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored, getFieldEditorParent());
- fColorEditor.setEnabled(!arePotentialMatchesIgnored && fEmphasizedCheckbox.getBooleanValue(), getFieldEditorParent());
- }
-
- /**
- * Return a 2-dimensional array of perspective names and ids.
- */
- private String[][] getPerspectiveNamesAndIds() {
-
- IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry();
- IPerspectiveDescriptor[] perspectiveDescriptors= registry.getPerspectives();
-
- Arrays.sort(perspectiveDescriptors, new PerspectiveDescriptorComparator());
-
- String[][] table = new String[perspectiveDescriptors.length + 1][2];
- table[0][0] = SearchMessages.getString("SearchPreferencePage.defaultPerspective.none"); //$NON-NLS-1$;
- table[0][1] = NO_DEFAULT_PERSPECTIVE;
- for (int i = 0; i < perspectiveDescriptors.length; i++) {
- table[i + 1][0] = perspectiveDescriptors[i].getLabel();
- table[i + 1][1] = perspectiveDescriptors[i].getId();
- }
- return table;
- }
-
- private static void handleDeletedPerspectives() {
- IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- String id= store.getString(DEFAULT_PERSPECTIVE);
- if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) {
- store.putValue(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE);
- }
- }
-}
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 86f69cf23..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- }
-}
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 c55d2ef26..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-class SearchResultLabelProvider extends LabelProvider {
-
- private static final String MATCHES_POSTFIX= " " + SearchMessages.getString("SearchResultView.matches") + ")"; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- private ILabelProvider fLabelProvider;
-
-
- SearchResultLabelProvider(ILabelProvider provider) {
- fLabelProvider= provider;
- }
-
- 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();
- }
-
- public Image getImage(Object element) {
- return fLabelProvider.getImage(element);
- }
-
- // Don't dispose since label providers are reused.
- public void dispose() {
- }
-
- ILabelProvider getLabelProvider() {
- return fLabelProvider;
- }
-
- public void addListener(ILabelProviderListener listener) {
- super.addListener(listener);
- fLabelProvider.addListener(listener);
- PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator().addListener(listener);
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return fLabelProvider.isLabelProperty(element, property);
- }
-
- public void removeListener(ILabelProviderListener listener) {
- super.removeListener(listener);
- fLabelProvider.removeListener(listener);
- PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator().removeListener(listener);
- }
-}
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 07f95b3f0..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.ViewPart;
-
-import org.eclipse.search.ui.IActionGroupFactory;
-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;
- private IPropertyChangeListener fPropertyChangeListener;
- private CellEditorActionHandler fCellEditorActionHandler;
- private SelectAllAction fSelectAllAction;
-
- /*
- * 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);
- fViewer.init();
-
- // Add selectAll action handlers.
- fCellEditorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
- fSelectAllAction= new SelectAllAction(fViewer);
- fCellEditorActionHandler.setSelectAllAction(fSelectAllAction);
-
- fillActionBars(getViewSite().getActionBars());
-
- fPropertyChangeListener= new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (SearchPreferencePage.POTENTIAL_MATCH_FG_COLOR.equals(event.getProperty()) || SearchPreferencePage.EMPHASIZE_POTENTIAL_MATCHES.equals(event.getProperty()))
- if (fViewer != null)
- fViewer.updatedPotentialMatchFgColor();
- }
- };
-
- SearchPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);
-
- WorkbenchHelp.setHelp(fViewer.getControl(), ISearchHelpContextIds.SEARCH_VIEW);
- }
-
- /**
- * Returns the search result viewer.
- */
- public SearchResultViewer getViewer() {
- return fViewer;
- }
-
- //---- IWorkbenchPart ------------------------------------------------------
-
-
- public void setFocus() {
- fViewer.getControl().setFocus();
- }
-
- public void dispose() {
- if (fViewer != null) {
- SearchManager.getDefault().removeSearchChangeListener(fViewer);
- fViewer= null;
- }
- if (fPropertyChangeListener != null)
- SearchPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyChangeListener);
- if (fCellEditorActionHandler != null) {
- fCellEditorActionHandler.dispose();
- fCellEditorActionHandler= 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 fillActionBars(IActionBars actionBars) {
- IToolBarManager toolBar= actionBars.getToolBarManager();
- fillToolBar(toolBar);
- actionBars.updateActionBars();
-
- // Add selectAll action handlers.
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.SELECT_ALL, fSelectAllAction);
- }
-
- 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() {
- if (fViewer == null)
- return null;
- IBaseLabelProvider labelProvider= fViewer.getLabelProvider();
- if (labelProvider == null)
- return null;
-
- return ((SearchResultLabelProvider)labelProvider).getLabelProvider();
- }
-
- 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
- */
- public void searchStarted(
- IActionGroupFactory groupFactory,
- String singularLabel,
- String pluralLabelPattern,
- ImageDescriptor imageDescriptor,
- String pageId,
- 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(),
- groupFactory,
- groupByKeyComputer,
- operation));
- };
-
- /**
- * 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
- * @deprecated As of build > 20020514
- */
- 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()));
- fResponse= null;
- }
-}
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 9d536a314..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.core.runtime.PlatformObject;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-/**
- * Represents an entry in the search result view
- */
-public class SearchResultViewEntry extends PlatformObject 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;
- private String fMarkerType;
-
- public SearchResultViewEntry(Object groupByKey, IResource resource) {
- fGroupByKey= groupByKey;
- fResource= resource;
- if (fResource != null)
- fModificationStamp= fResource.getModificationStamp();
- }
-
- //---- 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;
- }
-
- boolean isPotentialMatch() {
- if (fMarker != null)
- return fMarker.getAttribute(SearchUI.POTENTIAL_MATCH, false);
- return false;
- }
-
- List getAttributesPerMarker() {
- if (fAttributes == null)
- return new ArrayList(0);
- return fAttributes;
- }
-
- public long getModificationStamp() {
- return fModificationStamp;
- }
-
- void clearMarkerList() {
- fMarker= null;
- if (fMarkers != null)
- fMarkers.clear();
- }
-
- void add(IMarker marker) {
- if (marker != null && fMarkerType == null) {
- try {
- fMarkerType= marker.getType();
- } catch (CoreException ex) {
- // will default to org.eclipse.search.searchmarker
- }
- }
-
- 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;
- }
-
- public 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;
- }
-
- String getMarkerType() {
- if (fMarkerType == null)
- return SearchUI.SEARCH_MARKER;
- else
- return fMarkerType;
- }
-
- 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/SearchResultViewEntryAdapterFactory.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntryAdapterFactory.java
deleted file mode 100644
index 7acaaf169..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntryAdapterFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.search.internal.ui;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-
-import org.eclipse.search.ui.ISearchResultViewEntry;
-
-/**
- * Implements basic UI support for Java elements.
- * Implements handle to persistent support for Java elements.
- */
-public class SearchResultViewEntryAdapterFactory implements IAdapterFactory {
-
- private static Class[] PROPERTIES= new Class[] {
- IResource.class,
- };
-
-
- public Class[] getAdapterList() {
- return PROPERTIES;
- }
-
- public Object getAdapter(Object element, Class key) {
-
- ISearchResultViewEntry entry= (ISearchResultViewEntry)element;
-
- if (IResource.class.equals(key)) {
- IResource resource= entry.getResource();
- /*
- * This is a trick to filter out dummy markers that
- * have been attached to a project because there is no
- * corresponding resource in the workspace.
- */
- int type= resource.getType();
- if (type != IResource.PROJECT && type != IResource.ROOT)
- return resource;
- }
- return null;
- }
-}
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 921814374..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
+++ /dev/null
@@ -1,694 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-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.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-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.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-
-import org.eclipse.search.ui.IActionGroupFactory;
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.IContextMenuContributor;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-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.
- */
-public class SearchResultViewer extends TableViewer {
-
- private SearchResultView fOuterPart;
- private ShowNextResultAction fShowNextResultAction;
- private ShowPreviousResultAction fShowPreviousResultAction;
- private GotoMarkerAction fGotoMarkerActionProxy;
- private SearchAgainAction fSearchAgainAction;
- private RemoveResultAction fRemoveSelectedMatchesAction;
- private RemoveAllResultsAction fRemoveAllResultsAction;
- private SortDropDownAction fSortDropDownAction;
- private SearchDropDownAction fSearchDropDownAction;
- private CopyToClipboardAction fCopyToClipboardAction;
- private int fMarkerToShow;
- private boolean fHandleSelectionChangedEvents= true;
- private ISelection fLastSelection;
- private boolean fCurrentMatchRemoved= false;
- private Color fPotentialMatchFgColor;
- private ActionGroup fActionGroup;
- private IContextMenuContributor fContextMenuContributor;
- private IAction fGotoMarkerAction;
-
- private ResourceToItemsMapper fResourceToItemsMapper;
-
- public SearchResultViewer(SearchResultView outerPart, Composite parent) {
- super(new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
-
- fResourceToItemsMapper= new ResourceToItemsMapper(this);
-
- fOuterPart= outerPart;
- Assert.isNotNull(fOuterPart);
-
- if (SearchPreferencePage.arePotentialMatchesEmphasized())
- fPotentialMatchFgColor= new Color(SearchPlugin.getActiveWorkbenchShell().getDisplay(), SearchPreferencePage.getPotentialMatchForegroundColor());
-
- setUseHashlookup(true);
- setContentProvider(new SearchResultContentProvider());
-
- ILabelProvider labelProvider= new SearchResultLabelProvider(new FileLabelProvider(FileLabelProvider.SHOW_LABEL));
- setLabelProvider(labelProvider);
-
- Search currentSearch= SearchManager.getDefault().getCurrentSearch();
- boolean hasSearch= currentSearch != null;
- boolean hasSearchOperation= hasSearch && currentSearch.getOperation() != null;
-
- fShowNextResultAction= new ShowNextResultAction(this);
- fShowNextResultAction.setEnabled(false);
- fShowPreviousResultAction= new ShowPreviousResultAction(this);
- fShowPreviousResultAction.setEnabled(false);
- fGotoMarkerActionProxy= new GotoMarkerAction(this);
- fGotoMarkerActionProxy.setEnabled(false);
- fRemoveSelectedMatchesAction= new RemoveResultAction(this, false);
- fRemoveSelectedMatchesAction.setEnabled(false);
- fRemoveAllResultsAction= new RemoveAllResultsAction();
- fRemoveAllResultsAction.setEnabled(false);
- fSearchAgainAction= new SearchAgainAction();
- fSearchAgainAction.setEnabled(hasSearchOperation);
- 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) {
- if (fLastSelection == null || !fLastSelection.equals(event.getSelection())) {
- fLastSelection= event.getSelection();
- handleSelectionChanged();
- }
- }
- }
- );
-
- addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- 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);
-
- IActionBars actionBars= fOuterPart.getViewSite().getActionBars();
- if (actionBars != null) {
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.NEXT, fShowNextResultAction);
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PREVIOUS, fShowPreviousResultAction);
- }
-
- fOuterPart.getSite().setSelectionProvider(this);
- }
-
- void init() {
- Search search= SearchManager.getDefault().getCurrentSearch();
- if (search != null) {
- setGotoMarkerAction(search.getGotoMarkerAction());
- setContextMenuTarget(search.getContextMenuContributor());
- setActionGroupFactory(null);
- setActionGroupFactory(search.getActionGroupFactory());
- setPageId(search.getPageId());
- setInput(search.getResults());
- }
- }
-
- /**
- * @see StructuredViewer#doUpdateItem(Widget, Object, boolean)
- */
- protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
- super.doUpdateItem(item, element, fullMap);
- if (((SearchResultViewEntry)element).isPotentialMatch()) {
- TableItem ti = (TableItem) item;
- ti.setForeground(fPotentialMatchFgColor);
- }
- }
-
- private void handleSelectionChanged() {
- int selectionCount= getSelectedEntriesCount();
- boolean hasSingleSelection= selectionCount == 1;
- boolean hasElements= getItemCount() > 0;
- fShowNextResultAction.setEnabled(hasSingleSelection || (hasElements && selectionCount == 0));
- fShowPreviousResultAction.setEnabled(hasSingleSelection || (hasElements && selectionCount == 0));
- fGotoMarkerActionProxy.setEnabled(hasSingleSelection);
- fRemoveSelectedMatchesAction.setEnabled(selectionCount > 0);
-
- if (fHandleSelectionChangedEvents) {
- fMarkerToShow= -1;
- fCurrentMatchRemoved= false;
- } else
- fHandleSelectionChangedEvents= true;
-
- updateStatusLine();
- }
-
- void updateStatusLine() {
- boolean hasSingleSelection= getSelectedEntriesCount() == 1;
- 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);
- if (state != fRemoveAllResultsAction.isEnabled())
- fRemoveAllResultsAction.setEnabled(state);
-
- Search currentSearch= SearchManager.getDefault().getCurrentSearch();
- state= currentSearch != null;
- boolean operationState= state && currentSearch.getOperation() != null;
- if (state != fSearchDropDownAction.isEnabled())
- fSearchDropDownAction.setEnabled(state);
- if (operationState != fSearchAgainAction.isEnabled())
- fSearchAgainAction.setEnabled(operationState);
-
- state= !getSelection().isEmpty();
- if (state != fGotoMarkerActionProxy.isEnabled())
- fGotoMarkerActionProxy.setEnabled(state);
- if (state != fRemoveSelectedMatchesAction.isEnabled())
- fRemoveSelectedMatchesAction.setEnabled(state);
- }
-
-
- protected void inputChanged(Object input, Object oldInput) {
- fLastSelection= null;
- getTable().removeAll();
- super.inputChanged(input, oldInput);
- fMarkerToShow= -1;
- fCurrentMatchRemoved= false;
- 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) {
- ISelection selection= getSelection();
-
- if (fActionGroup != null) {
- ActionContext context= new ActionContext(selection);
- context.setInput(getInput());
- fActionGroup.setContext(context);
- fActionGroup.fillContextMenu(menu);
- fActionGroup.setContext(null);
- }
-
- if (fContextMenuContributor != null)
- fContextMenuContributor.fill(menu, this);
-
- if (!selection.isEmpty()) {
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fCopyToClipboardAction);
- menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fGotoMarkerActionProxy);
- if (enableRemoveMatchMenuItem())
- menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveMatchAction(this));
- menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveResultAction(this, true));
-
- if (isPotentialMatchSelected())
- menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemovePotentialMatchesAction(fOuterPart.getViewSite()));
- }
-
- // If we have elements
- if (getItemCount() > 0)
- menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveAllResultsAction());
-
- menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSearchAgainAction);
- if (getItemCount() > 0) {
- fSortDropDownAction= fSortDropDownAction.renew();
- if (fSortDropDownAction.getSorterCount() > 1)
- menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSortDropDownAction);
- }
- }
-
- private boolean isPotentialMatchSelected() {
- ISelection selection= getSelection();
- if (selection instanceof IStructuredSelection) {
- Object entry= ((IStructuredSelection)selection).getFirstElement();
- if (entry instanceof ISearchResultViewEntry) {
- IMarker marker= ((ISearchResultViewEntry)entry).getSelectedMarker();
- return marker != null && marker.getAttribute(SearchUI.POTENTIAL_MATCH, false);
- }
- }
- return false;
- }
-
- IAction getGotoMarkerAction() {
- // null as return value is covered (no action will take place)
- return fGotoMarkerAction;
- }
-
- void setGotoMarkerAction(IAction gotoMarkerAction) {
- fGotoMarkerAction= gotoMarkerAction;
- }
-
-
- void setContextMenuTarget(IContextMenuContributor contributor) {
- fContextMenuContributor= contributor;
- }
-
- void setActionGroupFactory(IActionGroupFactory groupFactory) {
- IActionBars actionBars= fOuterPart.getViewSite().getActionBars();
- if (fActionGroup != null) {
- fActionGroup.dispose();
- fActionGroup= null;
- }
-
- if (groupFactory != null) {
- fActionGroup= groupFactory.createActionGroup(fOuterPart);
- if (actionBars != null)
- fActionGroup.fillActionBars(actionBars);
- }
- if (actionBars != null)
- actionBars.updateActionBars();
- }
-
- void setPageId(String pageId) {
- ILabelProvider labelProvider= fOuterPart.getLabelProvider(pageId);
- if (labelProvider != null)
- internalSetLabelProvider(labelProvider);
- fSortDropDownAction.setPageId(pageId);
- }
-
- void fillToolBar(IToolBarManager tbm) {
- tbm.add(fShowNextResultAction);
- tbm.add(fShowPreviousResultAction);
-// tbm.add(fGotoMarkerAction); see bug 15275
- tbm.add(fRemoveSelectedMatchesAction);
- tbm.add(fRemoveAllResultsAction);
- tbm.add(new Separator());
- tbm.add(new OpenSearchDialogAction());
- 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, true).run();
- return; // performance
- }
- }
- });
- }
-
- int getItemCount() {
- return SearchManager.getDefault().getCurrentItemCount();
- }
-
- void internalSetLabelProvider(ILabelProvider provider) {
- setLabelProvider(new SearchResultLabelProvider(provider));
- }
-
- /**
- * 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;
- fCurrentMatchRemoved= false;
- 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();
-
- if (fCurrentMatchRemoved)
- fCurrentMatchRemoved= false;
- else
- 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();
- updateStatusLine();
- }
-
-
- /**
- * Makes the previous result (marker) visible. If there isn't any
- * visible result, this method makes the last result visible.
- */
- public void showPreviousResult() {
- fCurrentMatchRemoved= false;
- 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();
- updateStatusLine();
- }
-
- private boolean canDoShowResult(Table table) {
- if (table == null || getItemCount() == 0)
- return false;
- return true;
- }
-
- private void selectResult(Table table, int index) {
- fHandleSelectionChangedEvents= false;
- Object element= getElementAt(index);
- if (element != null)
- setSelection(new StructuredSelection(getElementAt(index)), true);
- else
- setSelection(StructuredSelection.EMPTY);
- }
-
- private void openCurrentSelection() {
- IAction action= getGotoMarkerAction();
- if (action != null)
- action.run();
- }
-
- /**
- * Updates the foreground color for potential matches.
- */
- void updatedPotentialMatchFgColor() {
- if (fPotentialMatchFgColor != null)
- fPotentialMatchFgColor.dispose();
- fPotentialMatchFgColor= null;
- if (SearchPreferencePage.arePotentialMatchesEmphasized())
- fPotentialMatchFgColor= new Color(SearchPlugin.getActiveWorkbenchShell().getDisplay(), SearchPreferencePage.getPotentialMatchForegroundColor());
- refresh();
- }
-
- /**
- * 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) {
- fLastSelection= null;
- Menu menu= getTable().getMenu();
- if (menu != null)
- menu.dispose();
- if (fPotentialMatchFgColor != null)
- fPotentialMatchFgColor.dispose();
- if (fActionGroup != null) {
- fActionGroup.dispose();
- fActionGroup= null;
- }
- 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)
- remove(entry);
- else
- updateItem(item, entry);
- updateStatusLine();
- }
-
- /**
- * Handle remove all.
- */
- protected void handleRemoveAll() {
- setContextMenuTarget(null);
- setActionGroupFactory(null);
- setInput(null);
- }
-
- /**
- * Handle an update of an entry.
- */
- protected void handleUpdateMatch(ISearchResultViewEntry entry, boolean matchRemoved) {
- Widget item= findItem(entry);
- updateItem(item, entry);
- if (matchRemoved && getSelectionFromWidget().contains(entry))
- fCurrentMatchRemoved= true;
- }
-
- //--- Persistency -------------------------------------------------
-
- void restoreState(IMemento memento) {
- fSortDropDownAction.restoreState(memento);
- }
-
- void saveState(IMemento memento) {
- fSortDropDownAction.saveState(memento);
- }
-
- /*
- * @see ContentViewer#handleLabelProviderChanged(LabelProviderChangedEvent)
- */
- protected void handleLabelProviderChanged(LabelProviderChangedEvent event) {
- Object[] changed= event.getElements();
- if (changed != null && !fResourceToItemsMapper.isEmpty()) {
- ArrayList others= new ArrayList(changed.length);
- for (int i= 0; i < changed.length; i++) {
- Object curr= changed[i];
- if (curr instanceof IResource)
- fResourceToItemsMapper.resourceChanged((IResource) curr);
- else if (curr instanceof IAdaptable) {
- IResource resource= (IResource)((IAdaptable)curr).getAdapter(IResource.class);
- if (resource != null)
- fResourceToItemsMapper.resourceChanged(resource);
- } else
- others.add(curr);
- }
- if (others.isEmpty()) {
- return;
- }
- event= new LabelProviderChangedEvent((IBaseLabelProvider) event.getSource(), others.toArray());
- }
- super.handleLabelProviderChanged(event);
- }
-
- /*
- * @see StructuredViewer#mapElement(Object, Widget)
- */
- protected void mapElement(Object element, Widget item) {
- super.mapElement(element, item);
- if (item instanceof Item) {
- fResourceToItemsMapper.addToMap(element, (Item)item);
- }
- }
-
- /*
- * @see StructuredViewer#unmapElement(Object, Widget)
- */
- protected void unmapElement(Object element, Widget item) {
- if (item instanceof Item) {
- fResourceToItemsMapper.removeFromMap(element, (Item)item);
- }
- super.unmapElement(element, item);
- }
-
- /*
- * @see StructuredViewer#unmapAllElements()
- */
- protected void unmapAllElements() {
- fResourceToItemsMapper.clearMap();
- super.unmapAllElements();
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.java
deleted file mode 100644
index 6ee7c5023..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * This action selects all entries currently showing in view.
- */
-class SelectAllAction extends Action {
-
- private SearchResultViewer fViewer;
-
- /**
- * Creates the action.
- */
- SelectAllAction(SearchResultViewer viewer) {
- super("selectAll"); //$NON-NLS-1$
- setText(SearchMessages.getString("SelectAllAction.label")); //$NON-NLS-1$
- setToolTipText(SearchMessages.getString("SelectAllAction.tooltip")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(this, ISearchHelpContextIds.SELECT_ALL_ACTION);
- fViewer= viewer;
- }
-
- /**
- * Selects all resources in the view.
- */
- public void run() {
- fViewer.getTable().selectAll();
- // force viewer selection change
- fViewer.setSelection(fViewer.getSelection());
- }
-}
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 434082444..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
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 97e157892..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
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 969e08500..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import org.eclipse.jface.action.Action;
-
-class ShowSearchAction extends Action {
- private Search fSearch;
-
- /**
- * 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 5705c9451..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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() == ListDialog.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 55ea5b75c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
-import org.eclipse.ui.model.WorkbenchViewerSorter;
-
-/**
- * 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 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() {
- if (fMenu != null && !fMenu.isDisposed())
- fMenu.dispose();
- fMenu= 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());
- } else {
- // Use default sort workbench viewer sorter
- fViewer.setSorter(new WorkbenchViewerSorter());
- }
- }
-
- public Menu getMenu(final Menu parent) {
- dispose(); // ensure old menu gets disposed
-
- fMenu= 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(fMenu, action);
- }
- }
- return fMenu;
- }
-
- 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);
- }
-
- /**
- * Disposes this action's menu and returns a new unused instance.
- */
- SortDropDownAction renew() {
- SortDropDownAction action= new SortDropDownAction(fViewer);
- action.fLastCheckedForType= fLastCheckedForType;
- action.fPageId= fPageId;
- dispose();
- return action;
- }
-
- //--- 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());
- }
- }
-
- int getSorterCount() {
- int count= 0;
- Iterator iter= SearchPlugin.getDefault().getSorterDescriptors().iterator();
- while (iter.hasNext()) {
- SorterDescriptor sorterDesc= (SorterDescriptor)iter.next();
- if (sorterDesc.getPageId().equals(fPageId) || sorterDesc.getPageId().equals("*")) //$NON-NLS-1$
- count++;
- }
- return count;
- }
-}
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 d1e572ffb..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-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-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);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/WorkingSetComparator.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/WorkingSetComparator.java
deleted file mode 100644
index f660f3cf9..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/WorkingSetComparator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui;
-
-import java.text.Collator;
-import java.util.Comparator;
-
-import org.eclipse.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/ui/text/GotoMarkerAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java
deleted file mode 100644
index dabcb4b68..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.IEditorReference;
-import org.eclipse.ui.IReusableEditor;
-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= page.findEditor(input);
- if (editor != null)
- page.bringToTop(editor);
- else {
- boolean isOpen= false;
- if (fEditor != null) {
- IEditorReference[] parts= page.getEditorReferences();
- int i= 0;
- while (!isOpen && i < parts.length)
- isOpen= fEditor == parts[i++].getEditor(false);
- }
-
- boolean canBeReused= isOpen && !fEditor.isDirty() && !isPinned(fEditor);
- boolean showsSameInputType= fEditor != null && fEditor.getSite().getId().equals(editorId);
-
- if (canBeReused && !showsSameInputType) {
- page.closeEditor(fEditor, false);
- fEditor= null;
- }
-
- if (canBeReused && showsSameInputType) {
- ((IReusableEditor)fEditor).setInput(input);
- page.bringToTop(fEditor);
- editor= fEditor;
- } else
- try {
- editor= page.openEditor(input, editorId, false);
- if (editor instanceof IReusableEditor)
- fEditor= editor;
- else
- fEditor= null;
- } 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;
- }
- }
-
- if (editor != null) {
- editor.gotoMarker(marker);
- }
- }
-
- private boolean isPinned(IEditorPart editor) {
- if (editor == null)
- return false;
-
- IEditorReference[] editorRefs= editor.getEditorSite().getPage().getEditorReferences();
- int i= 0;
- while (i < editorRefs.length) {
- if (editor.equals(editorRefs[i].getEditor(false)))
- return editorRefs[i].isPinned();
- i++;
- }
- return false;
- }
-
- 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;
- }
- }
-}
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 61e207ffb..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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();
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java
deleted file mode 100644
index b0855cde1..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-import org.eclipse.search.internal.ui.Search;
-import org.eclipse.search.internal.ui.SearchManager;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchResultViewEntry;
-import org.eclipse.search.internal.ui.util.ListDialog;
-
-/* package */ class ReplaceAction extends Action {
-
- private IWorkbenchSite fSite;
- private List fElements;
-
- public ReplaceAction(IWorkbenchSite site, List elements) {
- Assert.isNotNull(site);
- fSite= site;
- if (elements != null)
- fElements= elements;
- else
- fElements= new ArrayList(0);
- setText(SearchMessages.getString("ReplaceAction.label_all")); //$NON-NLS-1$
- setEnabled(!fElements.isEmpty());
- }
-
- public ReplaceAction(IWorkbenchSite site, IStructuredSelection selection) {
- Assert.isNotNull(site);
- fSite= site;
- setText(SearchMessages.getString("ReplaceAction.label_selected")); //$NON-NLS-1$
- fElements= selection.toList();
- setEnabled(!fElements.isEmpty());
- }
-
- public void run() {
- if (validateResources()) {
- Search search= SearchManager.getDefault().getCurrentSearch();
- IRunnableWithProgress operation= search.getOperation();
- if (operation instanceof TextSearchOperation) {
- ReplaceDialog dialog= new ReplaceDialog(fSite.getShell(), fElements, fSite.getWorkbenchWindow(), ((TextSearchOperation)operation).getPattern());
- dialog.open();
- } else {
- MessageDialog.openError(fSite.getShell(), getDialogTitle(), SearchMessages.getString("ReplaceAction.error.only_on_text_search")); //$NON-NLS-1$
- }
- }
- }
-
- private boolean validateResources() {
- List modifiedFiles= new ArrayList();
- List openedFilesInNonTextEditor= new ArrayList();
- List notFiles= new ArrayList();
- IWorkbenchPage activePage = fSite.getWorkbenchWindow().getActivePage();
-
- for (Iterator iter = fElements.iterator(); iter.hasNext();) {
- SearchResultViewEntry entry= (SearchResultViewEntry) iter.next();
- IResource resource= entry.getResource();
- if (resource instanceof IFile) {
- IFile file= (IFile)resource;
- if (file.getModificationStamp() != entry.getModificationStamp() || !file.isSynchronized(IResource.DEPTH_ZERO)) {
- modifiedFiles.add(resource);
- } else if (activePage != null) {
- IEditorPart part= activePage.findEditor(new FileEditorInput(file));
- if (part != null && !(part instanceof ITextEditor))
- openedFilesInNonTextEditor.add(file);
- }
- } else {
- if (resource != null)
- notFiles.add(resource);
- }
- }
- if (!modifiedFiles.isEmpty()) {
- showModifiedFileDialog(modifiedFiles);
- return false;
- }
- if (!openedFilesInNonTextEditor.isEmpty()) {
- showOpenedFileDialog(openedFilesInNonTextEditor);
- return false;
- }
- if (!notFiles.isEmpty()) {
- showNotFilesDialog(openedFilesInNonTextEditor);
- return false;
- }
- IFile[] readOnlyFiles= getReadOnlyFiles();
- if (readOnlyFiles.length == 0)
- return true;
- Map currentStamps= createModificationStampMap(readOnlyFiles);
- IStatus status= ResourcesPlugin.getWorkspace().validateEdit(readOnlyFiles, fSite.getShell());
- if (!status.isOK()) {
- ErrorDialog.openError(fSite.getShell(), getDialogTitle(), SearchMessages.getString("ReplaceAction.error.unable_to_perform"), status); //$NON-NLS-1$
- return false;
- }
- modifiedFiles= new ArrayList();
- Map newStamps= createModificationStampMap(readOnlyFiles);
- for (Iterator iter= currentStamps.keySet().iterator(); iter.hasNext();) {
- IFile file= (IFile) iter.next();
- if (! currentStamps.get(file).equals(newStamps.get(file))) {
- modifiedFiles.add(file);
- }
- }
- if (!modifiedFiles.isEmpty()) {
- showModifiedFileDialog(modifiedFiles);
- return false;
- }
- return true;
- }
-
- private void showModifiedFileDialog(List modifiedFiles) {
- String message= (modifiedFiles.size() == 1
- ? SearchMessages.getString("ReplaceAction.error.changed_file") //$NON-NLS-1$
- : SearchMessages.getString("ReplaceAction.error.changed_files")); //$NON-NLS-1$
- ListDialog dialog= new ListDialog(fSite.getShell(), modifiedFiles, getDialogTitle(),
- message,
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return ((List)inputElement).toArray();
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- },
- new WorkbenchLabelProvider());
- dialog.setCreateCancelButton(false);
- dialog.open();
- }
-
- private IFile[] getReadOnlyFiles() {
- List result= new ArrayList();
- for (Iterator iter = fElements.iterator(); iter.hasNext();) {
- IResource resource= ((SearchResultViewEntry) iter.next()).getResource();
- if (resource instanceof IFile && resource.isReadOnly())
- result.add(resource);
- }
- return (IFile[]) result.toArray(new IFile[result.size()]);
- }
-
- private static Map createModificationStampMap(IFile[] files){
- Map map= new HashMap();
- for (int i= 0; i < files.length; i++) {
- IFile file= files[i];
- map.put(file, new Long(file.getModificationStamp()));
- }
- return map;
- }
-
- private String getDialogTitle() {
- return SearchMessages.getString("ReplaceAction.dialog.title"); //$NON-NLS-1$
- }
-
- private void showOpenedFileDialog(List openedFilesInNonTextEditor) {
- String message= (openedFilesInNonTextEditor.size() == 1
- ? SearchMessages.getString("ReplaceAction.error.opened_file") //$NON-NLS-1$
- : SearchMessages.getString("ReplaceAction.error.opened_files")); //$NON-NLS-1$
- ListDialog dialog= new ListDialog(fSite.getShell(), openedFilesInNonTextEditor, getDialogTitle(),
- message,
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return ((List)inputElement).toArray();
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- },
- new WorkbenchLabelProvider());
- dialog.setCreateCancelButton(false);
- dialog.open();
- }
-
- private void showNotFilesDialog(List notFiles) {
- String message= (notFiles.size() == 1
- ? SearchMessages.getString("ReplaceAction.error.not_file") //$NON-NLS-1$
- : SearchMessages.getString("ReplaceAction.error.not_files")); //$NON-NLS-1$
- ListDialog dialog= new ListDialog(fSite.getShell(), notFiles, getDialogTitle(),
- message,
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return ((List)inputElement).toArray();
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- },
- new WorkbenchLabelProvider());
- dialog.setCreateCancelButton(false);
- dialog.open();
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java
deleted file mode 100644
index b575bc223..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.text;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-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.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-import org.eclipse.search.ui.ISearchResultView;
-
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.SearchResultView;
-import org.eclipse.search.internal.ui.SearchResultViewEntry;
-import org.eclipse.search.internal.ui.util.ExceptionHandler;
-
-public class ReplaceDialog extends Dialog {
-
- private static final int REPLACE_NEXT= IDialogConstants.CLIENT_ID;
- private static final int REPLACE= IDialogConstants.CLIENT_ID + 1;
- private static final int NEXT= IDialogConstants.CLIENT_ID + 2;
-
- private String fSearchPattern;
-
- private IWorkbenchWindow fWindow;
- private boolean fAutobuild;
- private boolean fFatalError;
-
- // UI
- private Text fTextField;
- private Button fSaveButton;
- private Button fReplaceNextButton;
- private Button fReplaceButton;
- private Button fNextButton;
-
-
- private boolean fSaved;
- private ITextEditor fEditor;
- private boolean fCloseEditor;
- private IDocument fDocument;
- private AbstractMarkerAnnotationModel fAnnotationModel;
-
-
- private List fElements;
- private int fElementIndex;
- private SearchResultViewEntry fCurrentEntry;
- private List fCurrentMarkers;
- private int fMarkerIndex;
- private IMarker fCurrentMatch;
-
- private static class MarkerNotPresentableException extends Exception {
- private IFile fFile;
- MarkerNotPresentableException(IFile file) {
- fFile= file;
- }
- public IFile getFile() {
- return fFile;
- }
- }
-
- protected ReplaceDialog(Shell parentShell, List elements, IWorkbenchWindow window, String searchPattern) {
- super(parentShell);
- Assert.isNotNull(elements);
- Assert.isNotNull(searchPattern);
- fElements= new ArrayList(elements);
- Assert.isNotNull(window);
- fWindow= window;
- fSearchPattern= searchPattern;
- }
-
- public void create() {
- super.create();
- Shell shell= getShell();
- shell.setText(getDialogTitle());
- updateButtons();
- }
-
- public int open() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- fAutobuild= workspace.isAutoBuilding();
- if (fAutobuild) {
- IWorkspaceDescription description= workspace.getDescription();
- description.setAutoBuilding(false);
- try {
- workspace.setDescription(description);
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), getDialogTitle(), SearchMessages.getString("ReplaceDialog.error.auto_building")); //$NON-NLS-1$
- fFatalError= true;
- }
- }
- try {
- fCurrentMatch= getNextMatch(false);
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), getDialogTitle(), SearchMessages.getString("ReplaceDialog.error.no_matches")); //$NON-NLS-1$
- fFatalError= true;
- } catch (MarkerNotPresentableException e) {
- handleMarkerNotPresentableException(e);
- fFatalError= true;
- }
- return super.open();
- }
-
- public boolean close() {
- boolean result= super.close();
- restoreAutoBuildState();
- return result;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite result= (Composite)super.createDialogArea(parent);
- GridLayout layout= (GridLayout)result.getLayout();
- layout.numColumns= 2;
-
- initializeDialogUnits(result);
-
- Label label= new Label(result, SWT.NONE);
- label.setText(SearchMessages.getString("ReplaceDialog.replace_label")); //$NON-NLS-1$
-
- CLabel clabel= new CLabel(result, SWT.NONE);
- clabel.setText(fSearchPattern);
- GridData gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint= convertWidthInCharsToPixels(50);
- clabel.setLayoutData(gd);
-
- label= new Label(result, SWT.NONE);
- label.setText(SearchMessages.getString("ReplaceDialog.with_label")); //$NON-NLS-1$
-
- fTextField= new Text(result, SWT.BORDER);
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint= convertWidthInCharsToPixels(50);
- fTextField.setLayoutData(gd);
- fTextField.setFocus();
-
- fSaveButton= new Button(result, SWT.CHECK);
- fSaveButton.setText(SearchMessages.getString("ReplaceDialog.save_changes")); //$NON-NLS-1$
- fSaveButton.setSelection(true);
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan= 2;
- fSaveButton.setLayoutData(gd);
-
- applyDialogFont(result);
- return result;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- fReplaceNextButton= createButton(parent, REPLACE_NEXT, SearchMessages.getString("ReplaceDialog.replace_next"), false); //$NON-NLS-1$
- fReplaceButton= createButton(parent, REPLACE, SearchMessages.getString("ReplaceDialog.replace"), false); //$NON-NLS-1$
- fNextButton= createButton(parent, NEXT, SearchMessages.getString("ReplaceDialog.next"), false); //$NON-NLS-1$
- createButton(parent, IDialogConstants.CANCEL_ID, SearchMessages.getString("ReplaceDialog.close"), false); //$NON-NLS-1$
- }
-
- protected Point getInitialLocation(Point initialSize) {
- SearchResultView view= (SearchResultView)SearchPlugin.getSearchResultView();
- if (view == null)
- return super.getInitialLocation(initialSize);
- Point result= new Point(0,0);
- Control control= view.getViewer().getControl();
- Point size= control.getSize();
- Point location= control.toDisplay(control.getLocation());
- result.x= Math.max(0, location.x + size.x - initialSize.x);
- result.y= Math.max(0, location.y + size. y - initialSize.y);
- return result;
- }
-
- protected void buttonPressed(int buttonId) {
- try {
- boolean save= fSaveButton.getSelection();
- String text= fTextField.getText();
- switch(buttonId) {
- case REPLACE_NEXT:
- replace(fCurrentMatch, text, save);
- fCurrentMatch= getNextMatch(save);
- break;
- case REPLACE:
- replace(fCurrentMatch, text, save);
- fCurrentMatch= null;
- break;
- case NEXT:
- fCurrentMatch= getNextMatch(save);
- break;
- case IDialogConstants.CANCEL_ID:
- saveEditor(save);
- break;
- }
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), getDialogTitle(), SearchMessages.getString("ReplaceDialog.error.unexpected_exception")); //$NON-NLS-1$
- fFatalError= true;
- } catch (BadLocationException e) {
- MessageDialog.openError(getShell(), getDialogTitle(), SearchMessages.getString("ReplaceDialog.error.different_content")); //$NON-NLS-1$
- fFatalError= true;
- } catch (MarkerNotPresentableException e) {
- handleMarkerNotPresentableException(e);
- fFatalError= true;
- }
- updateButtons();
- super.buttonPressed(buttonId);
- }
-
- private void replace(IMarker source, String text, boolean save) throws CoreException, BadLocationException {
- Position position= fAnnotationModel.getMarkerPosition(source);
- fDocument.replace(position.getOffset(), position.getLength(), text);
- SearchPlugin.getWorkspace().deleteMarkers(new IMarker[] {source});
- }
-
- private boolean hasNextMatch() {
- if (fCurrentMarkers != null)
- return true;
- return fElementIndex < fElements.size();
- }
-
- private IMarker getNextMatch(boolean save) throws CoreException, MarkerNotPresentableException {
- if (fCurrentMarkers == null) {
- if (fElementIndex >= fElements.size())
- return null;
- saveEditor(save);
- fCurrentEntry= (SearchResultViewEntry)fElements.get(fElementIndex++);
- fCurrentMarkers= new ArrayList(fCurrentEntry.getMarkers());
- fMarkerIndex= 0;
- }
- IMarker result= (IMarker)fCurrentMarkers.get(fMarkerIndex);
- if (fEditor == null) {
- IWorkbenchPage activePage = fWindow.getActivePage();
- int openEditors= activePage.getEditorReferences().length;
-
- fEditor= openFile(result, activePage);
- fEditor.gotoMarker(result);
- IDocumentProvider provider= fEditor.getDocumentProvider();
- IEditorInput input = fEditor.getEditorInput();
- fDocument= provider.getDocument(input);
- fAnnotationModel= (AbstractMarkerAnnotationModel)provider.getAnnotationModel(input);
- fCloseEditor= openEditors < activePage.getEditorReferences().length;
- } else {
- fEditor.gotoMarker(result);
- }
- if (fMarkerIndex == fCurrentMarkers.size() - 1) {
- fCurrentMarkers= null;
- } else {
- fMarkerIndex++;
- }
- return result;
- }
-
- private ITextEditor openFile(IMarker marker, IWorkbenchPage activePage) throws MarkerNotPresentableException, PartInitException {
- IFile markerFile= marker.getResource() instanceof IFile ? (IFile)marker.getResource() : null;
- if (markerFile == null)
- throw new MarkerNotPresentableException(null);
-
- String currentEditorId= null;
- IEditorRegistry editorRegistry= SearchPlugin.getDefault().getWorkbench().getEditorRegistry();
- IEditorDescriptor desc= editorRegistry.getDefaultEditor(markerFile);
- if (desc != null)
- currentEditorId= desc.getId();
- try {
- IEditorPart result= activePage.openEditor(markerFile, "org.eclipse.ui.DefaultTextEditor", false); //$NON-NLS-1$
- if (!(result instanceof ITextEditor))
- throw new MarkerNotPresentableException(markerFile);
- return (ITextEditor)result;
- } finally {
- if (currentEditorId != null)
- editorRegistry.setDefaultEditor(markerFile, currentEditorId);
- }
- }
-
- private void saveEditor(boolean save) throws CoreException {
- if (fEditor == null)
- return;
-
- save= save && fEditor.isDirty();
- if (save) {
- IDocumentProvider provider= fEditor.getDocumentProvider();
- IEditorInput input = fEditor.getEditorInput();
- try {
- provider.aboutToChange(input);
- provider.saveDocument(new NullProgressMonitor(), input, fDocument, true);
- fSaved= true;
- } finally {
- provider.changed(input);
- }
- }
- if (fCloseEditor && !fEditor.isDirty())
- fEditor.close(false);
- fEditor= null;
- fDocument= null;
- fAnnotationModel= null;
- fCloseEditor= false;
-
- }
-
- private void updateButtons() {
- boolean hasNext= hasNextMatch();
- fReplaceNextButton.setEnabled(!fFatalError && fCurrentMatch != null);
- fReplaceButton.setEnabled(!fFatalError && fCurrentMatch != null);
- fNextButton.setEnabled(!fFatalError && hasNext);
- }
-
- private void restoreAutoBuildState() {
- if (!fAutobuild)
- return;
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceDescription description= workspace.getDescription();
- description.setAutoBuilding(true);
- try {
- workspace.setDescription(description);
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), getDialogTitle(), SearchMessages.getString("ReplaceDialog.error.reenable_auto_build_failed")); //$NON-NLS-1$
- return;
- }
-
- ISearchResultView view= SearchPlugin.getSearchResultView();
- if (fSaved && view != null) {
- new GlobalBuildAction(
- view.getSite().getWorkbenchWindow(),
- IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
- }
- }
-
- private String getDialogTitle() {
- return SearchMessages.getString("ReplaceDialog.dialog.title"); //$NON-NLS-1$
- }
-
- private void handleMarkerNotPresentableException(MarkerNotPresentableException e) {
- IFile file= e.getFile();
- String message;
- if (file == null) {
- message= SearchMessages.getString("ReplaceDialog.error.no_file_for_marker"); //$NON-NLS-1$
- } else {
- message= SearchMessages.getFormattedString("ReplaceDialog.error.unable_to_open_text_editor", file.getName()); //$NON-NLS-1$
- }
- MessageDialog.openError(getParentShell(), getDialogTitle(), message);
- }
-}
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 591a085d8..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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 333f8c228..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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);
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java
deleted file mode 100644
index dd8e89d4b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.text;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.actions.OpenWithMenu;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.ISearchResultViewEntry;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.ui.SearchManager;
-import org.eclipse.search.internal.ui.SearchMessages;
-
-/**
- * Action group that adds the Text search actions to a context menu and
- * the global menu bar.
- *
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @since 2.1
- */
-class TextSearchActionGroup extends ActionGroup {
-
- private ISelectionProvider fSelectionProvider;
- private IWorkbenchPage fPage;
- private PropertyDialogAction fOpenPropertiesDialog;
-
- public TextSearchActionGroup(IViewPart part) {
- Assert.isNotNull(part);
- IWorkbenchPartSite site= part.getSite();
- fSelectionProvider= site.getSelectionProvider();
- fPage= site.getPage();
- fOpenPropertiesDialog= new PropertyDialogAction(site.getShell(), fSelectionProvider);
-
- ISelection selection= fSelectionProvider.getSelection();
-
- if (selection instanceof IStructuredSelection)
- fOpenPropertiesDialog.selectionChanged((IStructuredSelection)selection);
- else
- fOpenPropertiesDialog.selectionChanged(selection);
- }
-
- public void fillContextMenu(IMenuManager menu) {
- if (!isTextSearch())
- return;
-
- // view must exist if we create a context menu for it.
- ISearchResultView view= SearchUI.getSearchResultView();
- IStructuredSelection selection= null;
- if (getContext().getSelection() instanceof IStructuredSelection)
- selection= (IStructuredSelection)getContext().getSelection();
- else
- selection= StructuredSelection.EMPTY;
-
- addOpenWithMenu(menu, selection);
-
- ReplaceAction replaceAll= new ReplaceAction(view.getSite(), (List)getContext().getInput());
- if (replaceAll.isEnabled())
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceAll);
- ReplaceAction replaceSelected= new ReplaceAction(view.getSite(), selection);
- if (replaceSelected.isEnabled())
- menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceSelected);
-
- if (fOpenPropertiesDialog != null && fOpenPropertiesDialog.isEnabled() && selection != null &&fOpenPropertiesDialog.isApplicableForSelection(selection))
- menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fOpenPropertiesDialog);
- }
-
- private boolean isTextSearch() {
- IRunnableWithProgress operation= SearchManager.getDefault().getCurrentSearch().getOperation();
- if (operation instanceof TextSearchOperation) {
- String pattern= ((TextSearchOperation)operation).getPattern();
- return pattern != null && pattern.length() > 0;
- }
- return false;
- }
-
- private void addOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
- if (selection == null || selection.size() != 1)
- return;
-
- Object o= selection.getFirstElement();
- if (!(o instanceof ISearchResultViewEntry))
- return;
-
- Object resource= ((ISearchResultViewEntry)o).getResource();
- if (!(resource instanceof IFile))
- return;
-
- // Create menu
- IMenuManager submenu= new MenuManager(SearchMessages.getString("OpenWithMenu.label")); //$NON-NLS-1$
- submenu.add(new OpenWithMenu(fPage, (IFile)resource));
-
- // Add the submenu.
- menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
- }
-
- /* (non-Javadoc)
- * Method declared in ActionGroup
- */
- public void fillActionBars(IActionBars actionBar) {
- super.fillActionBars(actionBar);
- setGlobalActionHandlers(actionBar);
- }
-
- private void setGlobalActionHandlers(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PROPERTIES, fOpenPropertiesDialog);
- }
-}
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 a8a37b417..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.text;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-
-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.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;
- private IStatus fStatus;
-
- /**
- * 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) {
- fCollector.setProgressMonitor(monitor);
- TextSearchEngine engine= new TextSearchEngine();
- fStatus= engine.search(fWorkspace, fPattern, fOptions, fScope, fCollector);
- }
-
- String getSingularLabel() {
- if (fPattern == null || fPattern.length() < 1)
- return SearchMessages.getFormattedString("FileSearchOperation.singularLabelPostfix", new String[] {fScope.getDescription()}); //$NON-NLS-1$
- else
- return SearchMessages.getFormattedString("TextSearchOperation.singularLabelPostfix", new String[] {fPattern, fScope.getDescription()}); //$NON-NLS-1$
- }
-
- String getPluralLabelPattern() {
- if (fPattern == null || fPattern.length() < 1)
- return SearchMessages.getFormattedString("FileSearchOperation.pluralLabelPatternPostfix", new String[] {"{0}", fScope.getDescription()}); //$NON-NLS-2$ //$NON-NLS-1$
- else
- 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;
- }
-
- IStatus getStatus() {
- return fStatus;
- }
-
- String getPattern() {
- return fPattern;
- }
-}
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 d5fe9369c..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java
+++ /dev/null
@@ -1,585 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.HashSet;
-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.core.runtime.IStatus;
-
-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.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.ErrorDialog;
-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.IWorkingSet;
-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.SearchUI;
-
-import org.eclipse.search.internal.core.text.TextSearchScope;
-import org.eclipse.search.internal.ui.ISearchHelpContextIds;
-import org.eclipse.search.internal.ui.ScopePart;
-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 textPattern;
- Set fileNamePatterns;
- int scope;
- IWorkingSet[] workingSets;
-
- public SearchPatternData(String textPattern, boolean ignoreCase, Set fileNamePatterns, int scope, IWorkingSet[] workingSets) {
- this.ignoreCase= ignoreCase;
- this.textPattern= textPattern;
- this.fileNamePatterns= fileNamePatterns;
- this.scope= scope;
- this.workingSets= workingSets;
- }
- }
- //---- Action Handling ------------------------------------------------
-
- public boolean performAction() {
-
- SearchUI.activateSearchResultView();
-
- SearchPatternData patternData= getPatternData();
- if (patternData.fileNamePatterns == null || fExtensions.getText().length() <= 0) {
- patternData.fileNamePatterns= new HashSet(1);
- patternData.fileNamePatterns.add("*"); //$NON-NLS-1$
- }
-
- // 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[] workingSets= getContainer().getSelectedWorkingSets();
- String desc= SearchMessages.getFormattedString("WorkingSetScope", ScopePart.toString(workingSets)); //$NON-NLS-1$
- scope= new TextSearchScope(desc, workingSets);
- }
- scope.addExtensions(patternData.fileNamePatterns);
-
- TextSearchResultCollector collector= new TextSearchResultCollector();
-
- TextSearchOperation op= new TextSearchOperation(
- SearchPlugin.getWorkspace(),
- patternData.textPattern,
- 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;
- }
- IStatus status= op.getStatus();
- if (status != null && !status.isOK()) {
- String title= SearchMessages.getString("Search.Problems.title"); //$NON-NLS-1$
- ErrorDialog.openError(getShell(), title, null, status); //$NON-NLS-1$
- }
- 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() {
- SearchPatternData match= null;
- String textPattern= fPattern.getText();
- int i= fgPreviousSearchPatterns.size() - 1;
- while (i >= 0) {
- match= (SearchPatternData)fgPreviousSearchPatterns.get(i);
- if (textPattern.equals(match.textPattern))
- break;
- i--;
- };
- if (i >= 0) {
- match.ignoreCase= ignoreCase();
- match.textPattern= getPattern();
- match.fileNamePatterns= getExtensions();
- match.scope= getContainer().getSelectedScope();
- match.workingSets= getContainer().getSelectedWorkingSets();
- // remove - will be added last (see below)
- fgPreviousSearchPatterns.remove(match);
- } else {
- match= new SearchPatternData(
- getPattern(),
- ignoreCase(),
- getExtensions(),
- getContainer().getSelectedScope(),
- getContainer().getSelectedWorkingSets());
- }
- fgPreviousSearchPatterns.add(match);
- 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.fileNamePatterns);
- 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)).textPattern;
- return patterns;
- }
-
- private String getSearchOptions() {
- StringBuffer result= new StringBuffer();
- if (!ignoreCase())
- result.append("i"); //$NON-NLS-1$
- return result.toString();
- }
-
- 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(getContainer().hasValidScope());
- }
- super.setVisible(visible);
- }
-
- //---- Widget creation ------------------------------------------------
-
- /**
- * Creates the page's content.
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- readConfiguration();
-
- GridData gd;
- Composite result= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout(3, false);
- layout.horizontalSpacing= 10;
- result.setLayout(layout);
- result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- RowLayouter layouter= new RowLayouter(layout.numColumns);
- gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.verticalAlignment= GridData.VERTICAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_FILL;
-
- layouter.setDefaultGridData(gd, 0);
- layouter.setDefaultGridData(gd, 1);
- layouter.setDefaultGridData(gd, 2);
- layouter.setDefaultSpan();
-
- layouter.perform(createTextSearchComposite(result));
-
- // Vertical filler
- Label filler= new Label(result, SWT.LEFT);
- gd= new GridData(GridData.BEGINNING | GridData.VERTICAL_ALIGN_FILL);
- gd.heightHint= convertHeightInCharsToPixels(1) / 3;
- filler.setLayoutData(gd);
- layouter.perform(new Control[] {filler}, 3);
-
- layouter.perform(createFileNamePatternComposite(result));
-
- setControl(result);
- Dialog.applyDialogFont(result);
- WorkbenchHelp.setHelp(result, ISearchHelpContextIds.TEXT_SEARCH_PAGE);
- }
-
- private Control createTextSearchComposite(Composite group) {
- GridData gd;
- Label label;
-
- // Info text
- label= new Label(group, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.containingText.text")); //$NON-NLS-1$
- gd= new GridData(GridData.BEGINNING);
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
-
- // Pattern combo
- fPattern= new Combo(group, SWT.SINGLE | SWT.BORDER);
- // Not done here to prevent page from resizing
- // fPattern.setItems(getPreviousSearchPatterns());
- fPattern.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- getContainer().setPerformActionEnabled(true);
- }
- });
- fPattern.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleWidgetSelected();
- }
- });
- gd= new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- gd.horizontalSpan= 2;
- fPattern.setLayoutData(gd);
-
- fIgnoreCase= new Button(group, SWT.CHECK);
- fIgnoreCase.setText(SearchMessages.getString("SearchPage.caseSensitive")); //$NON-NLS-1$
- gd= new GridData(GridData.HORIZONTAL_ALIGN_END);
- fIgnoreCase.setLayoutData(gd);
- fIgnoreCase.setSelection(!fIsCaseSensitive);
- fIgnoreCase.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fIsCaseSensitive= !fIgnoreCase.getSelection();
- writeConfiguration();
- }
- });
-
- // Text line which explains the special characters
- label= new Label(group, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.containingText.hint")); //$NON-NLS-1$
- gd= new GridData(GridData.BEGINNING);
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
-
- return group;
- }
-
- private void handleWidgetSelected() {
- if (fPattern.getSelectionIndex() < 0)
- return;
- int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex();
- SearchPatternData patternData= (SearchPatternData) fgPreviousSearchPatterns.get(index);
- if (patternData == null || !fPattern.getText().equals(patternData.textPattern))
- return;
- fIgnoreCase.setSelection(patternData.ignoreCase);
- fPattern.setText(patternData.textPattern);
- fFileTypeEditor.setFileTypes(patternData.fileNamePatterns);
- if (patternData.workingSets != null)
- getContainer().setSelectedWorkingSets(patternData.workingSets);
- else
- getContainer().setSelectedScope(patternData.scope);
- }
-
- private void initializePatternControl() {
- ISelection selection= getSelection();
- String text= ""; //$NON-NLS-1$
- String extension= null;
- 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 Control createFileNamePatternComposite(Composite group) {
- GridData gd;
-
- // Line with label, combo and button
- Label label= new Label(group, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.fileNamePatterns.text")); //$NON-NLS-1$
- gd= new GridData(GridData.BEGINNING);
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
-
- fExtensions= new Combo(group, SWT.SINGLE | SWT.BORDER);
- fExtensions.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- getContainer().setPerformActionEnabled(getContainer().hasValidScope());
- }
- });
- gd= new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- gd.horizontalSpan= 2;
- fExtensions.setLayoutData(gd);
-
- Button button= new Button(group, SWT.PUSH);
- button.setText(SearchMessages.getString("SearchPage.browse")); //$NON-NLS-1$
- gd= new GridData(GridData.HORIZONTAL_ALIGN_END);
- button.setLayoutData(gd);
- SWTUtil.setButtonDimensionHint(button);
- fFileTypeEditor= new FileTypeEditor(
- SearchPlugin.getDefault().getWorkbench().getEditorRegistry(),
- fExtensions, button);
-
- // Text line which explains the special characters
- label= new Label(group, SWT.LEFT);
- label.setText(SearchMessages.getString("SearchPage.fileNamePatterns.hint")); //$NON-NLS-1$
- gd= new GridData(GridData.BEGINNING);
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
-
- return group;
- }
-
- 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 cbb14eb34..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.resources.IResourceProxy;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.ui.actions.ActionGroup;
-
-import org.eclipse.search.ui.IActionGroupFactory;
-import org.eclipse.search.ui.ISearchResultView;
-import org.eclipse.search.ui.SearchUI;
-
-import org.eclipse.search.internal.core.text.ITextSearchResultCollector;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.util.FileLabelProvider;
-
-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];
- private long fLastUpdateTime;
-
-
- private static class TextSearchActionGroupFactory implements IActionGroupFactory {
- public ActionGroup createActionGroup(ISearchResultView part) {
- return new TextSearchActionGroup(part);
- }
- }
-
- /**
- * 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;
- fLastUpdateTime= 0;
- if (fView != null) {
- fView.searchStarted(
- new TextSearchActionGroupFactory(),
- fOperation.getSingularLabel(),
- fOperation.getPluralLabelPattern(),
- fOperation.getImageDescriptor(),
- TextSearchPage.EXTENSION_POINT_ID,
- new FileLabelProvider(FileLabelProvider.SHOW_LABEL_PATH),
- new GotoMarkerAction(),
- new GroupByKeyComputer(),
- fOperation);
- }
- }
-
- /**
- * Accepts the given search result.
- */
- public void accept(final IResourceProxy proxy, String line, int start, int length, final int lineNumber) throws CoreException {
- IResource resource= proxy.requestResource();
- 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() && System.currentTimeMillis() - fLastUpdateTime > 1000) {
- getProgressMonitor().subTask(getFormattedMatchesString(fMatchCount));
- fLastUpdateTime= System.currentTimeMillis();
- }
- }
-
- /**
- * 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);
-
- }
-}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ComboFieldEditor.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ComboFieldEditor.java
deleted file mode 100644
index 877d9a3fc..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ComboFieldEditor.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.util;
-
-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.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.util.Assert;
-
-/**
- * A field editor for a combo box that allows the drop-down selection of one of a list of items.
- *
- * XXX: Note this is a copy from org.eclipse.debug.internal.ui.preferences
- * This class can be removed once bug 24928 is fixed.
- *
- * @since 2.1
- */
-public class ComboFieldEditor extends FieldEditor {
-
- /**
- * The <code>Combo</code> widget.
- */
- private Combo fCombo;
-
- /**
- * The value (not the name) of the currently selected item in the Combo widget.
- */
- private String fValue;
-
- /**
- * The names (labels) and underlying values to populate the combo widget. These should be
- * arranged as: { {name1, value1}, {name2, value2}, ...}
- */
- private String[][] fEntryNamesAndValues;
-
- public ComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) {
- init(name, labelText);
- Assert.isTrue(checkArray(entryNamesAndValues));
- fEntryNamesAndValues= entryNamesAndValues;
- createControl(parent);
- }
-
- /**
- * Checks whether given <code>String[][]</code> is of "type"
- * <code>String[][2]</code>.
- *
- * @return <code>true</code> if it is ok, and <code>false</code> otherwise
- */
- private boolean checkArray(String[][] table) {
- if (table == null) {
- return false;
- }
- for (int i= 0; i < table.length; i++) {
- String[] array= table[i];
- if (array == null || array.length != 2) {
- return false;
- }
- }
- return true;
- }
-
- /*
- * @see FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns) {
- Control control= getLabelControl();
- if (control != null) {
- ((GridData)control.getLayoutData()).horizontalSpan= numColumns;
- }
- ((GridData)fCombo.getLayoutData()).horizontalSpan= numColumns;
- }
-
- /*
- * @see FieldEditor#doFillIntoGrid(Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns) {
- Control control= getLabelControl(parent);
- GridData gd= new GridData();
- gd.horizontalSpan= numColumns;
- control.setLayoutData(gd);
- control= getComboBoxControl(parent);
- gd= new GridData();
- gd.horizontalSpan= numColumns;
- control.setLayoutData(gd);
- }
-
- /*
- * @see FieldEditor#doLoad()
- */
- protected void doLoad() {
- updateComboForValue(getPreferenceStore().getString(getPreferenceName()));
- }
-
- /*
- * @see FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault() {
- updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName()));
- }
-
- /*
- * @see FieldEditor#doStore()
- */
- protected void doStore() {
- if (fValue == null) {
- getPreferenceStore().setToDefault(getPreferenceName());
- return;
- }
-
- getPreferenceStore().setValue(getPreferenceName(), fValue);
- }
-
- /*
- * @see FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls() {
- return 2;
- }
-
- /**
- * Lazily create and return the Combo control.
- */
- public Combo getComboBoxControl(Composite parent) {
- if (fCombo == null) {
- fCombo= new Combo(parent, SWT.READ_ONLY);
- for (int i= 0; i < fEntryNamesAndValues.length; i++) {
- fCombo.add(fEntryNamesAndValues[i][0], i);
- }
- fCombo.setFont(parent.getFont());
- fCombo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- String oldValue= fValue;
- String name= fCombo.getText();
- fValue= getValueForName(name);
- setPresentsDefaultValue(false);
- fireValueChanged(VALUE, oldValue, fValue);
- }
- });
- }
- return fCombo;
- }
-
- /**
- * Given the name (label) of an entry, return the corresponding value.
- */
- protected String getValueForName(String name) {
- for (int i= 0; i < fEntryNamesAndValues.length; i++) {
- String[] entry= fEntryNamesAndValues[i];
- if (name.equals(entry[0])) {
- return entry[1];
- }
- }
- return fEntryNamesAndValues[0][0];
- }
-
- /**
- * Set the name in the combo widget to match the specified value.
- */
- protected void updateComboForValue(String value) {
- fValue= value;
- for (int i= 0; i < fEntryNamesAndValues.length; i++) {
- if (value.equals(fEntryNamesAndValues[i][1])) {
- fCombo.setText(fEntryNamesAndValues[i][0]);
- return;
- }
- }
- if (fEntryNamesAndValues.length > 0) {
- fValue= fEntryNamesAndValues[0][1];
- fCombo.setText(fEntryNamesAndValues[0][0]);
- }
- }
-}
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 1cf4a3240..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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) {
- SearchPlugin.log(e);
- 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 {
- SearchPlugin.log(e);
- 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());
- }
-}
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 98f20d400..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.SearchMessages;
-
-
-public abstract class ExtendedDialogWindow extends Dialog implements IRunnableContext {
-
- private Control fContents;
- private Button fCancelButton;
- private Button fSearchButton;
-
- 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 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);
-
- /**
- * 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));
-
- applyDialogFont(result);
- 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 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;
- }
-}
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 771da1589..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-
-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 LabelProvider {
-
- 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 WorkbenchLabelProvider fLabelProvider;
- private ILabelDecorator fDecorator;
-
- private int fOrder;
- private String[] fArgs= new String[2];
-
- public FileLabelProvider(int orderFlag) {
- fDecorator= PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
- fLabelProvider= new WorkbenchLabelProvider();
- 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= fLabelProvider.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]= fLabelProvider.getText(resource);
- text= MessageFormat.format(fgSeparatorFormat, fArgs);
- }
- }
- }
-
- // Do the decoration
- if (fDecorator != null) {
- String decoratedText= fDecorator.decorateText(text, resource);
- if (decoratedText != null)
- return decoratedText;
- }
- return text;
- }
-
- public Image getImage(Object element) {
- if (!(element instanceof ISearchResultViewEntry))
- return null; //$NON-NLS-1$
-
- IResource resource= ((ISearchResultViewEntry) element).getResource();
- Image image= fLabelProvider.getImage(resource);
- if (fDecorator != null) {
- Image decoratedImage= fDecorator.decorateImage(image, resource);
- if (decoratedImage != null)
- return decoratedImage;
- }
- return image;
- }
-
- public void dispose() {
- super.dispose();
- fLabelProvider.dispose();
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return fLabelProvider.isLabelProperty(element, property);
- }
-
- public void removeListener(ILabelProviderListener listener) {
- super.removeListener(listener);
- fLabelProvider.removeListener(listener);
- }
-
- public void addListener(ILabelProviderListener listener) {
- super.addListener(listener);
- fLabelProvider.addListener(listener);
- }
-}
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 34094200a..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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() == TypeFilteringDialog.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();
- }
-}
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 715c28cd9..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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);
- }
-}
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 bbe8b4e6e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.internal.ui.util;
-
-import java.util.List;
-
-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.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-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 static final int WIDTH_IN_CHARACTERS= 55;
-
- private IStructuredContentProvider fContentProvider;
- private ILabelProvider fLabelProvider;
- private Object fInput;
- private TableViewer fViewer;
- private boolean fCreateCancelButton= true;
-
- 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;
- }
-
- public void setCreateCancelButton(boolean value) {
- fCreateCancelButton= value;
- }
-
- /*
- * Overrides method from Dialog
- */
- protected Label createMessageArea(Composite composite) {
- Label label = new Label(composite,SWT.WRAP);
- label.setText(getMessage());
- GridData gd= new GridData(GridData.FILL_BOTH);
- gd.widthHint= convertWidthInCharsToPixels(WIDTH_IN_CHARACTERS);
- label.setLayoutData(gd);
- applyDialogFont(label);
- return label;
- }
-
- /*
- * 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) {
- if (fCreateCancelButton)
- okPressed();
- }
- });
- fViewer.setLabelProvider(fLabelProvider);
- fViewer.setInput(fInput);
- List initialSelection= getInitialElementSelections();
- if (initialSelection != null)
- fViewer.setSelection(new StructuredSelection(initialSelection));
- GridData gd= new GridData(GridData.FILL_BOTH);
- gd.heightHint= convertHeightInCharsToPixels(15);
- gd.widthHint= convertWidthInCharsToPixels(WIDTH_IN_CHARACTERS);
- table.setLayoutData(gd);
- applyDialogFont(table);
- return table;
- }
-
- /*
- * Overrides method from Dialog
- */
- protected void createButtonsForButtonBar(Composite parent) {
- if (! fCreateCancelButton)
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- else
- super.createButtonsForButtonBar(parent);
- }
-
- /*
- * 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 8678516e2..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- }
-}
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 a8540b94b..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- }
-}
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 728292c04..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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.resource.JFaceResources;
-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#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
- */
- 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 (button.getFont().equals(JFaceResources.getDefaultFont()))
- button.setFont(JFaceResources.getDialogFont());
- 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 (button.getFont().equals(JFaceResources.getDefaultFont()))
- button.setFont(JFaceResources.getDialogFont());
- 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);
- }
- }
-}
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 ff6a56de4..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/StringMatcher.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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;
- }
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* 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 485d59572..000000000
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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: bug 2763: TypeFilteringDialog should be public API
- */
-public class TypeFilteringDialog extends SelectionDialog {
-
- 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();
-
- applyDialogFont(composite);
- 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/ui/IActionGroupFactory.java b/org.eclipse.search/search/org/eclipse/search/ui/IActionGroupFactory.java
deleted file mode 100644
index f22876e54..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IActionGroupFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.ui;
-
-import org.eclipse.ui.actions.ActionGroup;
-
-/**
- * Allows to specify an <code>ActionGroup</code> factory
- * which will be used by the Search view to create an
- * <code>ActionGroup</code> which is used to build the
- * actions bars and the context menu.
- * <p>
- * Note: Local tool bar contributions are not supported in 2.0.
- * </p>
- *
- * Clients can implement this interface and pass an
- * instance to the search result view.
- *
- * @see org.eclipse.ui.actions.ActionGroup
- * @see ISearchResultView#searchStarted
- * @since 2.0
- */
-public interface IActionGroupFactory {
-
- /**
- * Creates an <code>ActionGroup</code> for a Search view.
- *
- * @param searchView the search result view for which the group is made
- * @see org.eclipse.ui.actions.ActionGroup
- */
- ActionGroup createActionGroup(ISearchResultView searchView);
-}
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 ca20099c6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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$
-
- /**
- * Pop-up menu: name of group for remove match actions (value <code>"group.removeMatches"</code>).
- * @since 2.1
- */
- public static final String GROUP_REMOVE_MATCHES= "group.removeMatches"; //$NON-NLS-1$
-}
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 96741e195..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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);
-}
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 776ff3563..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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 76fea75eb..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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);
-}
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 fdfa200b6..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.ui;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * 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 sets of this container.
- *
- * @return an array with the selected working sets or <code>null</code> if the scope is not WORKING_SET_SCOPE
- * @since 2.0
- */
- public IWorkingSet[] getSelectedWorkingSets();
-
- /**
- * Sets the selected working sets of this container.
- *
- * @param workingSets an array of IWorkingSet
- * @since 2.0
- */
- public void setSelectedWorkingSets(IWorkingSet[] workingSets);
-}
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 e0caced87..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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 b8ae3133e..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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 {
-
- /**
- * 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 groupFactory the action group factory
- * or <code>null</code> if no factory is provided.
- * @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 pageId the id of the search page which started the search
- * @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
- *
- * @see IActionGroupFactory
- * @since 2.0
- */
- public void searchStarted(
- IActionGroupFactory groupFactory,
- String singularLabel,
- String pluralLabelPattern,
- ImageDescriptor imageDescriptor,
- String pageId,
- ILabelProvider labelProvider,
- IAction gotoAction,
- IGroupByKeyComputer groupByKeyComputer,
- IRunnableWithProgress operation);
-
- /**
- * 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
- * @deprecated As of build > 20020514, replaced by the new version which provides an action group factory
- */
- 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();
-}
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 08a4c408f..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-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/SearchUI.java b/org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java
deleted file mode 100644
index f89aaa537..000000000
--- a/org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.search.ui;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.ui.IWorkbenchWindow;
-
-import org.eclipse.search.internal.ui.OpenSearchDialogAction;
-import org.eclipse.search.internal.ui.SearchPlugin;
-import org.eclipse.search.internal.ui.SearchPluginImages;
-import org.eclipse.search.internal.ui.SearchPreferencePage;
-
-/**
- * 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$
-
- /**
- * Potential match marker attribute
- * (value <code>"potentialMatch"</code>).
- * <p>
- * This optional marker attribute tells whether a marker is
- * a potential or an exact match.
- * The marker is considered an exact match if the attribute is missing.
- * </p>
- * <p>
- * Potential matches are shown with a different background color in
- * the Search view. The color can be changed in the Search preferences.
- * </p>
- *
- * @see org.eclipse.core.resources.IMarker#getAttribute
- * @since 2.0
- */
- public static final String POTENTIAL_MATCH= "potentialMatch"; //$NON-NLS-1$
-
- /**
- * Id of the Search result view
- * (value <code>"org.eclipse.search.SearchResultView"</code>).
- */
- public static final String SEARCH_RESULT_VIEW_ID= "org.eclipse.search.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();
- }
-
- /**
- * Opens the search dialog.
- * If <code>pageId</code> is specified and a corresponding page
- * is found then it is brought to top.
- *
- * @param pageId the page to select or <code>null</code>
- * if the best fitting page should be selected
- * @since 2.0
- */
- public static void openSearchDialog(IWorkbenchWindow window, String pageId) {
- new OpenSearchDialogAction(window, pageId).run();
- }
-
- /**
- * 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);
- }
-
- /**
- * Returns the preference whether editors should be reused
- * when showing search results.
- *
- * The goto action can decide to use or ignore this preference.
- *
- * @return <code>true</code> if editors should be reused for showing search results
- * @since 2.0
- */
- public static boolean reuseEditor() {
- return SearchPreferencePage.isEditorReused();
- }
-
- /**
- * Returns the preference whether a search engine is
- * allowed to report potential matches or not.
- * <p>
- * Search engines which can report inexact matches must
- * respect this preference i.e. they should not report
- * inexact matches if this method returns <code>true</code>
- * </p>
- * @return <code>true</code> if search engine must not report inexact matches
- * @since 2.1
- */
- public static boolean arePotentialMatchesIgnored() {
- return SearchPreferencePage.arePotentialMatchesIgnored();
- }
-
- /**
- * Returns the ID of the default perspective.
- * <p>
- * The perspective with this ID will be used to show the Search view.
- * If no default perspective is set then the Search view will
- * appear in the current perspective.
- * </p>
- * @return the ID of the default perspective <code>null</code> if no default perspective is set
- * @since 2.1
- */
- public static String getDefaultPerspectiveId() {
- return SearchPreferencePage.getDefaultPerspectiveId();
- }
-
- /**
- * 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 f92908814..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>
diff --git a/org.eclipse.ui.examples.javaeditor/.classpath b/org.eclipse.ui.examples.javaeditor/.classpath
deleted file mode 100644
index 958effbec..000000000
--- a/org.eclipse.ui.examples.javaeditor/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="Eclipse Java Editor Example/"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.ui.examples.javaeditor/.cvsignore b/org.eclipse.ui.examples.javaeditor/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/org.eclipse.ui.examples.javaeditor/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/.project b/org.eclipse.ui.examples.javaeditor/.project
deleted file mode 100644
index 4f621263a..000000000
--- a/org.eclipse.ui.examples.javaeditor/.project
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.javaeditor</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
deleted file mode 100644
index 6c9f57781..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.editors.text.TextEditorActionContributor;
-import org.eclipse.ui.texteditor.*;
-
-/**
- * Contributes interesting Java actions to the desktop's Edit menu and the toolbar.
- */
-public class JavaActionContributor extends TextEditorActionContributor {
-
- protected RetargetTextEditorAction fContentAssistProposal;
- protected RetargetTextEditorAction fContentAssistTip;
- protected TextEditorAction fTogglePresentation;
-
- /**
- * Default constructor.
- */
- public JavaActionContributor() {
- super();
- fContentAssistProposal= new RetargetTextEditorAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$
- fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- fContentAssistTip= new RetargetTextEditorAction(JavaEditorMessages.getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$
- fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
- fTogglePresentation= new PresentationAction();
- }
-
- /*
- * @see IEditorActionBarContributor#init(IActionBars)
- */
- public void init(IActionBars bars) {
- super.init(bars);
-
- IMenuManager menuManager= bars.getMenuManager();
- IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(new Separator());
- editMenu.add(fContentAssistProposal);
- editMenu.add(fContentAssistTip);
- }
-
- IToolBarManager toolBarManager= bars.getToolBarManager();
- if (toolBarManager != null) {
- toolBarManager.add(new Separator());
- toolBarManager.add(fTogglePresentation);
- }
- }
-
- private void doSetActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
-
- ITextEditor editor= null;
- if (part instanceof ITextEditor)
- editor= (ITextEditor) part;
-
- fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$
- fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$
-
- fTogglePresentation.setEditor(editor);
- fTogglePresentation.update();
- }
-
- /*
- * @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- doSetActiveEditor(part);
- }
-
- /*
- * @see IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- doSetActiveEditor(null);
- super.dispose();
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
deleted file mode 100644
index 3ef3d177b..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-/**
- * The JavaAnnotationHover provides the hover support for java editors.
- */
-
-public class JavaAnnotationHover implements IAnnotationHover {
-
- /* (non-Javadoc)
- * Method declared on IAnnotationHover
- */
- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
- IDocument document= sourceViewer.getDocument();
-
- try {
- IRegion info= document.getLineInformation(lineNumber);
- return document.get(info.getOffset(), info.getLength());
- } catch (BadLocationException x) {
- }
-
- return null;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
deleted file mode 100644
index 366ed82ef..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.javaeditor;
-
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-
-/**
- * A content outline page which always represents the content of the
- * connected editor in 10 segments.
- */
-public class JavaContentOutlinePage extends ContentOutlinePage {
-
- /**
- * A segment element.
- */
- protected static class Segment {
- public String name;
- public Position position;
-
- public Segment(String name, Position position) {
- this.name= name;
- this.position= position;
- }
-
- public String toString() {
- return name;
- }
- };
-
- /**
- * Divides the editor's document into ten segments and provides elements for them.
- */
- protected class ContentProvider implements ITreeContentProvider {
-
- protected final static String SEGMENTS= "__java_segments"; //$NON-NLS-1$
- protected IPositionUpdater fPositionUpdater= new DefaultPositionUpdater(SEGMENTS);
- protected List fContent= new ArrayList(10);
-
- protected void parse(IDocument document) {
-
- int lines= document.getNumberOfLines();
- int increment= Math.max(Math.round((float) (lines / 10)), 10);
-
- for (int line= 0; line < lines; line += increment) {
-
- int length= increment;
- if (line + increment > lines)
- length= lines - line;
-
- try {
-
- int offset= document.getLineOffset(line);
- int end= document.getLineOffset(line + length);
- length= end - offset;
- Position p= new Position(offset, length);
- document.addPosition(SEGMENTS, p);
- fContent.add(new Segment(MessageFormat.format(JavaEditorMessages.getString("OutlinePage.segment.title_pattern"), new Object[] { new Integer(offset) }), p)); //$NON-NLS-1$
-
- } catch (BadPositionCategoryException x) {
- } catch (BadLocationException x) {
- }
- }
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (oldInput != null) {
- IDocument document= fDocumentProvider.getDocument(oldInput);
- if (document != null) {
- try {
- document.removePositionCategory(SEGMENTS);
- } catch (BadPositionCategoryException x) {
- }
- document.removePositionUpdater(fPositionUpdater);
- }
- }
-
- fContent.clear();
-
- if (newInput != null) {
- IDocument document= fDocumentProvider.getDocument(newInput);
- if (document != null) {
- document.addPositionCategory(SEGMENTS);
- document.addPositionUpdater(fPositionUpdater);
-
- parse(document);
- }
- }
- }
-
- /*
- * @see IContentProvider#dispose
- */
- public void dispose() {
- if (fContent != n