|
84 | 84 | import org.springframework.web.socket.handler.TextWebSocketHandler; |
85 | 85 | import org.springframework.web.util.UriComponentsBuilder; |
86 | 86 |
|
| 87 | +import javax.annotation.PostConstruct; |
87 | 88 | import javax.imageio.ImageIO; |
88 | 89 | import javax.imageio.ImageReader; |
89 | 90 | import javax.imageio.stream.ImageInputStream; |
@@ -303,6 +304,9 @@ public class ApplicationController extends TextWebSocketHandler implements Initi |
303 | 304 | @Autowired |
304 | 305 | private SpellcheckConfigBean spellcheckConfigBean; |
305 | 306 |
|
| 307 | + @Autowired |
| 308 | + private EventService eventService; |
| 309 | + |
306 | 310 | private Stage stage; |
307 | 311 | private List<WebSocketSession> sessionList = new ArrayList<>(); |
308 | 312 | private Scene scene; |
@@ -373,6 +377,15 @@ public class ApplicationController extends TextWebSocketHandler implements Initi |
373 | 377 | private Scene markdownTableScene; |
374 | 378 | private String VERSION_PATTERN = "\\.AsciidocFX-\\d+\\.\\d+\\.\\d+"; |
375 | 379 |
|
| 380 | + @PostConstruct |
| 381 | + public void install_listeners() { |
| 382 | + // Listen to working directory update events |
| 383 | + eventService.subscribe(DirectoryService.WORKING_DIRECTORY_UPDATE_EVENT, event -> { |
| 384 | + Path path = (Path) event.getData(); |
| 385 | + getStage().setTitle(String.format("AsciidocFX - %s", path)); |
| 386 | + }); |
| 387 | + } |
| 388 | + |
376 | 389 | public void createAsciidocTable() { |
377 | 390 | asciidocTableStage.showAndWait(); |
378 | 391 | } |
@@ -2548,7 +2561,7 @@ public String readAsciidoctorResource(String uri, Integer parent) { |
2548 | 2561 | return String.format("link:%s[]", uri); |
2549 | 2562 | } |
2550 | 2563 |
|
2551 | | - PathFinderService fileReader = applicationContext.getBean("pathFinder", PathFinderService.class); |
| 2564 | + PathFinderService fileReader = applicationContext.getBean(PathFinderService.label, PathFinderService.class); |
2552 | 2565 | Path path = fileReader.findPath(uri, parent); |
2553 | 2566 |
|
2554 | 2567 | if (!Files.exists(path)) { |
|
0 commit comments