1 /**********************************************************************
2 * Copyright (c) 2012 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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
;
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
;
20 * Label provider for trace control tree viewer.
23 * @author Bernd Hufmann
25 public class TraceControlLabelProvider
extends ColumnLabelProvider
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
34 public Image
getImage(Object element
) {
35 if ((element
!= null) && (element
instanceof ITraceControlComponent
)) {
36 return ((ITraceControlComponent
) element
).getImage();
42 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
45 public String
getText(Object element
) {
46 if ((element
!= null) && (element
instanceof ITraceControlComponent
)) {
47 return ((ITraceControlComponent
) element
).getName();
49 return "";//$NON-NLS-1$
54 * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
57 public String
getToolTipText(Object element
) {
58 if ((element
!= null) && (element
instanceof ITraceControlComponent
)) {
59 return ((ITraceControlComponent
) element
).getToolTip();