Search in sources :

Example 1 with SearchAction

use of com.limegroup.gnutella.gui.actions.SearchAction 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 2 with SearchAction

use of com.limegroup.gnutella.gui.actions.SearchAction 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)

Example 3 with SearchAction

use of com.limegroup.gnutella.gui.actions.SearchAction in project frostwire by frostwire.

the class SearchResultMediator method createSearchAgainMenu.

/**
 * Returns a menu with a 'repeat search' and 'repeat search no clear' action.
 */
private JMenu createSearchAgainMenu(SearchResultDataLine line) {
    JMenu menu = new SkinMenu(tr("Search More"));
    menu.add(new SkinMenuItem(new RepeatSearchAction()));
    if (line == null) {
        menu.setEnabled(isRepeatSearchEnabled());
        return menu;
    }
    menu.addSeparator();
    String keywords = QueryUtils.createQueryString(line.getFilename());
    SearchInformation info = SearchInformation.createKeywordSearch(keywords, null, MediaType.getAnyTypeMediaType());
    if (SearchMediator.validateInfo(info) == SearchMediator.QUERY_VALID) {
        SeasonalContentSearchSuggestion.attemptToAddSeasonalContentSearchSuggestion(menu, null, searchTokens);
        menu.add(new SkinMenuItem(new SearchAction(info, tr("Search for Keywords: {0}"))));
    }
    return menu;
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinMenu(com.frostwire.gui.theme.SkinMenu) SearchAction(com.limegroup.gnutella.gui.actions.SearchAction)

Aggregations

SkinMenu (com.frostwire.gui.theme.SkinMenu)3 SkinMenuItem (com.frostwire.gui.theme.SkinMenuItem)3 SearchAction (com.limegroup.gnutella.gui.actions.SearchAction)3 File (java.io.File)2