Commit | Line | Data |
---|---|---|
bd9f92a8 | 1 | /********************************************************************** |
ed902a2b | 2 | * Copyright (c) 2013, 2014 Ericsson |
bd9f92a8 BH |
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 | ||
9bc60be7 | 13 | package org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl; |
bd9f92a8 BH |
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 | } |