KickJava   Java API By Example, From Geeks To Geeks.

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


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 SynchronizeWizardRegistry extends RegistryReader {
21
22     public static final String JavaDoc PT_SYNCHRONIZE_WIZARDS = "synchronizeWizards"; //$NON-NLS-1$
23
private static final String JavaDoc TAG_SYNCHRONIZE_WIZARD = "wizard"; //$NON-NLS-1$
24
private Map JavaDoc wizards = new HashMap JavaDoc();
25     
26     /* (non-Javadoc)
27      * @see org.eclipse.team.internal.ui.registry.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
28      */

29     protected boolean readElement(IConfigurationElement element) {
30         if (element.getName().equals(TAG_SYNCHRONIZE_WIZARD)) {
31             String JavaDoc descText = getDescription(element);
32             SynchronizeWizardDescription desc;
33             try {
34                 desc = new SynchronizeWizardDescription(element, descText);
35                 wizards.put(desc.getId(), desc);
36             } catch (CoreException e) {
37                 TeamUIPlugin.log(e);
38             }
39             return true;
40         }
41         return false;
42     }
43     
44     public SynchronizeWizardDescription[] getSynchronizeWizards() {
45         return (SynchronizeWizardDescription[])wizards.values().toArray(new SynchronizeWizardDescription[wizards.size()]);
46     }
47
48 }
49
Popular Tags