1 11 package org.eclipse.team.internal.ccvs.ui.model; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.team.core.TeamException; 17 import org.eclipse.team.internal.ccvs.core.CVSTag; 18 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; 19 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; 20 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; 21 import org.eclipse.team.internal.ccvs.ui.Policy; 22 import org.eclipse.ui.model.IWorkbenchAdapter; 23 24 29 public class ModulesCategory extends CVSModelElement implements IAdaptable { 30 private ICVSRepositoryLocation repository; 31 32 public ModulesCategory(ICVSRepositoryLocation repository) { 33 super(); 34 this.repository = repository; 35 } 36 37 42 public Object getAdapter(Class adapter) { 43 if (adapter == IWorkbenchAdapter.class) return this; 44 return null; 45 } 46 47 50 public Object [] fetchChildren(Object o, IProgressMonitor monitor) throws TeamException { 51 return repository.members(CVSTag.DEFAULT, true , monitor); 52 } 53 54 57 public ImageDescriptor getImageDescriptor(Object object) { 58 return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION); 59 } 60 61 64 public String getLabel(Object o) { 65 return Policy.bind("ModulesCategory.label"); } 67 68 71 public Object getParent(Object o) { 72 return repository; 73 } 74 75 78 public boolean isRemoteElement() { 79 return true; 80 } 81 82 86 public ICVSRepositoryLocation getRepository() { 87 return repository; 88 } 89 90 public String toString() { 91 return getRepository().toString() + " (modules)"; } 93 } 94 | Popular Tags |