1 33 34 package edu.rice.cs.drjava.model.definitions.indent; 35 36 import edu.rice.cs.drjava.model.AbstractDJDocument; 37 import edu.rice.cs.util.UnexpectedException; 38 39 import javax.swing.text.BadLocationException ; 40 41 45 public class ActionStartCurrStmtPlus extends IndentRuleAction { 46 private String _suffix; 47 48 51 public ActionStartCurrStmtPlus(String suffix) { 52 super(); 53 _suffix = suffix; 54 } 55 56 62 public boolean indentLine(AbstractDJDocument doc, int reason) { 63 boolean supResult = super.indentLine(doc, reason); 64 65 68 69 String indent = ""; 70 71 try { 72 indent = doc.getIndentOfCurrStmt(doc.getCurrentLocation(), new char[] {';','{','}'}, new char[] {' ', '\t','\n'}); 73 } 74 catch (BadLocationException e) { throw new UnexpectedException(e); } 75 76 indent = indent + _suffix; 77 doc.setTab(indent, doc.getCurrentLocation()); 78 79 return supResult; 80 } 81 } 82 | Popular Tags |