} else {
bounds = new ReferencedEnvelope(env, v.getCRS());
}
MapReference ref = bmManager.getMapReference(map);
Bookmark bookmark = new Bookmark(bounds, ref, null);
InputDialog dialog = new InputDialog(
Display.getCurrent().getActiveShell(),
Messages.BookmarkAction_dialogtitle_bookmarklocation,
Messages.BookmarkAction_dialogprompt_enterbookmarkname,
bookmark.getName(), null);
dialog.open();
if (dialog.getReturnCode() == Window.OK) {
String name = dialog.getValue();
bookmark.setName(name);
bmManager = BookmarksPlugin.getBookmarkService();
bmManager.addBookmark(bookmark);
refreshView();
}
((BookmarksView) view)
.selectReveal(new StructuredSelection(bookmark));
}
} else if (RENAME_BOOKMARK_ACTION_ID.equals(action.getId())) {
IBookmark bookmark = (IBookmark) selection.getFirstElement();
InputDialog dialog = new InputDialog(Display.getCurrent()
.getActiveShell(),
Messages.BookmarkAction_dialogtitle_renamebookmark,
Messages.BookmarkAction_dialogprompt_enterbookmarkname,
bookmark.getName(), null);
dialog.open();
if (dialog.getReturnCode() == Window.OK) {
String name = dialog.getValue();
bookmark.setName(name);
refreshView();
}
} else if (SAVE_BOOKMARKS_ACTION_ID.equals(action.getId())) {
BookmarksPlugin.getDefault().storeToPreferences();