1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.IEventInfo
;
15 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.ITraceControlComponent
;
16 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.property
.TraceProbeEventPropertySource
;
17 import org
.eclipse
.ui
.views
.properties
.IPropertySource
;
21 * <b><u>TraceProbeEventComponent</u></b>
23 * Implementation of the trace channel component.
26 public class TraceProbeEventComponent
extends TraceEventComponent
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 // ------------------------------------------------------------------------
37 // ------------------------------------------------------------------------
40 * @param name - the name of the component.
41 * @param parent - the parent of this component.
43 public TraceProbeEventComponent(String name
, ITraceControlComponent parent
) {
45 fEventInfo
= new ProbeEventInfo(name
);
48 // ------------------------------------------------------------------------
50 // ------------------------------------------------------------------------
53 * Sets the event information.
54 * @param eventInfo - the event information to set.
57 public void setEventInfo(IEventInfo eventInfo
) {
58 if (eventInfo
instanceof ProbeEventInfo
) {
59 fEventInfo
= eventInfo
;
62 throw new IllegalArgumentException("Invalid type passed. Only class of type ProbeEventInfo allowed:\n" + eventInfo
.getClass()); //$NON-NLS-1$
67 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
69 @SuppressWarnings("rawtypes")
71 public Object
getAdapter(Class adapter
) {
72 if (adapter
== IPropertySource
.class) {
73 return new TraceProbeEventPropertySource(this);
78 * @return the address of the probe. (null if Symbol is used)
80 public String
getAddress() {
81 return getEventInfo().getAddress();
84 * Sets the address of the probe.
85 * @param address - a address
87 public void setAddress(String address
) {
88 getEventInfo().setAddress(address
);
91 * @return the offset applied to the symbol.
93 public String
getOffset() {
94 return getEventInfo().getOffset();
97 * Sets the offset applied to the symbol. (valid if symbol is used)
98 * @param offset - a offset
100 public void setOffset(String offset
) {
101 getEventInfo().setOffset(offset
);
104 * @return the symbol name. (null if address is used)
106 public String
getSymbol() {
107 return getEventInfo().getSymbol();
110 * Sets the symbol name.
111 * @param symbol - a symbol name (null if address is used)
113 public void setSymbol(String symbol
) {
114 getEventInfo().setSymbol(symbol
);
117 // ------------------------------------------------------------------------
119 // ------------------------------------------------------------------------
120 private ProbeEventInfo
getEventInfo() {
121 return (ProbeEventInfo
) fEventInfo
;