As nature of a programmer calls I need to express myself about Xtend. During development of The Console I have almost smashed my face a few times by gesture flying straight from internal centre of disbeliefs.
The Console supports multiple tabs. By hitting CTRL+T combination new tab is opened and auto-named. I decided to name tabs as “Tab 1”, “Tab 2”, etc. However, those tabs can be renamed and moved inbetween so auto-naming need an algorithm. I’ve done similiar operation few times but never done this specific things by using Lambda Expressions in Xtend. I was quite surprised by one small detail.
Today I present a few snippets around JavaFX WebView that I use in The Console:
- load style sheet
- set style or class of element
- scroll page to the bottom
- check whether the page is scrolled down to the bottom
- handle adding DOM elements while web engine loads
- remove some elements from document
- style scrollbar in the document
Applications that are launched in Windows OS are by default listed on taskbar. For a utility software like The Console it is not the case. It shouldn’t pollute our task bar or even tray. It should be available under hotkey and that’s it.
Problem is, JavaFX won’t allow us. Previously presented line stage.initStyle(StageStyle.UNDECORATED) gives us undecorated window but collides with stage.initStyle(StageStyle.UTILITY) which makes window’s task not visible in taskbar but window itself is then decorated.
Between workarounds I’ve found a solution. TL;DR initialize window using Swing.