Internalize lttng.ui APIs
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / internal / lttng / ui / views / resources / model / ResourcesTimeRangeViewerProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Matthew Khouzam - Initial implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.internal.lttng.ui.views.resources.model;
14
15 import org.eclipse.linuxtools.internal.lttng.ui.model.trange.TimeRangeViewerProvider;
16 import org.eclipse.linuxtools.internal.lttng.ui.views.common.ParamsUpdater;
17
18 public class ResourcesTimeRangeViewerProvider extends TimeRangeViewerProvider {
19
20 public ResourcesTimeRangeViewerProvider(ParamsUpdater paramsUpdater) {
21 super(paramsUpdater);
22 }
23
24 /*
25 * (non-Javadoc)
26 *
27 * @see
28 * org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeAnalysisProvider
29 * #getStateName(org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.
30 * TmfTimeAnalysisProvider.StateColor)
31 */
32 @Override
33 public String getStateName(StateColor color) {
34 // Override to multiple instances of the widget, the same color can have
35 // multiple meanings
36 boolean isInBlockDevice = bdevStateToColor.containsValue(color);
37 boolean isInSoftIrq = softIrqStateToColor.containsValue(color);
38 boolean isInTrap = trapStateToColor.containsValue(color);
39 boolean isInIrq = irqStateToColor.containsValue(color);
40 boolean isInCpu = cpuStateToColor.containsValue(color);
41 if (isInCpu) {
42 return findObject(color, cpuStateToColor);
43 } else if (isInIrq) {
44 return findObject(color, irqStateToColor);
45 } else if (isInTrap) {
46 return findObject(color, trapStateToColor);
47 } else if (isInSoftIrq) {
48 return findObject(color, softIrqStateToColor);
49 } else if (isInBlockDevice) {
50 return findObject(color, bdevStateToColor);
51 }
52 return super.getStateName(color);
53 }
54
55 }
This page took 0.031991 seconds and 5 git commands to generate.