Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-09-18 07:19:47 +0000
committerTobias Schwarz2013-09-18 07:19:47 +0000
commit7506214108feb71f28e888ce322d32a4b0b81cff (patch)
treec36f29a971cb944cd077005e323b873dfa1f6967 /target_explorer
parent67b9727d6c2bc6139c508b1be7a5576a507783a3 (diff)
downloadorg.eclipse.tcf-7506214108feb71f28e888ce322d32a4b0b81cff.tar.gz
org.eclipse.tcf-7506214108feb71f28e888ce322d32a4b0b81cff.tar.xz
org.eclipse.tcf-7506214108feb71f28e888ce322d32a4b0b81cff.zip
Target Explorer: add new target path validator
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java33
3 files changed, 39 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java
index 625662db4..100ae4c27 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java
@@ -121,6 +121,9 @@ public class Messages extends NLS {
public static String DirectoryNameValidator_Error_IsRelativ;
public static String DirectoryNameValidator_Error_IsAbsolut;
+ public static String TargetPathValidator_Information_MissingTargetPath;
+ public static String TargetPathValidator_Error_InvalidTargetPath;
+
public static String RegexValidator_Information_MissingValue;
public static String RegexValidator_Error_InvalidValue;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties
index 4e87af3eb..39a45983e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties
@@ -62,6 +62,9 @@ DirectoryNameValidator_Error_NoAccess=The directory you entered cannot be access
DirectoryNameValidator_Error_IsRelativ=The directory path you entered cannot be relative.
DirectoryNameValidator_Error_IsAbsolut=The directory path you entered cannot be absolute.
+TargetPathValidator_Information_MissingTargetPath=Please enter a target path.
+TargetPathValidator_Error_InvalidTargetPath=The target path you entered is not valid.
+
RegexValidator_Information_MissingValue=Please enter a value.
RegexValidator_Error_InvalidValue=The value you entered is not valid.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java
new file mode 100644
index 000000000..e305ec298
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.ui.controls.validator;
+
+import org.eclipse.tcf.te.ui.controls.nls.Messages;
+
+/**
+ * TargetPathValidator
+ */
+public class TargetPathValidator extends RegexValidator {
+
+ protected static final String TARGET_PATH_SEGMENT_REGEX = "[^?* /\\\\]+|([^?* /\\\\]+[^?*/\\\\]*)"; //$NON-NLS-1$
+ protected static final String TARGET_PATH_REGEX = "(/(" + TARGET_PATH_SEGMENT_REGEX + "))+"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * Constructor.
+ * @param attributes
+ * @param regex
+ */
+ public TargetPathValidator(int attributes) {
+ super(attributes, TARGET_PATH_REGEX);
+ setMessageText(INFO_MISSING_VALUE, Messages.TargetPathValidator_Information_MissingTargetPath);
+ setMessageText(ERROR_INVALID_VALUE, Messages.TargetPathValidator_Error_InvalidTargetPath);
+ }
+}

Back to the top