doc.readLock(); try { for (int i=0; i<parserCount; i++) {
RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); String style = textArea.getSyntaxEditingStyle(); doc.readLock(); try { if (p.isEnabled()) {
doc.readLock(); try {
public void actionPerformed(ActionEvent e) { if (parser==null) { // Sanity check return; } long begin = 0; if (DEBUG_PARSING) { begin = System.currentTimeMillis(); } RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); doc.readLock(); try { DocumentReader r = new DocumentReader(doc); parser.parse(r); r.close(); } finally { doc.readUnlock(); } if (DEBUG_PARSING) { float time = (System.currentTimeMillis()-begin)/1000f; System.err.println("Parsing took: "+time+" seconds"); } textArea.refreshParserNoticeHighlights(parser.getNoticeIterator()); }
/** * Forces the given {@link Parser} to re-parse the content of this text * area.<p> * * This method can be useful when a <code>Parser</code> can be configured * as to what notices it returns. For example, if a Java language parser * can be configured to set whether no serialVersionUID is a warning, * error, or ignored, this method can be called after changing the expected * notice type to have the document re-parsed. * * @param parser The index of the <code>Parser</code> to re-run. * @see #getParser(int) */ public void forceReparsing(int parser) { Parser p = getParser(parser); RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); String style = textArea.getSyntaxEditingStyle(); doc.readLock(); try { ParseResult res = p.parse(doc, style); addParserNoticeHighlights(res); textArea.fireParserNoticesChange(); } finally { doc.readUnlock(); } }
doc.readLock(); try { for (int i=0; i<parserCount; i++) {
RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); String style = textArea.getSyntaxEditingStyle(); doc.readLock(); try { if (p.isEnabled()) {
doc.readLock(); try {
doc.readLock(); try { for (int i=0; i<parserCount; i++) {
doc.readLock(); try {