A new display will open for selecting one or more contexts to add. Select one or more contexts as described in chapter [[#Adding Contexts to Channels and Events of a Domain | Adding Contexts to Channels and Events of a Domain]]. Upon successful operation, the selected context will be added to all channels and their events of the selected domain. '''Note''' that the LTTng 2.0 tracer control on the remote host doesn't provide a way to retrieve added contexts. Hence it's not possible to display the context information in the GUI.
-==== Adding Contexts to a Event of a Specific Channel ====
+==== Adding Contexts to an Event of a Specific Channel ====
-Adding contexts to a event of a channel, select an event of a channel, click right mouse button on the corresponding event tree node and select the menu item '''Add Context...''' from the context-sensitive menu.
+Adding contexts to an event of a channel is only available in LTTng Tools versions v2.0.0-2.1.x. The menu option won't be visible for LTTng Tools version v2.2.0 or later. To add contexts on an event select an event of a channel, click right mouse button on the corresponding event tree node and select the menu item '''Add Context...''' from the context-sensitive menu.
[[Image:images/LTTng2AddContextToEventsAction.png]]
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.ui.ide,
+ org.eclipse.core.expressions,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.linuxtools.lttng2.core;bundle-version="2.1.0",
<with
variable="activeMenuSelection">
<and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
<count
value="1">
</count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <or>
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
+ </instanceof>
+ </or>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.isAddContextOnEventSupported">
+ </test>
+ </and>
+ </iterate>
</and>
</with>
</visibleWhen>
</command>
-
<command
commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate"
icon="icons/elcl16/calibrate.gif"
class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferenceInitializer">
</initializer>
</extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlPropertyTester"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.propertyTester"
+ namespace="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model"
+ properties="isAddContextOnEventSupported"
+ type="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent">
+ </propertyTester>
+ </extension>
</plugin>
return getControlService().isVersionSupported("2.3.0"); //$NON-NLS-1$
}
+ /**
+ * Returns if node supports adding contexts on event
+ * @return <code>true</code> if it supports adding contexts on events else <code>false</code>
+ *
+ */
+ public boolean isContextOnEventSupported() {
+ return !getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
+
+import org.eclipse.core.expressions.PropertyTester;
+
+/**
+ *
+ * Property Tester Implementation for Trace Control Components.
+ *
+ * @author Bernd Hufmann
+ */
+public class TraceControlPropertyTester extends PropertyTester {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final String ADD_CONTEXT_SUPPORT_PROPERTY = "isAddContextOnEventSupported"; //$NON-NLS-1$
+
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ // Check if node supports adding contexts on event level.
+ if (ADD_CONTEXT_SUPPORT_PROPERTY.equals(property)) {
+ if ((receiver != null) && (receiver instanceof TraceEventComponent)) {
+ TraceEventComponent event = (TraceEventComponent) receiver;
+ TargetNodeComponent node = event.getTargetNode();
+ return node.isContextOnEventSupported();
+ }
+ }
+ return false;
+ }
+}
return null;
}
+ /**
+ * @return target node component.
+ */
+ public TargetNodeComponent getTargetNode() {
+ return ((TraceChannelComponent)getParent()).getTargetNode();
+ }
+
/**
* @return session name from parent
*/