diff options
Diffstat (limited to 'plugins/org.eclipse.wst.common.ui/src-search/org/eclipse/wst/common/ui/internal/search/SearchResult.java')
-rw-r--r-- | plugins/org.eclipse.wst.common.ui/src-search/org/eclipse/wst/common/ui/internal/search/SearchResult.java | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/plugins/org.eclipse.wst.common.ui/src-search/org/eclipse/wst/common/ui/internal/search/SearchResult.java b/plugins/org.eclipse.wst.common.ui/src-search/org/eclipse/wst/common/ui/internal/search/SearchResult.java deleted file mode 100644 index c26fb9cd0..000000000 --- a/plugins/org.eclipse.wst.common.ui/src-search/org/eclipse/wst/common/ui/internal/search/SearchResult.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.common.ui.internal.search; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.search.internal.ui.SearchPluginImages; -import org.eclipse.search.ui.ISearchQuery; -import org.eclipse.search.ui.text.AbstractTextSearchResult; -import org.eclipse.search.ui.text.IEditorMatchAdapter; -import org.eclipse.search.ui.text.IFileMatchAdapter; -import org.eclipse.search.ui.text.Match; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; - -public class SearchResult extends AbstractTextSearchResult implements IEditorMatchAdapter, IFileMatchAdapter { - private final Match[] EMPTY_ARR= new Match[0]; - - private AbstractSearchQuery fQuery; - - public SearchResult(AbstractSearchQuery job) { - fQuery= job; - } - public ImageDescriptor getImageDescriptor() { - return SearchPluginImages.DESC_OBJ_TSEARCH_DPDN; - } - public String getLabel() { - return fQuery.getResultLabel(getMatchCount()); - } - public String getTooltip() { - return getLabel(); - } - - public Match[] computeContainedMatches(AbstractTextSearchResult result, IFile file) { - return getMatches(file); - } - - public IFile getFile(Object element) { - if (element instanceof IFile) - return (IFile)element; - return null; - } - - public boolean isShownInEditor(Match match, IEditorPart editor) { - IEditorInput ei= editor.getEditorInput(); - if (ei instanceof IFileEditorInput) { - IFileEditorInput fi= (IFileEditorInput) ei; - return match.getElement().equals(fi.getFile()); - } - return false; - } - - public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) { - IEditorInput ei= editor.getEditorInput(); - if (ei instanceof IFileEditorInput) { - IFileEditorInput fi= (IFileEditorInput) ei; - return getMatches(fi.getFile()); - } - return EMPTY_ARR; - } - - public ISearchQuery getQuery() { - return fQuery; - } - - public IFileMatchAdapter getFileMatchAdapter() { - return this; - } - - public IEditorMatchAdapter getEditorMatchAdapter() { - return this; - } -}
\ No newline at end of file |