KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > ui > ISearchResultPage


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.search.ui;
12 import org.eclipse.ui.IMemento;
13 import org.eclipse.ui.part.IPageBookViewPage;
14 /**
15  * Interface to be implemented by contributors to the extension point <code>org.eclipse.search.searchResultViewPages</code>.
16  * A <code>ISearchResultPage</code> is used to show the search results for a
17  * particular class of <code>ISearchResult</code> (as specified in the
18  * <code>searchResultClass</code> attribute of the extension point) in the search
19  * result view. <br>
20  * <p>
21  * Clients may implement this interface.
22  * </p>
23  * @since 3.0
24  */

25 public interface ISearchResultPage extends IPageBookViewPage {
26     /**
27      * Returns an object representing the current user interface state of the
28      * page. For example, the current selection in a viewer. The UI state will
29      * be later passed into the <code>setInput()</code> method when the
30      * currently shown <code>ISearchResult</code> is shown again.
31      *
32      * @return an object representing the UI state of this page
33      */

34     Object JavaDoc getUIState();
35     /**
36      * Sets the search result to be shown in this search results page.
37      * Implementers should restore UI state (e.g. selection) from the previously
38      * saved <code>uiState</code> object.
39      *
40      * @param search the search result to be shown or <code>null</code> to clear the page.
41      * @param uiState the previously saved UI state
42      *
43      * @see ISearchResultPage#getUIState()
44      */

45     void setInput(ISearchResult search, Object JavaDoc uiState);
46     /**
47      * Sets the search view this search results page is shown in. This method
48      * will be called before the page is shown for the first time (i.e. before
49      * the page control is created).
50      *
51      * @param part
52      * the parent search view
53      */

54     void setViewPart(ISearchResultViewPart part);
55     /**
56      * Restores the page state. Note that this applies only to state that is
57      * saved across sessions.
58      *
59      * @param memento a memento to restore the page state from or <code>null</code>
60      * if no previous state was saved
61      *
62      * @see #setInput(ISearchResult, Object)
63      */

64     void restoreState(IMemento memento);
65     /**
66      * Saves the page state in a memento. Note that this applies to state that
67      * should persist across sessions.
68      *
69      * @param memento a memento to receive the object state
70      *
71      * @see #getUIState()
72      */

73     void saveState(IMemento memento);
74     /**
75      * Sets the id for this page. This method will be called before any other
76      * initialization is done.
77      *
78      * @param id the id for this page
79      */

80     void setID(String JavaDoc id);
81     /**
82      * Returns the id set via <code>setID</code>.
83      *
84      * @return the id of this page
85      */

86     String JavaDoc getID();
87     
88     /**
89      * Returns a user readable label for this search result page. The label will be
90      * used to describe the contents for the page to the user (for example it will be
91      * displayed in the search view title bar). To take an example from file search,
92      * a label might read like this: 'test' - 896 matches in workspace.
93      *
94      * @return the user readable label for this search result page
95      */

96     String JavaDoc getLabel();
97 }
98
Popular Tags