KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > WindowSelectionService


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal;
12
13 import org.eclipse.ui.IWorkbenchWindow;
14
15 /**
16  * The selection service for a window.
17  */

18 /* package */
19 class WindowSelectionService extends AbstractSelectionService {
20
21     /**
22      * The window.
23      */

24     private IWorkbenchWindow window;
25
26     /**
27      * Creates a new selection service for the given window.
28      */

29     public WindowSelectionService(IWorkbenchWindow window) {
30         setWindow(window);
31     }
32
33     /**
34      * Sets the window.
35      */

36     private void setWindow(IWorkbenchWindow window) {
37         this.window = window;
38     }
39
40     /**
41      * Returns the window.
42      */

43     protected IWorkbenchWindow getWindow() {
44         return window;
45     }
46
47     /*
48      * @see AbstractSelectionService#createPartTracker(String)
49      */

50     protected AbstractPartSelectionTracker createPartTracker(String JavaDoc partId) {
51         return new WindowPartSelectionTracker(getWindow(), partId);
52     }
53
54 }
55
Popular Tags