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 org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.events
.TmfEventsTable
;
17 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.virtualtable
.ColumnData
;
18 import org
.eclipse
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
22 * Events table specific for LTTng 2.0 kernel traces
24 public class LTTng2EventsTable
extends TmfEventsTable
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
31 static private final String TIMESTAMP_COLUMN
= Messages
.EventsTable_timestampColumn
;
32 static private final String CHANNEL_COLUMN
= Messages
.EventsTable_channelColumn
;
33 static private final String TYPE_COLUMN
= Messages
.EventsTable_typeColumn
;
34 static private final String CONTENT_COLUMN
= Messages
.EventsTable_contentColumn
;
35 static private final String
[] COLUMN_NAMES
= new String
[] {
42 static private final ColumnData
[] COLUMN_DATA
= new ColumnData
[] {
43 new ColumnData(COLUMN_NAMES
[0], 150, SWT
.LEFT
),
44 new ColumnData(COLUMN_NAMES
[1], 120, SWT
.LEFT
),
45 new ColumnData(COLUMN_NAMES
[2], 200, SWT
.LEFT
),
46 new ColumnData(COLUMN_NAMES
[3], 100, SWT
.LEFT
)
49 // ------------------------------------------------------------------------
51 // ------------------------------------------------------------------------
57 * The parent composite
59 * The size of the rows cache
61 public LTTng2EventsTable(Composite parent
, int cacheSize
) {
62 super(parent
, cacheSize
, COLUMN_DATA
);
63 fTable
.getColumns()[0].setData(Key
.FIELD_ID
, ITmfEvent
.EVENT_FIELD_TIMESTAMP
);
64 fTable
.getColumns()[1].setData(Key
.FIELD_ID
, ITmfEvent
.EVENT_FIELD_REFERENCE
);
65 fTable
.getColumns()[2].setData(Key
.FIELD_ID
, ITmfEvent
.EVENT_FIELD_TYPE
);
66 fTable
.getColumns()[3].setData(Key
.FIELD_ID
, ITmfEvent
.EVENT_FIELD_CONTENT
);
70 public String
[] getItemStrings(ITmfEvent event
) {
72 return EMPTY_STRING_ARRAY
;
75 event
.getTimestamp().toString(),
77 event
.getType().getName(),
78 event
.getContent().toString()