Commit | Line | Data |
---|---|---|
b6eb4dce VP |
1 | /******************************************************************************* |
2 | * Copyright (c) 2014 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 | * Vincent Perot - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
93d1d135 | 13 | package org.eclipse.linuxtools.internal.tmf.pcap.core.signal; |
b6eb4dce VP |
14 | |
15 | import org.eclipse.jdt.annotation.Nullable; | |
93d1d135 | 16 | import org.eclipse.linuxtools.internal.tmf.pcap.core.event.TmfPacketStream; |
b6eb4dce | 17 | import org.eclipse.linuxtools.tmf.core.signal.TmfSignal; |
b6eb4dce VP |
18 | |
19 | /** | |
20 | * TmfSignal that is broadcasted when a new packet stream is chosen. Views that | |
21 | * are network-specific can uses this signal to track when the user selects a | |
22 | * new stream. | |
23 | * | |
24 | * @author Vincent Perot | |
25 | */ | |
26 | public class TmfPacketStreamSelectedSignal extends TmfSignal { | |
27 | ||
28 | private final @Nullable TmfPacketStream fStream; | |
29 | ||
30 | /** | |
31 | * Standard constructor | |
32 | * | |
33 | * @param source | |
34 | * Object sending this signal | |
35 | * @param reference | |
36 | * Reference index to assign to this signal | |
37 | * @param stream | |
38 | * The new stream. It can be null if the user cleared the | |
39 | * selection. | |
40 | */ | |
41 | public TmfPacketStreamSelectedSignal(Object source, int reference, @Nullable TmfPacketStream stream) { | |
42 | super(source, reference); | |
43 | fStream = stream; | |
44 | } | |
45 | ||
46 | /** | |
47 | * Getter method that returns the stream. | |
48 | * | |
49 | * @return The stream. | |
50 | */ | |
51 | public @Nullable TmfPacketStream getStream() { | |
52 | return fStream; | |
53 | } | |
54 | } |