01: /*******************************************************************************
02: * Copyright (c) 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.ide.registry;
11:
12: import java.util.HashMap;
13: import java.util.Map;
14:
15: import org.eclipse.core.commands.IParameterValues;
16: import org.eclipse.ui.IPerspectiveDescriptor;
17: import org.eclipse.ui.internal.WorkbenchPlugin;
18:
19: /**
20: * Provides the parameter values for the show perspective command.
21: *
22: * @since 3.1
23: */
24: public final class PerspectiveParameterValues implements
25: IParameterValues {
26:
27: public final Map getParameterValues() {
28: final Map values = new HashMap();
29:
30: final IPerspectiveDescriptor[] perspectives = WorkbenchPlugin
31: .getDefault().getPerspectiveRegistry()
32: .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: }
|