KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > context > PluginContexts


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.help.internal.context;
12 import java.util.HashMap JavaDoc;
13 import java.util.Map JavaDoc;
14
15 import org.eclipse.help.*;
16 /**
17  * Holds mapping of short contextId to IContext
18  */

19 public class PluginContexts {
20     private Map JavaDoc map = new HashMap JavaDoc();
21     public void put(String JavaDoc shortId, IContext context) {
22         map.put(shortId, context);
23     }
24     public IContext get(String JavaDoc shortId) {
25         return (IContext) map.get(shortId);
26     }
27     
28     /**
29      * For unit testing purposes.
30      */

31     public Map JavaDoc getMap() {
32         return map;
33     }
34 }
35
Popular Tags