use of com.frostwire.gui.theme.SkinMenu in project frostwire by frostwire.
the class BTDownloadMediatorAdvancedMenuFactory method createTrackerMenu.
public static SkinMenu createTrackerMenu() {
com.frostwire.bittorrent.BTDownload[] dms = getSingleSelectedDownloadManagers();
if (dms == null) {
return null;
}
SkinMenu menu = new SkinMenu(I18n.tr("Trackers"));
menu.add(new SkinMenuItem(new EditTrackersAction(dms[0])));
menu.add(new SkinMenuItem(new UpdateTrackerAction(dms[0])));
menu.add(new SkinMenuItem(new ScrapeTrackerAction(dms[0])));
return menu;
}
use of com.frostwire.gui.theme.SkinMenu in project frostwire by frostwire.
the class AbstractLibraryTableMediator method createAddToPlaylistSubMenu.
SkinMenu createAddToPlaylistSubMenu() {
SkinMenu menu = new SkinMenu(tr("Add to playlist"));
menu.add(new SkinMenuItem(new CreateNewPlaylistAction()));
Playlist currentPlaylist = LibraryMediator.instance().getSelectedPlaylist();
Playlist starredPlaylist = LibraryMediator.getLibrary().getStarredPlaylist();
if (currentPlaylist == null || !currentPlaylist.equals(starredPlaylist)) {
addToStarredPlaylistMenuItem(menu, starredPlaylist);
}
Library library = LibraryMediator.getLibrary();
List<Playlist> playlists = library.getPlaylists();
if (playlists.size() > 0) {
menu.addSeparator();
for (Playlist playlist : library.getPlaylists()) {
if (currentPlaylist != null && currentPlaylist.equals(playlist)) {
continue;
}
menu.add(new SkinMenuItem(new AddToPlaylistAction(playlist)));
}
}
return menu;
}
use of com.frostwire.gui.theme.SkinMenu in project frostwire by frostwire.
the class PopupUtils method addMenuItem.
/**
* Adds a menu item defined by the ActionListener & String to the JMenu, enabled or not at the given index.
*/
public static final void addMenuItem(String s, ActionListener l, JMenu m, boolean enable, int idx) {
JMenuItem item = m instanceof SkinMenu ? new SkinMenuItem(s) : new JMenuItem(s);
item.addActionListener(l);
item.setEnabled(enable);
m.add(item, idx);
}
use of com.frostwire.gui.theme.SkinMenu in project frostwire by frostwire.
the class LibraryPlaylistsTableMediator method createSearchSubMenu.
private JMenu createSearchSubMenu(LibraryPlaylistsTableDataLine dl) {
JMenu menu = new SkinMenu(I18n.tr("Search"));
if (dl != null) {
File f = dl.getFile();
String keywords = QueryUtils.createQueryString(f.getName());
if (keywords.length() > 0)
menu.add(new SkinMenuItem(new SearchAction(keywords)));
}
if (menu.getItemCount() == 0)
menu.setEnabled(false);
return menu;
}
use of com.frostwire.gui.theme.SkinMenu in project frostwire by frostwire.
the class LibraryFilesTableMediator method createSearchSubMenu.
private JMenu createSearchSubMenu(LibraryFilesTableDataLine dl) {
SkinMenu menu = new SkinMenu(I18n.tr("Search"));
if (dl != null) {
File f = dl.getInitializeObject();
String keywords = QueryUtils.createQueryString(f.getName());
if (keywords.length() > 0)
menu.add(new SkinMenuItem(new SearchAction(keywords)));
}
if (menu.getItemCount() == 0)
menu.setEnabled(false);
return menu;
}
Aggregations