1 22 23 package org.gjt.sp.jedit.indent; 24 25 import java.util.regex.PatternSyntaxException ; 26 27 public class IndentRuleFactory 28 { 29 public static IndentRule indentNextLines(String regexp) 30 throws PatternSyntaxException 31 { 32 return new RegexpIndentRule(regexp, 33 null, 34 new IndentAction.Increase(), 35 null,false); 36 } 37 38 public static IndentRule indentNextLine(String regexp) 39 throws PatternSyntaxException 40 { 41 return new RegexpIndentRule(regexp, 42 new IndentAction.Decrease(), 43 new IndentAction.Increase(), 44 null,true); 45 } 46 47 public static IndentRule unindentThisLine(String regexp) 48 throws PatternSyntaxException 49 { 50 return new RegexpIndentRule(regexp, 51 null, 52 new IndentAction.Increase(), 53 new IndentAction.Decrease(), 54 false); 55 } 56 57 public static IndentRule unindentNextLines(String regexp) 58 throws PatternSyntaxException 59 { 60 return new RegexpIndentRule(regexp, 61 null, 62 new IndentAction.Decrease(), 63 null, 64 false); 65 } 66 67 public static IndentRule indentOpenBracket(char bracket) 68 throws PatternSyntaxException 69 { 70 return new OpenBracketIndentRule(bracket,true); 71 } 72 73 public static IndentRule indentCloseBracket(char bracket) 74 throws PatternSyntaxException 75 { 76 return new CloseBracketIndentRule(bracket,true); 77 } 78 79 public static IndentRule unalignedOpenBracket(char bracket) 80 throws PatternSyntaxException 81 { 82 return new OpenBracketIndentRule(bracket,false); 83 } 84 85 public static IndentRule unalignedCloseBracket(char bracket) 86 throws PatternSyntaxException 87 { 88 return new CloseBracketIndentRule(bracket,false); 89 } 90 } 91 | Popular Tags |