Skip to content

Commit

Permalink
Refactor AboutViewController (#480)
Browse files Browse the repository at this point in the history
- rename getPaneFor to createPaneFor
- rename getViewFor to createViewFor
- remove aboutViewController update from ApplicationController
  • Loading branch information
jdrueckert authored and skaldarnar committed Nov 16, 2019
1 parent a48d817 commit 1f4c371
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void update() {
Stream.of("README.md", "CHANGELOG.md", "CONTRIBUTING.md", "LICENSE")
.map(filename -> BundleUtils.getFXMLUrl(ABOUT, filename))
.filter(Objects::nonNull)
.map(this::getPaneFor)
.map(this::createPaneFor)
.filter(Optional::isPresent)
.map(Optional::get)
.forEach(aboutInfoAccordion.getPanes()::add);
Expand All @@ -66,8 +66,8 @@ public void update() {
}
}

private Optional<TitledPane> getPaneFor(URL url) {
return getViewFor(url)
private Optional<TitledPane> createPaneFor(URL url) {
return createViewFor(url)
.map(view -> {
view.getStylesheets().add(BundleUtils.getFXMLUrl("css_webview").toExternalForm());
view.setContextMenuEnabled(false);
Expand All @@ -88,7 +88,7 @@ private Optional<TitledPane> getPaneFor(URL url) {
});
}

private Optional<WebView> getViewFor(URL url) {
private Optional<WebView> createViewFor(URL url) {
switch (Files.getFileExtension(url.getFile().toLowerCase())) {
case "md":
case "markdown":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ private void updateGui() {
updateLabels();
updateTooltipTexts();
updateChangeLog();
aboutViewController.update();
}

private void updateLabels() {
Expand Down

0 comments on commit 1f4c371

Please sign in to comment.