Re-structure LTTng sub-project as per the Linux Tools guidelines
[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.core.event.TmfTimestamp;
20 import org.eclipse.linuxtools.tmf.ui.internal.Messages;
21
22
23 public abstract class CustomTraceDefinition {
24
25 public static final int ACTION_SET = 0;
26 public static final int ACTION_APPEND = 1;
27 public static final int ACTION_APPEND_WITH_SEPARATOR = 2;
28
29 public static final String TAG_TIMESTAMP = Messages.CustomTraceDefinition_timestampTag;
30 public static final String TAG_MESSAGE = Messages.CustomTraceDefinition_messageTag;
31 public static final String TAG_OTHER = Messages.CustomTraceDefinition_otherTag;
32
33 public String definitionName;
34 public List<OutputColumn> outputs;
35 public String timeStampOutputFormat;
36
37 public static class OutputColumn {
38 public String name;
39
40 public OutputColumn() {};
41
42 public OutputColumn(String name) {
43 this.name = name;
44 }
45
46 @Override
47 public String toString() {
48 return name;
49 }
50 }
51
52 public String formatTimeStamp(TmfTimestamp timestamp) {
53 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeStampOutputFormat);
54 simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
55 return simpleDateFormat.format(timestamp.getValue());
56 }
57
58 public abstract void save();
59 public abstract void save(String path);
60 }
This page took 0.031633 seconds and 5 git commands to generate.