KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > ui > internal > search > HelpSearchResult


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others. All rights reserved.
3  * This program and the accompanying materials are made available under the
4  * terms of the Common Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/cpl-v10.html
6  *
7  * Contributors: IBM Corporation - initial API and implementation
8  ******************************************************************************/

9 package org.eclipse.help.ui.internal.search;
10 import java.text.*;
11
12 import org.eclipse.help.ui.internal.ide.*;
13 import org.eclipse.jface.resource.*;
14 import org.eclipse.search.ui.text.*;
15 public class HelpSearchResult extends AbstractTextSearchResult {
16     private static final ImageDescriptor IMAGE_DSCR_SEARCH = ImageDescriptor
17             .createFromURL(HelpIdeResources
18                     .getImagePath(IHelpIdeConstants.IMAGE_FILE_SEARCH));
19     private HelpSearchQuery query;
20     public HelpSearchResult(HelpSearchQuery query) {
21         super();
22         this.query = query;
23     }
24     public String JavaDoc getLabel() {
25         if (getMatchCount() == 1) {
26             return query.getSingularLabel();
27         } else
28             return MessageFormat.format(query.getPluralLabelpattern(),
29                     new Object JavaDoc[]{new Integer JavaDoc(getMatchCount())});
30     }
31     public String JavaDoc getTooltip() {
32         return getLabel();
33     }
34     public ImageDescriptor getImageDescriptor() {
35         return IMAGE_DSCR_SEARCH;
36     }
37     public org.eclipse.search.ui.ISearchQuery getQuery() {
38         return query;
39     }
40     public IEditorMatchAdapter getEditorMatchAdapter() {
41         return null;
42     }
43     public IFileMatchAdapter getFileMatchAdapter() {
44         return null;
45     }
46 }
Popular Tags