Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-07-19 19:56:39 +0000
committerTom Schindl2015-07-19 19:56:39 +0000
commit7ae9347f16730e8a0f747eba8e34d6fabf7175f9 (patch)
tree24eefc383e800dd06c772b04df3e744cff74677e /bundles/code/org.eclipse.fx.text
parent2b20c2b68203cc50b92c8b85efe2a1155f1e5e9e (diff)
downloadorg.eclipse.efxclipse-7ae9347f16730e8a0f747eba8e34d6fabf7175f9.tar.gz
org.eclipse.efxclipse-7ae9347f16730e8a0f747eba8e34d6fabf7175f9.tar.xz
org.eclipse.efxclipse-7ae9347f16730e8a0f747eba8e34d6fabf7175f9.zip
add a fixed WS detector
Diffstat (limited to 'bundles/code/org.eclipse.fx.text')
-rw-r--r--bundles/code/org.eclipse.fx.text/src/org/eclipse/jface/text/rules/FixedCharacterWSDetector.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/bundles/code/org.eclipse.fx.text/src/org/eclipse/jface/text/rules/FixedCharacterWSDetector.java b/bundles/code/org.eclipse.fx.text/src/org/eclipse/jface/text/rules/FixedCharacterWSDetector.java
new file mode 100644
index 000000000..7679c1bf2
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.text/src/org/eclipse/jface/text/rules/FixedCharacterWSDetector.java
@@ -0,0 +1,25 @@
+package org.eclipse.jface.text.rules;
+
+import java.util.List;
+
+public class FixedCharacterWSDetector implements IWhitespaceDetector {
+ private final char[] chars;
+
+ public FixedCharacterWSDetector(List<String> list) {
+ chars = new char[list.size()];
+ int i = 0;
+ for( String s : list ) {
+ chars[i++] = s.charAt(0);
+ }
+ }
+
+ @Override
+ public boolean isWhitespace(char c) {
+ for( char ch : chars ) {
+ if( ch == c ) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file

Back to the top