gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / internal / lttng2 / kernel / ui / viewers / events / LttngEventTableColumns.java
CommitLineData
be222f56 1/*******************************************************************************
99d7adc6 2 * Copyright (c) 2014 Ericsson
be222f56
PT
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:
99d7adc6 10 * Alexandre Montplaisir - Initial API and implementation
be222f56
PT
11 *******************************************************************************/
12
13package org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events;
14
baafe54c
AM
15import java.util.Collection;
16
17import org.eclipse.jdt.annotation.NonNull;
be222f56 18import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
99d7adc6 19import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.ITmfEventTableColumns;
baafe54c 20import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableColumn;
be222f56 21
baafe54c
AM
22import com.google.common.collect.ImmutableList;
23
be222f56 24/**
99d7adc6 25 * Event table columns for LTTng 2.x kernel traces
be222f56 26 */
99d7adc6 27public class LttngEventTableColumns implements ITmfEventTableColumns {
be222f56
PT
28
29 // ------------------------------------------------------------------------
baafe54c 30 // Column definition
be222f56
PT
31 // ------------------------------------------------------------------------
32
baafe54c
AM
33 @SuppressWarnings("null")
34 private static final @NonNull String CHANNEL_HEADER = Messages.EventsTable_channelColumn;
35
99d7adc6
AM
36 @SuppressWarnings("null")
37 private static final @NonNull Collection<TmfEventTableColumn> LTTNG_COLUMNS =
baafe54c
AM
38 ImmutableList.<TmfEventTableColumn> of(
39 TmfEventTableColumn.BaseColumns.TIMESTAMP,
40 new LttngChannelColumn(),
41 TmfEventTableColumn.BaseColumns.EVENT_TYPE,
42 TmfEventTableColumn.BaseColumns.CONTENTS);
43
44 private static class LttngChannelColumn extends TmfEventTableColumn {
be222f56 45
baafe54c
AM
46 public LttngChannelColumn() {
47 super(CHANNEL_HEADER);
48 }
49
50 @Override
51 public String getItemString(ITmfEvent event) {
52 String ret = event.getReference();
53 return (ret == null ? EMPTY_STRING : ret);
54 }
55
56 @Override
57 public String getFilterFieldId() {
58 return ITmfEvent.EVENT_FIELD_REFERENCE;
59 }
60 }
be222f56
PT
61
62 // ------------------------------------------------------------------------
63 // Constructor
64 // ------------------------------------------------------------------------
65
99d7adc6
AM
66 @Override
67 public Collection<? extends TmfEventTableColumn> getEventTableColumns() {
68 return LTTNG_COLUMNS;
be222f56 69 }
be222f56 70}
This page took 0.072013 seconds and 5 git commands to generate.