tmf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / editors / TmfEditor.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 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 * Patrick Tasse - Initial API and implementation
11 * Bernd Hufmann - Add interface for broadcasting signals asynchronously
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.tmf.ui.editors;
15
16 import org.eclipse.tracecompass.tmf.core.component.ITmfComponent;
17 import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
18 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
19 import org.eclipse.ui.part.EditorPart;
20
21 /**
22 * The main editor abstract class for use in TMF.
23 *
24 * @author Patrick Tasse
25 */
26 public abstract class TmfEditor extends EditorPart implements ITmfComponent {
27
28 private final String fName;
29
30 // ------------------------------------------------------------------------
31 // Constructor
32 // ------------------------------------------------------------------------
33
34 /**
35 * Default constructor
36 */
37 public TmfEditor() {
38 super();
39 fName = "TmfEditor"; //$NON-NLS-1$
40 TmfSignalManager.register(this);
41 }
42
43 @Override
44 public void dispose() {
45 TmfSignalManager.deregister(this);
46 super.dispose();
47 }
48
49 // ------------------------------------------------------------------------
50 // ITmfComponent
51 // ------------------------------------------------------------------------
52
53 @Override
54 public String getName() {
55 return fName;
56 }
57
58 @Override
59 public void broadcast(TmfSignal signal) {
60 TmfSignalManager.dispatchSignal(signal);
61 }
62
63 @Override
64 public void broadcastAsync(TmfSignal signal) {
65 TmfSignalManager.dispatchSignalAsync(signal);
66 }
67 }
This page took 0.075603 seconds and 5 git commands to generate.