Improved PDF export (every article is a chapter, outline, FileDialog)
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / renderer / StringUtil.java
1 package net.sourceforge.phpeclipse.wiki.renderer;
2
3 public class StringUtil {
4
5   /**
6    * @param body
7    * @param j
8    * @return
9    */
10   public static boolean checkNoContent(String body) {
11     char ch;
12     boolean noContent = true;
13     int j = 0;
14     try {
15       while (true) {
16         ch = body.charAt(j++);
17         if (!Character.isWhitespace(ch)) {
18           if (ch == '<' && body.charAt(j) == '!' && body.charAt(j + 1) == '-' && body.charAt(j + 2) == '-') {
19             //<!-- ... -->
20             j += 3;
21             while (true) {
22               ch = body.charAt(j++);
23               if (ch == '-' && body.charAt(j) == '-' && body.charAt(j + 1) == '>') {
24                 j += 2;
25                 break;
26               }
27             }
28           } else if (ch == '<' && body.charAt(j) == 'b' && body.charAt(j + 1) == 'r' && body.charAt(j + 2) == '>') {
29             // <br>
30           } else {
31             noContent = false;
32             break;
33           }
34         }
35       }
36     } catch (IndexOutOfBoundsException e) {
37   
38     }
39     return noContent;
40   }
41
42 }