1 11 package org.eclipse.team.internal.ccvs.ui.model; 12 13 14 import org.eclipse.core.runtime.IProgressMonitor; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.osgi.util.NLS; 17 import org.eclipse.team.core.TeamException; 18 import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; 19 import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; 20 import org.eclipse.ui.PlatformUI; 21 22 public class RemoteFileElement extends RemoteResourceElement { 23 26 public Object [] fetchChildren(Object o, IProgressMonitor monitor) { 27 return new Object [0]; 28 } 29 32 public ImageDescriptor getImageDescriptor(Object object) { 33 if (!(object instanceof ICVSRemoteFile)) return null; 34 return PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(((ICVSRemoteFile)object).getName()); 35 } 36 39 public String getLabel(Object o) { 40 if (!(o instanceof ICVSRemoteFile)) return null; 41 ICVSRemoteFile file = (ICVSRemoteFile)o; 42 try { 43 return NLS.bind(CVSUIMessages.nameAndRevision, new String [] { file.getName(), file.getRevision() }); 44 } catch (TeamException e) { 45 handle(null, null, e); 46 return null; 47 } 48 } 49 } 50 | Popular Tags |