1 package org
.argeo
.slc
.client
.contentprovider
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.argeo
.eclipse
.ui
.TreeParent
;
6 import org
.argeo
.slc
.client
.contentprovider
.ResultDetailContentProvider
.ResultPartNode
;
7 import org
.argeo
.slc
.client
.contentprovider
.ResultDetailContentProvider
.StatusAware
;
8 import org
.eclipse
.jface
.viewers
.ITableLabelProvider
;
9 import org
.eclipse
.jface
.viewers
.LabelProvider
;
10 import org
.eclipse
.swt
.graphics
.Image
;
15 * Fill ResultDetail view. Deported in an external bundle so that main
16 * slc ui bundle does not depend on DB implementation.
18 public class ResultDetailLabelProvider
extends LabelProvider
implements
20 private static final Log log
= LogFactory
21 .getLog(ResultDetailLabelProvider
.class);
23 // TODO : find a solution to get the icons here.
25 // public final static Image FAILED = ClientUiPlugin.getImageDescriptor(
26 // "icons/failed.gif").createImage();
27 // public final static Image PASSED = ClientUiPlugin.getImageDescriptor(
28 // "icons/passed.gif").createImage();
30 public String
getColumnText(Object obj
, int index
) {
32 if (obj
instanceof ResultPartNode
) {
33 ResultPartNode rpn
= (ResultPartNode
) obj
;
36 // if (log.isDebugEnabled())
37 // log.debug("Get col text, index = 0 & rpn.toString="
39 // return rpn.toString();
41 return rpn
.getStatus().toString();
43 return rpn
.getMessage();
45 return rpn
.getExceptionMessage();
50 if (obj
instanceof TreeParent
) {
52 if (log
.isDebugEnabled())
53 log
.debug("In GetTreeParent text, index = 0 & label ="
54 + ((TreeParent
) obj
).getName());
56 return ((TreeParent
) obj
).getName();
64 public Image
getImage(Object element
) {
65 if (element
instanceof StatusAware
) {
66 // Package use conflict problem when getting the icons, uncomment
67 // Images definition above and update Manifest to get it.
69 // if (((StatusAware) element).isPassed())
77 public Image
getColumnImage(Object obj
, int index
) {