if (_doc == null || !(_doc instanceof BaseDocument)) {
return;
}
BaseDocument doc = (BaseDocument) _doc;
final Reformat reformatter = Reformat.get(doc);
reformatter.lock();
try {
doc.runAtomic(new Runnable() {
public void run() {
try {
String s2 = s == null ? "" : s;
int start = insert(s2, target, _doc);
} catch (BadLocationException ex) {
Exceptions.printStackTrace(ex);
}
}
});
} finally {
reformatter.unlock();
}
}