KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > mappings > ChangeSetCompareAdapter


1 /*******************************************************************************
2  * Copyright (c) 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.ccvs.ui.mappings;
12
13 import org.eclipse.core.resources.mapping.*;
14 import org.eclipse.team.core.mapping.ISynchronizationScope;
15 import org.eclipse.team.internal.core.subscribers.ChangeSet;
16 import org.eclipse.team.internal.ui.mapping.DiffTreeChangesSection.ITraversalFactory;
17 import org.eclipse.team.ui.mapping.SynchronizationCompareAdapter;
18 import org.eclipse.ui.IMemento;
19
20 public class ChangeSetCompareAdapter extends SynchronizationCompareAdapter implements ITraversalFactory {
21
22     public void save(ResourceMapping[] mappings, IMemento memento) {
23         // Don't save
24
}
25
26     public ResourceMapping[] restore(IMemento memento) {
27         // Don't restore
28
return new ResourceMapping[0];
29     }
30
31     public ResourceTraversal[] getTraversals(ISynchronizationScope scope) {
32         return scope.getTraversals(ModelProvider.RESOURCE_MODEL_PROVIDER_ID);
33     }
34     
35     public String JavaDoc getName(ResourceMapping mapping) {
36         Object JavaDoc modelObject = mapping.getModelObject();
37         if (modelObject instanceof ChangeSet) {
38             ChangeSet changeSet = (ChangeSet) modelObject;
39             return changeSet.getName();
40         }
41         return super.getName(mapping);
42     }
43
44 }
45
Popular Tags