KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > ui > history > IHistoryPageSite


1 /*******************************************************************************
2  * Copyright (c) 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.team.ui.history;
12
13 import org.eclipse.jface.action.IToolBarManager;
14 import org.eclipse.jface.viewers.ISelectionProvider;
15 import org.eclipse.swt.widgets.Shell;
16 import org.eclipse.ui.IWorkbenchPart;
17 import org.eclipse.ui.part.IPageSite;
18
19 /**
20  * A site which provides access to the context in which this page
21  * is being displayed. Instances of this interface serve a similar purpose
22  * to <code>IWorkbenchSite</code> instances but is provided as a separate
23  * objects to allow clients to access the different site types
24  * (view, editor, dialog) using a common interface. This interface also provides
25  * access to the part for the site because this is required by some UI
26  * components. Clients should not need to access the part.
27  * <p>
28  * Clients can determine the type of workbench site by doing <code>instanceof</code>
29  * checks on the object returned by <code>getWorkbenchSite</code>. Similar
30  * <code>instanceof</code> checks can be done with the part.
31  * <p>
32  * This interface is not intended to be implemented by clients.
33  *
34  * @since 3.2
35  */

36 public interface IHistoryPageSite {
37     
38     /**
39      * Return the workbench page site for the page or <code>null</code> if a
40      * workbench page site is not available (e.g. if the page is being shown in
41      * a dialog).
42      *
43      * @return the workbench page site for the page or <code>null</code>
44      */

45     IPageSite getWorkbenchPageSite();
46     
47     /**
48      * Return the workbench part for the page or <code>null</code> if a
49      * workbench part is not available (e.g. if the page is being shown in a
50      * dialog).
51      *
52      * @return the workbench part for the page or <code>null</code>
53      */

54     IWorkbenchPart getPart();
55     
56     /**
57      * Returns the shell for this site.
58      * @return the shell for this site
59      */

60     Shell getShell();
61
62     /**
63      * Get the selection provider that gives access to the selection
64      * of the synchronize page associated with this page site.
65      * @return the selection provider for the page
66      */

67     ISelectionProvider getSelectionProvider();
68
69     /**
70      * Sets the selection provider for this workbench site.
71      * @param provider the selection provider, or <code>null</code> to clear it
72      */

73     void setSelectionProvider(ISelectionProvider provider);
74
75     /**
76      * Give the page focus.
77      */

78     void setFocus();
79     
80     /**
81      * Returns the toolbar manager for this site or <code>null</code>
82      * it there is no toolbar. For sites which have a corresponding
83      * workbench site, the toolbar manager will come from the action
84      * bars.
85      *
86      * @return toolbar manager
87      */

88     IToolBarManager getToolBarManager();
89     
90     /**
91      * Returns whether this site is modal.
92      * @return true if the site is modal, false otherwise
93      */

94     boolean isModal();
95     
96 }
97
Popular Tags