1 19 20 package org.netbeans.modules.tasklist.checkstyle; 21 22 import javax.swing.text.BadLocationException ; 23 import javax.swing.text.Document ; 24 25 29 public final class InsertStringSuggestionPerformer extends AbstractSuggestionPerformer { 30 31 32 private String insert; 33 34 35 public InsertStringSuggestionPerformer( 36 final Document doc, 37 final int lineno, 38 final int column) { 39 40 super(doc, lineno, column); 41 } 42 43 public InsertStringSuggestionPerformer setString(final String insert){ 44 this.insert = insert; 45 return this; 46 } 47 48 49 protected void performImpl(final int docPosition) throws BadLocationException { 50 51 if( insert == null ){ 52 throw new IllegalStateException ("Must assign insert first."); 53 } 54 doc.insertString(docPosition , insert, null); 56 } 57 58 } 59 | Popular Tags |