private boolean isSearchResultPlayable() { boolean playable = false; if (searchResult.getSearchResult() instanceof StreamableSearchResult) { playable = ((StreamableSearchResult) searchResult.getSearchResult()).getStreamUrl() != null; if (searchResult.getExtension() != null) { MediaType mediaType = MediaType.getMediaTypeForExtension(searchResult.getExtension()); playable = mediaType != null && (mediaType.equals(MediaType.getAudioMediaType())) || mediaType.equals(MediaType.getVideoMediaType()); } } return playable; }
private void labelPartialDownload_mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (searchResult.getSearchResult() instanceof CrawlableSearchResult) { searchResult.download(true); UXStats.instance().log(UXAction.SEARCH_RESULT_DETAIL_VIEW); } } }
private void labelPlay_mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (searchResult.getSearchResult() instanceof StreamableSearchResult && !isStreamableSourceBeingPlayed(searchResult)) { searchResult.play(); updatePlayButton(); } uxLogMediaPreview(); } }
private void updateUIData(SearchResultActionsHolder value, JTable table, int row, int column) { actionsHolder = value; searchResult = actionsHolder.getSearchResult(); showSolid = mouseIsOverRow(table, row); updatePlayButton(); labelPlay.setVisible(isSearchResultPlayable()); labelDownload.setIcon(showSolid ? download_solid : download_transparent); labelDownload.setVisible(true); labelPartialDownload.setIcon(showSolid ? details_solid : details_transparent); labelPartialDownload.setVisible( searchResult.getSearchResult() instanceof CrawlableSearchResult); }