1 11 package org.eclipse.team.internal.ccvs.ui.model; 12 13 14 import java.util.ArrayList ; 15 import java.util.List ; 16 17 import org.eclipse.core.runtime.IAdaptable; 18 import org.eclipse.core.runtime.IProgressMonitor; 19 import org.eclipse.jface.resource.ImageDescriptor; 20 import org.eclipse.team.internal.ccvs.core.CVSTag; 21 import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; 22 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; 23 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; 24 import org.eclipse.ui.model.IWorkbenchAdapter; 25 26 31 public class RemoteVersionModule extends CVSModelElement implements IAdaptable { 32 CVSTag tag; 33 List projects = new ArrayList (); 34 GroupedByVersionCategory parent; 35 36 39 public RemoteVersionModule(CVSTag tag, GroupedByVersionCategory parent) { 40 this.tag = tag; 41 this.parent = parent; 42 } 43 44 49 public Object getAdapter(Class adapter) { 50 if (adapter == IWorkbenchAdapter.class) return this; 51 return null; 52 } 53 54 public void addProject(ICVSRemoteFolder project) { 55 projects.add(project); 56 } 57 58 65 public Object [] fetchChildren(Object o, IProgressMonitor monitor) { 66 return (ICVSRemoteFolder[]) projects.toArray(new ICVSRemoteFolder[projects.size()]); 67 } 68 69 76 public ImageDescriptor getImageDescriptor(Object object) { 77 return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION); 78 } 79 80 85 public String getLabel(Object o) { 86 return tag.getName(); 87 } 88 89 92 public Object getParent(Object o) { 93 return parent; 94 } 95 96 97 100 public String toString() { 101 return "RemoteVersionModule(" + tag.getName() + ")"; } 103 } 104 | Popular Tags |