public int getPageCount() {
IPageCursor pageCursor = textDocument.getViewCursorService().getViewCursor().getPageCursor();
short currentPage = pageCursor.getPage();
pageCursor.jumpToLastPage();
short lastPage = pageCursor.getPage();
pageCursor.jumpToPage(currentPage);
return lastPage;
}
//----------------------------------------------------------------------------
/**
* Returns page with the submitted index. The first page has the index 0.