Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ea56e0265bf9c6e73b110efbab2b00492a34930c (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
/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.ui.history;

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.IPageSite;

/**
 * A site which provides access to the context in which this page
 * is being displayed. Instances of this interface serve a similar purpose
 * to <code>IWorkbenchSite</code> instances but is provided as a separate
 * objects to allow clients to access the different site types
 * (view, editor, dialog) using a common interface. This interface also provides
 * access to the part for the site because this is required by some UI
 * components. Clients should not need to access the part.
 * <p>
 * Clients can determine the type of workbench site by doing <code>instanceof</code>
 * checks on the object returned by <code>getWorkbenchSite</code>. Similar
 * <code>instanceof</code> checks can be done with the part.
 * <p>
 * This interface is not intended to be implemented by clients.
 *
 * @since 3.2
 */
public interface IHistoryPageSite {

	/**
	 * Return the workbench page site for the page or <code>null</code> if a
	 * workbench page site is not available (e.g. if the page is being shown in
	 * a dialog).
	 *
	 * @return the workbench page site for the page or <code>null</code>
	 */
	IPageSite getWorkbenchPageSite();

	/**
	 * Return the workbench part for the page or <code>null</code> if a
	 * workbench part is not available (e.g. if the page is being shown in a
	 * dialog).
	 *
	 * @return the workbench part for the page or <code>null</code>
	 */
	IWorkbenchPart getPart();

	/**
	 * Returns the shell for this site.
	 * @return the shell for this site
	 */
	Shell getShell();

	/**
	 * Get the selection provider that gives access to the selection
	 * of the synchronize page associated with this page site.
	 * @return the selection provider for the page
	 */
	ISelectionProvider getSelectionProvider();

	/**
	 * Sets the selection provider for this workbench site.
	 * @param provider the selection provider, or <code>null</code> to clear it
	 */
	void setSelectionProvider(ISelectionProvider provider);

	/**
	 * Give the page focus.
	 */
	void setFocus();

	/**
	 * Returns the toolbar manager for this site or <code>null</code>
	 * it there is no toolbar. For sites which have a corresponding
	 * workbench site, the toolbar manager will come from the action
	 * bars.
	 *
	 * @return toolbar manager
	 */
	IToolBarManager getToolBarManager();

	/**
	 * Returns whether this site is modal.
	 * @return true if the site is modal, false otherwise
	 */
	boolean isModal();

}

Back to the top