KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search2 > internal > ui > ShowSearchAction


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

11 package org.eclipse.search2.internal.ui;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.jface.resource.ImageDescriptor;
15
16 import org.eclipse.search.ui.ISearchResult;
17
18
19 class ShowSearchAction extends Action {
20     private ISearchResult fSearch;
21     private SearchView fView;
22     
23     /*
24      * Create a new instance of this class
25      */

26     public ShowSearchAction(SearchView view, ISearchResult search, String JavaDoc text, ImageDescriptor image, String JavaDoc tooltip) {
27         fSearch= search;
28         fView= view;
29         // fix for bug 38049
30
if (text.indexOf('@') >= 0)
31             text+= '@';
32         setText(text);
33         setImageDescriptor(image);
34         setToolTipText(tooltip);
35     }
36     
37     public void run() {
38         fView.showSearchResult(fSearch);
39     }
40 }
41
Popular Tags