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
.lttng
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.IBaseEventInfo
;
15 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.ITraceControlComponent
;
16 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.TraceEventType
;
17 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.TraceLogLevel
;
20 * <b><u>BaseEventComponent</u></b>
22 * Implementation of the base trace event component.
25 public class BaseEventComponent
extends TraceControlComponent
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 * Path to icon file for this component.
32 public static final String TRACE_EVENT_ICON_FILE_ENABLED
= "icons/obj16/event_enabled.gif"; //$NON-NLS-1$
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
38 * The Event information implementation.
40 private IBaseEventInfo fEventInfo
;
42 // ------------------------------------------------------------------------
44 // ------------------------------------------------------------------------
48 * @param name - the name of the component.
49 * @param parent - the parent of this component.
51 public BaseEventComponent(String name
, ITraceControlComponent parent
) {
53 setImage(TRACE_EVENT_ICON_FILE_ENABLED
);
54 fEventInfo
= new EventInfo(name
);
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
61 * Sets the event information.
62 * @param eventInfo - the event info to set.
64 public void setEventInfo(IBaseEventInfo eventInfo
) {
65 fEventInfo
= eventInfo
;
69 * @return the event type.
71 public TraceEventType
getEventType() {
72 return fEventInfo
.getEventType();
76 * Sets the event type to the given value.
77 * @param type - type to set.
79 public void setEventType(TraceEventType type
) {
80 fEventInfo
.setEventType(type
);
84 * Sets the event type to the value specified by the give name.
85 * @param typeName - the type name.
87 public void setEventType(String typeName
) {
88 fEventInfo
.setEventType(typeName
);
92 * @return the trace event log level
94 public TraceLogLevel
getLogLevel() {
95 return fEventInfo
.getLogLevel();
99 * Sets the trace event log level to the given level
100 * @param level - event log level to set
102 public void setLogLevel(TraceLogLevel level
) {
103 fEventInfo
.setLogLevel(level
);
107 * Sets the trace event log level to the level specified by the given name.
108 * @param levelName - event log level name
110 public void setLogLevel(String levelName
) {
111 fEventInfo
.setLogLevel(levelName
);
114 // ------------------------------------------------------------------------
116 // ------------------------------------------------------------------------