tmf: Update Javadoc throughout tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / TmfView.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2012 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.views;
14
15 import org.eclipse.linuxtools.tmf.core.component.ITmfComponent;
16 import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
17 import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
18 import org.eclipse.ui.part.ViewPart;
19
20 /**
21 * Basic abstract TMF view class implementation.
22 *
23 * It registers any sub class to the signal manager for receiving and sending
24 * TMF signals.
25 *
26 * @version 1.0
27 * @author Francois Chouinard
28 */
29 public abstract class TmfView extends ViewPart implements ITmfComponent {
30
31 private final String fName;
32
33 // ------------------------------------------------------------------------
34 // Constructor
35 // ------------------------------------------------------------------------
36
37 /**
38 * Constructor. Creates a TMF view and registers to the signal manager.
39 *
40 * @param viewName A view name
41 */
42 public TmfView(String viewName) {
43 super();
44 fName = viewName;
45 TmfSignalManager.register(this);
46 }
47
48 /**
49 * Disposes this view and deregisters itself from the signal manager
50 * @see org.eclipse.ui.part.WorkbenchPart#dispose()
51 */
52 @Override
53 public void dispose() {
54 TmfSignalManager.deregister(this);
55 super.dispose();
56 }
57
58 // ------------------------------------------------------------------------
59 // ITmfComponent
60 // ------------------------------------------------------------------------
61
62 /*
63 * (non-Javadoc)
64 * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#getName()
65 */
66 @Override
67 public String getName() {
68 return fName;
69 }
70
71 /*
72 * (non-Javadoc)
73 * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#broadcast(org.eclipse.linuxtools.tmf.core.signal.TmfSignal)
74 */
75 @Override
76 public void broadcast(TmfSignal signal) {
77 TmfSignalManager.dispatchSignal(signal);
78 }
79
80 }
This page took 0.031336 seconds and 5 git commands to generate.