| 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.editors; |
| 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.MultiPageEditorPart; |
| 19 | |
| 20 | /** |
| 21 | * Multi-page editor part abstract class for use in TMF. |
| 22 | * |
| 23 | * @version 1.0 |
| 24 | * @author Patrick Tasse |
| 25 | */ |
| 26 | public abstract class TmfMultiPageEditorPart extends MultiPageEditorPart implements ITmfComponent { |
| 27 | |
| 28 | private final String fName; |
| 29 | |
| 30 | // ------------------------------------------------------------------------ |
| 31 | // Constructor |
| 32 | // ------------------------------------------------------------------------ |
| 33 | |
| 34 | /** |
| 35 | * Default constructor |
| 36 | */ |
| 37 | public TmfMultiPageEditorPart() { |
| 38 | super(); |
| 39 | fName = "TmfMultiPageEditorPart"; //$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 | } |