analysis.ui: Add follow cpu context menu to resources view
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.ui / src / org / eclipse / tracecompass / internal / analysis / os / linux / ui / actions / FollowCpuAction.java
1 /*******************************************************************************
2 * Copyright (c) 2016 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
10 package org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions;
11
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal;
15 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
16 import org.eclipse.tracecompass.tmf.ui.views.TmfView;
17
18 /**
19 * CPU Selection Action
20 *
21 * @author Matthew Khouzam
22 */
23 public class FollowCpuAction extends Action {
24
25 private final @NonNull TmfView fView;
26 private final int fCpu;
27 private final @NonNull ITmfTrace fTrace;
28
29 /**
30 * Contructor
31 *
32 * @param view
33 * the view to send a signal
34 * @param cpu
35 * the cpu number
36 * @param trace
37 * the trace
38 */
39 public FollowCpuAction(@NonNull TmfView view, int cpu, @NonNull ITmfTrace trace) {
40 fView = view;
41 fCpu = cpu;
42 fTrace = trace;
43 }
44
45 @Override
46 public String getText() {
47 return Messages.CpuSelectionAction_followCpu + ' ' + fCpu;
48 }
49
50 @Override
51 public void run() {
52 fView.broadcast(new TmfCpuSelectedSignal(fView, fCpu, fTrace));
53 super.run();
54 }
55
56 }
This page took 0.032907 seconds and 5 git commands to generate.