AbstractFile volumes[] = LocalFile.getVolumes();
int nbFolders = volumes.length;
for(int i=0; i<nbFolders; i++)
goMenu.add(new OpenLocationAction(mainFrame, new Hashtable<String, Object>(), volumes[i]));
}
else if(source==bookmarksMenu) {
// Remove any previous bookmarks menu items from menu
// as bookmarks might have changed since menu was last selected
for(int i=bookmarksMenu.getItemCount(); i>bookmarksOffset; i--)
bookmarksMenu.remove(bookmarksOffset);
// Add bookmarks menu items
java.util.List<Bookmark> bookmarks = BookmarkManager.getBookmarks();
int nbBookmarks = bookmarks.size();
if(nbBookmarks>0) {
for(int i=0; i<nbBookmarks; i++)
MenuToolkit.addMenuItem(bookmarksMenu, new OpenLocationAction(mainFrame, new Hashtable<String, Object>(), bookmarks.get(i)), null);
}
else {
// Show 'No bookmark' as a disabled menu item instead showing nothing
JMenuItem noBookmarkItem = MenuToolkit.addMenuItem(bookmarksMenu, Translator.get("bookmarks_menu.no_bookmark"), null, null, null);
noBookmarkItem.setEnabled(false);