KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > syncinfo > MutableFolderSyncInfo


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.ccvs.core.syncinfo;
12
13 import org.eclipse.team.internal.ccvs.core.CVSTag;
14
15 /**
16  * Mutable version of FolderSyncInfo. Can be used when either creating a
17  * folder sync object from scratch or when modifying an existing
18  * <code>FolderSyncInfo</code> instance. Example usage:
19  * <pre>
20  * FolderSyncInfo info = folder.getFolderSyncInfo();
21  * if(info!=null) {
22  * MutableFolderSyncInfo newInfo = info.cloneMutable();
23  * newInfo.setTag(CVSTag.DEFAULT);
24  * folder.setFolderSyncInfo(newInfo);
25  * }
26  * </pre>
27  * @see FolderSyncInfo
28  */

29 public class MutableFolderSyncInfo extends FolderSyncInfo {
30     
31     public MutableFolderSyncInfo(FolderSyncInfo info) {
32         this(info.getRepository(), info.getRoot(), info.getTag(), info.getIsStatic());
33     }
34
35     public MutableFolderSyncInfo(String JavaDoc repo, String JavaDoc root, CVSTag tag, boolean isStatic) {
36         super(repo, root, tag, isStatic);
37     }
38
39     public void setTag(CVSTag tag) {
40         super.setTag(tag);
41     }
42
43     public void setRepository(String JavaDoc repository) {
44         this.repository = repository;
45     }
46
47     public void setStatic(boolean isStatic) {
48         this.isStatic = isStatic;
49     }
50     
51     public FolderSyncInfo asImmutable() {
52         return new FolderSyncInfo(getRepository(), getRoot(), getTag(), getIsStatic());
53     }
54
55     public void setRoot(String JavaDoc root) {
56         this.root = root;
57     }
58 }
59
Popular Tags