KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > registry > ViewParameterValues


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.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.PlatformUI;
19 import org.eclipse.ui.views.IViewDescriptor;
20
21 /**
22  * Provides the parameter values for the show view command.
23  *
24  * @since 3.1
25  */

26 public final class ViewParameterValues implements IParameterValues {
27
28     public final Map JavaDoc getParameterValues() {
29         final Map JavaDoc values = new HashMap JavaDoc();
30
31         final IViewDescriptor[] views = PlatformUI.getWorkbench()
32                 .getViewRegistry().getViews();
33         for (int i = 0; i < views.length; i++) {
34             final IViewDescriptor view = views[i];
35             values.put(view.getLabel(), view.getId());
36         }
37
38         return values;
39     }
40 }
41
Popular Tags