fa97c94451f86017f4c85468b387452d408db911
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / model / impl / TraceControlLabelProvider.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2013 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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
13
14 import org.eclipse.jface.viewers.ColumnLabelProvider;
15 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
16 import org.eclipse.swt.graphics.Image;
17
18 /**
19 * <p>
20 * Label provider for trace control tree viewer.
21 * </p>
22 *
23 * @author Bernd Hufmann
24 */
25 public class TraceControlLabelProvider extends ColumnLabelProvider {
26
27 // ------------------------------------------------------------------------
28 // Operations
29 // ------------------------------------------------------------------------
30
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
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
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.032191 seconds and 4 git commands to generate.