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.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.PlatformUI;
17: import org.eclipse.ui.views.IViewDescriptor;
18:
19: /**
20: * Provides the parameter values for the show view command.
21: *
22: * @since 3.1
23: */
24: public final class ViewParameterValues implements IParameterValues {
25:
26: public final Map getParameterValues() {
27: final Map values = new HashMap();
28:
29: final IViewDescriptor[] views = PlatformUI.getWorkbench()
30: .getViewRegistry().getViews();
31: for (int i = 0; i < views.length; i++) {
32: final IViewDescriptor view = views[i];
33: values.put(view.getLabel(), view.getId());
34: }
35:
36: return values;
37: }
38: }
|