1 /*******************************************************************************
2 * Copyright (c) 2014 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 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.kernel
.ui
.viewers
.events
;
15 import java
.util
.Collection
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
.ITmfEventAspect
;
20 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.event
.CtfTmfEvent
;
21 import org
.eclipse
.tracecompass
.tmf
.ui
.viewers
.events
.columns
.ITmfEventTableColumns
;
22 import org
.eclipse
.tracecompass
.tmf
.ui
.viewers
.events
.columns
.TmfEventTableColumn
;
24 import com
.google
.common
.collect
.ImmutableList
;
27 * Event table columns for LTTng 2.x kernel traces
29 public class LttngEventTableColumns
implements ITmfEventTableColumns
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 @SuppressWarnings("null")
36 private static final @NonNull String CHANNEL_HEADER
= Messages
.EventsTable_channelColumn
;
38 @SuppressWarnings("null")
39 private static final @NonNull Collection
<TmfEventTableColumn
> LTTNG_COLUMNS
=
40 ImmutableList
.<TmfEventTableColumn
> of(
41 new TmfEventTableColumn(ITmfEventAspect
.BaseAspects
.TIMESTAMP
),
42 new TmfEventTableColumn(new LttngChannelAspect()),
43 new TmfEventTableColumn(ITmfEventAspect
.BaseAspects
.EVENT_TYPE
),
44 new TmfEventTableColumn(ITmfEventAspect
.BaseAspects
.CONTENTS
));
46 private static class LttngChannelAspect
implements ITmfEventAspect
{
49 public String
getName() {
50 return CHANNEL_HEADER
;
54 public String
getHelpText() {
59 public String
resolve(ITmfEvent event
) {
60 if (!(event
instanceof CtfTmfEvent
)) {
63 String ret
= ((CtfTmfEvent
) event
).getReference();
64 return (ret
== null ? EMPTY_STRING
: ret
);
68 public String
getFilterId() {
69 return ITmfEvent
.EVENT_FIELD_REFERENCE
;
73 // ------------------------------------------------------------------------
75 // ------------------------------------------------------------------------
78 public Collection
<?
extends TmfEventTableColumn
> getEventTableColumns() {