KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > plugin > BlankQuery


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.pde.internal.ui.editor.plugin;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.core.runtime.OperationCanceledException;
16 import org.eclipse.core.runtime.Status;
17 import org.eclipse.pde.internal.core.text.bundle.PackageObject;
18 import org.eclipse.pde.internal.ui.IPDEUIConstants;
19 import org.eclipse.pde.internal.ui.search.SearchResult;
20 import org.eclipse.search.ui.ISearchQuery;
21 import org.eclipse.search.ui.ISearchResult;
22
23 public class BlankQuery implements ISearchQuery {
24     
25     private PackageObject fObject;
26     
27     BlankQuery(PackageObject object) {
28         fObject = object;
29     }
30
31     public IStatus run(IProgressMonitor monitor)
32             throws OperationCanceledException {
33         monitor.done();
34         return new Status(IStatus.OK, IPDEUIConstants.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
35
}
36
37     public String JavaDoc getLabel() {
38         return '\'' + fObject.getName() + '\'';
39     }
40
41     public boolean canRerun() {
42         return true;
43     }
44
45     public boolean canRunInBackground() {
46         return true;
47     }
48
49     public ISearchResult getSearchResult() {
50         return new SearchResult(this);
51     }
52
53 }
54
Popular Tags