/**********************************************************************
* Copyright (c) 2012 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:
+ *
+ * Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
* <p>
* Property source implementation for the target node component.
* </p>
- *
+ *
* @author Bernd Hufmann
*/
public class TargetNodePropertySource extends BasePropertySource {
*/
public static final String TARGET_NODE_STATE_PROPERTY_ID = "target.node.state"; //$NON-NLS-1$
/**
- * The node name property name.
+ * The node version property ID.
+ */
+ public static final String TARGET_NODE_VERSION_PROPERTY_ID = "target.node.version"; //$NON-NLS-1$
+
+ /**
+ * The node name property name.
*/
public static final String TARGET_NODE_NAME_PROPERTY_NAME = Messages.TraceControl_HostNamePropertyName;
/**
* The state address property name.
*/
public static final String TARGET_NODE_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName;
-
+ /**
+ * The node version property name.
+ */
+ public static final String TARGET_NODE_VERSION_PROPERTY_NAME = Messages.TraceControl_VersionPropertyName;
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
/**
- * The node component which this property source is for.
+ * The node component which this property source is for.
*/
private final TargetNodeComponent fTargetNode;
-
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
public TargetNodePropertySource(TargetNodeComponent component) {
fTargetNode = component;
}
-
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
return new IPropertyDescriptor[] {
new TextPropertyDescriptor(TARGET_NODE_NAME_PROPERTY_ID, TARGET_NODE_NAME_PROPERTY_NAME),
new TextPropertyDescriptor(TARGET_NODE_ADDRESS_PROPERTY_ID, TARGET_NODE_ADDRESS_PROPERTY_NAME),
- new TextPropertyDescriptor(TARGET_NODE_STATE_PROPERTY_ID, TARGET_NODE_STATE_PROPERTY_NAME)};
+ new TextPropertyDescriptor(TARGET_NODE_STATE_PROPERTY_ID, TARGET_NODE_STATE_PROPERTY_NAME),
+ new TextPropertyDescriptor(TARGET_NODE_VERSION_PROPERTY_ID, TARGET_NODE_VERSION_PROPERTY_NAME)};
}
/*
if (TARGET_NODE_STATE_PROPERTY_ID.equals(id)) {
return fTargetNode.getTargetNodeState().name();
}
+ if (TARGET_NODE_VERSION_PROPERTY_ID.equals(id)) {
+ return fTargetNode.getNodeVersion();
+ }
return null;
}
}
int index = 0;
while (index < result.getOutput().length) {
String line = result.getOutput()[index];
- Matcher matcher = LTTngControlServiceConstants.VERSION_PATTERN.matcher(line);
- if (matcher.matches()) {
- String version = matcher.group(1).trim();
- if (version.startsWith(LTTngControlServiceConstants.LTTNG_MAJOR_VERSION_2_0)) {
+ Matcher versionMatcher = LTTngControlServiceConstants.VERSION_PATTERN.matcher(line);
+ if (versionMatcher.matches()) {
+ String version = versionMatcher.group(1).trim();
+ Matcher matcher = LTTngControlServiceConstants.VERSION_2_PATTERN.matcher(version);
+ if (matcher.matches()) {
LTTngControlService service = new LTTngControlService(shell);
service.setVersion(version);
return service;