Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java')
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java
new file mode 100644
index 000000000..84b6e4e7a
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.core.syncinfo;
+
+import org.eclipse.team.internal.ccvs.core.CVSTag;
+
+/**
+ * Mutable version of FolderSyncInfo. Can be used when either creating a
+ * folder sync object from scratch or when modifying an existing
+ * <code>FolderSyncInfo</code> instance. Example usage:
+ * <pre>
+ * FolderSyncInfo info = folder.getFolderSyncInfo();
+ * if(info!=null) {
+ * MutableFolderSyncInfo newInfo = info.cloneMutable();
+ * newInfo.setTag(CVSTag.DEFAULT);
+ * folder.setFolderSyncInfo(newInfo);
+ * }
+ * </pre>
+ * @see FolderSyncInfo
+ */
+public class MutableFolderSyncInfo extends FolderSyncInfo {
+
+ public MutableFolderSyncInfo(FolderSyncInfo info) {
+ this(info.getRepository(), info.getRoot(), info.getTag(), info.getIsStatic());
+ }
+
+ public MutableFolderSyncInfo(String repo, String root, CVSTag tag, boolean isStatic) {
+ super(repo, root, tag, isStatic);
+ }
+
+ public void setTag(CVSTag tag) {
+ super.setTag(tag);
+ }
+
+ public void setRepository(String repository) {
+ this.repository = repository;
+ }
+
+ public void setStatic(boolean isStatic) {
+ this.isStatic = isStatic;
+ }
+
+ public FolderSyncInfo asImmutable() {
+ return new FolderSyncInfo(getRepository(), getRoot(), getTag(), getIsStatic());
+ }
+
+ public void setRoot(String root) {
+ this.root = root;
+ }
+}

Back to the top