Changes between Initial Version and Version 4 of Ticket #20456
- Timestamp:
- 2021-02-21T17:41:34+01:00 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #20456
- Property Milestone 21.01 → 21.02
- Property Summary Classloader problem with loading look and feel from plugin (FlatLaf) → [Patch] Classloader problem with loading look and feel from plugin (FlatLaf)
-
Ticket #20456 – Description
initial v4 6 6 7 7 Both classloaders include the laf plugin jar (`flatlaf.jar` in my case). 8 So it seems to work, but FlatLaf can not find the properties files in the plugin 9 and JOSM specific colors and UI delegates are missing. 8 So it seems to work, but FlatLaf can not find the properties files in the plugin and JOSM specific colors and UI delegates are missing. 10 9 11 The necessary information to load plugin properties files 12 is stored in a static variable in class `FlatLaf`. 13 Because class `FlatLaf` is loaded into two classloaders, 14 there are **two** instances of the static variable. 10 The necessary information to load plugin properties files is stored in a static variable in class `FlatLaf`. 11 Because class `FlatLaf` is loaded into two classloaders, there are **two** instances of the static variable. 15 12 16 The static variable is set in `FlatLafPlugin` constructor 17 by invoking `FlatLaf.registerCustomDefaultsSource()`. 13 The static variable is set in `FlatLafPlugin` constructor by invoking `FlatLaf.registerCustomDefaultsSource()`. 18 14 This is done with a `PluginClassLoader`. 19 15 20 Later when the laf is initialized with `UIManager.setLookAndFeel()`, 21 this static variable is `null` because this is done in `DynamicURLClassLoader`. 16 Later when the laf is initialized with `UIManager.setLookAndFeel()`, this static variable is `null` because this is done in `DynamicURLClassLoader`. 22 17 23 18 Tried to workaround this without success. 24 19 25 The reason for the different classloaders is that 26 `PluginHandler.getResourceClassLoaders()` is used 27 in `MainApplication.setupUIManager()` to find/load the laf class from a plugin. 20 The reason for the different classloaders is that `PluginHandler.getResourceClassLoaders()` is used in `MainApplication.setupUIManager()` to find/load the laf class from a plugin. 28 21 29 22 See:


