use of com.frostwire.gui.theme.SkinMenuItem 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.SkinMenuItem in project frostwire by frostwire.
the class LibraryExplorer method setupTree.
private void setupTree() {
tree = new LibraryIconTree(model);
tree.setRowHeight(TableSettings.DEFAULT_TABLE_ROW_HEIGHT.getValue());
tree.setRootVisible(false);
tree.setShowsRootHandles(false);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setCellRenderer(new NodeRenderer());
tree.setDragEnabled(true);
tree.setTransferHandler(new LibraryFilesTransferHandler(tree));
((BasicTreeUI) tree.getUI()).setExpandedIcon(null);
((BasicTreeUI) tree.getUI()).setCollapsedIcon(null);
SkinPopupMenu popup = new SkinPopupMenu();
popup.add(new SkinMenuItem(refreshAction));
popup.add(new SkinMenuItem(exploreAction));
popup.add(new SkinMenuItem(new ConfigureOptionsAction(OptionsConstructor.SHARED_KEY, I18n.tr("Configure Options"), I18n.tr("You can configure the FrostWire\'s Options."))));
tree.addMouseListener(new DefaultMouseListener(new TreeMouseObserver(tree, popup)));
tree.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if (LibraryUtils.isRefreshKeyEvent(e)) {
refreshSelection(true);
}
}
});
treeSelectionListener = new LibraryExplorerTreeSelectionListener();
tree.addTreeSelectionListener(treeSelectionListener);
ToolTipManager.sharedInstance().registerComponent(tree);
}
use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class LibraryFilesTableMediator method createPopupMenu.
// inherit doc comment
protected JPopupMenu createPopupMenu() {
if (TABLE.getSelectionModel().isSelectionEmpty()) {
return null;
}
JPopupMenu menu = new SkinPopupMenu();
menu.add(new SkinMenuItem(LAUNCH_ACTION));
if (getMediaType().equals(MediaType.getAudioMediaType())) {
menu.add(new SkinMenuItem(LAUNCH_OS_ACTION));
}
if (hasExploreAction()) {
menu.add(new SkinMenuItem(OPEN_IN_FOLDER_ACTION));
}
if (areAllSelectedFilesMP4s()) {
menu.add(DEMUX_MP4_AUDIO_ACTION);
DEMUX_MP4_AUDIO_ACTION.setEnabled(!((DemuxMP4AudioAction) DEMUX_MP4_AUDIO_ACTION).isDemuxing());
}
menu.add(new SkinMenuItem(CREATE_TORRENT_ACTION));
if (areAllSelectedFilesPlayable()) {
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(DELETE_ACTION));
menu.addSeparator();
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;
}
DELETE_ACTION.setEnabled(true);
LibraryFilesTableDataLine line = DATA_MODEL.get(rows[0]);
menu.add(createSearchSubMenu(line));
return menu;
}
use of com.frostwire.gui.theme.SkinMenuItem 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.SkinMenuItem in project frostwire by frostwire.
the class LibraryPlaylists method getPlaylistPopupMenu.
private SkinPopupMenu getPlaylistPopupMenu(Playlist playlist) {
SkinPopupMenu playlistPopup = new SkinPopupMenu();
final List<PlaylistItem> items = playlist.getItems();
boolean playlistEmpty = items == null || items.size() == 0;
playlistPopup.add(new SkinMenuItem(actions[REFRESH_ACTION]));
if (!playlistEmpty) {
playlistPopup.add(new SkinMenuItem(actions[REFRESH_ID3_TAGS_ACTION]));
}
playlistPopup.addSeparator();
playlistPopup.add(new SkinMenuItem(actions[RENAME_ACTION]));
playlistPopup.add(new SkinMenuItem(actions[DELETE_ACTION]));
if (!playlistEmpty) {
playlistPopup.add(new SkinMenuItem(actions[CLEANUP_PLAYLIST_ACTION]));
}
playlistPopup.addSeparator();
playlistPopup.add(new SkinMenuItem(actions[IMPORT_TO_PLAYLIST_ACTION]));
playlistPopup.add(new SkinMenuItem(actions[IMPORT_TO_NEW_PLAYLIST_ACTION]));
addExportActionsToPopupMenu(playlistPopup, playlistEmpty);
playlistPopup.addSeparator();
playlistPopup.add(new SkinMenuItem(actions[CONFIGURE_OPTIONS_ACTION]));
return playlistPopup;
}
Aggregations