KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > registry > SynchronizeParticipantRegistry


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.team.internal.ui.registry;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.core.runtime.IConfigurationElement;
18 import org.eclipse.team.internal.ui.TeamUIPlugin;
19
20 public class SynchronizeParticipantRegistry extends RegistryReader {
21
22     public static final String JavaDoc PT_SYNCPARTICIPANTS = "synchronizeParticipants"; //$NON-NLS-1$
23
private static final String JavaDoc TAG_SYNCPARTICIPANT = "participant"; //$NON-NLS-1$
24
private Map JavaDoc participants = new HashMap JavaDoc();
25     
26     public SynchronizeParticipantRegistry() {
27         super();
28     }
29
30     /* (non-Javadoc)
31      * @see org.eclipse.team.internal.ui.registry.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
32      */

33     protected boolean readElement(IConfigurationElement element) {
34         if (element.getName().equals(TAG_SYNCPARTICIPANT)) {
35             String JavaDoc descText = getDescription(element);
36             SynchronizeParticipantDescriptor desc;
37             try {
38                 desc = new SynchronizeParticipantDescriptor(element, descText);
39                 participants.put(desc.getId(), desc);
40             } catch (CoreException e) {
41                 TeamUIPlugin.log(e);
42             }
43             return true;
44         }
45         return false;
46     }
47     
48     public SynchronizeParticipantDescriptor find(String JavaDoc id) {
49         return (SynchronizeParticipantDescriptor)participants.get(id);
50     }
51 }
52
Popular Tags