1 /*******************************************************************************
2 * Copyright (c) 2009 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
.lttng
.ui
.views
.events
;
15 import org
.eclipse
.linuxtools
.tmf
.event
.TmfEvent
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.TmfEventsView
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.events
.SelectionEvent
;
19 import org
.eclipse
.swt
.events
.SelectionListener
;
20 import org
.eclipse
.swt
.widgets
.Table
;
21 import org
.eclipse
.swt
.widgets
.TableColumn
;
24 * <b><u>EventsView</u></b>
26 * TODO: Implement me. Please.
28 public class EventsView
extends TmfEventsView
{
30 public static final String ID
= "org.eclipse.linuxtools.lttng.ui.views.events";
32 // ========================================================================
34 // ========================================================================
37 private final String TIMESTAMP_COLUMN
= "Timestamp";
38 private final String SOURCE_COLUMN
= "Source";
39 private final String TYPE_COLUMN
= "Type";
40 private final String REFERENCE_COLUMN
= "Reference";
41 private final String CONTENT_COLUMN
= "Content";
42 private final String
[] columnProperties
= new String
[] {
51 private class ColumnData
{
52 public final String header
;
53 public final int width
;
54 public final int alignment
;
56 public ColumnData(String h
, int w
, int a
) {
63 private ColumnData
[] columnData
= new ColumnData
[] {
64 new ColumnData(columnProperties
[0], 100, SWT
.LEFT
),
65 new ColumnData(columnProperties
[1], 100, SWT
.LEFT
),
66 new ColumnData(columnProperties
[2], 100, SWT
.LEFT
),
67 new ColumnData(columnProperties
[3], 100, SWT
.LEFT
),
68 new ColumnData(columnProperties
[4], 100, SWT
.LEFT
)
71 // ========================================================================
73 // ========================================================================
81 * FIXME: Add support for column selection
84 protected void setColumnHeaders(Table table
) {
85 for (int i
= 0; i
< columnData
.length
; i
++) {
86 final TableColumn column
= new TableColumn(table
, columnData
[i
].alignment
, i
);
87 column
.setText(columnData
[i
].header
);
88 column
.setWidth(columnData
[i
].width
);
89 // TODO: Investigate why the column resizing doesn't work by default
90 // Anything to do with SWT_VIRTUAL?
91 column
.addSelectionListener(new SelectionListener() {
92 public void widgetDefaultSelected(SelectionEvent e
) {
93 // TODO Auto-generated method stub
95 public void widgetSelected(SelectionEvent e
) {
107 protected String
[] extractItemFields(TmfEvent event
) {
108 String
[] fields
= new String
[0];
110 fields
= new String
[] {
111 event
.getTimestamp().toString(),
112 event
.getSource().toString(),
113 event
.getType().toString(),
114 event
.getReference().toString(),
115 event
.getContent().getContent() };
121 * @see java.lang.Object#toString()
124 public String
toString() {
125 return "[EventsView]";
This page took 0.033197 seconds and 5 git commands to generate.