Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/TagRootElement.java')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/TagRootElement.java105
1 files changed, 0 insertions, 105 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/TagRootElement.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/TagRootElement.java
deleted file mode 100644
index 34fd6b85c..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/TagRootElement.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.eclipse.team.internal.ccvs.ui.merge;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class TagRootElement implements IWorkbenchAdapter, IAdaptable {
- private ICVSFolder project;
- private List cachedTags;
- private int typeOfTagRoot;
-
- public TagRootElement(ICVSFolder project, int typeOfTagRoot) {
- this.typeOfTagRoot = typeOfTagRoot;
- this.project = project;
- }
-
- public TagRootElement(ICVSFolder project, int typeOfTagRoot, CVSTag[] tags) {
- this(project, typeOfTagRoot);
- add(tags);
- }
-
- public Object[] getChildren(Object o) {
- CVSTag[] childTags = new CVSTag[0];
- if(cachedTags==null) {
- if(typeOfTagRoot==CVSTag.BRANCH) {
- childTags = CVSUIPlugin.getPlugin().getRepositoryManager().getKnownTags(project, CVSTag.BRANCH);
- } else if(typeOfTagRoot==CVSTag.VERSION) {
- childTags = CVSUIPlugin.getPlugin().getRepositoryManager().getKnownTags(project, CVSTag.VERSION);
- }
- } else {
- childTags = getTags();
- }
- TagElement[] result = new TagElement[childTags.length];
- for (int i = 0; i < childTags.length; i++) {
- result[i] = new TagElement(childTags[i]);
- }
- return result;
- }
- public void removeAll() {
- if(cachedTags!=null) {
- cachedTags.clear();
- }
- }
- public void add(CVSTag[] tags) {
- if(cachedTags==null) {
- cachedTags = new ArrayList(tags.length);
- }
- cachedTags.addAll(Arrays.asList(tags));
- }
- public void remove(CVSTag tag) {
- if(cachedTags!=null) {
- cachedTags.remove(tag);
- }
- }
- public CVSTag[] getTags() {
- if(cachedTags!=null) {
- return (CVSTag[]) cachedTags.toArray(new CVSTag[cachedTags.size()]);
- } else {
- return new CVSTag[0];
- }
- }
- public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class) return this;
- return null;
- }
- public ImageDescriptor getImageDescriptor(Object object) {
- if(typeOfTagRoot==CVSTag.BRANCH) {
- return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_BRANCHES_CATEGORY);
- } else {
- return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_VERSIONS_CATEGORY);
- }
- }
- public String getLabel(Object o) {
- if(typeOfTagRoot==CVSTag.BRANCH) {
- return Policy.bind("MergeWizardEndPage.branches"); //$NON-NLS-1$
- } else {
- return Policy.bind("VersionsElement.versions"); //$NON-NLS-1$
- }
- }
- public Object getParent(Object o) {
- return null;
- }
- /**
- * Gets the typeOfTagRoot.
- * @return Returns a int
- */
- public int getTypeOfTagRoot() {
- return typeOfTagRoot;
- }
-
-} \ No newline at end of file

Back to the top