1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
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
10 * Matthew Khouzam - Initial implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.resources
.model
;
15 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.model
.trange
.TimeRangeViewerProvider
;
16 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.common
.ParamsUpdater
;
18 public class ResourcesTimeRangeViewerProvider
extends TimeRangeViewerProvider
{
20 public ResourcesTimeRangeViewerProvider(ParamsUpdater paramsUpdater
) {
28 * org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeAnalysisProvider
29 * #getStateName(org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.
30 * TmfTimeAnalysisProvider.StateColor)
33 public String
getStateName(StateColor color
) {
34 // Override to multiple instances of the widget, the same color can have
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
);
42 return findObject(color
, cpuStateToColor
);
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
);
52 return super.getStateName(color
);