diff dwtx/jface/internal/text/link/contentassist/LineBreakingReader.d @ 158:25f1f92fa3df

...
author Frank Benoit <benoit@tionex.de>
date Tue, 26 Aug 2008 02:46:34 +0200
parents 6dcb0baaa031
children 1a5b8f8129df
line wrap: on
line diff
--- a/dwtx/jface/internal/text/link/contentassist/LineBreakingReader.d	Mon Aug 25 19:06:44 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/LineBreakingReader.d	Tue Aug 26 02:46:34 2008 +0200
@@ -24,13 +24,8 @@
 
 
 import dwt.dwthelper.utils;
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-import com.ibm.icu.text.BreakIterator;
+import dwtx.dwtxhelper.BufferedReader;
+import dwtx.dwtxhelper.mangoicu.UBreakIterator;
 
 import dwt.graphics.GC;
 
@@ -46,12 +41,12 @@
     private String fLine;
     private int fOffset;
 
-    private BreakIterator fLineBreakIterator;
+    private UBreakIterator fLineBreakIterator;
     private bool fBreakWords;
 
     /**
      * Creates a reader that breaks an input text to fit in a given width.
-     * 
+     *
      * @param reader Reader of the input text
      * @param gc The graphic context that defines the currently used font sizes
      * @param maxLineWidth The max width (pixels) where the text has to fit in
@@ -62,7 +57,7 @@
         fMaxWidth= maxLineWidth;
         fOffset= 0;
         fLine= null;
-        fLineBreakIterator= BreakIterator.getLineInstance();
+        fLineBreakIterator= UBreakIterator.getLineInstance();
         fBreakWords= true;
     }
 
@@ -73,9 +68,9 @@
     /**
      * Reads the next line. The lengths of the line will not exceed the given maximum
      * width.
-     * 
-     * @return the next line 
-     * @throws IOException 
+     *
+     * @return the next line
+     * @throws IOException
      */
     public String readLine()  {
         if (fLine is null) {
@@ -93,7 +88,7 @@
         }
         int breakOffset= findNextBreakOffset(fOffset);
         String res;
-        if (breakOffset !is BreakIterator.DONE) {
+        if (breakOffset !is UBreakIterator.DONE) {
             res= fLine.substring(fOffset, breakOffset);
             fOffset= findWordBegin(breakOffset);
             if (fOffset is fLine.length()) {
@@ -109,7 +104,7 @@
     private int findNextBreakOffset(int currOffset) {
         int currWidth= 0;
         int nextOffset= fLineBreakIterator.following(currOffset);
-        while (nextOffset !is BreakIterator.DONE) {
+        while (nextOffset !is UBreakIterator.DONE) {
             String word= fLine.substring(currOffset, nextOffset);
             int wordWidth= fGC.textExtent(word).x;
             int nextWidth= wordWidth + currWidth;