popupMenu.add(new JSeparator());
// Add boookmarks
java.util.List<Bookmark> bookmarks = BookmarkManager.getBookmarks();
int nbBookmarks = bookmarks.size();
Bookmark b;
if(nbBookmarks>0) {
for(int i=0; i<nbBookmarks; i++) {
b = bookmarks.get(i);
item = popupMenu.add(new CustomOpenLocationAction(mainFrame, new Hashtable<String, Object>(), b));
setMnemonic(item, mnemonicHelper);
}
}
else {
// No bookmark : add a disabled menu item saying there is no bookmark
popupMenu.add(Translator.get("bookmarks_menu.no_bookmark")).setEnabled(false);
}
popupMenu.add(new JSeparator());
// Add 'Network shares' shortcut
if(FileFactory.isRegisteredProtocol(FileProtocols.SMB)) {
action = new CustomOpenLocationAction(mainFrame, new Hashtable<String, Object>(), new Bookmark(Translator.get("drive_popup.network_shares"), "smb:///"));
action.setIcon(IconManager.getIcon(IconManager.FILE_ICON_SET, CustomFileIconProvider.NETWORK_ICON_NAME));
setMnemonic(popupMenu.add(action), mnemonicHelper);
}
// Add Bonjour services menu