blob: 84b1fc9dc9ed7c8c3a1b563425d85a3eaf96f890 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.search.ui;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.part.IPageBookViewPage;
/**
* A <code>ISearchResultPage</code> is used to render the search results for a
* particular class of <code>ISearchResult</code> (as specified in the
* <code>searchResultClass</code> attribute of the extension point) in the search
* view. <br>
* Extensions of extension point <code>org.eclipse.search.ui.searchResultViewPages</code>
* must implement this interface.
* <p>
* Clients may implement this interface.
* </p>
* @since 3.0
*/
public interface ISearchResultPage extends IPageBookViewPage {
/**
* Returns an Object representing the current user interface state of the
* page. For example, the current selection in a viewer. The UI state will
* be later passed into the <code>setInput()</code> method when the
* currently shown <code>ISearchResult</code> is shown again.
*
* @return an object representing the UI state of this page
*/
Object getUIState();
/**
* Sets the search result to be shown in this search results page.
* Implementers should restore UI state (e.g. selection) from the previously
* saved <code>uiState</code> object.
*
* @param search the search result to be shown
* @param uiState the previously saved UI state
*
* @see ISearchResultPage#getUIState()
*/
void setInput(ISearchResult search, Object uiState);
/**
* Sets the search view this search results page is shown in. This method
* will be called before the page is shown for the first time (i.e. before
* the page control is created).
*
* @param part
* the parent search view
*/
void setViewPart(ISearchResultViewPart part);
/**
* Restores the page state. Note that this applies only to state that is
* saved across sessions.
*
* @param memento a memento to restore the page state from or <code>null</code>
* if no previous state was saved
*
* @see #setInput(ISearchResult, Object)
*/
void restoreState(IMemento memento);
/**
* Saves the page state in a memento. Note that this applies to state that
* should persist across sessions.
*
* @param memento a memento to receive the object state
*
* @see #getUIState()
*/
void saveState(IMemento memento);
/**
* Sets the id for this page. This method will be called before any other
* initialization is done.
*
* @param id the id for this page
*/
void setID(String id);
/**
* Returns the id set via <code>setID</code>.
*
* @return the id of this page
*/
String getID();
/**
* Returns a user readable label for this search result page. The label will be
* used to describe the contents for the page to the user (for example it will be
* displayed in the search view title bar). To take an example from file search,
* a label might read like this: '"test" 896 matches in Workspace'.
*
* @return the user readable label for this search result page
*/
String getLabel();
}
|