1 19 20 package org.netbeans.modules.db.sql.editor; 21 22 import java.io.IOException ; 23 import java.io.Writer ; 24 import javax.swing.text.BadLocationException ; 25 import javax.swing.text.Document ; 26 import javax.swing.text.JTextComponent ; 27 import org.netbeans.editor.BaseDocument; 28 import org.netbeans.editor.Syntax; 29 import org.netbeans.editor.SyntaxSupport; 30 import org.netbeans.editor.TokenID; 31 import org.netbeans.editor.TokenItem; 32 import org.netbeans.editor.ext.ExtFormatter; 33 import org.netbeans.editor.Utilities; 34 import org.netbeans.editor.ext.AbstractFormatLayer; 35 import org.netbeans.editor.ext.FormatSupport; 36 import org.netbeans.editor.ext.FormatWriter; 37 import org.openide.ErrorManager; 38 39 44 public class SQLFormatter extends ExtFormatter { 45 46 49 public SQLFormatter(Class kitClass) { 50 super(kitClass); 51 } 52 53 56 protected boolean acceptSyntax(Syntax syntax) { 57 return (syntax instanceof SQLSyntax); 58 } 59 60 63 public Writer reformat(BaseDocument doc, int startOffset, int endOffset, boolean indentOnly) 64 throws BadLocationException , IOException { 65 return super.reformat(doc, startOffset, endOffset, indentOnly); 66 } 67 68 71 public int[] getReformatBlock(JTextComponent target, String typedText) { 72 return super.getReformatBlock(target, typedText); 73 } 74 } 75 | Popular Tags |