KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > WorkbenchPartSynchronizePageSite


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.team.internal.ui.synchronize;
12
13 import org.eclipse.jface.dialogs.IDialogSettings;
14 import org.eclipse.jface.viewers.ISelectionProvider;
15 import org.eclipse.swt.widgets.Shell;
16 import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
17 import org.eclipse.ui.*;
18 import org.eclipse.ui.part.IPageSite;
19
20 /**
21  * Maps a workbench part to a synchronize page site.
22  */

23 public class WorkbenchPartSynchronizePageSite implements ISynchronizePageSite {
24     private IWorkbenchPart part;
25     private IDialogSettings settings;
26     private IPageSite site;
27
28     public WorkbenchPartSynchronizePageSite(IWorkbenchPart part, IPageSite site, IDialogSettings settings) {
29         this.part = part;
30         this.site = site;
31         this.settings = settings;
32     }
33
34     /* (non-Javadoc)
35      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getPart()
36      */

37     public IWorkbenchPart getPart() {
38         return part;
39     }
40     
41     /* (non-Javadoc)
42      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getShell()
43      */

44     public Shell getShell() {
45         return part.getSite().getShell();
46     }
47
48     /* (non-Javadoc)
49      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getSelectionProvider()
50      */

51     public ISelectionProvider getSelectionProvider() {
52         return site.getSelectionProvider();
53     }
54
55     /* (non-Javadoc)
56      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
57      */

58     public void setSelectionProvider(ISelectionProvider provider) {
59         site.setSelectionProvider(provider);
60     }
61
62     /* (non-Javadoc)
63      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getWorkbenchSite()
64      */

65     public IWorkbenchSite getWorkbenchSite() {
66         return part.getSite();
67     }
68
69     /* (non-Javadoc)
70      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getKeyBindingService()
71      */

72     public IKeyBindingService getKeyBindingService() {
73         return part.getSite().getKeyBindingService();
74     }
75
76     /* (non-Javadoc)
77      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#setFocus()
78      */

79     public void setFocus() {
80         part.getSite().getPage().activate(part);
81     }
82
83     /* (non-Javadoc)
84      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getPageSettings()
85      */

86     public IDialogSettings getPageSettings() {
87         return settings;
88     }
89
90     /* (non-Javadoc)
91      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#getActionBars()
92      */

93     public IActionBars getActionBars() {
94         return site.getActionBars();
95     }
96
97     /* (non-Javadoc)
98      * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#isModal()
99      */

100     public boolean isModal() {
101         return false;
102     }
103 }
104
Popular Tags