use of com.frostwire.gui.theme.SkinPopupMenu in project frostwire by frostwire.
the class SearchResultMediator method createPopupMenu.
JPopupMenu createPopupMenu(SearchResultDataLine[] lines) {
// do not return a menu if right-clicking on the dummy panel
if (!isKillable())
return null;
JPopupMenu menu = new SkinPopupMenu();
if (lines.length > 0) {
boolean allWithHash = true;
for (SearchResultDataLine line : lines) {
if (line.getHash() == null) {
allWithHash = false;
break;
}
}
PopupUtils.addMenuItem(tr("Copy Magnet"), COPY_MAGNET_ACTION_LISTENER, menu, allWithHash);
PopupUtils.addMenuItem(tr("Copy Hash"), COPY_HASH_ACTION_LISTENER, menu, allWithHash);
menu.add(createSearchAgainMenu(lines[0]));
} else {
SeasonalContentSearchSuggestion.attemptToAddSeasonalContentSearchSuggestion(null, menu, searchTokens);
menu.add(new SkinMenuItem(new RepeatSearchAction()));
menu.add(new JSeparator(JSeparator.HORIZONTAL));
menu.add(new SkinMenuItem(new CloseTabAction()));
menu.add(new SkinMenuItem(new CloseAllTabsAction()));
menu.add(new SkinMenuItem(new CloseOtherTabsAction()));
menu.add(new SkinMenuItem(new CloseTabsToTheRight()));
}
return (new SearchResultMenu(this)).addToMenu(menu, lines);
}
use of com.frostwire.gui.theme.SkinPopupMenu in project frostwire by frostwire.
the class PopupUtils method addMenuItem.
/**
* Adds a menu item defined by the ActionListener & String to the JPopupMenu, enabled or not at the given index.
*/
public static final void addMenuItem(String s, ActionListener l, JPopupMenu m, boolean enable, int idx) {
JMenuItem item = m instanceof SkinPopupMenu ? new SkinMenuItem(s) : new JMenuItem(s);
item.addActionListener(l);
item.setEnabled(enable);
m.add(item, idx);
}
use of com.frostwire.gui.theme.SkinPopupMenu in project frostwire by frostwire.
the class SearchField method createPopup.
/**
* Creates the JPopupMenu that all LimeTextFields will share.
*/
private static JPopupMenu createPopup() {
if (POPUP != null) {
return POPUP;
}
// initialize the JPopupMenu with necessary stuff.
POPUP = new SkinPopupMenu() {
/**
*/
private static final long serialVersionUID = -6004124495511263059L;
public void show(Component invoker, int x, int y) {
((SearchField) invoker).updateActions();
super.show(invoker, x, y);
}
};
POPUP.add(new SkinMenuItem(UNDO_ACTION));
POPUP.addSeparator();
POPUP.add(new SkinMenuItem(CUT_ACTION));
POPUP.add(new SkinMenuItem(COPY_ACTION));
POPUP.add(new SkinMenuItem(PASTE_ACTION));
POPUP.add(new SkinMenuItem(DELETE_ACTION));
POPUP.addSeparator();
POPUP.add(new SkinMenuItem(SELECT_ALL_ACTION));
return POPUP;
}
use of com.frostwire.gui.theme.SkinPopupMenu in project frostwire by frostwire.
the class LibraryPlaylistsTableMediator method createPopupMenu.
// inherit doc comment
protected JPopupMenu createPopupMenu() {
if (TABLE.getSelectionModel().isSelectionEmpty())
return null;
JPopupMenu menu = new SkinPopupMenu();
menu.add(new SkinMenuItem(LAUNCH_ACTION));
menu.add(new SkinMenuItem(LAUNCH_OS_ACTION));
if (hasExploreAction()) {
menu.add(new SkinMenuItem(OPEN_IN_FOLDER_ACTION));
}
menu.add(new SkinMenuItem(CREATE_TORRENT_ACTION));
menu.add(createAddToPlaylistSubMenu());
menu.add(new SkinMenuItem(SEND_TO_FRIEND_ACTION));
menu.add(new SkinMenuItem(SEND_TO_ITUNES_ACTION));
menu.addSeparator();
menu.add(new SkinMenuItem(COPY_PLAYLIST_FILES_TO_FOLDER_ACTION));
menu.addSeparator();
menu.add(new SkinMenuItem(DELETE_ACTION));
int[] rows = TABLE.getSelectedRows();
boolean dirSelected = false;
boolean fileSelected = false;
for (int row : rows) {
File f = DATA_MODEL.get(row).getFile();
if (f.isDirectory()) {
dirSelected = true;
// if (IncompleteFileManager.isTorrentFolder(f))
// torrentSelected = true;
} else
fileSelected = true;
if (dirSelected && fileSelected)
break;
}
if (dirSelected) {
DELETE_ACTION.setEnabled(true);
} else {
DELETE_ACTION.setEnabled(true);
}
menu.addSeparator();
menu.add(new SkinMenuItem(importToPlaylistAction));
menu.add(new SkinMenuItem(exportPlaylistAction));
menu.add(new SkinMenuItem(cleanupPlaylistAction));
menu.add(new SkinMenuItem(refreshID3TagsAction));
menu.addSeparator();
LibraryPlaylistsTableDataLine line = DATA_MODEL.get(rows[0]);
menu.add(createSearchSubMenu(line));
return menu;
}
use of com.frostwire.gui.theme.SkinPopupMenu in project frostwire by frostwire.
the class LibraryPlaylists method getNewPlaylistPopupMenu.
private SkinPopupMenu getNewPlaylistPopupMenu() {
SkinPopupMenu popupMenu = new SkinPopupMenu();
popupMenu.add(new SkinMenuItem(actions[IMPORT_TO_NEW_PLAYLIST_ACTION]));
popupMenu.add(new SkinMenuItem(actions[CONFIGURE_OPTIONS_ACTION]));
return popupMenu;
}
Aggregations