~ubuntu-branches/ubuntu/utopic/eclipse-linuxtools/utopic

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceLabelProvider.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2014-05-12 18:11:40 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140512181140-w237r3vsah1tmybz
Tags: 2.2.1-1
* New upstream release.
* Refreshed d/patches.
* Removed eclipse-cdt-valgrind-remote package, all its functionality
  is now provided by eclipse-cdt-profiling-framework-remote.
* Added remove-license-feature.patch.
* Bump Standards-Version to 3.9.5.
* Enable eclipse-changelog package.
* Enable eclipse-rpm-editor package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 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
 *   Matthew Khouzam - Initial API and implementation
 
11
 *******************************************************************************/
 
12
 
 
13
package org.eclipse.linuxtools.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
 * @since 2.0
 
24
 */
 
25
class ImportTraceLabelProvider extends LabelProvider {
 
26
 
 
27
    @Override
 
28
    public String getText(Object element) {
 
29
        if (element instanceof String) {
 
30
            return (String) element;
 
31
        }
 
32
        if (element instanceof FileAndName) {
 
33
            final File file = ((FileAndName) element).getFile();
 
34
            if (file != null) { // should never not happen since file is final
 
35
                                // and always set automatically
 
36
                return file.getName();
 
37
            }
 
38
        }
 
39
        return null;
 
40
    }
 
41
}