1 /*******************************************************************************
2 * Copyright (c) 2010 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.ui
.parsers
.custom
;
15 import java
.text
.SimpleDateFormat
;
16 import java
.util
.List
;
17 import java
.util
.TimeZone
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.internal
.Messages
;
23 public abstract class CustomTraceDefinition
{
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;
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
;
33 public String definitionName
;
34 public List
<OutputColumn
> outputs
;
35 public String timeStampOutputFormat
;
37 public static class OutputColumn
{
40 public OutputColumn() {};
42 public OutputColumn(String name
) {
47 public String
toString() {
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());
58 public abstract void save();
59 public abstract void save(String path
);