KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > registry > PerspectiveParameterValues


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.ui.internal.ide.registry;
13
14 import java.util.HashMap JavaDoc;
15 import java.util.Map JavaDoc;
16
17 import org.eclipse.core.commands.IParameterValues;
18 import org.eclipse.ui.IPerspectiveDescriptor;
19 import org.eclipse.ui.internal.WorkbenchPlugin;
20
21 /**
22  * Provides the parameter values for the show perspective command.
23  *
24  * @since 3.1
25  */

26 public final class PerspectiveParameterValues implements IParameterValues {
27
28     public final Map JavaDoc getParameterValues() {
29         final Map JavaDoc values = new HashMap JavaDoc();
30
31         final IPerspectiveDescriptor[] perspectives = WorkbenchPlugin
32                 .getDefault().getPerspectiveRegistry().getPerspectives();
33         for (int i = 0; i < perspectives.length; i++) {
34             final IPerspectiveDescriptor perspective = perspectives[i];
35             values.put(perspective.getLabel(), perspective.getId());
36         }
37
38         return values;
39     }
40 }
41
Popular Tags