01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.IWorkbenchWindow;
13:
14: /**
15: * The selection service for a window.
16: */
17: /* package */
18: class WindowSelectionService extends AbstractSelectionService {
19:
20: /**
21: * The window.
22: */
23: private IWorkbenchWindow window;
24:
25: /**
26: * Creates a new selection service for the given window.
27: */
28: public WindowSelectionService(IWorkbenchWindow window) {
29: setWindow(window);
30: }
31:
32: /**
33: * Sets the window.
34: */
35: private void setWindow(IWorkbenchWindow window) {
36: this .window = window;
37: }
38:
39: /**
40: * Returns the window.
41: */
42: protected IWorkbenchWindow getWindow() {
43: return window;
44: }
45:
46: /*
47: * @see AbstractSelectionService#createPartTracker(String)
48: */
49: protected AbstractPartSelectionTracker createPartTracker(
50: String partId) {
51: return new WindowPartSelectionTracker(getWindow(), partId);
52: }
53:
54: }
|