01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.navigator;
11:
12: import org.eclipse.jface.action.MenuManager;
13: import org.eclipse.jface.viewers.ISelectionProvider;
14: import org.eclipse.swt.widgets.Shell;
15: import org.eclipse.ui.IActionBars;
16: import org.eclipse.ui.IViewSite;
17: import org.eclipse.ui.IWorkbenchPage;
18: import org.eclipse.ui.IWorkbenchPart;
19: import org.eclipse.ui.IWorkbenchPartSite;
20: import org.eclipse.ui.IWorkbenchWindow;
21: import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
22:
23: /**
24: * Provides a delegate implementation of {@link ICommonViewerWorkbenchSite}.
25: *
26: * @since 3.2
27: *
28: */
29: public class CommonViewerSiteIViewSiteDelegate implements
30: ICommonViewerWorkbenchSite {
31:
32: private IViewSite viewSite;
33:
34: /**
35: *
36: * @param aViewSite
37: */
38: public CommonViewerSiteIViewSiteDelegate(IViewSite aViewSite) {
39: viewSite = aViewSite;
40: }
41:
42: public String getId() {
43: return viewSite.getId();
44: }
45:
46: public IActionBars getActionBars() {
47: return viewSite.getActionBars();
48: }
49:
50: public Object getAdapter(Class adapter) {
51: return viewSite.getAdapter(adapter);
52: }
53:
54: public IWorkbenchPage getPage() {
55: return viewSite.getPage();
56: }
57:
58: public ISelectionProvider getSelectionProvider() {
59: return viewSite.getSelectionProvider();
60: }
61:
62: public void setSelectionProvider(
63: ISelectionProvider aSelectionProvider) {
64: viewSite.setSelectionProvider(aSelectionProvider);
65: }
66:
67: public Shell getShell() {
68: return viewSite.getShell();
69: }
70:
71: public IWorkbenchWindow getWorkbenchWindow() {
72: return viewSite.getWorkbenchWindow();
73: }
74:
75: public void registerContextMenu(String menuId,
76: MenuManager menuManager,
77: ISelectionProvider selectionProvider) {
78: viewSite.registerContextMenu(menuId, menuManager,
79: selectionProvider);
80: }
81:
82: public IWorkbenchPart getPart() {
83: return viewSite.getPart();
84: }
85:
86: /* (non-Javadoc)
87: * @see org.eclipse.ui.navigator.ICommonViewerWorkbenchSite#getSite()
88: */
89: public IWorkbenchPartSite getSite() {
90: return viewSite;
91: }
92:
93: }
|