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