1 18 package org.visualcontent.ui.repositorypropertylist; 19 20 import javax.jcr.Repository; 21 22 import org.eclipse.jface.viewers.ITableLabelProvider; 23 import org.eclipse.jface.viewers.LabelProvider; 24 import org.eclipse.swt.graphics.Image; 25 import org.eclipse.ui.ISharedImages; 26 import org.eclipse.ui.PlatformUI; 27 28 class ViewLabelProvider extends LabelProvider implements ITableLabelProvider { 29 32 private final RepositoryPropertyList list; 33 34 37 ViewLabelProvider(RepositoryPropertyList aList) { 38 list = aList; 39 } 40 41 public String getColumnText(Object obj, int index) { 42 String key = (String ) obj; 43 Repository repository = list.getRepository(); 44 String label = (index==0) ? key : repository.getDescriptor(key); 45 return label; 46 } 47 48 public Image getColumnImage(Object obj, int index) { 49 return getImage(obj); 50 } 51 52 public Image getImage(Object obj) { 53 return PlatformUI.getWorkbench().getSharedImages().getImage( 54 ISharedImages.IMG_OBJ_ELEMENT); 55 } 56 } | Popular Tags |