This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 63953
Collapse All | Expand All

(-)nbproject/project.properties (-1 / +1 lines)
Lines 1-3 Link Here
1
javac.compilerargs=-Xlint:unchecked
1
javac.compilerargs=-Xlint:unchecked
2
javac.source=1.5
2
javac.source=1.5
3
spec.version.base=1.0.0
3
spec.version.base=2.0.0
(-)nbproject/project.xml (-4 / +45 lines)
Lines 6-11 Link Here
6
            <code-name-base>org.netbeans.modules.showtodos</code-name-base>
6
            <code-name-base>org.netbeans.modules.showtodos</code-name-base>
7
            <module-dependencies>
7
            <module-dependencies>
8
                <dependency>
8
                <dependency>
9
                    <code-name-base>org.netbeans.modules.editor</code-name-base>
10
                    <build-prerequisite/>
11
                    <compile-dependency/>
12
                    <run-dependency>
13
                        <release-version>3</release-version>
14
                        <specification-version>1.42</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
9
                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
18
                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
10
                    <build-prerequisite/>
19
                    <build-prerequisite/>
11
                    <compile-dependency/>
20
                    <compile-dependency/>
Lines 42-47 Link Here
42
                    </run-dependency>
51
                    </run-dependency>
43
                </dependency>
52
                </dependency>
44
                <dependency>
53
                <dependency>
54
                    <code-name-base>org.netbeans.modules.editor.util</code-name-base>
55
                    <build-prerequisite/>
56
                    <compile-dependency/>
57
                    <run-dependency>
58
                        <release-version>1</release-version>
59
                        <specification-version>1.28</specification-version>
60
                    </run-dependency>
61
                </dependency>
62
                <dependency>
45
                    <code-name-base>org.netbeans.modules.lexer</code-name-base>
63
                    <code-name-base>org.netbeans.modules.lexer</code-name-base>
46
                    <build-prerequisite/>
64
                    <build-prerequisite/>
47
                    <compile-dependency/>
65
                    <compile-dependency/>
Lines 60-81 Link Here
60
                    </run-dependency>
78
                    </run-dependency>
61
                </dependency>
79
                </dependency>
62
                <dependency>
80
                <dependency>
63
                    <code-name-base>org.openide.util</code-name-base>
81
                    <code-name-base>org.openide.filesystems</code-name-base>
64
                    <build-prerequisite/>
82
                    <build-prerequisite/>
65
                    <compile-dependency/>
83
                    <compile-dependency/>
66
                    <run-dependency>
84
                    <run-dependency>
85
                        <specification-version>7.21</specification-version>
86
                    </run-dependency>
87
                </dependency>
88
                <dependency>
89
                    <code-name-base>org.openide.loaders</code-name-base>
90
                    <build-prerequisite/>
91
                    <compile-dependency/>
92
                    <run-dependency>
67
                        <specification-version>6.5</specification-version>
93
                        <specification-version>6.5</specification-version>
68
                    </run-dependency>
94
                    </run-dependency>
69
                </dependency>
95
                </dependency>
70
            <dependency>
96
            <dependency>
71
                    <code-name-base>org.netbeans.modules.editor.deprecated.pre61settings</code-name-base>
97
                    <code-name-base>org.openide.nodes</code-name-base>
72
                    <build-prerequisite/>
98
                    <build-prerequisite/>
73
                    <compile-dependency/>
99
                    <compile-dependency/>
74
                    <run-dependency>
100
                    <run-dependency>
75
                        <release-version>0-1</release-version>
101
                        <specification-version>7.9</specification-version>
76
                        <specification-version>1.0</specification-version>
77
                    </run-dependency>
102
                    </run-dependency>
78
                </dependency>
103
                </dependency>
104
                <dependency>
105
                    <code-name-base>org.openide.text</code-name-base>
106
                    <build-prerequisite/>
107
                    <compile-dependency/>
108
                    <run-dependency>
109
                        <specification-version>6.22</specification-version>
110
                    </run-dependency>
111
                </dependency>
112
                <dependency>
113
                    <code-name-base>org.openide.util</code-name-base>
114
                    <build-prerequisite/>
115
                    <compile-dependency/>
116
                    <run-dependency>
117
                        <specification-version>6.5</specification-version>
118
                    </run-dependency>
119
                </dependency>
79
            </module-dependencies>
120
            </module-dependencies>
80
            <public-packages/>
121
            <public-packages/>
81
        </data>
122
        </data>
(-)src/org/netbeans/modules/showtodos/HighlightTodos.java (-66 / +5 lines)
Lines 1-7 Link Here
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
3
 *
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
4
 * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
5
 *
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
7
 * General Public License Version 2 only ("GPL") or the Common
Lines 40-72 Link Here
40
 */
40
 */
41
package org.netbeans.modules.showtodos;
41
package org.netbeans.modules.showtodos;
42
42
43
import java.util.LinkedList;
43
import static org.netbeans.modules.showtodos.TodoSourceParsing.parse;
44
import java.util.List;
44
import java.util.List;
45
45
46
import java.util.logging.Level;
46
import java.util.logging.Level;
47
import java.util.logging.Logger;
47
import java.util.logging.Logger;
48
import javax.swing.JEditorPane;
48
import javax.swing.JEditorPane;
49
import javax.swing.text.AttributeSet;
49
import javax.swing.text.AttributeSet;
50
import javax.swing.text.BadLocationException;
51
import javax.swing.text.Document;
50
import javax.swing.text.Document;
52
import javax.swing.text.JTextComponent;
51
import javax.swing.text.JTextComponent;
53
52
54
import org.netbeans.api.editor.mimelookup.MimeLookup;
53
import org.netbeans.api.editor.mimelookup.MimeLookup;
55
import org.netbeans.api.editor.settings.FontColorSettings;
54
import org.netbeans.api.editor.settings.FontColorSettings;
56
import org.netbeans.api.lexer.Token;
57
import org.netbeans.api.lexer.TokenHierarchy;
58
import org.netbeans.api.lexer.TokenSequence;
59
import org.netbeans.editor.BaseDocument;
55
import org.netbeans.editor.BaseDocument;
60
import org.netbeans.editor.FinderFactory;
61
import org.netbeans.editor.Utilities;
62
import org.netbeans.modules.tasklist.todo.settings.Settings;
63
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
56
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
64
import org.netbeans.spi.editor.highlighting.HighlightsContainer;
57
import org.netbeans.spi.editor.highlighting.HighlightsContainer;
65
import org.netbeans.spi.editor.highlighting.HighlightsLayer;
58
import org.netbeans.spi.editor.highlighting.HighlightsLayer;
66
import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
59
import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
67
import org.netbeans.spi.editor.highlighting.HighlightsSequence;
60
import org.netbeans.spi.editor.highlighting.HighlightsSequence;
68
import org.netbeans.spi.editor.highlighting.ZOrder;
61
import org.netbeans.spi.editor.highlighting.ZOrder;
69
import org.openide.util.Exceptions;
70
import org.openide.util.Lookup;
62
import org.openide.util.Lookup;
71
63
72
64
Lines 98-164 Link Here
98
        }
90
        }
99
        
91
        
100
        AttributeSet coloring = fcs.getTokenFontColors("todo-tasks"); // NOI18N
92
        AttributeSet coloring = fcs.getTokenFontColors("todo-tasks"); // NOI18N
101
        
102
        if (coloring == null) {
93
        if (coloring == null) {
103
            return HighlightsSequence.EMPTY;
94
            return HighlightsSequence.EMPTY;
104
        }
95
        }
105
        
96
        
106
        List<int[]> highlights = new LinkedList<int[]>();
97
        return new SeqImpl(parse(doc, startOffset, endOffset), coloring);
107
108
        TokenHierarchy th = TokenHierarchy.get(doc);
109
        TokenSequence ts = null;
110
111
        if (th != null) {
112
            ts = th.tokenSequence();
113
        }
98
        }
114
99
115
        try {
116
            startOffset = Utilities.getRowStart(doc, startOffset);
117
            endOffset = Math.min(doc.getLength(), endOffset);
118
        
119
            for (String word : Settings.getDefault().getPatterns()) {
120
                int pos = startOffset;
121
122
                // Search from pos to endPos for TODO markers.
123
                while (pos < endOffset) {
124
                    FinderFactory.WholeWordsFwdFinder finder =
125
                            new FinderFactory.WholeWordsFwdFinder(doc, word, true);
126
                    int next = doc.find(finder, pos, endOffset);
127
128
                    if ((next >= startOffset) && (next < endOffset)) {
129
                        // See if it looks like a token we care about (comments)
130
                        if (ts != null) {
131
                            ts.move(next);
132
133
                            if (ts.moveNext()) {
134
                                Token token = ts.token();
135
                                pos = Math.min(Utilities.getRowEnd(doc, next), ts.offset() + token.length());
136
137
                                if (token != null) {
138
                                    String category = token.id().primaryCategory();
139
140
                                    if ("comment".equals(category)) { // NOI18N
141
                                        highlights.add(new int[]{next, pos});
142
                                    }
143
                                }
144
                            } else {
145
                                pos = next + word.length();
146
                            }
147
                        } else {
148
                            pos = next + word.length();
149
                        }
150
                    } else {
151
                        break;
152
                    }
153
                }
154
            }
155
        } catch (BadLocationException e) {
156
            Exceptions.printStackTrace(e);
157
        }
158
        
159
        return new SeqImpl(highlights, coloring);
160
    }
161
162
    public void addHighlightsChangeListener(HighlightsChangeListener listener) {
100
    public void addHighlightsChangeListener(HighlightsChangeListener listener) {
163
    }
101
    }
164
102
Lines 184-191 Link Here
184
        }
122
        }
185
123
186
        public boolean moveNext() {
124
        public boolean moveNext() {
187
            if (highlights.isEmpty())
125
            if (highlights.isEmpty()) {
188
                return false;
126
                return false;
127
           }
189
            
128
            
190
            current = highlights.remove(0);
129
            current = highlights.remove(0);
191
            
130
            
(-)src/org/netbeans/modules/showtodos/TodoAnnotation.java (+62 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
package org.netbeans.modules.showtodos;
40
41
import org.openide.text.Annotation;
42
43
/**
44
 * @author Michel Graciano
45
 */
46
public final class TodoAnnotation extends Annotation {
47
   private final String message;
48
49
   public TodoAnnotation(String message) {
50
      this.message = message;
51
   }
52
53
   @Override
54
   public String getAnnotationType() {
55
      return "org-netbeans-spi-editor-hints-parser_annotation_todo";
56
   }
57
58
   @Override
59
   public String getShortDescription() {
60
      return message;
61
   }
62
}
(-)src/org/netbeans/modules/showtodos/TodoAnnotationProvider.java (+163 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
package org.netbeans.modules.showtodos;
40
41
import static org.netbeans.modules.showtodos.TodoSourceParsing.parseForLines;
42
import java.io.IOException;
43
import java.lang.ref.Reference;
44
import java.lang.ref.WeakReference;
45
import java.util.ArrayList;
46
import java.util.Collection;
47
import java.util.List;
48
import java.util.Map;
49
import java.util.WeakHashMap;
50
import javax.swing.event.DocumentEvent;
51
import javax.swing.event.DocumentListener;
52
import javax.swing.text.Document;
53
import org.netbeans.editor.BaseDocument;
54
import org.netbeans.lib.editor.util.swing.DocumentListenerPriority;
55
import org.netbeans.lib.editor.util.swing.DocumentUtilities;
56
import org.openide.cookies.EditorCookie;
57
import org.openide.filesystems.FileObject;
58
import org.openide.loaders.DataObject;
59
import org.openide.text.Annotation;
60
import org.openide.text.AnnotationProvider;
61
import org.openide.text.Line;
62
import org.openide.util.Exceptions;
63
import org.openide.util.Lookup;
64
import org.openide.util.RequestProcessor;
65
import org.openide.util.lookup.ServiceProvider;
66
67
/**
68
 * @author Michel Graciano
69
 */
70
@ServiceProvider(service = AnnotationProvider.class)
71
public class TodoAnnotationProvider implements AnnotationProvider {
72
   private static final RequestProcessor requestProcessor =
73
         new RequestProcessor("TODO Annotation Parser", 2);
74
   private final Map<FileObject, Collection<Annotation>> file2annotation =
75
         new WeakHashMap<FileObject, Collection<Annotation>>();
76
77
   public void annotate(Line.Set lines, Lookup context) {
78
      final DataObject dataObj = context.lookup(DataObject.class);
79
      new ScanningDocumentListener().attachTo(dataObj);
80
      annotate(dataObj);
81
   }
82
83
   private void annotate(final DataObject dataObj) {
84
      final FileObject fo = dataObj.getPrimaryFile();
85
      if (file2annotation.containsKey(fo)) {
86
         for (Annotation annotation : file2annotation.get(fo)) {
87
            annotation.detach();
88
         }
89
      }
90
91
      final List<Annotation> annotations = new ArrayList<Annotation>();
92
      final BaseDocument doc = documentFor(dataObj);
93
      for (Line line : parse(doc)) {
94
         final TodoAnnotation ann = new TodoAnnotation(line.getText().trim());
95
         ann.attach(line);
96
         annotations.add(ann);
97
      }
98
      file2annotation.put(fo, annotations);
99
   }
100
101
   private List<Line> parse(final BaseDocument doc) {
102
      return parseForLines(doc);
103
   }
104
105
   private static BaseDocument documentFor(final DataObject ob) {
106
      try {
107
         EditorCookie ck = ob.getCookie(EditorCookie.class);
108
         if (ck != null) {
109
            return (BaseDocument)ck.openDocument();
110
         }
111
      } catch (IOException ioe) {
112
         Exceptions.printStackTrace(ioe);
113
      }
114
      return null;
115
   }
116
117
   private class ScanningDocumentListener implements DocumentListener, Runnable {
118
      private static final int AUTO_SCANNING_DELAY = 2000; //ms
119
      private final RequestProcessor.Task parseTask;
120
      private Reference<DataObject> dobref;
121
122
      ScanningDocumentListener() {
123
         parseTask = requestProcessor.create(this);
124
      }
125
126
      public void insertUpdate(DocumentEvent e) {
127
         change(e);
128
      }
129
130
      public void changedUpdate(DocumentEvent e) {
131
      }
132
133
      public void removeUpdate(DocumentEvent e) {
134
         change(e);
135
      }
136
137
      private void attachTo(Document document) {
138
         DocumentUtilities.addDocumentListener(document, this,
139
               DocumentListenerPriority.AFTER_CARET_UPDATE);
140
         restartTimer();
141
      }
142
143
      private void attachTo(DataObject dob) {
144
         dobref = new WeakReference<DataObject>(dob);
145
         attachTo(documentFor(dob));
146
      }
147
148
      private void change(DocumentEvent e) {
149
         restartTimer();
150
      }
151
152
      private void restartTimer() {
153
         parseTask.schedule(AUTO_SCANNING_DELAY);
154
      }
155
156
      public void run() {
157
         DataObject dob = dobref.get();
158
         if (dob != null) {
159
            annotate(dob);
160
         }
161
      }
162
   }
163
}
(-)src/org/netbeans/modules/showtodos/TodoSourceParsing.java (+129 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
package org.netbeans.modules.showtodos;
40
41
import java.util.LinkedList;
42
import java.util.List;
43
import javax.swing.text.BadLocationException;
44
import javax.swing.text.Document;
45
import org.netbeans.api.lexer.Token;
46
import org.netbeans.api.lexer.TokenHierarchy;
47
import org.netbeans.api.lexer.TokenSequence;
48
import org.netbeans.editor.BaseDocument;
49
import org.netbeans.editor.FinderFactory;
50
import org.netbeans.editor.Utilities;
51
import org.netbeans.modules.editor.NbEditorUtilities;
52
import org.netbeans.modules.tasklist.todo.settings.Settings;
53
import org.openide.text.Line;
54
import org.openide.util.Exceptions;
55
56
/**
57
 *
58
 * @author Michel Graciano
59
 */
60
final class TodoSourceParsing {
61
   private TodoSourceParsing() {
62
   }
63
64
   static List<int[]> parse(final BaseDocument doc, int startOffset,
65
         int endOffset) {
66
      List<int[]> pairsPosition = new LinkedList<int[]>();
67
      TokenHierarchy th = TokenHierarchy.get(doc);
68
      TokenSequence ts = null;
69
70
      if (th != null) {
71
         ts = th.tokenSequence();
72
      }
73
74
      try {
75
         startOffset = Utilities.getRowStart(doc, startOffset);
76
         endOffset = Math.min(doc.getLength(), endOffset);
77
78
         for (String word : Settings.getDefault().getPatterns()) {
79
            int pos = startOffset;
80
81
            // Search from pos to endPos for TODO markers.
82
            while (pos < endOffset) {
83
               FinderFactory.WholeWordsFwdFinder finder =
84
                     new FinderFactory.WholeWordsFwdFinder(doc, word, true);
85
               int next = doc.find(finder, pos, endOffset);
86
87
               if ((next >= startOffset) && (next < endOffset)) {
88
                  // See if it looks like a token we care about (comments)
89
                  if (ts != null) {
90
                     ts.move(next);
91
92
                     if (ts.moveNext()) {
93
                        Token token = ts.token();
94
                        pos = Math.min(Utilities.getRowEnd(doc, next),
95
                              ts.offset() + token.length());
96
97
                        if (token != null) {
98
                           String category = token.id().primaryCategory();
99
100
                           if ("comment".equals(category)) { // NOI18N
101
                              pairsPosition.add(new int[] {next, pos});
102
                           }
103
                        }
104
                     } else {
105
                        pos = next + word.length();
106
                     }
107
                  } else {
108
                     pos = next + word.length();
109
                  }
110
               } else {
111
                  break;
112
               }
113
            }
114
         }
115
      } catch (BadLocationException e) {
116
         Exceptions.printStackTrace(e);
117
      }
118
      return pairsPosition;
119
   }
120
121
   static List<Line> parseForLines(final BaseDocument doc) {
122
      final List<Line> lines = new LinkedList<Line>();
123
      for (int[] pairs : parse(doc, doc.getStartPosition().getOffset(), doc.
124
            getEndPosition().getOffset())) {
125
         lines.add(NbEditorUtilities.getLine((Document)doc, pairs[1], false));
126
      }
127
      return lines;
128
   }
129
}

Return to bug 63953