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.drjava.model.definitions.reducedmodel.*; 38 39 44 class QuestionPrevLineStartsComment extends IndentRuleQuestion { 45 46 QuestionPrevLineStartsComment(IndentRule yesRule, IndentRule noRule) { 47 super(yesRule, noRule); 48 } 49 50 66 boolean applyRule(AbstractDJDocument doc, int reason) { 67 68 int cursor; 69 70 cursor = doc.getLineStartPos(doc.getCurrentLocation()); 72 73 75 if (cursor == AbstractDJDocument.DOCSTART) return false; 76 77 cursor = cursor - 1; 79 80 cursor = doc.getLineStartPos(cursor); 82 83 doc.resetReducedModelLocation(); 86 ReducedModelState state = doc.stateAtRelLocation(cursor - doc.getCurrentLocation()); 87 return !state.equals(ReducedModelStates.INSIDE_BLOCK_COMMENT); 88 } 89 } 90 91 | Popular Tags |