1 11 package org.eclipse.team.internal.ccvs.ui; 12 13 import org.eclipse.core.resources.IResource; 14 import org.eclipse.core.runtime.IAdaptable; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.ui.model.IWorkbenchAdapter; 17 18 21 public class AdaptableResourceList implements IAdaptable, IWorkbenchAdapter { 22 23 IResource[] resources; 24 25 public AdaptableResourceList(IResource[] resources) { 26 this.resources = resources; 27 } 28 29 32 public Object getAdapter(Class adapter) { 33 if (adapter == IWorkbenchAdapter.class) return this; 34 return null; 35 } 36 37 40 public Object [] getChildren(Object o) { 41 return resources; 42 } 43 46 public ImageDescriptor getImageDescriptor(Object object) { 47 return null; 48 } 49 52 public String getLabel(Object o) { 53 return o == null ? "" : o.toString(); } 55 58 public Object getParent(Object o) { 59 return null; 60 } 61 62 } 63 | Popular Tags |