KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > model > RemoteProjectsElement


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.ui.model;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.team.core.TeamException;
15 import org.eclipse.team.internal.ccvs.core.CVSTag;
16 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
17
18 /**
19  * This model element provides the remote projects for a given repository and
20  * tag.
21  */

22 public class RemoteProjectsElement extends CVSTagElement {
23     
24     /**
25      * Constructor for RemoteProjectsElement.
26      */

27     public RemoteProjectsElement() {
28         super(CVSTag.DEFAULT, null);
29     }
30     
31     /**
32      * Sets the root.
33      * @param root The root to set
34      */

35     public void setRoot(ICVSRepositoryLocation root) {
36         this.root = root;
37     }
38
39     /**
40      * Sets the tag.
41      * @param tag The tag to set
42      */

43     public void setTag(CVSTag tag) {
44         this.tag = tag;
45     }
46     /**
47      * @see java.lang.Object#equals(java.lang.Object)
48      */

49     public boolean equals(Object JavaDoc o) {
50         if (!(o instanceof RemoteProjectsElement)) return false;
51         RemoteProjectsElement element = (RemoteProjectsElement)o;
52         if (root == null) {
53             return element.root == null && tag.equals(element.tag);
54         }
55         return super.equals(o);
56     }
57
58     /**
59      * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
60      */

61     public Object JavaDoc getParent(Object JavaDoc o) {
62         return null;
63     }
64
65     /**
66      * @see java.lang.Object#hashCode()
67      */

68     public int hashCode() {
69         if (root == null) return tag.hashCode();
70         return super.hashCode();
71     }
72
73     /**
74      * @see org.eclipse.team.internal.ccvs.ui.model.CVSModelElement#internalGetChildren(java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
75      */

76     public Object JavaDoc[] fetchChildren(Object JavaDoc o, IProgressMonitor monitor) throws TeamException {
77         if (root == null) return new Object JavaDoc[0];
78         return super.fetchChildren(o, monitor);
79     }
80 }
81
Popular Tags