2010-07-12 Francois Chouinard <fchouinar@gmail.com> Contributions for Bug319429...
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / parsers / custom / CustomTraceDefinition.java
1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
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:
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.parsers.custom;
14
15 import java.text.SimpleDateFormat;
16 import java.util.List;
17 import java.util.TimeZone;
18
19 import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
20
21
22 public abstract class CustomTraceDefinition {
23
24 public static final int ACTION_SET = 0;
25 public static final int ACTION_APPEND = 1;
26 public static final int ACTION_APPEND_WITH_SEPARATOR = 2;
27
28 public static final String TAG_TIMESTAMP = "Time Stamp";
29 public static final String TAG_MESSAGE = "Message";
30 public static final String TAG_OTHER = "Other";
31
32 public String definitionName;
33 public List<OutputColumn> outputs;
34 public String timeStampOutputFormat;
35
36 public static class OutputColumn {
37 public String name;
38
39 public OutputColumn() {};
40
41 public OutputColumn(String name) {
42 this.name = name;
43 }
44
45 @Override
46 public String toString() {
47 return name;
48 }
49 }
50
51 public String formatTimeStamp(TmfTimestamp timestamp) {
52 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeStampOutputFormat);
53 simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
54 return simpleDateFormat.format(timestamp.getValue());
55 }
56
57 public abstract void save();
58 public abstract void save(String path);
59 }
This page took 0.03807 seconds and 5 git commands to generate.