25a34426d9a16aeab9764063cc23805ae693bddf
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / internal / tmf / ui / project / wizards / importtrace / ImportTraceLabelProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 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 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace;
14
15 import java.io.File;
16
17 import org.eclipse.jface.viewers.LabelProvider;
18
19 /**
20 * Trace label provider for the candidate tree
21 *
22 * @author Matthew Khouzam
23 */
24 class ImportTraceLabelProvider extends LabelProvider {
25
26 @Override
27 public String getText(Object element) {
28 if (element instanceof String) {
29 return (String) element;
30 }
31 if (element instanceof FileAndName) {
32 final File file = ((FileAndName) element).getFile();
33 if (file != null) { // should never not happen since file is final
34 // and always set automatically
35 return file.getName();
36 }
37 }
38 return null;
39 }
40 }
This page took 0.032746 seconds and 4 git commands to generate.