| 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2010, 2012 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 | * Francois Chouinard - Initial API and implementation |
| 11 | *******************************************************************************/ |
| 12 | |
| 13 | package org.eclipse.linuxtools.tmf.ui.project.model; |
| 14 | |
| 15 | import org.eclipse.jface.viewers.ITableLabelProvider; |
| 16 | import org.eclipse.jface.viewers.LabelProvider; |
| 17 | import org.eclipse.swt.graphics.Image; |
| 18 | |
| 19 | /** |
| 20 | * Label provider implementation for trace folders for tree viewers that display |
| 21 | * the content of a trace folder. |
| 22 | * <p> |
| 23 | * |
| 24 | * @version 1.0 |
| 25 | * @author Francois Chouinard |
| 26 | */ |
| 27 | public class TraceFolderLabelProvider extends LabelProvider implements ITableLabelProvider { |
| 28 | |
| 29 | /* |
| 30 | * (non-Javadoc) |
| 31 | * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) |
| 32 | */ |
| 33 | @Override |
| 34 | public Image getColumnImage(Object element, int columnIndex) { |
| 35 | return null; |
| 36 | } |
| 37 | |
| 38 | /* |
| 39 | * (non-Javadoc) |
| 40 | * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) |
| 41 | */ |
| 42 | @Override |
| 43 | public String getColumnText(Object element, int columnIndex) { |
| 44 | if (element instanceof TmfTraceElement) { |
| 45 | TmfTraceElement entry = (TmfTraceElement) element; |
| 46 | switch (columnIndex) { |
| 47 | case 0: |
| 48 | return entry.getName(); |
| 49 | default: |
| 50 | return null; |
| 51 | } |
| 52 | } |
| 53 | return null; |
| 54 | } |
| 55 | |
| 56 | } |