Code refactoring

master
Dmitry Isaenko 2019-12-07 10:02:40 +03:00
parent 2735c8bfa7
commit 2fbdbc805f
2 changed files with 7 additions and 18 deletions

View File

@ -33,33 +33,25 @@ public class AboutController implements Initializable {
private void gitHubUrl(){ private void gitHubUrl(){
try { try {
hostServices.showDocument("https://github.com/developersu/mplayer4anime"); hostServices.showDocument("https://github.com/developersu/mplayer4anime");
} catch (Exception e){ } catch (Exception ignored){ }
e.printStackTrace();
}
} }
@FXML @FXML
private void bloggerUrl(){ private void bloggerUrl(){
try { try {
hostServices.showDocument("https://developersu.blogspot.com/search/label/mplayer4anime"); hostServices.showDocument("https://developersu.blogspot.com/search/label/mplayer4anime");
} catch (Exception e){ } catch (Exception ignored){ }
e.printStackTrace();
}
} }
@FXML @FXML
private void libGSON(){ private void libGSON(){
try { try {
hostServices.showDocument("https://github.com/google/gson"); hostServices.showDocument("https://github.com/google/gson");
} catch (Exception e){ } catch (Exception ignored){ }
e.printStackTrace();
}
} }
@FXML @FXML
private void iconsMaterial(){ private void iconsMaterial(){
try { try {
hostServices.showDocument("https://materialdesignicons.com/"); hostServices.showDocument("https://materialdesignicons.com/");
} catch (Exception e){ } catch (Exception ignored){ }
e.printStackTrace();
}
} }
//TODO note icons meaterial design //TODO note icons meaterial design

View File

@ -329,12 +329,9 @@ public class Controller implements Initializable {
menuItem.setText(fileNameOnly); menuItem.setText(fileNameOnly);
menuItem.setUserData(playlistPath); menuItem.setUserData(playlistPath);
menuItem.setOnAction(new EventHandler<ActionEvent>() { menuItem.setOnAction(actionEvent -> {
@Override JsonStorage jsonStorage = Playlists.ReadByPath(resourceBundle, new File(playlistPath));
public void handle(ActionEvent actionEvent) { setAllLists(jsonStorage);
JsonStorage jsonStorage = Playlists.ReadByPath(resourceBundle, new File(playlistPath));
setAllLists(jsonStorage);
}
}); });
// Limit list to 13 elements (2 in the end are separator and clear button) // Limit list to 13 elements (2 in the end are separator and clear button)
if (recentlyOpenedMenu.getItems().size() >= 11) if (recentlyOpenedMenu.getItems().size() >= 11)