Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2002-06-27 16:59:43 +0000
committercvs2svn2002-06-27 16:59:43 +0000
commit87224127c429282d8f2e44e4d67b114eca521134 (patch)
treee2719b5ab55055810bac9de53996e5a463eca84c
parent8c5e9f69f6d9608660099e93ee15f2a938ed7894 (diff)
downloadeclipse.platform.text-87224127c429282d8f2e44e4d67b114eca521134.tar.gz
eclipse.platform.text-87224127c429282d8f2e44e4d67b114eca521134.tar.xz
eclipse.platform.text-87224127c429282d8f2e44e4d67b114eca521134.zip
This commit was manufactured by cvs2svn to create branch 'R2_0_1'.
Sprout from master 2002-06-27 16:59:40 UTC Kai Maetzel <kmaetzel> 'Example code' Delete: org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaWordDetector.java
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaWordDetector.java63
1 files changed, 0 insertions, 63 deletions
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaWordDetector.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaWordDetector.java
deleted file mode 100644
index 6aaf28508..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaWordDetector.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.ui.examples.javaeditor.java;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-
-/**
- * Detects Java words in documents.
- */
-public class JavaWordDetector {
-
- /**
- * Find the location of the word at offset in document.
- * @returns Point - x is the start position, y is the end position.
- * Return null if it is not found.
- * @param document the document being searched.
- * @param offset - the position to start searching from.
- */
- public static Point findWord(IDocument document, int offset) {
-
- int start= -1;
- int end= -1;
-
- try {
-
- int position= offset;
- char character;
-
- while (position >= 0) {
- character= document.getChar(position);
- if (!Character.isJavaIdentifierPart(character))
- break;
- --position;
- }
-
- start= position;
-
- position= offset;
- int length= document.getLength();
-
- while (position < length) {
- character= document.getChar(position);
- if (!Character.isJavaIdentifierPart(character))
- break;
- ++position;
- }
-
- end= position;
-
- if (end > start)
- return new Point(start, end - start);
-
- } catch (BadLocationException x) {
- }
-
- return null;
- }
-}

Back to the top