1 11 package org.eclipse.jdt.internal.ui.text.spelling; 12 13 import com.ibm.icu.text.BreakIterator; 14 15 import java.util.Locale ; 16 17 import org.eclipse.jface.text.IDocument; 18 import org.eclipse.jface.text.IRegion; 19 20 21 27 public class PropertiesFileSpellCheckIterator extends SpellCheckIterator { 28 29 public PropertiesFileSpellCheckIterator(IDocument document, IRegion region, Locale locale) { 30 super(document, region, locale); 31 } 32 33 36 public final Object next() { 37 int previous= -1; 38 String token= nextToken(); 39 while (fSuccessor != BreakIterator.DONE && (token == null || fContent.charAt(fNext) == '&')) { 40 if (token != null) { 41 if (previous == -1) 42 previous= fPrevious; 43 String nextToken= nextToken(); 44 if (nextToken != null) 45 token= token + nextToken.substring(1); 46 else 47 token= token + '&'; 48 } else 49 token= nextToken(); 50 51 } 52 53 if (previous != -1) 54 fPrevious= previous; 55 56 if (token != null && token.length() > 1 && token.startsWith("&")) { token= token.substring(1); 58 59 while (fPrevious > 0 && !Character.isWhitespace(fContent.charAt(fPrevious - 1)) && fContent.charAt(fPrevious - 1) != '=') { 61 token= fContent.charAt(fPrevious - 1) + token; 62 fPrevious--; 63 } 64 65 } 66 67 fLastToken= token; 68 69 return token; 70 } 71 72 } 73 | Popular Tags |