Skip to main content
summaryrefslogtreecommitdiffstats
blob: 569ef4f0567c099a7420ba2c00ba48ab01d1393d (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
/*******************************************************************************
 * 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.team.ui.synchronize;

import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.*;

/**
 * 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>
 * Clients are not intended to implement this interface
 * 
 * @since 3.0
 */
public interface ISynchronizePageSite {

	/**
	 * Return the workbench site for the page
	 * or <code>null</code> if a workbench site is not available (e.g. if
	 * the page is being shown in a dialog). 
	 * @return the workbench site for the page or <code>null</code>
	 */
	IWorkbenchSite getWorkbenchSite();
	
	/**
	 * 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);

	/**
	 * Get the keybinding service for the site or <code>null</code>
	 * if one is not available.
	 * @return the keybinding service for the site or <code>null</code>
	 * if one is not available
	 */
	IKeyBindingService getKeyBindingService();

	/**
	 * Give the page focus.
	 */
	void setFocus();
	
	/**
	 * Return a settings node that can be used by the
	 * page to save state. A <code>null</code> value
	 * is returned if the site does not allow for
	 * persisted settings.
	 * @return a settings node or <code>null</code>
	 */
	IDialogSettings getPageSettings();

}

Back to the top