Search in sources :

Example 1 with SkinMenu

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;
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinMenu(com.frostwire.gui.theme.SkinMenu)

Example 2 with SkinMenu

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;
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) Playlist(com.frostwire.alexandria.Playlist) SkinMenu(com.frostwire.gui.theme.SkinMenu) Library(com.frostwire.alexandria.Library)

Example 3 with SkinMenu

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);
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinMenu(com.frostwire.gui.theme.SkinMenu)

Example 4 with SkinMenu

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;
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinMenu(com.frostwire.gui.theme.SkinMenu) File(java.io.File) SearchAction(com.limegroup.gnutella.gui.actions.SearchAction)

Example 5 with SkinMenu

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;
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinMenu(com.frostwire.gui.theme.SkinMenu) File(java.io.File) SearchAction(com.limegroup.gnutella.gui.actions.SearchAction)

Aggregations

SkinMenu (com.frostwire.gui.theme.SkinMenu)10 SkinMenuItem (com.frostwire.gui.theme.SkinMenuItem)9 SearchAction (com.limegroup.gnutella.gui.actions.SearchAction)3 File (java.io.File)3 Library (com.frostwire.alexandria.Library)2 Playlist (com.frostwire.alexandria.Playlist)2 BTEngine (com.frostwire.bittorrent.BTEngine)1 AddToPlaylistAction (com.frostwire.gui.bittorrent.BTDownloadActions.AddToPlaylistAction)1 CreateNewPlaylistAction (com.frostwire.gui.bittorrent.BTDownloadActions.CreateNewPlaylistAction)1 SkinPopupMenu (com.frostwire.gui.theme.SkinPopupMenu)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1