/**
* Performs an action assigned to the processBookmark entry-point.
*/
public void processBookmark() {//GEN-END:|898-entry|0|899-preAction
// write pre-action user code here
final Book book = bookCanvas.getCurrentBook();
final String s = getBookmarkText().getString();
if (bookmarkAdding) {
/*
* Adding a new bookmark
*/
final Bookmark bookmark =
new Bookmark(book.getCurrentChapter(), bookmarkPosition, s);
final int pos = book.getBookmarkManager().addBookmark(bookmark);
/*
* Insert the new bookmark into the list
*/
getBookmarks().insert(pos, bookmark.getTextForList(), null);
} else {
/*
* Eding the selected bookmark
*/
final int pos = getBookmarks().getSelectedIndex();
final Bookmark bookmark =
book.getBookmarkManager().bookmarkAt(pos);
if (bookmark != null) {
/*
* Update the bookmark
*/