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
.linuxtools
.tmf
.ui
.viewers
.events
.text
;
15 import java
.util
.List
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.text
.TextTraceEvent
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.text
.TextTraceEventContent
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.events
.TmfEventsTable
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.virtualtable
.ColumnData
;
22 import org
.eclipse
.swt
.widgets
.Composite
;
25 * Event table for text traces, which has one column for every event field.
27 * @author Alexandre Montplaisir
29 * @deprecated Users of this class should instead use
30 * {@link TmfEventsTable#TmfEventsTable(Composite, int, java.util.Collection)}
32 * {@link org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableColumn}
34 * {@link org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableFieldColumn}
38 public class TmfTextEventTable
extends TmfEventsTable
{
44 * The parent composite UI object
46 * The size of the event table cache
48 * The column data to use for this table
50 public TmfTextEventTable(Composite parent
, int cacheSize
, ColumnData
[] columnData
) {
51 super(parent
, cacheSize
, columnData
);
56 * The event to get the column strings for. It should be an
57 * instance of {@link TextTraceEvent}.
60 public String
[] getItemStrings(ITmfEvent event
) {
61 if (event
instanceof TextTraceEvent
) {
62 List
<TextTraceEventContent
> fields
= ((TextTraceEvent
) event
).getContent().getFields();
63 String
[] strings
= new String
[fields
.size()];
64 for (int i
= 0; i
< strings
.length
; i
++) {
65 Object value
= fields
.get(i
).getValue();
66 strings
[i
] = (value
== null ? EMPTY_STRING
: value
.toString());
70 return EMPTY_STRING_ARRAY
;
This page took 0.046637 seconds and 5 git commands to generate.