01: /*******************************************************************************
02: * Copyright (c) 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.viewers.ISelectionProvider;
13: import org.eclipse.swt.widgets.Shell;
14: import org.eclipse.ui.navigator.ICommonViewerSite;
15: import org.eclipse.ui.part.IPageSite;
16:
17: /**
18: * Provides a delegate implementation of {@link ICommonViewerSite}.
19: *
20: * @since 3.2
21: *
22: */
23: public class CommonViewerSiteIPageSiteDelegate implements
24: ICommonViewerSite {
25:
26: private IPageSite pageSite;
27:
28: private String viewerId;
29:
30: /**
31: *
32: * @param aViewerId
33: * @param aPageSite
34: */
35: public CommonViewerSiteIPageSiteDelegate(String aViewerId,
36: IPageSite aPageSite) {
37: viewerId = aViewerId;
38: pageSite = aPageSite;
39: }
40:
41: public String getId() {
42: return viewerId;
43: }
44:
45: public Object getAdapter(Class adapter) {
46: return pageSite.getAdapter(adapter);
47: }
48:
49: public ISelectionProvider getSelectionProvider() {
50: return pageSite.getSelectionProvider();
51: }
52:
53: public void setSelectionProvider(
54: ISelectionProvider aSelectionProvider) {
55: pageSite.setSelectionProvider(aSelectionProvider);
56: }
57:
58: public Shell getShell() {
59: return pageSite.getShell();
60: }
61:
62: }
|