1 /*******************************************************************************
2 * Copyright (c) 2013 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 * Marc-Andre Laperle - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.project
.wizards
.tracepkg
;
15 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfNavigatorLabelProvider
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfTraceElement
;
17 import org
.eclipse
.swt
.graphics
.Image
;
20 * An ExportTraceElement associated to a TmfTraceElement. This will be the
21 * parent of other elements (events, supplementary files, bookmarks, etc).
23 * @author Marc-Andre Laperle
25 public class TracePackageTraceElement
extends TracePackageElement
{
27 private final TmfTraceElement fTraceElement
;
28 private final String fImportName
;
29 private final String fTraceType
;
32 * Construct an instance associated to a TmfTraceElement. For exporting.
35 * the parent of this element, can be set to null
37 * the associated TmfTraceElement
39 public TracePackageTraceElement(TracePackageElement parent
, TmfTraceElement traceElement
) {
41 fTraceElement
= traceElement
;
47 * Construct an instance associated to a TmfTraceElement. For importing.
50 * the parent of this element, can be set to null
52 * the name to use to identify this trace
54 * the trace type to set for this trace
56 public TracePackageTraceElement(TracePackageElement parent
, String importName
, String traceType
) {
58 fImportName
= importName
;
60 fTraceType
= traceType
;
64 public String
getText() {
65 return fTraceElement
!= null ? fTraceElement
.getName() : fImportName
;
69 * @return the associated TmfTraceElement
71 public TmfTraceElement
getTraceElement() {
76 * @return the trace type of this trace
78 public String
getTraceType() {
83 public Image
getImage() {
84 TmfNavigatorLabelProvider tmfNavigatorLabelProvider
= new TmfNavigatorLabelProvider();
85 return tmfNavigatorLabelProvider
.getImage(fTraceElement
);