BaseMetricLabelProvider.java
Go to the documentation of this file.00001 package edu.rice.cs.hpc.viewer.metric;
00002
00003 import org.eclipse.jface.viewers.ColumnLabelProvider;
00004 import org.eclipse.swt.graphics.Color;
00005 import org.eclipse.swt.graphics.Font;
00006 import edu.rice.cs.hpc.data.experiment.metric.BaseMetric;
00007 import edu.rice.cs.hpc.data.experiment.scope.Scope;
00008 import edu.rice.cs.hpc.viewer.util.Utilities;
00009
00010
00011
00012
00013
00014
00015
00016 public class BaseMetricLabelProvider extends ColumnLabelProvider implements IMetricLabelProvider {
00017 protected Scope scope = null;
00018 protected BaseMetric metric = null;
00019
00020
00021 public BaseMetricLabelProvider(BaseMetric metricNew) {
00022 this.metric = metricNew;
00023 }
00024
00025
00026
00027
00028
00029 public boolean isEnabled() {
00030 return false;
00031 }
00032
00033
00034
00035
00036
00037 public void setScope(Object scope) {
00038 if (scope instanceof Scope) {
00039 this.scope = (Scope)scope;
00040 }
00041 return;
00042 }
00043
00044
00045
00046
00047
00048 public void setMetric(Object metric) {
00049 if (metric instanceof BaseMetric) {
00050 this.metric = (BaseMetric)metric;
00051 }
00052 return;
00053 }
00054
00055
00056
00057
00058
00059 public Font getFont(Object element) {
00060 return Utilities.fontMetric;
00061 }
00062
00063
00064
00065
00066
00067 public String getText(Object element) {
00068 String text = null;
00069
00070 if ((metric != null) && (element instanceof Scope)) {
00071 Scope node = (Scope) element;
00072 text = metric.getMetricTextValue(node);
00073 }
00074 return text;
00075 }
00076
00077
00078
00079
00080
00081 public Color getBackground(final Object element) {
00082 return null;
00083 }
00084
00085
00086
00087
00088
00089 public Color getForeground(final Object element) {
00090 return null;
00091 }
00092 }