Commit | Line | Data |
---|---|---|
abfad0aa FC |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2010 Ericsson\r | |
3 | * \r | |
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 | |
8 | * \r | |
9 | * Contributors:\r | |
10 | * Patrick Tasse - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
12 | \r | |
13 | package org.eclipse.linuxtools.tmf.ui.parsers;\r | |
14 | \r | |
15 | import java.util.Map;\r | |
16 | \r | |
17 | import org.eclipse.core.resources.IResource;\r | |
18 | import org.eclipse.linuxtools.tmf.trace.ITmfTrace;\r | |
19 | import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable;\r | |
20 | import org.eclipse.swt.widgets.Composite;\r | |
21 | \r | |
22 | public interface IParserProvider {\r | |
23 | \r | |
90e2b925 FC |
24 | /**\r |
25 | * Return the readable category name for this parser provider\r | |
26 | * \r | |
27 | * @return the category name\r | |
28 | */\r | |
abfad0aa FC |
29 | public String getCategory();\r |
30 | \r | |
90e2b925 FC |
31 | /**\r |
32 | * Return a trace instance for a resource given a parser id\r | |
33 | * \r | |
34 | * @param parser the parser id\r | |
35 | * @param resource the resource\r | |
36 | * @return a trace instance or null if the parser id is not handled by this parser provider\r | |
37 | */\r | |
12c155f5 | 38 | public ITmfTrace<?> getTraceForParser(String parser, IResource resource);\r |
abfad0aa | 39 | \r |
90e2b925 FC |
40 | /**\r |
41 | * Return a trace instance for a resource given a content type id\r | |
42 | * \r | |
43 | * @param contentTypeId the content type id\r | |
44 | * @param resource the resource\r | |
45 | * @return a trace instance or null if the content type id is not handled by this parser provider\r | |
46 | */\r | |
12c155f5 | 47 | public ITmfTrace<?> getTraceForContentType(String contentTypeId, IResource resource);\r |
abfad0aa | 48 | \r |
90e2b925 FC |
49 | /**\r |
50 | * Return the parser map for this parser provider\r | |
51 | * Map key: readable parser name\r | |
52 | * Map value: unique parser id\r | |
53 | * \r | |
54 | * @return the parser map\r | |
55 | */\r | |
abfad0aa FC |
56 | public Map<String, String> getParserMap();\r |
57 | \r | |
90e2b925 FC |
58 | /**\r |
59 | * Return the event type map given a parser id\r | |
60 | * Map key: readable event type name\r | |
61 | * Map value: unique event type id\r | |
62 | * \r | |
63 | * @param parser the parser id\r | |
64 | * @return the event type map or null if the parser id is not handled by this parser provider\r | |
65 | */\r | |
66 | public Map<String, String> getEventTypeMapForParser(String parser);\r | |
67 | \r | |
68 | /**\r | |
69 | * Return the field label array given an event type id\r | |
70 | * Array value: readable field label\r | |
71 | * \r | |
72 | * @param eventType the event type id\r | |
73 | * @return the field label array or null if the event type id is not handled by this parser provider\r | |
74 | */\r | |
75 | public String[] getFieldLabelsForEventType(String eventType);\r | |
76 | \r | |
77 | /**\r | |
78 | * Return the editor id given a parser id\r | |
79 | * \r | |
80 | * @param parser the parser id\r | |
81 | * @return an editor id or null to use the default trace editor\r | |
82 | */\r | |
83 | public String getEditorIdForParser(String parser);\r | |
84 | \r | |
85 | /**\r | |
86 | * Return an events table instance for a given trace\r | |
87 | * \r | |
88 | * @param parser the parser id\r | |
89 | * @param parent the parent composite for the table\r | |
90 | * @param cacheSize the desired cache size for the table\r | |
91 | * @return an events table instance or null if the trace is not handled by this parser provider\r | |
92 | */\r | |
12c155f5 | 93 | public TmfEventsTable getEventsTable(ITmfTrace<?> trace, Composite parent, int cacheSize);\r |
abfad0aa FC |
94 | \r |
95 | }\r |