Commit | Line | Data |
---|---|---|
c3c5c786 FC |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2010 Ericsson\r | |
abbdd66a | 3 | *\r |
c3c5c786 FC |
4 | * All rights reserved. This program and the accompanying materials are\r |
5 | * made available under the terms of the Eclipse Public License v1.0 which\r | |
6 | * accompanies this distribution, and is available at\r | |
7 | * http://www.eclipse.org/legal/epl-v10.html\r | |
abbdd66a | 8 | *\r |
c3c5c786 FC |
9 | * Contributors:\r |
10 | * Patrick Tasse - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
12 | \r | |
d34665f9 | 13 | package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;\r |
c3c5c786 FC |
14 | \r |
15 | import java.text.SimpleDateFormat;\r | |
16 | import java.util.List;\r | |
c3c5c786 | 17 | \r |
d34665f9 | 18 | import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r |
6c13869b | 19 | import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r |
c3c5c786 FC |
20 | \r |
21 | \r | |
22 | public abstract class CustomTraceDefinition {\r | |
23 | \r | |
24 | public static final int ACTION_SET = 0;\r | |
25 | public static final int ACTION_APPEND = 1;\r | |
26 | public static final int ACTION_APPEND_WITH_SEPARATOR = 2;\r | |
27 | \r | |
3b38ea61 FC |
28 | public static final String TAG_TIMESTAMP = Messages.CustomTraceDefinition_timestampTag;\r |
29 | public static final String TAG_MESSAGE = Messages.CustomTraceDefinition_messageTag;\r | |
30 | public static final String TAG_OTHER = Messages.CustomTraceDefinition_otherTag;\r | |
abbdd66a | 31 | \r |
c3c5c786 FC |
32 | public String definitionName;\r |
33 | public List<OutputColumn> outputs;\r | |
34 | public String timeStampOutputFormat;\r | |
abbdd66a | 35 | \r |
c3c5c786 FC |
36 | public static class OutputColumn {\r |
37 | public String name;\r | |
38 | \r | |
abbdd66a | 39 | public OutputColumn() {}\r |
c3c5c786 FC |
40 | \r |
41 | public OutputColumn(String name) {\r | |
42 | this.name = name;\r | |
43 | }\r | |
44 | \r | |
45 | @Override\r | |
46 | public String toString() {\r | |
47 | return name;\r | |
48 | }\r | |
49 | }\r | |
50 | \r | |
51 | public String formatTimeStamp(TmfTimestamp timestamp) {\r | |
52 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeStampOutputFormat);\r | |
c3c5c786 FC |
53 | return simpleDateFormat.format(timestamp.getValue());\r |
54 | }\r | |
abbdd66a | 55 | \r |
c3c5c786 FC |
56 | public abstract void save();\r |
57 | public abstract void save(String path);\r | |
58 | }\r |