KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > HierarchicalModelManager


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.synchronize;
12
13 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
14
15 /**
16  * Manager for hierarchical models
17  */

18 public class HierarchicalModelManager extends SynchronizeModelManager {
19     
20     public HierarchicalModelManager(ISynchronizePageConfiguration configuration) {
21         super(configuration);
22     }
23     
24     /* (non-Javadoc)
25      * @see org.eclipse.team.internal.ui.synchronize.SynchronizeModelManager#getSupportedModelProviders()
26      */

27     protected ISynchronizeModelProviderDescriptor[] getSupportedModelProviders() {
28         return new ISynchronizeModelProviderDescriptor[] {
29                 new FlatModelProvider.FlatModelProviderDescriptor(),
30                 new HierarchicalModelProvider.HierarchicalModelProviderDescriptor(),
31                 new CompressedFoldersModelProvider.CompressedFolderModelProviderDescriptor() };
32     }
33     
34     /* (non-Javadoc)
35      * @see org.eclipse.team.internal.ui.synchronize.SynchronizeModelManager#createModelProvider(java.lang.String)
36      */

37     protected ISynchronizeModelProvider createModelProvider(String JavaDoc id) {
38         if(id == null) {
39             id = getDefaultProviderId();
40         }
41         if (id.endsWith(FlatModelProvider.FlatModelProviderDescriptor.ID)) {
42             return new FlatModelProvider(getConfiguration(), getSyncInfoSet());
43         } else if(id.endsWith(CompressedFoldersModelProvider.CompressedFolderModelProviderDescriptor.ID)) {
44             return new CompressedFoldersModelProvider(getConfiguration(), getSyncInfoSet());
45         } else {
46             return new HierarchicalModelProvider(getConfiguration(), getSyncInfoSet());
47         }
48     }
49 }
50
Popular Tags