lttng: Fix ControlViewTest
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / model / impl / TraceControlLabelProvider.java
CommitLineData
eb1bab5b 1/**********************************************************************
ed902a2b 2 * Copyright (c) 2012, 2014 Ericsson
11252342 3 *
eb1bab5b
BH
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
11252342
AM
8 *
9 * Contributors:
eb1bab5b
BH
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
9bc60be7 12package org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl;
eb1bab5b
BH
13
14import org.eclipse.jface.viewers.ColumnLabelProvider;
eb1bab5b 15import org.eclipse.swt.graphics.Image;
9bc60be7 16import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
eb1bab5b
BH
17
18/**
eb1bab5b
BH
19 * <p>
20 * Label provider for trace control tree viewer.
21 * </p>
11252342 22 *
dbd4432d 23 * @author Bernd Hufmann
eb1bab5b
BH
24 */
25public class TraceControlLabelProvider extends ColumnLabelProvider {
26
27 // ------------------------------------------------------------------------
28 // Operations
29 // ------------------------------------------------------------------------
11252342 30
eb1bab5b
BH
31 @Override
32 public Image getImage(Object element) {
33 if ((element != null) && (element instanceof ITraceControlComponent)) {
34 return ((ITraceControlComponent) element).getImage();
35 }
36 return null;
37 }
38
eb1bab5b
BH
39 @Override
40 public String getText(Object element) {
41 if ((element != null) && (element instanceof ITraceControlComponent)) {
42 return ((ITraceControlComponent) element).getName();
43 }
44 return "";//$NON-NLS-1$
45 }
46
eb1bab5b
BH
47 @Override
48 public String getToolTipText(Object element) {
49 if ((element != null) && (element instanceof ITraceControlComponent)) {
50 return ((ITraceControlComponent) element).getToolTip();
51 }
52 return null;
53 }
54}
This page took 0.088127 seconds and 5 git commands to generate.