diff options
author | cvs2svn | 2004-01-05 14:29:22 +0000 |
---|---|---|
committer | cvs2svn | 2004-01-05 14:29:22 +0000 |
commit | 31346304d2556e3b461b5740383dc77893d333ef (patch) | |
tree | c7c444bf52d9ecf5dface9186b6e91d89f625cfa /org.eclipse.search | |
parent | 2cbf8b64bb820cdaa3f4324993104cad0240a3f3 (diff) | |
download | eclipse.platform.text-typingTarget.tar.gz eclipse.platform.text-typingTarget.tar.xz eclipse.platform.text-typingTarget.zip |
This commit was manufactured by cvs2svn to create branch 'typingTarget'.typingTarget
Sprout from master 2004-01-05 14:29:18 UTC Dani Megert <dmegert> 'Fixed bug 47877: [misc] NPE in TextViewer.addPresentation'
Delete:
org.eclipse.core.filebuffers/.classpath
org.eclipse.core.filebuffers/.cvsignore
org.eclipse.core.filebuffers/.project
org.eclipse.core.filebuffers/about.html
org.eclipse.core.filebuffers/build.properties
org.eclipse.core.filebuffers/hglegal2003.htm
org.eclipse.core.filebuffers/ngibmcpy2003.gif
org.eclipse.core.filebuffers/plugin.properties
org.eclipse.core.filebuffers/plugin.xml
org.eclipse.core.filebuffers/schema/documentCreation.exsd
org.eclipse.core.filebuffers/schema/documentSetup.exsd
org.eclipse.core.filebuffers/scripts/exportplugin.xml
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentFactory.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentSetupParticipant.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferListener.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferManager.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ISynchronizationContext.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/AbstractFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ContainerGenerator.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/DefaultDocumentFactory.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
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.1.html
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/MatchLocator.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/SearchAgainConfirmationDialog.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/PixelConverter.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/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/IReplacePage.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.text/.classpath
org.eclipse.text/.cvsignore
org.eclipse.text/.project
org.eclipse.text/about.html
org.eclipse.text/build.properties
org.eclipse.text/plugin.properties
org.eclipse.text/plugin.xml
org.eclipse.text/projection/org/eclipse/jface/text/CoordinatesTranslator.java
org.eclipse.text/projection/org/eclipse/jface/text/Fragment.java
org.eclipse.text/projection/org/eclipse/jface/text/FragmentUpdater.java
org.eclipse.text/projection/org/eclipse/jface/text/ProjectionDocument.java
org.eclipse.text/projection/org/eclipse/jface/text/ProjectionDocumentManager.java
org.eclipse.text/projection/org/eclipse/jface/text/ProjectionPosition.java
org.eclipse.text/projection/org/eclipse/jface/text/ProjectionPositionUpdater.java
org.eclipse.text/projection/org/eclipse/jface/text/ProjectionTextStore.java
org.eclipse.text/scripts/exportplugin.xml
org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java
org.eclipse.text/src/org/eclipse/jface/text/Assert.java
org.eclipse.text/src/org/eclipse/jface/text/BadLocationException.java
org.eclipse.text/src/org/eclipse/jface/text/BadPartitioningException.java
org.eclipse.text/src/org/eclipse/jface/text/BadPositionCategoryException.java
org.eclipse.text/src/org/eclipse/jface/text/ChildDocument.java
org.eclipse.text/src/org/eclipse/jface/text/ChildDocumentManager.java
org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java
org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java
org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java
org.eclipse.text/src/org/eclipse/jface/text/Document.java
org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java
org.eclipse.text/src/org/eclipse/jface/text/DocumentPartitioningChangedEvent.java
org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java
org.eclipse.text/src/org/eclipse/jface/text/FindReplaceOperationCode.java
org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java
org.eclipse.text/src/org/eclipse/jface/text/IDocument.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension2.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension3.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentInformationMapping.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentListener.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioner.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitionerExtension.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitionerExtension2.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListener.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListenerExtension.java
org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListenerExtension2.java
org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
org.eclipse.text/src/org/eclipse/jface/text/IPositionUpdater.java
org.eclipse.text/src/org/eclipse/jface/text/IRegion.java
org.eclipse.text/src/org/eclipse/jface/text/IRepairableDocument.java
org.eclipse.text/src/org/eclipse/jface/text/ISlaveDocumentManager.java
org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java
org.eclipse.text/src/org/eclipse/jface/text/ITypedRegion.java
org.eclipse.text/src/org/eclipse/jface/text/Line.java
org.eclipse.text/src/org/eclipse/jface/text/ParentChildMapping.java
org.eclipse.text/src/org/eclipse/jface/text/Position.java
org.eclipse.text/src/org/eclipse/jface/text/Region.java
org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
org.eclipse.text/src/org/eclipse/jface/text/SlaveDocumentEvent.java
org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java
org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java
org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java
org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java
org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java
org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java
org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java
org.eclipse.text/src/org/eclipse/text/edits/ISourceModifier.java
org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java
org.eclipse.text/src/org/eclipse/text/edits/MalformedTreeException.java
org.eclipse.text/src/org/eclipse/text/edits/Messages.properties
org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java
org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java
org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java
org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java
org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java
org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java
org.eclipse.text/src/org/eclipse/text/edits/TextEditCopier.java
org.eclipse.text/src/org/eclipse/text/edits/TextEditMessages.java
org.eclipse.text/src/org/eclipse/text/edits/TextEditProcessor.java
org.eclipse.text/src/org/eclipse/text/edits/TextEditVisitor.java
org.eclipse.text/src/org/eclipse/text/edits/TreeIterationInfo.java
org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java
org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java
org.eclipse.ui.editors/.classpath
org.eclipse.ui.editors/.cvsignore
org.eclipse.ui.editors/.project
org.eclipse.ui.editors/_buildnotes_text_2_0.html
org.eclipse.ui.editors/_buildnotes_text_2_1.html
org.eclipse.ui.editors/about.html
org.eclipse.ui.editors/build.properties
org.eclipse.ui.editors/buildnotes_text.html
org.eclipse.ui.editors/icons/full/ctool16/next_nav.gif
org.eclipse.ui.editors/icons/full/ctool16/prev_nav.gif
org.eclipse.ui.editors/icons/full/dtool16/next_nav.gif
org.eclipse.ui.editors/icons/full/dtool16/prev_nav.gif
org.eclipse.ui.editors/icons/full/etool16/next_nav.gif
org.eclipse.ui.editors/icons/full/etool16/prev_nav.gif
org.eclipse.ui.editors/icons/full/obj16/file_obj.gif
org.eclipse.ui.editors/migration_guidelines.html
org.eclipse.ui.editors/plugin.properties
org.eclipse.ui.editors/plugin.xml
org.eclipse.ui.editors/schema/annotationTypes.exsd
org.eclipse.ui.editors/schema/documentProviders.exsd
org.eclipse.ui.editors/schema/markerAnnotationSpecification.exsd
org.eclipse.ui.editors/schema/markerUpdaters.exsd
org.eclipse.ui.editors/scripts/exportplugin.xml
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsConstants.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsDefinitionIds.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsHelpContextIds.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingSupport.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ILocationProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ISchedulingRuleProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IStorageDocumentProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferenceConstants.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/UISynchronizationContext.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/WorkspaceOperationRunner.java
org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/package.html
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ColorEditor.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IEditorsStatusConstants.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/JavaFileEditorInput.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPulldownActionDelegate.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OpenExternalFileAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TabFolderLayout.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddTaskAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationType.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeHierarchy.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BookmarkRulerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultAnnotation.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DelegatingAnnotationPreference.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditorPreferenceConstants.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ImageUtilities.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUpdater.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerInfoAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectRulerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.properties
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/JavaDocumentSetupParticipant.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/JavaEditorExamplePlugin.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/JavaPartitionScanner.java
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/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/hglegal2003.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/ngibmcpy2003.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
org.eclipse.ui.workbench.texteditor/.classpath
org.eclipse.ui.workbench.texteditor/.cvsignore
org.eclipse.ui.workbench.texteditor/.project
org.eclipse.ui.workbench.texteditor/about.html
org.eclipse.ui.workbench.texteditor/build.properties
org.eclipse.ui.workbench.texteditor/icons/full/ctool16/last_edit_pos.gif
org.eclipse.ui.workbench.texteditor/icons/full/ctool16/segment_edit.gif
org.eclipse.ui.workbench.texteditor/icons/full/dtool16/last_edit_pos.gif
org.eclipse.ui.workbench.texteditor/icons/full/dtool16/segment_edit.gif
org.eclipse.ui.workbench.texteditor/icons/full/etool16/last_edit_pos.gif
org.eclipse.ui.workbench.texteditor/icons/full/etool16/segment_edit.gif
org.eclipse.ui.workbench.texteditor/plugin.properties
org.eclipse.ui.workbench.texteditor/plugin.xml
org.eclipse.ui.workbench.texteditor/schema/quickDiffReferenceProvider.exsd
org.eclipse.ui.workbench.texteditor/scripts/exportplugin.xml
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditPosition.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditorMessages.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditorMessages.properties
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/GotoLastEditPositionAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffMessages.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffMessages.properties
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffRestoreAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/ReferenceSelectionAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RestoreAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertBlockAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertLineAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertSelectionAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/DifferencesIterator.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/DocLineComparator.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/IRangeComparator.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/ITokenComparator.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/LinkedRangeDifference.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/RangeDifference.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/RangeDifferencer.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/package.html
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/package.html
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/BasicTextEditorActionContributor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ComboContentAssistSubjectAdapter.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ContentAssistAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineTarget.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorMessages.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorMessages.properties
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorStatusLine.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceTarget.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAnnotationImageProvider.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension2.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension3.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IEditorStatusLine.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListenerExtension.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IFindReplaceTargetExtension2.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IReadOnlyDependent.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusFieldExtension.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension2.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IUpdate.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IWorkbenchActionDefinitionIds.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkRegionTarget.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MoveLinesAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/PropagatingFontFieldEditor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RegExContentAssistProcessor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ResourceAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RevertToSavedAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SaveAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ShiftAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SmartEnterAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/StatusLineContributionItem.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/StatusTextEditor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextNavigationAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextOperationAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextSelectionNavigationLocation.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ValidateStateException.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/WorkbenchChainedTextFontFieldEditor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/package.html
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/IQuickDiffProviderImplementation.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/IQuickDiffReferenceProvider.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/QuickDiff.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/QuickDiffToggleAction.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/ReferenceProviderDescriptor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/package.html
Diffstat (limited to 'org.eclipse.search')
128 files changed, 0 insertions, 17511 deletions
diff --git a/org.eclipse.search/.classpath b/org.eclipse.search/.classpath deleted file mode 100644 index a9ba8cb51e5..00000000000 --- a/org.eclipse.search/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="search"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/org.eclipse.search/.cvsignore b/org.eclipse.search/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- 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 aa7e58b5ea3..00000000000 --- a/org.eclipse.search/.project +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.search</name> - <comment></comment> - <projects> - <project>org.eclipse.core.boot</project> - <project>org.eclipse.core.filebuffers</project> - <project>org.eclipse.core.resources</project> - <project>org.eclipse.core.runtime</project> - <project>org.eclipse.core.runtime.compatibility</project> - <project>org.eclipse.jface.text</project> - <project>org.eclipse.swt</project> - <project>org.eclipse.ui</project> - <project>org.eclipse.ui.editors</project> - <project>org.eclipse.ui.ide</project> - <project>org.eclipse.ui.workbench.texteditor</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 9db411aab99..00000000000 --- 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 ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). 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, "Program" 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 ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") 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 b4d9c8eedb8..00000000000 --- 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 82ce5bbb62c..00000000000 --- a/org.eclipse.search/buildnotes_search.html +++ /dev/null @@ -1,189 +0,0 @@ -<!-- - DO NOT EDIT THIS FILE WITH HTML EDITORS ---> - -<!DOCTYPE doctype 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.76 [en] (Windows NT 5.0; U) [Netscape]"> - <title>Eclipse Platform Build Notes - Search</title> -</head> - -<body> -<h1> -Eclipse Platform Build Notes<br> -Search</h1> -To see which bugs have been addressed in one of the builds simply open the <a href="http://bugs.eclipse.org/bugs/query.cgi?short_desc_type=allwordssubstr&product=Platform&component=Search&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&namedcmd=Assigned&newqueryname=&field0-0-0=noop&type0-0-0=noop&value0-0-0=">Search bugzilla query page</a>, select status, resolution and the time frame. -<br> -<br> -<br> -========== Eclipse Build Input December 16th 2003 ==========<br> - -<!-- Add what's new below and end each line with br tag --> -<pre> -- bug fixing -</pre> -<br> -<br> -========== Eclipse Build Input November 18th 2003 ==========<br> - -<!-- Add what's new below and end each line with br tag --> -<pre> -- Added a new interface IReplacePage. If an ISearchPage implements IReplacePage, - a "Replace" button will be shown in the search dialog (when the page is active). - The text search page implements that interface. -- Extended the text replace dialog to support "Replace in File" and "Replace All" actions. -</pre> -<br> -<br> -========== Eclipse Build Input November 11th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- Converted to RPC -</pre> -<br> -<br> - -========== Eclipse Build Input October 28th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- A new preference has been introduced which allows to prevent the - Search view from being activated. -- Search annotations can be configured to be highlighted using background painter -</pre> -<br> -<br> -========== Eclipse Build Input October 21th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- 1 bug fixed -</pre> -<br> -<br> -========== Eclipse Build Input October 7th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- Added F1 help for File search page's regular expression support -</pre> -<br> -<br> -========== Eclipse Build Input September 30th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input September 23th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input September 16th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- File Search page now supports regular expressions -- 1 bug fixed -</pre -<br> -========== Eclipse Build Input September 9th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input September 3th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input August 26th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input August 19th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<pre> -- Added a new attribute "canSearchEnclosingProjects" to the extension point - "org.eclipse.search.searchPages". If the attribute is set to true, the search - dialog scope area will have a new radio button labeled "Enclosing Projects". - Search page contributors whishing to support search in projects enclosing the - current selection have to set this attribute to true and handle the new search - scope constant org.eclipse.search.ui.ISearchPageContainer.SELECTED_PROJECTS_SCOPE. - The file search page supports search in enclosing projects. -- Improved project scope -</pre> -<br> -<br> -========== Eclipse Build Input August 12th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- Project scope has been added to the Search dialog (see feature 16287) -<br> -<br> -========== Eclipse Build Input August 5th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input July 29th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input July 22th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input July 15th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input July 8st 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- searchPage contributors can now specify a custom help context ID for the Search view.<br> -<br> -<br> -========== Eclipse Build Input July 1st 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- 1 bug fixed<br> -<br> -<br> -========== Eclipse Build Input June 24th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input June 17th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- Added missing requirement in schema documentation -<br> -<br> -========== Eclipse Build Input June 10th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input June 3rd 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- 1 bug fixed<br> -<br> -<br> -========== Eclipse Build Input May 27th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input May 20th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input May 13th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- 1 bug fixed<br> -<br> -<br> -========== Eclipse Build Input May 6th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- 1 bug fixed<br> -<br> -<br> -========== Eclipse Build Input April 29th 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -<br> -<br> -========== Eclipse Build Input April 22nd 2003 ==========<br> -<!-- Add what's new below and end each line with br tag --> -- 1 bug fixed<br> -<br> -<br> -</body></html>
\ No newline at end of file diff --git a/org.eclipse.search/hglegal2003.htm b/org.eclipse.search/hglegal2003.htm deleted file mode 100644 index 47c8540c84c..00000000000 --- 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 Binary files differdeleted file mode 100644 index 80484787d21..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_goto.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_history.gif b/org.eclipse.search/icons/full/clcl16/search_history.gif Binary files differdeleted file mode 100644 index 151fe137e33..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_history.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_next.gif b/org.eclipse.search/icons/full/clcl16/search_next.gif Binary files differdeleted file mode 100644 index 8392f3345c5..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_next.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_prev.gif b/org.eclipse.search/icons/full/clcl16/search_prev.gif Binary files differdeleted file mode 100644 index 9b278e6fa81..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_prev.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_rem.gif b/org.eclipse.search/icons/full/clcl16/search_rem.gif Binary files differdeleted file mode 100644 index 12a9167c59d..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_rem.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_remall.gif b/org.eclipse.search/icons/full/clcl16/search_remall.gif Binary files differdeleted file mode 100644 index 2c069ab3f43..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_remall.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif Binary files differdeleted file mode 100644 index 9ed470d02f7..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_sortmatch.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/clcl16/search_stop.gif b/org.eclipse.search/icons/full/clcl16/search_stop.gif Binary files differdeleted file mode 100644 index 4eb53ec41c4..00000000000 --- a/org.eclipse.search/icons/full/clcl16/search_stop.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/ctool16/search.gif b/org.eclipse.search/icons/full/ctool16/search.gif Binary files differdeleted file mode 100644 index 6dc3ebefc92..00000000000 --- a/org.eclipse.search/icons/full/ctool16/search.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/cview16/searchres.gif b/org.eclipse.search/icons/full/cview16/searchres.gif Binary files differdeleted file mode 100644 index 8b39ab3b8be..00000000000 --- a/org.eclipse.search/icons/full/cview16/searchres.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_goto.gif b/org.eclipse.search/icons/full/dlcl16/search_goto.gif Binary files differdeleted file mode 100644 index 4d8cd04e403..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_goto.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_history.gif b/org.eclipse.search/icons/full/dlcl16/search_history.gif Binary files differdeleted file mode 100644 index ee26f79a803..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_history.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_next.gif b/org.eclipse.search/icons/full/dlcl16/search_next.gif Binary files differdeleted file mode 100644 index 6cbeced2629..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_next.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_prev.gif b/org.eclipse.search/icons/full/dlcl16/search_prev.gif Binary files differdeleted file mode 100644 index a3441a06280..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_prev.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_rem.gif b/org.eclipse.search/icons/full/dlcl16/search_rem.gif Binary files differdeleted file mode 100644 index 7e0ad4aed42..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_rem.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_remall.gif b/org.eclipse.search/icons/full/dlcl16/search_remall.gif Binary files differdeleted file mode 100644 index 7ace43e8a73..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_remall.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif Binary files differdeleted file mode 100644 index 8a47d61be8d..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_sortmatch.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dlcl16/search_stop.gif b/org.eclipse.search/icons/full/dlcl16/search_stop.gif Binary files differdeleted file mode 100644 index 7f0f9b925f8..00000000000 --- a/org.eclipse.search/icons/full/dlcl16/search_stop.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/dtool16/search.gif b/org.eclipse.search/icons/full/dtool16/search.gif Binary files differdeleted file mode 100644 index 5fe80f3fc6e..00000000000 --- a/org.eclipse.search/icons/full/dtool16/search.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_goto.gif b/org.eclipse.search/icons/full/elcl16/search_goto.gif Binary files differdeleted file mode 100644 index d02e028054b..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_goto.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_history.gif b/org.eclipse.search/icons/full/elcl16/search_history.gif Binary files differdeleted file mode 100644 index d1e6b85ecf4..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_history.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_next.gif b/org.eclipse.search/icons/full/elcl16/search_next.gif Binary files differdeleted file mode 100644 index 1d0b40adc61..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_next.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_prev.gif b/org.eclipse.search/icons/full/elcl16/search_prev.gif Binary files differdeleted file mode 100644 index 13729577c02..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_prev.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_rem.gif b/org.eclipse.search/icons/full/elcl16/search_rem.gif Binary files differdeleted file mode 100644 index 310510ee588..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_rem.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_remall.gif b/org.eclipse.search/icons/full/elcl16/search_remall.gif Binary files differdeleted file mode 100644 index 33908b12653..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_remall.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif b/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif Binary files differdeleted file mode 100644 index 336c0ec3d09..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_sortmatch.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/elcl16/search_stop.gif b/org.eclipse.search/icons/full/elcl16/search_stop.gif Binary files differdeleted file mode 100644 index a519f44d453..00000000000 --- a/org.eclipse.search/icons/full/elcl16/search_stop.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/etool16/search.gif b/org.eclipse.search/icons/full/etool16/search.gif Binary files differdeleted file mode 100644 index 57ed3b4f6dd..00000000000 --- a/org.eclipse.search/icons/full/etool16/search.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/eview16/searchres.gif b/org.eclipse.search/icons/full/eview16/searchres.gif Binary files differdeleted file mode 100644 index 7425e604f91..00000000000 --- a/org.eclipse.search/icons/full/eview16/searchres.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/obj16/searchm_obj.gif b/org.eclipse.search/icons/full/obj16/searchm_obj.gif Binary files differdeleted file mode 100644 index 657b67e716e..00000000000 --- a/org.eclipse.search/icons/full/obj16/searchm_obj.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif b/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif Binary files differdeleted file mode 100644 index e6be5623860..00000000000 --- a/org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gif +++ /dev/null diff --git a/org.eclipse.search/icons/full/obj16/tsearch_obj.gif b/org.eclipse.search/icons/full/obj16/tsearch_obj.gif Binary files differdeleted file mode 100644 index 73ac91bddbc..00000000000 --- a/org.eclipse.search/icons/full/obj16/tsearch_obj.gif +++ /dev/null diff --git a/org.eclipse.search/ngibmcpy2003.gif b/org.eclipse.search/ngibmcpy2003.gif Binary files differdeleted file mode 100644 index c786e43e1f9..00000000000 --- a/org.eclipse.search/ngibmcpy2003.gif +++ /dev/null diff --git a/org.eclipse.search/old_buildnotes_search_2.1.html b/org.eclipse.search/old_buildnotes_search_2.1.html deleted file mode 100644 index 7822f778b7a..00000000000 --- a/org.eclipse.search/old_buildnotes_search_2.1.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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F20&chfieldto=2003%2F02%2F27&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F18&chfieldto=2003%2F02%2F20&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F13&chfieldto=2003%2F02%2F18&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F11&chfieldto=2003%2F02%2F13&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F07&chfieldto=2003%2F02%2F11&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F02%2F05&chfieldto=2003%2F02%2F06&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F01%2F28&chfieldto=2003%2F02%2F05&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F01%2F21&chfieldto=2003%2F01%2F28&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F01%2F14&chfieldto=2003%2F01%2F21&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2003%2F01%2F07&chfieldto=2003%2F01%2F14&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F12%2F16&chfieldto=2003%2F01%2F07&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F12%2F13&chfieldto=2002%2F12%2F16&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F12%2F10&chfieldto=2002%2F12%2F13&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F11%2F26&chfieldto=2002%2F12%2F10&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F11%2F19&chfieldto=2002%2F11%2F26&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F11%2F13&chfieldto=2002%2F11%2F19&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F11%2F12&chfieldto=2002%2F11%2F13&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F10%2F29&chfieldto=2002%2F11%2F12&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F10%2F15&chfieldto=2002%2F10%2F29&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F10%2F08&chfieldto=2002%2F10%2F15&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F10%2F01&chfieldto=2002%2F10%2F08&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F09%2F19&chfieldto=2002%2F10%2F01&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F09%2F10&chfieldto=2002%2F09%2F20&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F09%2F03&chfieldto=2002%2F09%2F10&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F08%2F27&chfieldto=2002%2F09%2F03&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F08%2F20&chfieldto=2002%2F08%2F27&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F08%2F13&chfieldto=2002%2F08%2F20&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F07%2F23&chfieldto=2002%2F08%2F13&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F06%2F29&chfieldto=2002%2F07%2F23&product=Platform&component=Search&cmdtype=doit&&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/old_buildnotes_search_2_0.html b/org.eclipse.search/old_buildnotes_search_2_0.html deleted file mode 100644 index d36c4a7942c..00000000000 --- 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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F06%2F06&chfieldto=2002%2F06%2F18&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F31&chfieldto=2002%2F06%2F06&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F28&chfieldto=2002%2F05%2F31&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F21&chfieldto=2002%2F05%2F28&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F18&chfieldto=2002%2F05%2F21&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F14&chfieldto=2002%2F05%2F18&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F05%2F08&chfieldto=2002%2F05%2F14&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F30&chfieldto=2002%2F05%2F08&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F23&chfieldto=2002%2F04%2F30&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F19&chfieldto=2002%2F04%2F23&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F16&chfieldto=2002%2F04%2F19&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F11&chfieldto=2002%2F04%2F17&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F09&chfieldto=2002%2F04%2F12&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F04%2F02&chfieldto=2002%2F04%2F09&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F03%2F19&chfieldto=2002%2F03%2F26&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F03%2F26&chfieldto=2002%2F04%2F02&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F02%2F14&chfieldto=2002%2F02%2F26&product=Platform&component=Search&cmdtype=doit&&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&bug_status=CLOSED&chfield=bug_status&chfieldfrom=2002%2F02%2F05&chfieldto=2002%2F02%2F14&product=Platform&component=Search&cmdtype=doit&&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> - -</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 f8e4c8ba326..00000000000 --- 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 01dfc641454..00000000000 --- a/org.eclipse.search/plugin.xml +++ /dev/null @@ -1,212 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> - -<!-- ======================================================================= --> -<!-- Search Plugin --> -<!-- ======================================================================= --> -<plugin - name="%pluginName" - - id="org.eclipse.search" - version="3.0.0" - provider-name="%providerName" - class="org.eclipse.search.internal.ui.SearchPlugin"> - - <requires> - <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.core.filebuffers"/> - <import plugin="org.eclipse.ui"/> - <import plugin="org.eclipse.ui.ide"/> - <import plugin="org.eclipse.ui.workbench.texteditor"/> - <import plugin="org.eclipse.jface.text"/> - <import plugin="org.eclipse.ui.editors"/> - <import plugin="org.eclipse.core.runtime.compatibility" optional="true"/> - </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.ide.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" - canSearchEnclosingProjects="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.editors.markerAnnotationSpecification"> - <specification - annotationType="org.eclipse.search.results" - label="%SearchMarkerPreference.label" - icon="icons/full/obj16/searchm_obj.gif" - markerType="org.eclipse.search.searchmarker" - textPreferenceKey="searchResultIndication" - textPreferenceValue="true" - highlightPreferenceKey="searchResultHighlighting" - highlightPreferenceValue="false" - overviewRulerPreferenceKey="searchResultIndicationInOverviewRuler" - overviewRulerPreferenceValue="true" - verticalRulerPreferenceKey="searchResultIndicationInVerticalRuler" - verticalRulerPreferenceValue="true" - colorPreferenceKey="searchResultIndicationColor" - colorPreferenceValue="192,192,192" - presentationLayer="3" - showInNextPrevDropdownToolbarActionKey="showSearchResultInNextPrevDropdownToolbarAction" - showInNextPrevDropdownToolbarAction="true" - isGoToNextNavigationTargetKey="isSearchResultGoToNextNavigationTarget" - isGoToNextNavigationTarget="false" - isGoToPreviousNavigationTargetKey="isSearchResultGoToPreviousNavigationTarget" - isGoToPreviousNavigationTarget="false"> - </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 71f901c9fdd..00000000000 --- a/org.eclipse.search/schema/searchPages.exsd +++ /dev/null @@ -1,234 +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 which implements <samp>org.eclipse.search.ui.ISearchPage</samp>. We recommend subclassing -<samp>org.eclipse.jface.dialogs.DialogPage</samp>. - </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'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. "50, 60"). 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: -<ol> -<li> -if neither page defines the tab position then they are -ordered alphabetically according to their labels -</li> -<li> -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.) -</li> -<li> -if only one page has the value specified then this -page comes first -</ol> - </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 "*" can be used. - </documentation> - </annotation> - </attribute> - <attribute name="searchViewHelpContextId" type="string"> - <annotation> - <documentation> - an optional help context ID of the Search view displaying results of this page. If this attribute is missing then the default search help context ID (<samp>org.eclipse.search.search_view_context</samp>) is used. - </documentation> - </annotation> - </attribute> - <attribute name="showScopeSection" type="boolean"> - <annotation> - <documentation> - If this attribute is missing or set to "false", then the scope section is not shown in the Search dialog. -To see the scope section, this attribute has to be set to "true". -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 "false", then the page is not initially shown in the Search dialog. -The page can be activated by the user via the "Customize..." button on the Search dialog. - </documentation> - </annotation> - </attribute> - <attribute name="canSearchEnclosingProjects" type="boolean"> - <annotation> - <documentation> - If this attribute is missing or set to "false", the "Enclosing Projects" search scope is not shown in the search dialog's scope part. -If the attribute "showScopeSection" is missing or set to "false", this attribute will be ignored. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - The following is an example of a search page extension -definition: - -<p> -<pre> - <extension point="org.eclipse.search.searchPages"> - <page - id="org.eclipse.search.ui.text.TextSearchPage" - label="Text Search" - icon="icons/full/obj16/tsearch_pref.gif" - sizeHint="250,160" - tabPosition="1" - extensions="*:1" - showScopeSection="true" - class="org.eclipse.search.ui.text.TextSearchPage"> - </page> - </extension> -</pre> -</p> - </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> - <p> -<a href="hglegal.htm"> - <img SRC="ngibmcpy.gif" - ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." - BORDER=0 height=14 width=324></a> -</p> - </documentation> - </annotation> - -</schema> diff --git a/org.eclipse.search/schema/searchResultSorters.exsd b/org.eclipse.search/schema/searchResultSorters.exsd deleted file mode 100644 index 8959ebe79ba..00000000000 --- 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 <samp>org.eclipse.jface.viewers.ViewerSorter</samp> - </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: -<p> -<pre> - <extension point="org.eclipse.search.searchResultSorters"> - <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"> - </sorter> - </extension> -</pre> -</p> - </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> - <p> -<a href="hglegal.htm"> - <img SRC="ngibmcpy.gif" - ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." - BORDER=0 height=14 width=324></a> -</p> - </documentation> - </annotation> - -</schema> diff --git a/org.eclipse.search/scripts/exportplugin.xml b/org.eclipse.search/scripts/exportplugin.xml deleted file mode 100644 index a7840c24ab5..00000000000 --- 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="_3.0.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 1400e4a06e2..00000000000 --- 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 315abd9318a..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java +++ /dev/null @@ -1,101 +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]); - } - - public void setDescription(String description) { - Assert.isNotNull(description); - fDescription= description; - } - - /* - * @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 5a200092353..00000000000 --- 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 e2caed1e5ae..00000000000 --- 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/MatchLocator.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/MatchLocator.java deleted file mode 100644 index 9d77f53f612..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/MatchLocator.java +++ /dev/null @@ -1,189 +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.IOException; -import java.io.Reader; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.search.internal.ui.SearchMessages; - -/** - * A class finding matches withing a file. - * @since 3.0 - */ -public class MatchLocator { - - protected static final int fgLF= '\n'; - protected static final int fgCR= '\r'; - - private Matcher fMatcher; - protected int fPushbackChar; - protected boolean fPushback; - private String fPattern; - private boolean fIsRegEx; - - public MatchLocator(String pattern, String options) { - fPattern= pattern; - Pattern regExPattern; - - fIsRegEx= options.indexOf('r') != -1; - if (!isRegExSearch()) - pattern= asRegEx(pattern); - - if (options.indexOf('i') != -1) - regExPattern= Pattern.compile(pattern, Pattern.CASE_INSENSITIVE); - else - regExPattern= Pattern.compile(pattern); - - fMatcher= regExPattern.matcher(""); //$NON-NLS-1$ - - } - - public boolean isEmtpy() { - return getPattern().length() == 0; - } - - public String getPattern() { - return fPattern; - } - - public void locateMatches(IProgressMonitor monitor, IResourceProxy proxy, Reader reader, ITextSearchResultCollector collector) throws CoreException, IOException { - 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(); - while (start < lineLength) { - fMatcher.reset(line); - if (fMatcher.find(start)) { - start= charCounter + fMatcher.start(); - int length= fMatcher.end() - fMatcher.start(); - collector.accept(proxy, line.trim(), start, length, lineCounter); - start= fMatcher.end(); - } - else // no match in this line - start= lineLength; - } - charCounter+= lineLength + eolStrLength; - lineCounter++; - if (monitor.isCanceled()) - throw new OperationCanceledException(SearchMessages.getString("TextSearchVisitor.canceled")); //$NON-NLS-1$ - } - } finally { - if (reader != null) - reader.close(); - } - } - - /* - * Converts '*' and '?' to regEx variables. - */ - private String asRegEx(String pattern) { - - StringBuffer out= new StringBuffer(pattern.length()); - - boolean escaped= false; - boolean quoting= false; - - int i= 0; - while (i < pattern.length()) { - char ch= pattern.charAt(i++); - - if (ch == '*' && !escaped) { - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append(".*"); //$NON-NLS-1$ - escaped= false; - continue; - } else if (ch == '?' && !escaped) { - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append("."); //$NON-NLS-1$ - escaped= false; - continue; - } else if (ch == '\\' && !escaped) { - escaped= true; - continue; - - } else if (ch == '\\' && escaped) { - escaped= false; - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append("\\\\"); //$NON-NLS-1$ - continue; - } - - if (!quoting) { - out.append("\\Q"); //$NON-NLS-1$ - quoting= true; - } - if (escaped && ch != '*' && ch != '?' && ch != '\\') - out.append('\\'); - out.append(ch); - escaped= ch == '\\'; - - } - if (quoting) - out.append("\\E"); //$NON-NLS-1$ - - return out.toString(); - } - - protected int readLine(Reader 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; - } - - public boolean isRegExSearch() { - return fIsRegEx; - } - -} 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 55a3a5f56e3..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.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.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, ISearchScope scope, ITextSearchResultCollector collector, MatchLocator matchLocator) { - Assert.isNotNull(workspace); - Assert.isNotNull(scope); - Assert.isNotNull(collector); - Assert.isNotNull(matchLocator); - 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(matchLocator, 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 5b2646f1c21..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java +++ /dev/null @@ -1,226 +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 java.util.regex.Matcher; -import java.util.regex.Pattern; - -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; - -/** - * 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) { - Pattern pattern= Pattern.compile(asRegEx(extension), Pattern.CASE_INSENSITIVE); - fExtensions.add(pattern.matcher("")); //$NON-NLS-1$ - } - - /* - * Converts '*' and '?' to regEx variables. - */ - private String asRegEx(String pattern) { - - StringBuffer out= new StringBuffer(pattern.length()); - - boolean escaped= false; - boolean quoting= false; - - int i= 0; - while (i < pattern.length()) { - char ch= pattern.charAt(i++); - - if (ch == '*' && !escaped) { - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append(".*"); //$NON-NLS-1$ - escaped= false; - continue; - } else if (ch == '?' && !escaped) { - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append("."); //$NON-NLS-1$ - escaped= false; - continue; - } else if (ch == '\\' && !escaped) { - escaped= true; - continue; - - } else if (ch == '\\' && escaped) { - escaped= false; - if (quoting) { - out.append("\\E"); //$NON-NLS-1$ - quoting= false; - } - out.append("\\\\"); //$NON-NLS-1$ - continue; - } - - if (!quoting) { - out.append("\\Q"); //$NON-NLS-1$ - quoting= true; - } - if (escaped && ch != '*' && ch != '?' && ch != '\\') - out.append('\\'); - out.append(ch); - escaped= ch == '\\'; - - } - if (quoting) - out.append("\\E"); //$NON-NLS-1$ - - return out.toString(); - } - - /** - * 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 (((Matcher)iter.next()).reset(proxy.getName()).matches()) - 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 (((Matcher)iter.next()).reset(file.getName()).matches()) - 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 a5f9ceff64f..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java +++ /dev/null @@ -1,196 +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.search.internal.core.ISearchScope; -import org.eclipse.search.internal.ui.SearchMessages; -import org.eclipse.search.internal.ui.SearchPlugin; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * 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 ISearchScope fScope; - private ITextSearchResultCollector fCollector; - private IEditorPart[] fEditors; - private MatchLocator fLocator; - - private IProgressMonitor fProgressMonitor; - private Integer[] fMessageFormatArgs; - - private int fNumberOfScannedFiles; - private int fNumberOfFilesToScan; - private long fLastUpdateTime; - - public TextSearchVisitor(MatchLocator locator, ISearchScope scope, ITextSearchResultCollector collector, MultiStatus status, int fileCount) { - super(status); - fScope= scope; - fCollector= collector; - - fProgressMonitor= collector.getProgressMonitor(); - - fLocator= locator; - - 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 editor parts. - */ - public static IEditorPart[] getEditors() { - 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++) { - IEditorReference[] editorRefs= pages[x].getEditorReferences(); - for (int z= 0; z < editorRefs.length; z++) { - IEditorPart ep= editorRefs[z].getEditor(false); - if (ep != null) { - IEditorInput input= ep.getEditorInput(); - if (!inputs.contains(input)) { - inputs.add(input); - result.add(ep); - } - } - } - } - } - 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 (fLocator.isEmtpy()) { - fCollector.accept(proxy, "", -1, 0, -1); //$NON-NLS-1$ - updateProgressMonitor(); - return true; - } - IFile file= (IFile)proxy.requestResource(); - try { - BufferedReader reader= null; - ITextEditor editor= findEditorFor(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())); - } - fLocator.locateMatches(fProgressMonitor, proxy, reader, fCollector); - } 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 findEditorFor(IFile file) { - int i= 0; - while (i < fEditors.length) { - IEditorPart editor= fEditors[i]; - IEditorInput input= editor.getEditorInput(); - if (input instanceof IFileEditorInput && editor instanceof ITextEditor) - if (((IFileEditorInput)input).getFile().equals(file)) - return (ITextEditor)editor; - i++; - } - return null; - } - - /* - * @see IResourceProxyVisitor#visit(IResourceProxy) - */ - public boolean visit(IResourceProxy proxy) { - fEditors= getEditors(); - 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 6188516cfd1..00000000000 --- 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 b1b4770b7d6..00000000000 --- 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 3050af6c73a..00000000000 --- 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 9fde0e98ee4..00000000000 --- 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 1c4f4ee5570..00000000000 --- 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 ce38d4da8dc..00000000000 --- 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 08ffc5be6ac..00000000000 --- 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 178ccbab8f8..00000000000 --- 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 98abd6ac731..00000000000 --- 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 5ff5b301f59..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java +++ /dev/null @@ -1,117 +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.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; - -import org.eclipse.ui.IWorkbenchSite; - -import org.eclipse.search.ui.SearchUI; - -import org.eclipse.search.internal.ui.util.ExceptionHandler; - -class RemovePotentialMatchesAction extends Action { - - private IWorkbenchSite fSite; - - public RemovePotentialMatchesAction(IWorkbenchSite site) { - fSite= site; - - if (usePluralLabel()) { - setText(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatches.text")); //$NON-NLS-1$ - setToolTipText(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatches.tooltip")); //$NON-NLS-1$ - } - else { - setText(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatch.text")); //$NON-NLS-1$ - setToolTipText(SearchMessages.getString("RemovePotentialMatchesAction.removePotentialMatch.tooltip")); //$NON-NLS-1$ - } - } - - 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() { - - ISelection s= fSite.getSelectionProvider().getSelection(); - if (! (s instanceof IStructuredSelection)) - return null; - IStructuredSelection selection= (IStructuredSelection)s; - - int size= selection.size(); - if (size <= 0) - return null; - - ArrayList markers= new ArrayList(size * 3); - Iterator iter= selection.iterator(); - for(int i= 0; iter.hasNext(); i++) { - SearchResultViewEntry entry= (SearchResultViewEntry)iter.next(); - Iterator entryIter= entry.getMarkers().iterator(); - while (entryIter.hasNext()) { - IMarker marker= (IMarker)entryIter.next(); - if (marker.getAttribute(SearchUI.POTENTIAL_MATCH, false)) - markers.add(marker); - } - } - return (IMarker[])markers.toArray(new IMarker[markers.size()]); - } - - private boolean usePluralLabel() { - ISelection s= fSite.getSelectionProvider().getSelection(); - - if (! (s instanceof IStructuredSelection) || s.isEmpty()) - return false; - - IStructuredSelection selection= (IStructuredSelection)s; - int size= selection.size(); - if (size <= 0) - return false; - - int markerCount= 0; - Iterator iter= selection.iterator(); - for(int i= 0; iter.hasNext(); i++) { - SearchResultViewEntry entry= (SearchResultViewEntry)iter.next(); - Iterator entryIter= entry.getMarkers().iterator(); - while (entryIter.hasNext()) { - IMarker marker= (IMarker)entryIter.next(); - if (marker.getAttribute(SearchUI.POTENTIAL_MATCH, false)) { - markerCount++; - } - if (markerCount > 1) - return true; - } - } - return false; - } -}
\ No newline at end of file diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java deleted file mode 100644 index 4922292bd0c..00000000000 --- 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 3019eb396ac..00000000000 --- 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 187cebc1c43..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java +++ /dev/null @@ -1,424 +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.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -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.search.internal.ui.util.PixelConverter; -import org.eclipse.search.internal.ui.util.SWTUtil; -import org.eclipse.search.ui.ISearchPageContainer; -import org.eclipse.search.ui.SearchUI; -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.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog; - -public class ScopePart { - - // 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 fUseProject; - private Button fUseWorkingSet; - - private int fScope; - private boolean fCanSearchEnclosingProjects; - 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(ISearchPageContainer searchPageContainer, boolean searchEnclosingProjects) { - int initialScope= getStoredScope(); - Assert.isLegal(initialScope >= 0 && initialScope <= 3); - fScope= initialScope; - fCanSearchEnclosingProjects= searchEnclosingProjects; - if (!fCanSearchEnclosingProjects && fScope == ISearchPageContainer.SELECTED_PROJECTS_SCOPE) - fScope= ISearchPageContainer.WORKSPACE_SCOPE; - fSearchPageContainer= searchPageContainer; - restoreState(); - } - - private static int getStoredScope() { - int scope; - try { - scope= fgSettingsStore.getInt(STORE_SCOPE); - } catch (NumberFormatException ex) { - scope= ISearchPageContainer.WORKSPACE_SCOPE; - } - if (scope != ISearchPageContainer.WORKING_SET_SCOPE - && scope != ISearchPageContainer.SELECTION_SCOPE - && scope != ISearchPageContainer.SELECTED_PROJECTS_SCOPE - && scope != ISearchPageContainer.WORKSPACE_SCOPE) - scope= ISearchPageContainer.WORKSPACE_SCOPE; - return scope; - } - - - 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 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); - Assert.isNotNull(fUseProject); - fScope= scope; - if (fScope == ISearchPageContainer.SELECTED_PROJECTS_SCOPE) { - if (!fCanSearchEnclosingProjects) { - SearchPlugin.log(new Status(IStatus.WARNING, SearchUI.PLUGIN_ID, IStatus.WARNING, "Enclosing projects scope set on search page that does not support it", null)); //$NON-NLS-1$ - fScope= ISearchPageContainer.WORKSPACE_SCOPE; - } else if (!fUseProject.isEnabled()) { - fScope= ISearchPageContainer.WORKSPACE_SCOPE; - } - } else if (fScope == ISearchPageContainer.SELECTION_SCOPE) { - if (!fUseSelection.isEnabled()) { - fScope= ISearchPageContainer.WORKSPACE_SCOPE; - } - } - switch (fScope) { - case ISearchPageContainer.WORKSPACE_SCOPE : - fUseWorkspace.setSelection(true); - fUseSelection.setSelection(false); - fUseProject.setSelection(false); - fUseWorkingSet.setSelection(false); - break; - case ISearchPageContainer.SELECTION_SCOPE : - fUseWorkspace.setSelection(false); - fUseSelection.setSelection(true); - fUseProject.setSelection(false); - fUseWorkingSet.setSelection(false); - break; - case ISearchPageContainer.WORKING_SET_SCOPE : - fUseWorkspace.setSelection(false); - fUseSelection.setSelection(false); - fUseProject.setSelection(false); - fUseWorkingSet.setSelection(true); - break; - case ISearchPageContainer.SELECTED_PROJECTS_SCOPE : - fUseWorkspace.setSelection(false); - fUseSelection.setSelection(false); - fUseProject.setSelection(true); - fUseWorkingSet.setSelection(false); - break; - } - - updateSearchPageContainerActionPerformedEnablement(); - fgSettingsStore.put(STORE_SCOPE, fScope); - - } - - private void updateSearchPageContainerActionPerformedEnablement() { - boolean newState= fScope != ISearchPageContainer.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() == ISearchPageContainer.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(ISearchPageContainer.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= 4; - fPart.setLayout(layout); - fPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fUseWorkspace= new Button(fPart, SWT.RADIO); - fUseWorkspace.setData(new Integer(ISearchPageContainer.WORKSPACE_SCOPE)); - fUseWorkspace.setText(SearchMessages.getString("ScopePart.workspaceScope.text")); //$NON-NLS-1$ - - fUseSelection= new Button(fPart, SWT.RADIO); - fUseSelection.setData(new Integer(ISearchPageContainer.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.horizontalIndent= 8; - fUseSelection.setLayoutData(gd); - - fUseProject= new Button(fPart, SWT.RADIO); - fUseProject.setData(new Integer(ISearchPageContainer.SELECTED_PROJECTS_SCOPE)); - fUseProject.setText(SearchMessages.getString("ScopePart.enclosingProjectsScope.text")); //$NON-NLS-1$ - fUseProject.setEnabled((selection instanceof IStructuredSelection && - !fSearchPageContainer.getSelection().isEmpty()) || - hasFocusEditor()); - - gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); - gd.horizontalSpan= 2; - gd.horizontalIndent= 8; - fUseProject.setLayoutData(gd); - if (!fCanSearchEnclosingProjects) - fUseProject.setVisible(false); - - fUseWorkingSet= new Button(fPart, SWT.RADIO); - fUseWorkingSet.setData(new Integer(ISearchPageContainer.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(ISearchPageContainer.WORKING_SET_SCOPE); - } - } - }); - gd= new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalIndent= 8; - gd.horizontalSpan= 2; - gd.widthHint= new PixelConverter(fWorkingSetText).convertWidthInCharsToPixels(30); - fWorkingSetText.setLayoutData(gd); - - // Add scope change listeners - SelectionAdapter scopeChangedLister= new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleScopeChanged(e); - } - }; - fUseWorkspace.addSelectionListener(scopeChangedLister); - fUseSelection.addSelectionListener(scopeChangedLister); - fUseProject.addSelectionListener(scopeChangedLister); - fUseWorkingSet.addSelectionListener(scopeChangedLister); - - // Set initial scope - setSelectedScope(fScope); - - // Set initial working set - if (fWorkingSets != null) - fWorkingSetText.setText(toString(fWorkingSets)); - - return fPart; - } - - /** - * @return Whether an editor has the focus - */ - private boolean hasFocusEditor() { - IWorkbenchPage activePage= SearchPlugin.getActivePage(); - if (activePage == null) - return false; - if (activePage.getActivePart() instanceof IEditorPart) - return true; - return false; - } - - 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 == ISearchPageContainer.WORKING_SET_SCOPE) - setSelectedScope(ISearchPageContainer.WORKSPACE_SCOPE); - return false; - } else { - if (fWorkingSets != null) { - // test if selected working set has been removed - int i= 0; - while (i < fWorkingSets.length) { - if (PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(fWorkingSets[i].getName()) - == null) - break; - i++; - } - if (i < fWorkingSets.length) { - 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 9a78101b36d..00000000000 --- 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 && fOperation != null; - } - - 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 304d838c78b..00000000000 --- 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 64dd64485c5..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java +++ /dev/null @@ -1,574 +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.jface.dialogs.Dialog; -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.jface.window.Window; -import org.eclipse.search.internal.ui.util.ExtendedDialogWindow; -import org.eclipse.search.internal.ui.util.ListContentProvider; -import org.eclipse.search.internal.ui.util.SWTUtil; -import org.eclipse.search.ui.IReplacePage; -import org.eclipse.search.ui.ISearchPage; -import org.eclipse.search.ui.ISearchPageContainer; -import org.eclipse.search.ui.ISearchPageScoreComputer; -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.FillLayout; -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.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.dialogs.ListSelectionDialog; -import org.eclipse.ui.help.WorkbenchHelp; - -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 static final int SEARCH_ID= IDialogConstants.CLIENT_ID+1; - private static final int REPLACE_ID= SEARCH_ID+1; - - 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; - private Button fCustomizeButton; - private Button fReplaceButton; - - public SearchDialog(Shell shell, IWorkspace workspace, ISelection selection, IEditorPart editor, String pageId) { - super(shell); - Assert.isNotNull(workspace); - fWorkspace= workspace; - 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() == Window.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); - FillLayout layout= new FillLayout(); - layout.marginWidth= 7; - layout.marginHeight= 7; - border.setLayout(layout); - - TabFolder folder= new TabFolder(border, SWT.NONE); - 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 void createButtonsForButtonBar(Composite parent) { - fReplaceButton= createActionButton(parent, REPLACE_ID, SearchMessages.getString("SearchDialog.replaceAction"), true); //$NON-NLS-1$ - fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage); - createActionButton(parent, SEARCH_ID, SearchMessages.getString("SearchDialog.searchAction"), true); //$NON-NLS-1$ - super.createButtonsForButtonBar(parent); - } - - 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(SEARCH_ID).setEnabled(fDescriptors.size() > 0); - applyDialogFont(composite); - - return result; - } - - protected boolean performAction(int actionID) { - 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); - if (actionID == SEARCH_ID) - return fCurrentPage.performAction(); - else - // safe cast, replace button is only visible when the curren page is - // a replace page. - return ((IReplacePage)fCurrentPage).performReplace(); - } 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; - TabFolder folder= item.getParent(); - Control oldControl= folder.getItem(fCurrentIndex).getControl(); - Point oldSize= oldControl.getSize(); - 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(); - fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage); - fCurrentIndex= item.getParent().getSelectionIndex(); - fCurrentPage.setVisible(true); - } - Control newControl= item.getControl(); - resizeDialogIfNeeded(oldSize, newControl.computeSize(SWT.DEFAULT, SWT.DEFAULT, 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 ISearchPageContainer.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) { - Control control= page.getControl(); - if (control != null) - return control; - // Page wrapper - Composite pageWrapper= new Composite(parent, SWT.NONE); - GridLayout layout= new GridLayout(); - layout.marginWidth= 0; - layout.marginHeight= 0; - pageWrapper.setLayout(layout); - - Dialog.applyDialogFont(pageWrapper); - // The page itself - page.createControl(pageWrapper); - - - // Search scope - SearchPageDescriptor descriptor= getDescriptorAt(index); - boolean showScope= descriptor.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, descriptor.canSearchInProjects()); - Control part= fScopeParts[index].createPart(c); - applyDialogFont(part); - fScopeParts[index].setVisible(true); - } - return pageWrapper; - } - - private void resizeDialogIfNeeded(Point oldSize, Point newSize) { - if (oldSize == null || newSize == null) - return; - Shell shell= getShell(); - Point shellSize= shell.getSize(); - if (mustResize(oldSize, newSize)) { - if (newSize.x > oldSize.x) - shellSize.x+= (newSize.x-oldSize.x); - if (newSize.y > oldSize.y) - shellSize.y+= (newSize.y-oldSize.y); - shell.setSize(shellSize); - shell.layout(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 bb6db831989..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java +++ /dev/null @@ -1,92 +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 Menu fMenu; - - public SearchDropDownAction() { - 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(); - fMenu= 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); - } - - /** - * Get's rid of the menu, because the menu hangs on to - * the searches, etc. - */ - void clear() { - dispose(); - } -} 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 6e310231650..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java +++ /dev/null @@ -1,507 +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 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(null) { - 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(); - handleAllSearchesRemoved(viewer); - } - } - - private void handleAllSearchesRemoved(SearchResultViewer viewer) { - viewer.handleAllSearchesRemoved(); - } - - void setCurrentSearch(final Search search) { - if (fCurrentSearch == search) - return; - - SearchPlugin.getWorkspace().removeResourceChangeListener(this); - WorkspaceModifyOperation op= new WorkspaceModifyOperation(null) { - 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(final Search newSearch) { - - SearchPlugin.getWorkspace().removeResourceChangeListener(this); - - // 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()); - setNewSearch(viewer, newSearch); - } - }); - } - } - - 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 searchFinished(ArrayList results) { - Assert.isNotNull(results); - getCurrentSearch().setResults(results); - - Display display= getDisplay(); - if (display == null || display.isDisposed()) - return; - - if (Thread.currentThread() == display.getThread()) - handleNewSearchResult(); - else { - display.syncExec(new Runnable() { - public void run() { - handleNewSearchResult(); - } - }); - } - SearchPlugin.getWorkspace().addResourceChangeListener(this); - } - - //--- Change event handling ------------------------------------------------- - - void addSearchChangeListener(SearchResultViewer viewer) { - fListeners.add(viewer); - } - - void removeSearchChangeListener(SearchResultViewer viewer) { - Assert.isNotNull(viewer); - fListeners.remove(viewer); - } - - private final void handleSearchMarkersChanged(IMarkerDelta[] markerDeltas) { - 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(); - // don't listen for adds will be done by ISearchResultView.addMatch(...) - if (((kind & IResourceDelta.REMOVED) != 0)) - handleRemoveMatch(markerDelta.getMarker()); - else if ((kind & IResourceDelta.CHANGED) != 0) - handleUpdateMatch(markerDelta.getMarker()); - } - - private void handleRemoveAll() { - if (fCurrentSearch != null) - fCurrentSearch.removeResults(); - Iterator iter= fListeners.iterator(); - while (iter.hasNext()) - ((SearchResultViewer)iter.next()).handleRemoveAll(); - } - - private void handleNewSearchResult() { - Iterator iter= fListeners.iterator(); - while (iter.hasNext()) { - SearchResultViewer viewer= (SearchResultViewer)iter.next(); - viewer.setInput(getCurrentResults()); - } - } - - private void setNewSearch(SearchResultViewer viewer, Search search) { - viewer.setInput(null); - viewer.clearTitle(); - viewer.setPageId(search.getPageId()); - viewer.setGotoMarkerAction(search.getGotoMarkerAction()); - viewer.setContextMenuTarget(search.getContextMenuContributor()); - 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; - } - - /** - * 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() { - if (getCurrentSearch() != null) { - handleSearchMarkersChanged(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 2f9d75ec664..00000000000 --- 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 4cbec3d110e..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties +++ /dev/null @@ -1,223 +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.searchAction= &Search -SearchDialog.replaceAction= R&eplace... -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 -SearchPage.regularExpression= &Regular expression -SearchPage.regularExpressionSyntaxProblem.title= Search: Invalid Regular Expression - -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 -EnclosingProjectsScope= Projects {0}, ... -EnclosingProjectScope= Project {0} - -ScopePart.group.text= Scope -ScopePart.selectedResourcesScope.text= Selecte&d Resources -ScopePart.enclosingProjectsScope.text= Enclosing Pro&jects -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.bringToFront= &Bring Search view to front after search -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.dialog.title= Replace - -ReplaceDialog.replace_label= Replace: -ReplaceDialog.with_label= &With: -ReplaceDialog.replace= &Replace -ReplaceDialog.replaceAllInFile= Replace All in &File -ReplaceDialog.replaceAll= Replace &All -ReplaceDialog.skip= &Skip -ReplaceDialog.skipFile= S&kip File -ReplaceDialog.dialog.title= Replace -ReplaceDialog.error.unable_to_open_text_editor= It is not possible to open the built-in text editor for file ''{0}''. -ReplaceDialog.error.unable_to_replace= An error occurred while replacing in file ''{0}''. -ReplaceDialog.progress.message= File: {0} ({1} of {2}) - -SelectAllAction.label= Select A&ll -SelectAllAction.tooltip= Select All - -RemovePotentialMatchesAction.removePotentialMatch.text= Remove Inexact Match -RemovePotentialMatchesAction.removePotentialMatch.tooltip= Remove inexact match -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 - -ReadOnlyDialog.skipFile= Skip File -ReadOnlyDialog.skipAll= Skip All -ReadOnlyDialog.message= The file {0} is read-only -ReplaceDialog.task.replace= Replacing Match -ReplaceDialog.task.replaceInFile= Replacing Matches in File {0} -ReplaceDialog.task.replace.replaceAll= Replacing Matches -ReplaceAction.label= Replace -ReplaceAction.research.error= An error occurred while updating the matches -SearchAgainConfirmationDialog.outofsync.message= Some resources are out of sync with the file system or may contain stale matches. Do you want to refresh those files and search again? -SearchAgainConfirmationDialog.outofsync.label= Files out of sync: -SearchAgainConfirmationDialog.stale.message= Some resources may contain stale matches. Do you want to search again? -SearchAgainConfirmationDialog.stale.label= Files with stale matches: -SearchAgainConfirmationDialog.title= Replace -ReplaceDialog.isRegex.label= Regular Expression 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 8361043b745..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java +++ /dev/null @@ -1,342 +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 CAN_SEARCH_ENCLOSING_PROJECTS= "canSearchEnclosingProjects"; //$NON-NLS-1$ - private final static String ENABLED_ATTRIBUTE= "enabled"; //$NON-NLS-1$ - private final static String SEARCH_VIEW_HELP_CONTEXT_ID_ATTRIBUTE= "searchViewHelpContextId"; //$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 static class ExtensionScorePair { - public String extension; - public int score; - public ExtensionScorePair(String extension, int score) { - this.extension= extension; - this.score= score; - } - } - - private IConfigurationElement fElement; - 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 <code>true</code> if the page can handle - * searches in enclosing projects. The value should be ignored if <code>showScopeSection()</code> - * returns <code>false</code>. - * - * This attribute is optional and defaults to <code>false</code>. - */ - public boolean canSearchInProjects() { - return Boolean.valueOf(fElement.getAttribute(CAN_SEARCH_ENCLOSING_PROJECTS)).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()); - } - - /** - * Returns the help context for help shown in search view. - * - * @return the help context id or <code>null</code> if not defined - */ - public String getSearchViewHelpContextId() { - return fElement.getAttribute(SEARCH_VIEW_HELP_CONTEXT_ID_ATTRIBUTE); - } - - 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 eb98f2a4b74..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java +++ /dev/null @@ -1,376 +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 { - IViewPart viewPart= getActivePage().findView(SearchUI.SEARCH_RESULT_VIEW_ID); - if (viewPart == null || SearchPreferencePage.isViewBroughtToFront()) { - return (getActivePage().showView(SearchUI.SEARCH_RESULT_VIEW_ID) != null); - } - return true; - } 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; - } - - /** - * Returns the help context ID for the Search view - * as provided by the current search page extension. - * - * @since 3.0 - */ - public String getSearchViewHelpContextId() { - Search currentSearch= SearchManager.getDefault().getCurrentSearch(); - if (currentSearch != null) { - String pageId= currentSearch.getPageId(); - Iterator iter= getSearchPageDescriptors().iterator(); - while (iter.hasNext()) { - SearchPageDescriptor desc= (SearchPageDescriptor)iter.next(); - if (desc.getId().equals(pageId)) { - String helpId= desc.getSearchViewHelpContextId(); - if (helpId == null) - return ISearchHelpContextIds.SEARCH_VIEW; - else - return desc.getSearchViewHelpContextId(); - } - } - } - return ISearchHelpContextIds.SEARCH_VIEW; - } - - /** - * 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 54331cc6b45..00000000000 --- 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 f07ae469bbd..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.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; - -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$ - public static final String BRING_VIEW_TO_FRONT= "org.eclipse.search.bringToFront"; //$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(BRING_VIEW_TO_FRONT, true); - store.setDefault(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE); - } - - public static boolean isEditorReused() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return store.getBoolean(REUSE_EDITOR); - } - - public static boolean isViewBroughtToFront() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return store.getBoolean(BRING_VIEW_TO_FRONT); - - } - - 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); - - boolEditor= new BooleanFieldEditor( - BRING_VIEW_TO_FRONT, - SearchMessages.getString("SearchPreferencePage.bringToFront"), //$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 86f69cf23a7..00000000000 --- 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 c55d2ef26fd..00000000000 --- 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 8fc92a41475..00000000000 --- 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.PartInitException; -import org.eclipse.ui.actions.ActionFactory; -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(), SearchPlugin.getDefault().getSearchViewHelpContextId()); - } - - /** - * 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(ActionFactory.SELECT_ALL.getId(), 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().searchFinished(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 9d536a31410..00000000000 --- 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 7acaaf16980..00000000000 --- 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 d9e07dfff65..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java +++ /dev/null @@ -1,728 +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 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.actions.ActionContext; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.ui.help.WorkbenchHelp; - -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; - private String fCurrentPageId= null; - - 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(); - 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(ActionFactory.NEXT.getId(), fShowNextResultAction); - actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), 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(0); - - WorkbenchHelp.setHelp(getControl(), SearchPlugin.getDefault().getSearchViewHelpContextId()); - } - - 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() { - if (getSelectedEntriesCount() == 0) - return false; - - Iterator iter= Collections.EMPTY_LIST.iterator(); - ISelection selection= getSelection(); - if (selection instanceof IStructuredSelection) - iter= ((IStructuredSelection)selection).iterator(); - - while (iter.hasNext()) { - Object entry= iter.next(); - if (entry instanceof ISearchResultViewEntry) { - IMarker marker= ((ISearchResultViewEntry)entry).getSelectedMarker(); - if (marker != null && marker.getAttribute(SearchUI.POTENTIAL_MATCH, false)) - return true; - } - } - - 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) { - if (fCurrentPageId != null && fCurrentPageId.equals(pageId)) - return; - - fCurrentPageId= 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(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(index); - } - entry.setSelectedMarkerIndex(fMarkerToShow); - openCurrentSelection(); - updateStatusLine(); - } - - private boolean canDoShowResult(Table table) { - if (table == null || getItemCount() == 0) - return false; - return true; - } - - private void selectResult(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.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(); - } - - protected void internalRefresh(Object element, boolean updateLabels) { - // see bug 44891 - getTable().setRedraw(false); - super.internalRefresh(element, updateLabels); - getTable().setRedraw(true); - } - - void handleAllSearchesRemoved() { - setContextMenuTarget(null); - setActionGroupFactory(null); - setInput(null); - fSearchDropDownAction.clear(); - } - -} 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 6ee7c5023a7..00000000000 --- 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 974505625eb..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java +++ /dev/null @@ -1,30 +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; - setActionDefinitionId("org.eclipse.ui.navigate.next"); //$NON-NLS-1$ - } - - 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 806144d7122..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java +++ /dev/null @@ -1,30 +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$ - setActionDefinitionId("org.eclipse.ui.navigate.previous"); //$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 969e08500ed..00000000000 --- 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 26baeae4ef0..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java +++ /dev/null @@ -1,128 +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.resource.ImageDescriptor; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.window.Window; - -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 class SearchesLabelProvider extends LabelProvider { - - private ArrayList fImages= new ArrayList(); - - 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; - - ImageDescriptor imageDescriptor= ((ShowSearchAction)element).getImageDescriptor(); - if (imageDescriptor == null) - return null; - - Image image= imageDescriptor.createImage(); - fImages.add(image); - - return image; - } - - public void dispose() { - Iterator iter= fImages.iterator(); - while (iter.hasNext()) - ((Image)iter.next()).dispose(); - - fImages= null; - } - } - - /** - * 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$ - } - - LabelProvider labelProvider=new SearchesLabelProvider(); - - ListDialog dlg= new ListDialog(SearchPlugin.getActiveWorkbenchShell(),input, title, message, new SearchResultContentProvider(), labelProvider); - if (selectedAction != null) { - Object[] selected= new Object[1]; - selected[0]= selectedAction; - dlg.setInitialSelections(selected); - } - if (dlg.open() == Window.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 4df1ab0e4d6..00000000000 --- 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 d1e572ffb03..00000000000 --- 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 f660f3cf98e..00000000000 --- 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 5c7b954e607..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java +++ /dev/null @@ -1,145 +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.IEditorRegistry; -import org.eclipse.ui.IReusableEditor; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.ide.IDE; -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= IDE.getDefaultEditor((IFile)resource); - if (desc == null) - editorId= SearchPlugin.getDefault().getWorkbench().getEditorRegistry().findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID).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) { - IDE.gotoMarker(editor, 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 { - IDE.openEditor(page, 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 61e207ffb3f..00000000000 --- 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 8bd9767e8d4..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java +++ /dev/null @@ -1,193 +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.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.filebuffers.FileBuffers; -import org.eclipse.core.filebuffers.ITextFileBuffer; -import org.eclipse.core.filebuffers.ITextFileBufferManager; -import org.eclipse.core.resources.IFile; -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.core.runtime.IStatus; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.search.internal.core.text.ITextSearchResultCollector; -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.ExceptionHandler; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.IWorkbenchSite; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/* 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() { - Search search= SearchManager.getDefault().getCurrentSearch(); - IRunnableWithProgress operation= search.getOperation(); - if (operation instanceof TextSearchOperation) { - if (validateResources((TextSearchOperation) operation)) { - ReplaceDialog dialog= new ReplaceDialog(fSite.getShell(), fElements, (TextSearchOperation)operation); - dialog.open(); - } - } else { - MessageDialog.openError(fSite.getShell(), getDialogTitle(), SearchMessages.getString("ReplaceAction.error.only_on_text_search")); //$NON-NLS-1$ - } - } - - private boolean validateResources(final TextSearchOperation operation) { - final List outOfDateEntries= new ArrayList(); - for (Iterator elements = fElements.iterator(); elements.hasNext();) { - SearchResultViewEntry entry = (SearchResultViewEntry) elements.next(); - if (isOutOfDate(entry)) { - outOfDateEntries.add(entry); - } - } - - final List outOfSyncEntries= new ArrayList(); - for (Iterator elements = fElements.iterator(); elements.hasNext();) { - SearchResultViewEntry entry = (SearchResultViewEntry) elements.next(); - if (isOutOfSync(entry)) { - outOfSyncEntries.add(entry); - } - } - - if (outOfDateEntries.size() > 0 || outOfSyncEntries.size() > 0) { - if (askForResearch(outOfDateEntries, outOfSyncEntries)) { - ProgressMonitorDialog pmd= new ProgressMonitorDialog(fSite.getShell()); - try { - pmd.run(true, true, new WorkspaceModifyOperation(null) { - protected void execute(IProgressMonitor monitor) throws CoreException { - research(monitor, outOfDateEntries, operation); - } - }); - return true; - } catch (InvocationTargetException e) { - ExceptionHandler.handle(e, fSite.getShell(), SearchMessages.getString("ReplaceAction.label"), SearchMessages.getString("ReplaceAction.research.error")); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (InterruptedException e) { - // canceled - } - } - return false; - } - return true; - } - - private void research(IProgressMonitor monitor, List outOfDateEntries, TextSearchOperation operation) throws CoreException { - IStatus status= null; - for (Iterator elements = outOfDateEntries.iterator(); elements.hasNext();) { - SearchResultViewEntry entry = (SearchResultViewEntry) elements.next(); - status = research(operation, monitor, entry); - if (status != null && !status.isOK()) { - throw new CoreException(status); - } - } - } - - private boolean askForResearch(List outOfDateEntries, List outOfSyncEntries) { - SearchAgainConfirmationDialog dialog= new SearchAgainConfirmationDialog(fSite.getShell(), outOfSyncEntries, outOfDateEntries); - return dialog.open() == IDialogConstants.OK_ID; - } - - private String getDialogTitle() { - return SearchMessages.getString("ReplaceAction.dialog.title"); //$NON-NLS-1$ - } - - private boolean isOutOfDate(SearchResultViewEntry entry) { - IResource resource= entry.getResource(); - if (entry.getModificationStamp() != resource.getModificationStamp()) - return true; - ITextFileBufferManager bm= FileBuffers.getTextFileBufferManager(); - ITextFileBuffer fb= bm.getTextFileBuffer(resource.getFullPath()); - if (fb != null && fb.isDirty()) - return true; - return false; - } - - private boolean isOutOfSync(SearchResultViewEntry entry) { - return !entry.getResource().isSynchronized(IResource.DEPTH_ZERO); - } - - private IStatus research(TextSearchOperation operation, final IProgressMonitor monitor, SearchResultViewEntry entry) throws CoreException { - List markers= new ArrayList(); - markers.addAll(entry.getMarkers()); - operation.searchInFile((IFile) entry.getResource(), new ITextSearchResultCollector() { - public IProgressMonitor getProgressMonitor() { - return monitor; - } - - public void aboutToStart() { - } - - public void accept(IResourceProxy proxy, String line, int start, int length, int lineNumber) throws CoreException { - IFile file= (IFile)proxy.requestResource(); - if (start < 0 || length < 1) - return; - IMarker marker= file.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); - } - - public void done(){ - } - }); - IStatus status = operation.getStatus(); - if (status == null || status.isOK()) { - for (Iterator markerIter = markers.iterator(); markerIter.hasNext();) { - IMarker marker = (IMarker) markerIter.next(); - marker.delete(); - } - } - return status; - } - -} 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 a967c507880..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java +++ /dev/null @@ -1,674 +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.IOException; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.filebuffers.FileBuffers; -import org.eclipse.core.filebuffers.ITextFileBuffer; -import org.eclipse.core.filebuffers.ITextFileBufferManager; -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.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.SubProgressMonitor; -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.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -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.SearchResultViewer; -import org.eclipse.search.internal.ui.util.ExtendedDialogWindow; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.swt.SWT; -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.Table; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IEditorDescriptor; -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.actions.WorkspaceModifyOperation; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.MarkerUtilities; - -class ReplaceDialog extends ExtendedDialogWindow { - - /** - * A class wrapping a resource marker, adding a position. - */ - private static class ReplaceMarker { - private Position fPosition; - private IMarker fMarker; - - ReplaceMarker(IMarker marker) { - fMarker= marker; - } - - public IFile getFile() { - return (IFile)fMarker.getResource(); - } - - public void deletePosition(IDocument doc) { - if (fPosition != null) { - MarkerUtilities.setCharStart(fMarker, fPosition.getOffset()); - MarkerUtilities.setCharEnd(fMarker, fPosition.getOffset()+fPosition.getLength()); - doc.removePosition(fPosition); - fPosition= null; - } - } - - public void delete() throws CoreException { - fMarker.delete(); - } - - public void createPosition(IDocument doc) throws BadLocationException { - if (fPosition == null) { - int charStart= MarkerUtilities.getCharStart(fMarker); - fPosition= new Position(charStart, MarkerUtilities.getCharEnd(fMarker)-charStart); - doc.addPosition(fPosition); - } - } - - public int getLength() { - if (fPosition != null) - return fPosition.getLength(); - return MarkerUtilities.getCharEnd(fMarker)-MarkerUtilities.getCharStart(fMarker); - } - - public int getOffset() { - if (fPosition != null) - return fPosition.getOffset(); - return MarkerUtilities.getCharStart(fMarker); - } - } - - private abstract static class ReplaceOperation extends WorkspaceModifyOperation { - public void execute(IProgressMonitor monitor) throws InvocationTargetException { - try { - doReplace(monitor); - } catch (BadLocationException e) { - throw new InvocationTargetException(e); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } catch (IOException e) { - throw new InvocationTargetException(e); - } - } - - protected abstract void doReplace(IProgressMonitor pm) throws BadLocationException, CoreException, IOException; - } - - // various widget related constants - private static final int REPLACE= IDialogConstants.CLIENT_ID + 1; - private static final int REPLACE_ALL_IN_FILE= IDialogConstants.CLIENT_ID + 2; - private static final int REPLACE_ALL= IDialogConstants.CLIENT_ID + 3; - private static final int SKIP= IDialogConstants.CLIENT_ID + 4; - private static final int SKIP_FILE= IDialogConstants.CLIENT_ID + 5; - private static final int SKIP_ALL= IDialogConstants.CLIENT_ID + 6; - - // Widgets - private Text fTextField; - private Button fReplaceButton; - private Button fReplaceAllInFileButton; - private Button fReplaceAllButton; - private Button fSkipButton; - private Button fSkipFileButton; - - private List fMarkers; - private TextSearchOperation fOperation; - private boolean fSkipReadonly= false; - - // reuse editors stuff - private IReusableEditor fEditor; - - protected ReplaceDialog(Shell parentShell, List entries, TextSearchOperation operation) { - super(parentShell); - Assert.isNotNull(entries); - Assert.isNotNull(operation); - fMarkers= new ArrayList(); - initializeMarkers(entries); - fOperation= operation; - } - - private void initializeMarkers(List entries) { - for (Iterator elements= entries.iterator(); elements.hasNext(); ) { - SearchResultViewEntry element= (SearchResultViewEntry)elements.next(); - List markerList= element.getMarkers(); - for (Iterator markers= markerList.iterator(); markers.hasNext(); ) { - IMarker marker= (IMarker)markers.next(); - fMarkers.add(new ReplaceMarker(marker)); - } - } - } - - // widget related stuff ----------------------------------------------------------- - public void create() { - super.create(); - Shell shell= getShell(); - shell.setText(getDialogTitle()); - gotoCurrentMarker(); - enableButtons(); - } - - protected Control createPageArea(Composite parent) { - Composite result= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - result.setLayout(layout); - layout.numColumns= 2; - - layout.marginHeight = - convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); - layout.marginWidth = - convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - layout.verticalSpacing = - convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - layout.horizontalSpacing = - convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); - - initializeDialogUnits(result); - - Label label= new Label(result, SWT.NONE); - label.setText(SearchMessages.getString("ReplaceDialog.replace_label")); //$NON-NLS-1$ - Text clabel= new Text(result, SWT.BORDER); - clabel.setEnabled(false); - clabel.setText(fOperation.getPattern()); - 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(); - - - new Label(result, SWT.NONE); - Button replaceWithRegex= new Button(result, SWT.CHECK); - replaceWithRegex.setText(SearchMessages.getString("ReplaceDialog.isRegex.label")); //$NON-NLS-1$ - replaceWithRegex.setEnabled(false); - replaceWithRegex.setSelection(false); - - applyDialogFont(result); - return result; - } - - protected void createButtonsForButtonBar(Composite parent) { - fReplaceButton= createButton(parent, REPLACE, SearchMessages.getString("ReplaceDialog.replace"), true); //$NON-NLS-1$ - fReplaceAllInFileButton= createButton(parent, REPLACE_ALL_IN_FILE, SearchMessages.getString("ReplaceDialog.replaceAllInFile"), false); //$NON-NLS-1$ - - Label filler= new Label(parent, SWT.NONE); - filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - - fReplaceAllButton= createButton(parent, REPLACE_ALL, SearchMessages.getString("ReplaceDialog.replaceAll"), false); //$NON-NLS-1$ - fSkipButton= createButton(parent, SKIP, SearchMessages.getString("ReplaceDialog.skip"), false); //$NON-NLS-1$ - fSkipFileButton= createButton(parent, SKIP_FILE, SearchMessages.getString("ReplaceDialog.skipFile"), false); //$NON-NLS-1$ - - filler= new Label(parent, SWT.NONE); - filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - super.createButtonsForButtonBar(parent); - ((GridLayout)parent.getLayout()).numColumns= 4; - } - - 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; - } - - private void enableButtons() { - fSkipButton.setEnabled(hasNextMarker()); - fSkipFileButton.setEnabled(hasNextFile()); - fReplaceButton.setEnabled(canReplace()); - fReplaceAllInFileButton.setEnabled(canReplace()); - fReplaceAllButton.setEnabled(canReplace()); - } - - protected void buttonPressed(int buttonId) { - final String replaceText= fTextField.getText(); - try { - switch (buttonId) { - case SKIP : - skip(); - break; - case SKIP_FILE : - skipFile(); - break; - case REPLACE : - run(false, true, new ReplaceOperation() { - protected void doReplace(IProgressMonitor pm) throws BadLocationException, CoreException { - replace(pm, replaceText); - } - }); - if (hasNextMarker()) - gotoCurrentMarker(); - break; - case REPLACE_ALL_IN_FILE : - run(false, true, new ReplaceOperation() { - protected void doReplace(IProgressMonitor pm) throws BadLocationException, CoreException { - replaceInFile(pm, replaceText); - - } - }); - if (hasNextFile()) - gotoCurrentMarker(); - break; - case REPLACE_ALL : - run(false, true, new ReplaceOperation() { - protected void doReplace(IProgressMonitor pm) throws BadLocationException, CoreException { - replaceAll(pm, replaceText); - } - }); - if (hasNextFile()) - gotoCurrentMarker(); - break; - default : - { - super.buttonPressed(buttonId); - return; - } - } - } catch (InvocationTargetException e) { - SearchPlugin.log(e); - String message= SearchMessages.getFormattedString("ReplaceDialog.error.unable_to_replace", getCurrentMarker().getFile().getName()); //$NON-NLS-1$ - MessageDialog.openError(getParentShell(), getDialogTitle(), message); - } catch (InterruptedException e) { - // means operation canceled - } - if (!hasNextMarker() && !hasNextFile() && !canReplace()) - close(); - else { - enableButtons(); - } - } - - private ReplaceMarker getCurrentMarker() { - return (ReplaceMarker)fMarkers.get(0); - } - - private void replace(IProgressMonitor pm, String replacementText) throws BadLocationException, CoreException { - ReplaceMarker marker= getCurrentMarker(); - pm.beginTask(SearchMessages.getString("ReplaceDialog.task.replace"), 10); //$NON-NLS-1$ - replaceInFile(pm, marker.getFile(), replacementText, new ReplaceMarker[]{marker}); - } - - private void replaceInFile(IProgressMonitor pm, String replacementText) throws BadLocationException, CoreException { - ReplaceMarker firstMarker= getCurrentMarker(); - ReplaceMarker[] markers= collectMarkers(firstMarker.getFile()); - pm.beginTask(SearchMessages.getFormattedString("ReplaceDialog.task.replaceInFile", firstMarker.getFile().getFullPath().toOSString()), 4); //$NON-NLS-1$ - replaceInFile(pm, firstMarker.getFile(), replacementText, markers); - } - - private void replaceAll(IProgressMonitor pm, String replacementText) throws BadLocationException, CoreException { - int resourceCount= countResources(); - pm.beginTask(SearchMessages.getString("ReplaceDialog.task.replace.replaceAll"), resourceCount); //$NON-NLS-1$ - while (fMarkers.size() > 0) { - replaceInFile(new SubProgressMonitor(pm, 1, 0), replacementText); - } - pm.done(); - } - - private void replaceInFile(final IProgressMonitor pm, final IFile file, final String replacementText, final ReplaceMarker[] markers) throws BadLocationException, CoreException { - if (pm.isCanceled()) - throw new OperationCanceledException(); - doReplaceInFile(pm, file, replacementText, markers); - } - - private void doReplaceInFile(IProgressMonitor pm, IFile file, String replacementText, final ReplaceMarker[] markers) throws BadLocationException, CoreException { - try { - if (file.isReadOnly()) { - file.getWorkspace().validateEdit(new IFile[]{file}, null); - } - if (file.isReadOnly()) { - if (fSkipReadonly) { - skipFile(); - return; - } - int rc= askForSkip(file); - switch (rc) { - case CANCEL : - throw new OperationCanceledException(); - case SKIP_FILE : - skipFile(); - return; - case SKIP_ALL : - fSkipReadonly= true; - skipFile(); - return; - } - } - ITextFileBufferManager bm= FileBuffers.getTextFileBufferManager(); - try { - bm.connect(file.getFullPath(), new SubProgressMonitor(pm, 1)); - ITextFileBuffer fb= bm.getTextFileBuffer(file.getFullPath()); - boolean wasDirty= fb.isDirty(); - IDocument doc= fb.getDocument(); - try { - createPositionsInFile(file, doc); - for (int i= 0; i < markers.length; i++) { - doc.replace(markers[i].getOffset(), markers[i].getLength(), replacementText); - fMarkers.remove(0); - markers[i].delete(); - } - } finally { - removePositonsInFile(file, doc); - } - if (!wasDirty) - fb.commit(new SubProgressMonitor(pm, 1), true); - } finally { - bm.disconnect(file.getFullPath(), new SubProgressMonitor(pm, 1)); - } - } finally { - pm.done(); - } - } - - private void removePositonsInFile(IFile file, IDocument doc) { - for (Iterator markers= fMarkers.iterator(); markers.hasNext(); ) { - ReplaceMarker marker= (ReplaceMarker)markers.next(); - if (!marker.getFile().equals(file)) - return; - marker.deletePosition(doc); - } - } - - private void createPositionsInFile(IFile file, IDocument doc) throws BadLocationException { - for (Iterator markers= fMarkers.iterator(); markers.hasNext(); ) { - ReplaceMarker marker= (ReplaceMarker)markers.next(); - if (!marker.getFile().equals(file)) - return; - marker.createPosition(doc); - } - } - - private int askForSkip(final IFile file) { - - String message= SearchMessages.getFormattedString("ReadOnlyDialog.message", file.getFullPath().toOSString()); //$NON-NLS-1$ - String[] buttonLabels= null; - boolean showSkip= countResources() > 1; - if (showSkip) { - String skipLabel= SearchMessages.getString("ReadOnlyDialog.skipFile"); //$NON-NLS-1$ - String skipAllLabel= SearchMessages.getString("ReadOnlyDialog.skipAll"); //$NON-NLS-1$ - buttonLabels= new String[]{skipLabel, skipAllLabel, IDialogConstants.CANCEL_LABEL}; - } else { - buttonLabels= new String[]{IDialogConstants.CANCEL_LABEL}; - - } - - MessageDialog msd= new MessageDialog(getShell(), getShell().getText(), null, message, MessageDialog.ERROR, buttonLabels, 0); - int rc= msd.open(); - switch (rc) { - case 0 : - return showSkip ? SKIP_FILE : CANCEL; - case 1 : - return SKIP_ALL; - default : - return CANCEL; - } - } - - private String getDialogTitle() { - return SearchMessages.getString("ReplaceDialog.dialog.title"); //$NON-NLS-1$ - } - - private void skip() { - fMarkers.remove(0); - Assert.isTrue(fMarkers.size() > 0); - gotoCurrentMarker(); - } - - private void skipFile() { - ReplaceMarker currentMarker= getCurrentMarker(); - if (currentMarker == null) - return; - IResource currentFile= currentMarker.getFile(); - while (fMarkers.size() > 0 && getCurrentMarker().getFile().equals(currentFile)) - fMarkers.remove(0); - if (fMarkers.size() > 0) - gotoCurrentMarker(); - } - - private void gotoCurrentMarker() { - if (fMarkers.size() > 0) { - ReplaceMarker marker= getCurrentMarker(); - Control focusControl= getShell().getDisplay().getFocusControl(); - try { - selectEntry(marker); - ITextEditor editor= null; - if (SearchUI.reuseEditor()) - editor= openEditorReuse(marker); - else - editor= openEditorNoReuse(marker); - editor.selectAndReveal(marker.getOffset(), marker.getLength()); - if (focusControl != null && !focusControl.isDisposed()) - focusControl.setFocus(); - } catch (PartInitException e) { - String message= SearchMessages.getFormattedString("ReplaceDialog.error.unable_to_open_text_editor", marker.getFile().getName()); //$NON-NLS-1$ - MessageDialog.openError(getParentShell(), getDialogTitle(), message); - } - } - } - - private void selectEntry(ReplaceMarker marker) { - SearchResultView view= (SearchResultView) SearchPlugin.getSearchResultView(); - if (view == null) - return; - SearchResultViewer viewer= view.getViewer(); - if (viewer == null) - return; - ISelection sel= viewer.getSelection(); - if (!(sel instanceof IStructuredSelection)) - return; - IStructuredSelection ss= (IStructuredSelection) sel; - IFile file= marker.getFile(); - if (ss.size() == 1 && file.equals(ss.getFirstElement())) - return; - Table table= viewer.getTable(); - if (table == null || table.isDisposed()) - return; - int selectionIndex= table.getSelectionIndex(); - if (selectionIndex < 0) - selectionIndex= 0; - for (int i= 0; i < table.getItemCount(); i++) { - int currentTableIndex= (selectionIndex+i) % table.getItemCount(); - SearchResultViewEntry entry= (SearchResultViewEntry) viewer.getElementAt(currentTableIndex); - if (file.equals(entry.getGroupByKey())) { - viewer.setSelection(new StructuredSelection(entry)); - return; - } - } - } - - // opening editors ------------------------------------------ - private ITextEditor openEditorNoReuse(ReplaceMarker marker) throws PartInitException { - IFile file= marker.getFile(); - IWorkbenchPage activePage= SearchPlugin.getActivePage(); - if (activePage == null) - return null; - ITextEditor textEditor= showOpenTextEditor(activePage, file); - if (textEditor != null) - return textEditor; - return openNewTextEditor(file, activePage); - } - - private ITextEditor openNewTextEditor(IFile file, IWorkbenchPage activePage) throws PartInitException { - IEditorDescriptor desc= IDE.getDefaultEditor(file); - if (desc != null) { - String editorID= desc.getId(); - IEditorPart editor; - if (desc.isInternal()) { - editor= activePage.openEditor(new FileEditorInput(file), editorID); - if (editor instanceof ITextEditor) { - if (editor instanceof IReusableEditor) - fEditor= (IReusableEditor) editor; - return (ITextEditor)editor; - } else - activePage.closeEditor(editor, false); - } - } - IEditorPart editor= activePage.openEditor(new FileEditorInput(file), "org.eclipse.ui.DefaultTextEditor"); //$NON-NLS-1$ - return (ITextEditor)editor; - } - - private ITextEditor openEditorReuse(ReplaceMarker marker) throws PartInitException { - IWorkbenchPage page= SearchPlugin.getActivePage(); - IFile file= marker.getFile(); - if (page == null) - return null; - - ITextEditor textEditor= showOpenTextEditor(page, file); - if (textEditor != null) - return textEditor; - - String editorId= null; - IEditorDescriptor desc= IDE.getDefaultEditor(file); - if (desc != null && desc.isInternal()) - editorId= desc.getId(); - - boolean isOpen= isEditorOpen(page, fEditor); - - boolean canBeReused= isOpen && !fEditor.isDirty() && !isPinned(fEditor); - boolean showsSameInputType= fEditor != null && (editorId == null || fEditor.getSite().getId().equals(editorId)); - - if (canBeReused) { - if (showsSameInputType) { - fEditor.setInput(new FileEditorInput(file)); - page.bringToTop(fEditor); - return (ITextEditor) fEditor; - } else { - page.closeEditor(fEditor, false); - fEditor= null; - } - } - return openNewTextEditor(file, page); - } - - private boolean isEditorOpen(IWorkbenchPage page, IEditorPart editor) { - if (editor != null) { - IEditorReference[] parts= page.getEditorReferences(); - int i= 0; - for (int j = 0; j < parts.length; j++) { - if (editor == parts[i++].getEditor(false)) - return true; - } - } - return false; - } - - private ITextEditor showOpenTextEditor(IWorkbenchPage page, IFile file) { - IEditorPart editor= page.findEditor(new FileEditorInput(file)); - if (editor instanceof ITextEditor) { - page.bringToTop(editor); - return (ITextEditor) editor; - } - return null; - } - - 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; - } - - // resource related ------------------------------------------------------------- - /** - * @return the number of resources referred to in fMarkers - */ - private int countResources() { - IResource r= null; - int count= 0; - for (Iterator elements= fMarkers.iterator(); elements.hasNext(); ) { - ReplaceMarker element= (ReplaceMarker)elements.next(); - if (!element.getFile().equals(r)) { - count++; - r= element.getFile(); - } - } - return count; - } - - private ReplaceMarker[] collectMarkers(IResource resource) { - List matching= new ArrayList(); - for (int i= 0; i < fMarkers.size(); i++) { - ReplaceMarker marker= (ReplaceMarker)fMarkers.get(i); - if (!marker.getFile().equals(resource)) - break; - matching.add(marker); - } - ReplaceMarker[] markers= new ReplaceMarker[matching.size()]; - return (ReplaceMarker[])matching.toArray(markers); - } - - - // some queries ------------------------------------------------------------- - private boolean hasNextMarker() { - return fMarkers.size() > 1; - } - - private boolean hasNextFile() { - if (!hasNextMarker()) - return false; - IResource currentFile= getCurrentMarker().getFile(); - for (int i= 0; i < fMarkers.size(); i++) { - if (!((ReplaceMarker)fMarkers.get(i)).getFile().equals(currentFile)) - return true; - } - return false; - } - - private boolean canReplace() { - return fMarkers.size() > 0; - } -}
\ No newline at end of file diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java deleted file mode 100644 index 591a085d8cb..00000000000 --- 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 333f8c2288e..00000000000 --- 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/SearchAgainConfirmationDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/SearchAgainConfirmationDialog.java deleted file mode 100644 index 543c6bb7874..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/SearchAgainConfirmationDialog.java +++ /dev/null @@ -1,124 +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.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TableViewer; -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.util.ListContentProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -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; - -/** - * Dialog telling the user that files are out of sync or matches - * are stale and asks for confirmation to refresh/search again - * @since 3.0 - */ - -public class SearchAgainConfirmationDialog extends Dialog { - private List fOutOfSync; - private List fOutOfDate; - - private static class ProxyLabelProvider extends LabelProvider { - private ILabelProvider fLabelProvider; - - ProxyLabelProvider() { - SearchResultView view= (SearchResultView) SearchPlugin.getSearchResultView(); - if (view != null) - fLabelProvider= view.getLabelProvider(); - else - fLabelProvider= null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) - */ - public Image getImage(Object element) { - if (fLabelProvider != null) - return fLabelProvider.getImage(element); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - if (fLabelProvider != null) - return fLabelProvider.getText(element); - return null; - } - - } - - SearchAgainConfirmationDialog(Shell shell, List outOfSync, List outOfDate) { - super(shell); - fOutOfSync= outOfSync; - fOutOfDate= outOfDate; - setShellStyle(getShellStyle() | SWT.RESIZE); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createDialogArea(Composite parent) { - Composite result= (Composite) super.createDialogArea(parent); - - if (fOutOfSync.size() > 0) { - createLabel(result, SearchMessages.getString("SearchAgainConfirmationDialog.outofsync.message")); //$NON-NLS-1$ - - createLabel(result, SearchMessages.getString("SearchAgainConfirmationDialog.outofsync.label")); //$NON-NLS-1$ - createTableViewer(fOutOfSync, result); - } else { - createLabel(result, SearchMessages.getString("SearchAgainConfirmationDialog.stale.message")); //$NON-NLS-1$ - } - - createLabel(result, SearchMessages.getString("SearchAgainConfirmationDialog.stale.label")); //$NON-NLS-1$ - createTableViewer(fOutOfDate, result); - return result; - } - - private void createLabel(Composite parent, String text) { - Label message= new Label(parent, SWT.WRAP); - GridData gd= new GridData(GridData.FILL_HORIZONTAL); - gd.widthHint= convertWidthInCharsToPixels(40); - message.setLayoutData(gd); - message.setText(text); - } - - private TableViewer createTableViewer(List input, Composite result) { - TableViewer viewer= new TableViewer(result); - viewer.setContentProvider(new ListContentProvider()); - viewer.setLabelProvider(new ProxyLabelProvider()); - viewer.setInput(input); - GridData gd= new GridData(GridData.FILL_BOTH); - gd.widthHint= convertWidthInCharsToPixels(40); - gd.heightHint= convertHeightInCharsToPixels(5); - viewer.getControl().setLayoutData(gd); - return viewer; - } - - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(SearchMessages.getString("SearchAgainConfirmationDialog.title")); //$NON-NLS-1$ - } - -} 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 44418875b0a..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java +++ /dev/null @@ -1,154 +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.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.search.internal.ui.SearchManager; -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.SearchResultViewer; -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.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPartSite; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.ui.actions.OpenWithMenu; -import org.eclipse.ui.dialogs.PropertyDialogAction; - -/** - * 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(), getSearchResultEntries()); - 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 List getSearchResultEntries() { - SearchResultView view= (SearchResultView) SearchPlugin.getSearchResultView(); - // we can assume we have a view, how else would we be called? - SearchResultViewer viewer= view.getViewer(); - Table table= viewer.getTable(); - TableItem[] items= table.getItems(); - List elements = new ArrayList(items.length); - for (int i = 0; i < items.length; i++) { - elements.add(items[i].getData()); - } - return elements; - } - - 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(ActionFactory.PROPERTIES.getId(), 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 5500c99e8a1..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java +++ /dev/null @@ -1,103 +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.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.search.internal.core.ISearchScope; -import org.eclipse.search.internal.core.text.ITextSearchResultCollector; -import org.eclipse.search.internal.core.text.MatchLocator; -import org.eclipse.search.internal.core.text.TextSearchEngine; -import org.eclipse.search.internal.core.text.TextSearchScope; -import org.eclipse.search.internal.ui.SearchMessages; -import org.eclipse.search.internal.ui.SearchPluginImages; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/** - * 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 MatchLocator fMatchLocator; - 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) { - super(null); - Assert.isNotNull(collector); - fWorkspace= workspace; - fMatchLocator= new MatchLocator(pattern, 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, fScope, fCollector, fMatchLocator); - } - - void searchInFile(IFile file, ITextSearchResultCollector collector) { - TextSearchEngine engine= new TextSearchEngine(); - TextSearchScope scope= new TextSearchScope(""); //$NON-NLS-1$ - scope.add(file); - scope.addExtension("*"); //$NON-NLS-1$ - fStatus= engine.search(fWorkspace, scope, collector, fMatchLocator); - } - - String getSingularLabel() { - String pattern= fMatchLocator.getPattern(); - if (pattern == null || pattern.length() < 1) - return SearchMessages.getFormattedString("FileSearchOperation.singularLabelPostfix", new String[] {fScope.getDescription()}); //$NON-NLS-1$ - else - return SearchMessages.getFormattedString("TextSearchOperation.singularLabelPostfix", new String[] {fMatchLocator.getPattern(), fScope.getDescription()}); //$NON-NLS-1$ - } - - String getPluralLabelPattern() { - String pattern= fMatchLocator.getPattern(); - if (pattern == null || pattern.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[] {fMatchLocator.getPattern(), "{0}", fScope.getDescription()}); //$NON-NLS-2$ //$NON-NLS-1$ - } - - ImageDescriptor getImageDescriptor() { - return SearchPluginImages.DESC_OBJ_TSEARCH_DPDN; - } - - IStatus getStatus() { - return fStatus; - } - - String getPattern() { - return fMatchLocator.getPattern(); - } - - boolean isRegexSearch() { - return fMatchLocator.isRegExSearch(); - } -} 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 53563f6036a..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java +++ /dev/null @@ -1,698 +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 java.util.regex.PatternSyntaxException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -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.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.MessageDialog; -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.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.SearchResultView; -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; -import org.eclipse.search.ui.IReplacePage; -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.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.model.IWorkbenchAdapter; - -public class TextSearchPage extends DialogPage implements ISearchPage, IReplacePage { - - 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 final static String STORE_IS_REG_EX_SEARCH= PAGE_NAME + "REG_EX_SEARCH"; //$NON-NLS-1$ - - private static List fgPreviousSearchPatterns= new ArrayList(20); - - private IDialogSettings fDialogSettings; - private boolean fFirstTime= true; - private boolean fIsCaseSensitive; - private boolean fIsRegExSearch; - - private Combo fPattern; - private Button fIgnoreCase; - private Combo fExtensions; - private Button fIsRegExCheckbox; - private Label fHintLabel; - - private ISearchPageContainer fContainer; - private FileTypeEditor fFileTypeEditor; - - - private static class SearchPatternData { - boolean ignoreCase; - boolean isRegExSearch; - String textPattern; - Set fileNamePatterns; - int scope; - IWorkingSet[] workingSets; - - public SearchPatternData(String textPattern, boolean ignoreCase, boolean isRegExSearch, Set fileNamePatterns, int scope, IWorkingSet[] workingSets) { - this.ignoreCase= ignoreCase; - this.isRegExSearch= isRegExSearch; - this.textPattern= textPattern; - this.fileNamePatterns= fileNamePatterns; - this.scope= scope; - this.workingSets= workingSets; - } - } - //---- Action Handling ------------------------------------------------ - - public boolean performAction() { - - TextSearchOperation op = createTextSearchOperation(); - - return runOperation(op); - } - - private boolean runOperation(final TextSearchOperation op) { - 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) { - if (ex.getTargetException() instanceof PatternSyntaxException) - showRegExSyntaxError((PatternSyntaxException)ex.getTargetException()); - else - 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 false; - } - - return true; - } - - private TextSearchOperation createTextSearchOperation() { - - 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(false); - break; - case ISearchPageContainer.SELECTED_PROJECTS_SCOPE: - scope= getSelectedResourcesScope(true); - 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); - - SearchUI.activateSearchResultView(); - TextSearchResultCollector collector= new TextSearchResultCollector(); - - final TextSearchOperation op= new TextSearchOperation( - SearchPlugin.getWorkspace(), - patternData.textPattern, - getSearchOptions(), - scope, - collector); - return op; - } - - /* (non-Javadoc) - * @see org.eclipse.search.ui.IReplacePage#performReplace() - */ - public boolean performReplace() { - final TextSearchOperation op= createTextSearchOperation(); - - if (!runOperation(op)) - return false; - - Display.getCurrent().asyncExec(new Runnable() { - public void run() { - SearchResultView view= (SearchResultView) SearchPlugin.getSearchResultView(); - new ReplaceDialog(SearchPlugin.getSearchResultView().getViewSite().getShell(), (List) view.getViewer().getInput(), op).open(); - } - }); - return true; - } - - private void showRegExSyntaxError(PatternSyntaxException ex) { - String title= SearchMessages.getString("SearchPage.regularExpressionSyntaxProblem.title"); //$NON-NLS-1$ - MessageDialog.openInformation(getShell(), title, ex.getLocalizedMessage()); - } - - 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.isRegExSearch= fIsRegExCheckbox.getSelection(); - 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(), - fIsRegExCheckbox.getSelection(), - 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$ - - if (fIsRegExSearch) - result.append("r"); //$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_BEGINNING); - 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 - fHintLabel= new Label(group, SWT.LEFT); - fHintLabel.setText(SearchMessages.getString("SearchPage.containingText.hint")); //$NON-NLS-1$ - fHintLabel.setVisible(!fIsRegExSearch); - gd= new GridData(GridData.BEGINNING); - gd.horizontalSpan= 2; - fHintLabel.setLayoutData(gd); - - // RegEx checkbox - fIsRegExCheckbox= new Button(group, SWT.CHECK); - fIsRegExCheckbox.setText(SearchMessages.getString("SearchPage.regularExpression")); //$NON-NLS-1$ - gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); - fIsRegExCheckbox.setLayoutData(gd); - fIsRegExCheckbox.setSelection(fIsRegExSearch); - fIsRegExCheckbox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - fIsRegExSearch= fIsRegExCheckbox.getSelection(); - fHintLabel.setVisible(!fIsRegExSearch); - writeConfiguration(); - } - }); - - 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); - fIsRegExCheckbox.setSelection(patternData.isRegExSearch); - fHintLabel.setVisible(!patternData.isRegExSearch); - 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= ((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(boolean isProjectScope) { - TextSearchScope scope= new TextSearchScope(SearchMessages.getString("SelectionScope")); //$NON-NLS-1$ - int elementCount= 0; - IProject firstProject= null; - 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(); - - IResource resource= null; - if (selection instanceof IResource) - resource= (IResource)selection; - else if (selection instanceof IAdaptable) { - if (isProjectScope) - resource= (IProject)((IAdaptable)selection).getAdapter(IProject.class); - if (resource == null) - resource= (IResource)((IAdaptable)selection).getAdapter(IResource.class); - } - if (resource != null) { - - if (isProjectScope) { - resource= resource.getProject(); - if (resource == null || isProjectScope && scope.encloses(resource)) - continue; - if (firstProject == null) - firstProject= (IProject)resource; - } - elementCount++; - scope.add(resource); - } - } - } else if (isProjectScope) { - IProject editorProject= getEditorProject(); - if (editorProject != null)scope.add(editorProject); - } - if (isProjectScope) { - if (elementCount > 1) - scope.setDescription(SearchMessages.getFormattedString("EnclosingProjectsScope", firstProject.getName())); //$NON-NLS-1$ - else if (elementCount == 1) - scope.setDescription(SearchMessages.getFormattedString("EnclosingProjectScope", firstProject.getName())); //$NON-NLS-1$ - else - scope.setDescription(SearchMessages.getFormattedString("EnclosingProjectScope", "")); //$NON-NLS-1$ //$NON-NLS-2$ - } - return scope; - } - - private IProject getEditorProject() { - IWorkbenchPart activePart= SearchPlugin.getActivePage().getActivePart(); - if (activePart instanceof IEditorPart) { - IEditorPart editor= (IEditorPart) activePart; - IEditorInput input= editor.getEditorInput(); - if (input instanceof IFileEditorInput) { - return ((IFileEditorInput)input).getFile().getProject(); - } - } - return null; - } - //--------------- 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); - fIsRegExSearch= s.getBoolean(STORE_IS_REG_EX_SEARCH); - } - - /** - * Stores it current configuration in the dialog store. - */ - private void writeConfiguration() { - IDialogSettings s= getDialogSettings(); - s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); - s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch); - } -} 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 cbb14eb3448..00000000000 --- 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 877d9a3fcce..00000000000 --- 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 1cf4a324005..00000000000 --- 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 1f5c705f58b..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java +++ /dev/null @@ -1,356 +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 java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.runtime.IProgressMonitor; -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.util.Assert; -import org.eclipse.jface.wizard.ProgressMonitorPart; -import org.eclipse.search.internal.ui.SearchMessages; -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; - - -public abstract class ExtendedDialogWindow extends Dialog implements IRunnableContext { - - private Control fContents; - private Button fCancelButton; - private Set fActionButtons; - - // The number of long running operation executed from the dialog. - private long fActiveRunningOperations; - - // 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); - fActionButtons= new HashSet(); - } - - //---- 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(int buttonId) { - 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) { - fCancelButton= createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - } - - protected Button createActionButton(Composite parent, int id, String label, - boolean defaultButton) { - Button actionButton= createButton(parent, id, label, defaultButton); - fActionButtons.add(actionButton); - return actionButton; - } - - /** - * 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); - fContents.setLayoutData(new GridData(GridData.FILL_BOTH)); - - // 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.CANCEL_ID: - if (fActiveRunningOperations == 0) - close(); - break; - default: - if (performAction(buttonId)) - close(); - } - } - - //---- Setters and Getters -------------------------------------------------- - - /** - * Set the enable state of the perform action button. - */ - public void setPerformActionEnabled(boolean state) { - for (Iterator buttons = fActionButtons.iterator(); buttons.hasNext(); ) { - Button element = (Button) buttons.next(); - element.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; - 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); //$NON-NLS-1$ - for (Iterator actionButtons = fActionButtons.iterator(); actionButtons.hasNext(); ) { - Button button = (Button) actionButtons.next(); - restoreEnableState(button, state); - } - 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) { - if (!w.isDisposed()) { - Boolean b= (Boolean)h.get(w); - if (b != null) - w.setEnabled(b.booleanValue()); - } - } - - private HashMap saveUIState(boolean keepCancelEnabled) { - HashMap savedState= new HashMap(10); - saveEnableStateAndSet(fCancelButton, savedState, keepCancelEnabled); //$NON-NLS-1$ - for (Iterator actionButtons = fActionButtons.iterator(); actionButtons.hasNext(); ) { - Button button = (Button) actionButtons.next(); - saveEnableStateAndSet(button, savedState, false); - } - savedState.put("tabForm", ControlEnableState.disable(fContents)); //$NON-NLS-1$ - - return savedState; - } - - private void saveEnableStateAndSet(Control w, HashMap h, boolean enabled) { - if (!w.isDisposed()) { - h.put(w, 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 771da1589d0..00000000000 --- 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 1cc0730c0c3..00000000000 --- 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.jface.window.Window; - -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; - - final static String TYPE_DELIMITER= SearchMessages.getString("FileTypeEditor.typeDelimiter"); //$NON-NLS-1$ - - public FileTypeEditor(IEditorRegistry registry, Combo textField, Button browseButton) { - 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() == Window.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 715c28cd981..00000000000 --- 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 bbe8b4e6e30..00000000000 --- 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 8678516e26b..00000000000 --- 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/PixelConverter.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/PixelConverter.java deleted file mode 100644 index 4a8bee42bab..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/PixelConverter.java +++ /dev/null @@ -1,58 +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.graphics.FontMetrics; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.widgets.Control; - -import org.eclipse.jface.dialogs.Dialog; - -public class PixelConverter { - - private FontMetrics fFontMetrics; - - public PixelConverter(Control control) { - GC gc = new GC(control); - gc.setFont(control.getFont()); - fFontMetrics= gc.getFontMetrics(); - gc.dispose(); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int) - */ - public int convertHeightInCharsToPixels(int chars) { - return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int) - */ - public int convertHorizontalDLUsToPixels(int dlus) { - return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int) - */ - public int convertVerticalDLUsToPixels(int dlus) { - return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int) - */ - public int convertWidthInCharsToPixels(int chars) { - return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); - } - -} 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 a8540b94b99..00000000000 --- 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 83cd7e562a8..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java +++ /dev/null @@ -1,122 +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.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.Table; -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; - } - - - /** - * Returns a width hint for a button control. - */ - public static int getButtonWidthHint(Button button) { - if (button.getFont().equals(JFaceResources.getDefaultFont())) - button.setFont(JFaceResources.getDialogFont()); - PixelConverter converter= new PixelConverter(button); - int widthHint= converter.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 getButtonHeightHint(Button button) { - if (button.getFont().equals(JFaceResources.getDefaultFont())) - button.setFont(JFaceResources.getDialogFont()); - PixelConverter converter= new PixelConverter(button); - return converter.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= getButtonHeightHint(button); - ((GridData)gd).widthHint= getButtonWidthHint(button); - } - } - - public static int getTableHeightHint(Table table, int rows) { - if (table.getFont().equals(JFaceResources.getDefaultFont())) - table.setFont(JFaceResources.getDialogFont()); - int result= table.getItemHeight() * rows + table.getHeaderHeight(); - if (table.getLinesVisible()) - result+= table.getGridLineWidth() * (rows - 1); - return result; - } - - -} 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 485d59572df..00000000000 --- 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 f22876e545b..00000000000 --- 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 ca20099c63a..00000000000 --- 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 96741e19566..00000000000 --- 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 776ff356334..00000000000 --- 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/IReplacePage.java b/org.eclipse.search/search/org/eclipse/search/ui/IReplacePage.java deleted file mode 100644 index 11abd3dd388..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/ui/IReplacePage.java +++ /dev/null @@ -1,31 +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; - -/** - * An extension interface to <code>ISearchPage</code>. If clients implement - * <code>IReplacePage</code> in addition to <code>ISearchPage</code>, a - * "Replace" button will be shown in the search dialog. - * - * @since 3.0 - */ -public interface IReplacePage { - - /** - * Performs the replace action for this page. - * The search dialog calls this method when the Replace - * button is pressed. - * - * @return <code>true</code> if the dialog can be closed after execution - */ - public boolean performReplace(); - -} 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 76fea75eb6e..00000000000 --- 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 27f6f4cdec9..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java +++ /dev/null @@ -1,121 +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; - - /** - * Current Project scope (value <code>3</code>). - * - * @since 3.0 - */ - public static final int SELECTED_PROJECTS_SCOPE= 3; - - /** - * 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, SELECTED_PROJECTS_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, SELECTED_PROJECTS_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 e0caced8766..00000000000 --- 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><page></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 b8ae3133e01..00000000000 --- 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 08a4c408fcc..00000000000 --- 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 f89aaa537b6..00000000000 --- 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 f92908814cb..00000000000 --- 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> |