Commit | Line | Data |
---|---|---|
6151d86c PT |
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.signal; | |
14 | ||
15 | import org.eclipse.core.resources.IFile; | |
16 | import org.eclipse.linuxtools.tmf.core.signal.TmfSignal; | |
17 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; | |
18 | import org.eclipse.linuxtools.tmf.ui.viewers.events.ITmfEventsFilterProvider; | |
19 | ||
20 | /** | |
21 | * Signal indicating a trace has been opened. | |
22 | * | |
23 | * @version 1.0 | |
24 | * @author Patrick Tasse | |
25 | */ | |
26 | public class TmfTraceOpenedSignal extends TmfSignal { | |
27 | ||
28 | private final ITmfTrace fTrace; | |
29 | private final IFile fBookmarksFile; | |
30 | private final ITmfEventsFilterProvider fEventsFilterProvider; | |
31 | ||
32 | /** | |
33 | * Constructor for a new signal. | |
34 | * | |
35 | * @param source | |
36 | * The object sending this signal | |
37 | * @param trace | |
38 | * The trace that has been opened | |
39 | * @param bookmarksFile | |
40 | * Pointer to the bookmark file | |
41 | * @param eventsFilterProvider | |
42 | * Provider for the event filter in use | |
43 | */ | |
44 | public TmfTraceOpenedSignal(Object source, ITmfTrace trace, | |
45 | IFile bookmarksFile, ITmfEventsFilterProvider eventsFilterProvider) { | |
46 | super(source); | |
47 | fTrace = trace; | |
48 | fBookmarksFile = bookmarksFile; | |
49 | fEventsFilterProvider = eventsFilterProvider; | |
50 | } | |
51 | ||
52 | /** | |
53 | * Get the trace object concerning this signal | |
54 | * | |
55 | * @return The trace | |
56 | */ | |
57 | public ITmfTrace getTrace() { | |
58 | return fTrace; | |
59 | } | |
60 | ||
61 | /** | |
62 | * Get a pointer to the bookmark file of this trace | |
63 | * | |
64 | * @return The IFile object | |
65 | */ | |
66 | public IFile getBookmarksFile() { | |
67 | return fBookmarksFile; | |
68 | } | |
69 | ||
70 | /** | |
71 | * Get the events filter provider of this trace | |
72 | * | |
73 | * @return The EventsFilterProvider | |
74 | */ | |
75 | public ITmfEventsFilterProvider getEventsFilterProvider() { | |
76 | return fEventsFilterProvider; | |
77 | } | |
78 | ||
79 | @Override | |
80 | public String toString() { | |
81 | return "[TmfTraceOpenedSignal (" + fTrace.getName() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ | |
82 | } | |
83 | } |