1 11 package org.eclipse.team.internal.ccvs.ui.model; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.team.internal.ccvs.core.CVSException; 15 import org.eclipse.team.internal.ccvs.core.CVSTag; 16 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; 17 import org.eclipse.ui.model.IWorkbenchAdapter; 18 19 22 public abstract class TagCategory extends CVSModelElement { 23 protected ICVSRepositoryLocation repository; 24 25 public TagCategory(ICVSRepositoryLocation repository) { 26 this.repository = repository; 27 } 28 29 32 public Object [] fetchChildren(Object o, IProgressMonitor monitor) throws CVSException { 33 CVSTag[] tags = getTags(monitor); 34 CVSTagElement[] elements = new CVSTagElement[tags.length]; 35 for (int i = 0; i < tags.length; i++) { 36 elements[i] = new CVSTagElement(tags[i], repository); 37 } 38 return elements; 39 } 40 41 46 protected abstract CVSTag[] getTags(IProgressMonitor monitor) throws CVSException; 47 48 51 public Object getParent(Object o) { 52 return repository; 53 } 54 55 58 public ICVSRepositoryLocation getRepository(Object o) { 59 return repository; 60 } 61 62 67 public Object getAdapter(Class adapter) { 68 if (adapter == IWorkbenchAdapter.class) return this; 69 return null; 70 } 71 72 } 73 | Popular Tags |