lttng: Rename lttng2 feature/plugins to lttng2.control
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.control.ui / src / org / eclipse / linuxtools / internal / lttng2 / control / ui / views / model / impl / TraceControlPropertyTester.java
1 /**********************************************************************
2 * Copyright (c) 2013 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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12
13 package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl;
14
15 import org.eclipse.core.expressions.PropertyTester;
16
17 /**
18 *
19 * Property Tester Implementation for Trace Control Components.
20 *
21 * @author Bernd Hufmann
22 */
23 public class TraceControlPropertyTester extends PropertyTester {
24
25 // ------------------------------------------------------------------------
26 // Constants
27 // ------------------------------------------------------------------------
28 private static final String ADD_CONTEXT_SUPPORT_PROPERTY = "isAddContextOnEventSupported"; //$NON-NLS-1$
29
30
31 @Override
32 public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
33
34 // Check if node supports adding contexts on event level.
35 if (ADD_CONTEXT_SUPPORT_PROPERTY.equals(property)) {
36 if ((receiver != null) && (receiver instanceof TraceEventComponent)) {
37 TraceEventComponent event = (TraceEventComponent) receiver;
38 TargetNodeComponent node = event.getTargetNode();
39 return node.isContextOnEventSupported();
40 }
41 }
42 return false;
43 }
44 }
This page took 0.044771 seconds and 5 git commands to generate.