KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > java > ContentAssistComputerParameter


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.jdt.internal.ui.text.java;
12
13 import java.util.Collection JavaDoc;
14 import java.util.HashMap JavaDoc;
15 import java.util.Iterator JavaDoc;
16 import java.util.Map JavaDoc;
17
18 import org.eclipse.core.commands.IParameterValues;
19
20 /**
21  * Map of parameters for the specific content assist command.
22  *
23  * @since 3.2
24  */

25 public final class ContentAssistComputerParameter implements IParameterValues {
26     /*
27      * @see org.eclipse.core.commands.IParameterValues#getParameterValues()
28      */

29     public Map JavaDoc getParameterValues() {
30         Collection JavaDoc descriptors= CompletionProposalComputerRegistry.getDefault().getProposalCategories();
31         Map JavaDoc map= new HashMap JavaDoc(descriptors.size());
32         for (Iterator JavaDoc it= descriptors.iterator(); it.hasNext();) {
33             CompletionProposalCategory category= (CompletionProposalCategory) it.next();
34             map.put(category.getDisplayName(), category.getId());
35         }
36         return map;
37     }
38 }
39
Popular Tags