public class WriterConnector implements IOOConnector {
@Override
public boolean insertTagsIntoDocument(String tag, OODocument ooDocument) {
IDocument document = ooDocument.getDocument();
if (!document.getDocumentType().equals(IDocument.WRITER))
return false;
IViewCursor viewCursor = ((ITextDocument) document)
.getViewCursorService().getViewCursor();
ITextCursor textCursor = viewCursor.getTextCursorFromEnd();
try {
if (tag.length() > 0) {
textCursor.setString(tag);
document.setModified(true);
}
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}