1 /*******************************************************************************
\r
2 * Copyright (c) 2012 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.selectionview;
\r
14 import org.eclipse.jface.action.MenuManager;
\r
15 import org.eclipse.jface.viewers.ISelectionProvider;
\r
16 import org.eclipse.swt.widgets.Shell;
\r
17 import org.eclipse.ui.IActionBars;
\r
18 import org.eclipse.ui.IWorkbenchPage;
\r
19 import org.eclipse.ui.IWorkbenchWindow;
\r
20 import org.eclipse.ui.internal.services.INestable;
\r
21 import org.eclipse.ui.part.IPageSite;
\r
24 * @author Tuukka Lehtonen
\r
26 public class PageSiteProxy implements IPageSite, INestable {
\r
30 public PageSiteProxy(IPageSite proxy) {
\r
35 public IWorkbenchPage getPage() {
\r
36 return proxy.getPage();
\r
40 public ISelectionProvider getSelectionProvider() {
\r
41 return proxy.getSelectionProvider();
\r
45 public Shell getShell() {
\r
46 return proxy.getShell();
\r
50 public IWorkbenchWindow getWorkbenchWindow() {
\r
51 return proxy.getWorkbenchWindow();
\r
55 public void setSelectionProvider(ISelectionProvider provider) {
\r
56 proxy.setSelectionProvider(provider);
\r
60 public Object getAdapter(Class adapter) {
\r
61 return proxy.getAdapter(adapter);
\r
65 public Object getService(Class api) {
\r
66 return proxy.getService(api);
\r
70 public boolean hasService(Class api) {
\r
71 return proxy.hasService(api);
\r
75 public void activate() {
\r
76 if (proxy instanceof INestable)
\r
77 ((INestable) proxy).activate();
\r
81 public void deactivate() {
\r
82 if (proxy instanceof INestable)
\r
83 ((INestable) proxy).deactivate();
\r
87 public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider) {
\r
88 proxy.registerContextMenu(menuId, menuManager, selectionProvider);
\r
92 public IActionBars getActionBars() {
\r
93 return proxy.getActionBars();
\r