1 /*******************************************************************************
2 * Copyright (c) 2012, 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.viewers
.events
;
15 import java
.util
.Collection
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.events
.TmfEventsTable
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.events
.columns
.TmfEventTableColumn
;
21 import org
.eclipse
.swt
.widgets
.Composite
;
23 import com
.google
.common
.collect
.ImmutableList
;
26 * Events table specific for LTTng 2.0 kernel traces
28 public class LTTng2EventsTable
extends TmfEventsTable
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
34 @SuppressWarnings("null")
35 private static final @NonNull String CHANNEL_HEADER
= Messages
.EventsTable_channelColumn
;
37 private static final Collection
<TmfEventTableColumn
> LTTNG_COLUMNS
=
38 ImmutableList
.<TmfEventTableColumn
> of(
39 TmfEventTableColumn
.BaseColumns
.TIMESTAMP
,
40 new LttngChannelColumn(),
41 TmfEventTableColumn
.BaseColumns
.EVENT_TYPE
,
42 TmfEventTableColumn
.BaseColumns
.CONTENTS
);
44 private static class LttngChannelColumn
extends TmfEventTableColumn
{
46 public LttngChannelColumn() {
47 super(CHANNEL_HEADER
);
51 public String
getItemString(ITmfEvent event
) {
52 String ret
= event
.getReference();
53 return (ret
== null ? EMPTY_STRING
: ret
);
57 public String
getFilterFieldId() {
58 return ITmfEvent
.EVENT_FIELD_REFERENCE
;
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
70 * The parent composite
72 * The size of the rows cache
74 public LTTng2EventsTable(Composite parent
, int cacheSize
) {
75 super(parent
, cacheSize
, LTTNG_COLUMNS
);