Commit | Line | Data |
---|---|---|
f9ff7d40 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 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 | * Alexandre Montplaisir - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.tracecompass.tmf.ctf.core.event.aspect; | |
14 | ||
15 | import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; | |
16 | import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; | |
17 | import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent; | |
18 | ||
19 | /** | |
20 | * Channel aspect for CTF traces | |
21 | * | |
22 | * @author Alexandre Montplaisir | |
23 | */ | |
24 | public class CtfChannelAspect implements ITmfEventAspect { | |
25 | ||
26 | @Override | |
27 | public String getName() { | |
28 | return Messages.getMessage(Messages.AspectName_Channel); | |
29 | } | |
30 | ||
31 | @Override | |
32 | public String getHelpText() { | |
33 | return Messages.getMessage(Messages.AspectHelpText_Channel); | |
34 | } | |
35 | ||
36 | @Override | |
37 | public String resolve(ITmfEvent event) { | |
38 | if (!(event instanceof CtfTmfEvent)) { | |
39 | return EMPTY_STRING; | |
40 | } | |
41 | String ret = ((CtfTmfEvent) event).getReference(); | |
42 | return (ret == null ? EMPTY_STRING : ret); | |
43 | } | |
c409f16b | 44 | } |