GraphEditorInput.java
Go to the documentation of this file.00001 package edu.rice.cs.hpc.viewer.graph;
00002
00003 import org.eclipse.jface.resource.ImageDescriptor;
00004 import org.eclipse.ui.IEditorInput;
00005 import org.eclipse.ui.IPersistableElement;
00006 import org.eclipse.ui.IWorkbenchWindow;
00007
00008 import edu.rice.cs.hpc.data.experiment.metric.MetricRaw;
00009 import edu.rice.cs.hpc.data.experiment.scope.Scope;
00010 import edu.rice.cs.hpc.viewer.window.Database;
00011
00012 public class GraphEditorInput implements IEditorInput {
00013 private final Database _database;
00014 private final Scope _scope;
00015 private final MetricRaw _metric;
00016
00017 private final GraphType.PlotType _type;
00018
00019
00020
00021
00022
00023
00024
00025
00026 public GraphEditorInput(Database database, Scope scope, MetricRaw metric,
00027 GraphType.PlotType type, IWorkbenchWindow window) {
00028 this._scope = scope;
00029 this._metric = metric;
00030 this._type = type;
00031 this._database = database;
00032 }
00033
00034 public boolean exists() {
00035
00036 return false;
00037 }
00038
00039 public ImageDescriptor getImageDescriptor() {
00040
00041 return null;
00042 }
00043
00044 public String getName() {
00045 final String sOrignalTitle = "[" + GraphType.toString(_type) + "] " + _scope.getName()+": " + _metric.getDisplayName();
00046 return sOrignalTitle;
00047 }
00048
00049 public String getID() {
00050 return getID(_scope, _metric, _type, _database);
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 static public String getID(Scope scope, MetricRaw metric, GraphType.PlotType type, Database database) {
00062 return Integer.toString(database.getWindowIndex()) + GraphType.toString(type) + ":" +
00063 scope.getCCTIndex()+":" + metric.getID();
00064 }
00065
00066
00067 public IPersistableElement getPersistable() {
00068
00069 return null;
00070 }
00071
00072 public String getToolTipText() {
00073 return getName();
00074 }
00075
00076 public Object getAdapter(Class adapter) {
00077
00078 return null;
00079 }
00080
00081
00082 public GraphType.PlotType getType() {
00083 return this._type;
00084 }
00085
00086 public Database getDatabase() {
00087 return this._database;
00088 }
00089
00090 public Scope getScope() {
00091 return this._scope;
00092 }
00093
00094 public MetricRaw getMetric() {
00095 return this._metric;
00096 }
00097 }