Commit | Line | Data |
---|---|---|
6151d86c | 1 | /******************************************************************************* |
deaae6e1 | 2 | * Copyright (c) 2012, 2014 Ericsson |
6151d86c PT |
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 | ||
faa38350 | 13 | package org.eclipse.linuxtools.tmf.core.signal; |
6151d86c PT |
14 | |
15 | import org.eclipse.core.resources.IFile; | |
6151d86c | 16 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
6151d86c PT |
17 | |
18 | /** | |
19 | * Signal indicating a trace has been opened. | |
20 | * | |
faa38350 PT |
21 | * Receivers can get ready to receive TmfTraceRangeUpdatedSignal for coalescing |
22 | * and can expect TmfTraceSelectedSignal to follow. | |
23 | * | |
6151d86c PT |
24 | * @version 1.0 |
25 | * @author Patrick Tasse | |
faa38350 | 26 | * @since 2.0 |
6151d86c PT |
27 | */ |
28 | public class TmfTraceOpenedSignal extends TmfSignal { | |
29 | ||
30 | private final ITmfTrace fTrace; | |
deaae6e1 | 31 | private final IFile fEditorFile; |
6151d86c PT |
32 | |
33 | /** | |
34 | * Constructor for a new signal. | |
35 | * | |
36 | * @param source | |
37 | * The object sending this signal | |
38 | * @param trace | |
39 | * The trace that has been opened | |
deaae6e1 PT |
40 | * @param editorFile |
41 | * Pointer to the editor file | |
6151d86c | 42 | */ |
deaae6e1 | 43 | public TmfTraceOpenedSignal(Object source, ITmfTrace trace, IFile editorFile) { |
6151d86c PT |
44 | super(source); |
45 | fTrace = trace; | |
deaae6e1 | 46 | fEditorFile = editorFile; |
6151d86c PT |
47 | } |
48 | ||
49 | /** | |
50 | * Get the trace object concerning this signal | |
51 | * | |
52 | * @return The trace | |
53 | */ | |
54 | public ITmfTrace getTrace() { | |
55 | return fTrace; | |
56 | } | |
57 | ||
58 | /** | |
deaae6e1 | 59 | * Get a pointer to the editor file for this trace |
6151d86c PT |
60 | * |
61 | * @return The IFile object | |
deaae6e1 | 62 | * @since 3.0 |
6151d86c | 63 | */ |
deaae6e1 PT |
64 | public IFile getEditorFile() { |
65 | return fEditorFile; | |
6151d86c PT |
66 | } |
67 | ||
6151d86c PT |
68 | @Override |
69 | public String toString() { | |
70 | return "[TmfTraceOpenedSignal (" + fTrace.getName() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ | |
71 | } | |
72 | } |