1 33 34 package edu.rice.cs.drjava.model.definitions.indent; 35 36 import javax.swing.text.*; 37 38 import edu.rice.cs.drjava.model.AbstractDJDocument; 39 40 import edu.rice.cs.util.UnexpectedException; 41 42 46 class QuestionCurrLineEmpty extends IndentRuleQuestion { 47 48 QuestionCurrLineEmpty(IndentRule yesRule, IndentRule noRule) { super(yesRule, noRule); } 49 50 54 boolean applyRule(AbstractDJDocument doc, int reason) { 55 try { 56 int here = doc.getCurrentLocation(); 58 int endOfLine = doc.getLineEndPos(here); 59 int firstNonWS = doc.getLineFirstCharPos(here); 60 return (endOfLine == firstNonWS); 61 } 62 catch (BadLocationException e) { 63 throw new UnexpectedException(e); 65 } 66 } 67 } | Popular Tags |