01: /*******************************************************************************
02: * Copyright (c) 2000, 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;
11:
12: import org.eclipse.ui.IWorkbenchPage;
13:
14: /**
15: * The selection service for a page.
16: */
17: /* package */
18: class PageSelectionService extends AbstractSelectionService {
19:
20: private IWorkbenchPage page;
21:
22: /**
23: * Creates a new selection service for a specific workbench page.
24: */
25: public PageSelectionService(IWorkbenchPage page) {
26: setPage(page);
27: }
28:
29: /**
30: * Sets the page.
31: */
32: private void setPage(IWorkbenchPage page) {
33: this .page = page;
34: }
35:
36: /**
37: * Returns the page.
38: */
39: protected IWorkbenchPage getPage() {
40: return page;
41: }
42:
43: /*
44: * @see AbstractSelectionService#createPartTracker(String)
45: */
46: protected AbstractPartSelectionTracker createPartTracker(
47: String partId) {
48: return new PagePartSelectionTracker(getPage(), partId);
49: }
50:
51: }
|