Re: Plugin installation without restart
Hi, thanks. It make sense now. I think I was confused because the JOSM didn't ask for restart after update once. But maybe I just overlooked it. Thanks again, jiri On Wed, Feb 27, 2019 at 06:56:47PM +0100, Michael Zangl wrote: > Hi, > > A plugin update always requires a restart - you cannot get around this. > > The technical reason is that JOSM cannot unload the old plugin classes. This > is why an activation of a plugin is possible without restart, but > deactivating it is not. > > Am 27. Februar 2019 13:33:49 MEZ schrieb Jiri Vlasak : > >Hi Gerd, > > > >thanks for your time. I am pretty sure I miss something trivial. > > > >On Sat, Feb 23, 2019 at 08:10:12AM +, Gerd Petermann wrote: > >> Hi Jiri, > >> > >> my understanding is that your plugin either requires a restart (set > >plugin.canloadatruntime to false in build.xml) > > > >The `canLoadAtRuntime = true` should be set properly [1]. > > > >> or it should work so that it reacts on a event to rebuild everything > >(maybe costly) > > > >I am confused a little bit with "reacts on a event" part. The plugin > >constructor add entries to menu: > > > >public class MapathonerPlugin extends Plugin > >{ > >/** > > * Constructs a new {@code MapathonerPlugin}. > > */ > >public MapathonerPlugin(PluginInformation info) > >{ > >super(info); > >MainMenu mm = MainApplication.getMenu(); > >JMenu hm = mm.addMenu("Mapathoner", > >tr("Mapathoner"), > >KeyEvent.VK_M, > >mm.getDefaultMenuPos(), > >ht("/Plugin/Mapathoner")); > > > >hm.setMnemonic(KeyEvent.VK_M); > > > >mm.add(hm, new BatchCircleBuildingAction()); > >mm.add(hm, new BatchOrthogonalBuildingAction()); > >mm.add(hm, new BatchLBuildingAction()); > >hm.addSeparator(); > >mm.add(hm, new PickResidentialAreaAction()); > >} > >} > > > >Which should be ok ("Adding a menu entry to the main menu in the plugin > >Constructor" [3]). Also, shortcuts are bound to actions. > > > >Thanks for any pointer, > >jiri > > > >[1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle > >[2]: > >https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java > >[3]: > >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart > > > >> Gerd > >> > >> > >> Von: Jiri Vlasak > >> Gesendet: Dienstag, 19. Februar 2019 07:47 > >> An: josm-dev@openstreetmap.org > >> Betreff: Plugin installation without restart > >> > >> Dear JOSM devs, > >> > >> I would like to ask about the difference between installing and > >upgrading JOSM > >> plugin. In my case, the installation does not the restart of JOSM > >[1]. However, > >> when the plugin is upgraded, the new functionality does not work > >until restart. > >> > >> The plugin adds JMenu with multiple options. > >> > >> Thanks, > >> jiri > >> > >> [1]: > >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart > >>
Re: Plugin installation without restart
Hi, A plugin update always requires a restart - you cannot get around this. The technical reason is that JOSM cannot unload the old plugin classes. This is why an activation of a plugin is possible without restart, but deactivating it is not. Am 27. Februar 2019 13:33:49 MEZ schrieb Jiri Vlasak : >Hi Gerd, > >thanks for your time. I am pretty sure I miss something trivial. > >On Sat, Feb 23, 2019 at 08:10:12AM +, Gerd Petermann wrote: >> Hi Jiri, >> >> my understanding is that your plugin either requires a restart (set >plugin.canloadatruntime to false in build.xml) > >The `canLoadAtRuntime = true` should be set properly [1]. > >> or it should work so that it reacts on a event to rebuild everything >(maybe costly) > >I am confused a little bit with "reacts on a event" part. The plugin >constructor add entries to menu: > >public class MapathonerPlugin extends Plugin >{ >/** > * Constructs a new {@code MapathonerPlugin}. > */ >public MapathonerPlugin(PluginInformation info) >{ >super(info); >MainMenu mm = MainApplication.getMenu(); >JMenu hm = mm.addMenu("Mapathoner", >tr("Mapathoner"), >KeyEvent.VK_M, >mm.getDefaultMenuPos(), >ht("/Plugin/Mapathoner")); > >hm.setMnemonic(KeyEvent.VK_M); > >mm.add(hm, new BatchCircleBuildingAction()); >mm.add(hm, new BatchOrthogonalBuildingAction()); >mm.add(hm, new BatchLBuildingAction()); >hm.addSeparator(); >mm.add(hm, new PickResidentialAreaAction()); >} >} > >Which should be ok ("Adding a menu entry to the main menu in the plugin >Constructor" [3]). Also, shortcuts are bound to actions. > >Thanks for any pointer, >jiri > >[1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle >[2]: >https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java >[3]: >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart > >> Gerd >> >> >> Von: Jiri Vlasak >> Gesendet: Dienstag, 19. Februar 2019 07:47 >> An: josm-dev@openstreetmap.org >> Betreff: Plugin installation without restart >> >> Dear JOSM devs, >> >> I would like to ask about the difference between installing and >upgrading JOSM >> plugin. In my case, the installation does not the restart of JOSM >[1]. However, >> when the plugin is upgraded, the new functionality does not work >until restart. >> >> The plugin adds JMenu with multiple options. >> >> Thanks, >> jiri >> >> [1]: >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart >>
Re: Plugin installation without restart
Hi Gerd, thanks for your time. I am pretty sure I miss something trivial. On Sat, Feb 23, 2019 at 08:10:12AM +, Gerd Petermann wrote: > Hi Jiri, > > my understanding is that your plugin either requires a restart (set > plugin.canloadatruntime to false in build.xml) The `canLoadAtRuntime = true` should be set properly [1]. > or it should work so that it reacts on a event to rebuild everything (maybe > costly) I am confused a little bit with "reacts on a event" part. The plugin constructor add entries to menu: public class MapathonerPlugin extends Plugin { /** * Constructs a new {@code MapathonerPlugin}. */ public MapathonerPlugin(PluginInformation info) { super(info); MainMenu mm = MainApplication.getMenu(); JMenu hm = mm.addMenu("Mapathoner", tr("Mapathoner"), KeyEvent.VK_M, mm.getDefaultMenuPos(), ht("/Plugin/Mapathoner")); hm.setMnemonic(KeyEvent.VK_M); mm.add(hm, new BatchCircleBuildingAction()); mm.add(hm, new BatchOrthogonalBuildingAction()); mm.add(hm, new BatchLBuildingAction()); hm.addSeparator(); mm.add(hm, new PickResidentialAreaAction()); } } Which should be ok ("Adding a menu entry to the main menu in the plugin Constructor" [3]). Also, shortcuts are bound to actions. Thanks for any pointer, jiri [1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle [2]: https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java [3]: https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart > Gerd > > > Von: Jiri Vlasak > Gesendet: Dienstag, 19. Februar 2019 07:47 > An: josm-dev@openstreetmap.org > Betreff: Plugin installation without restart > > Dear JOSM devs, > > I would like to ask about the difference between installing and upgrading JOSM > plugin. In my case, the installation does not the restart of JOSM [1]. > However, > when the plugin is upgraded, the new functionality does not work until > restart. > > The plugin adds JMenu with multiple options. > > Thanks, > jiri > > [1]: > https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart >
AW: Plugin installation without restart
Hi Jiri, my understanding is that your plugin either requires a restart (set plugin.canloadatruntime to false in build.xml) or it should work so that it reacts on a event to rebuild everything (maybe costly) Gerd Von: Jiri Vlasak Gesendet: Dienstag, 19. Februar 2019 07:47 An: josm-dev@openstreetmap.org Betreff: Plugin installation without restart Dear JOSM devs, I would like to ask about the difference between installing and upgrading JOSM plugin. In my case, the installation does not the restart of JOSM [1]. However, when the plugin is upgraded, the new functionality does not work until restart. The plugin adds JMenu with multiple options. Thanks, jiri [1]: https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
Plugin installation without restart
Dear JOSM devs, I would like to ask about the difference between installing and upgrading JOSM plugin. In my case, the installation does not the restart of JOSM [1]. However, when the plugin is upgraded, the new functionality does not work until restart. The plugin adds JMenu with multiple options. Thanks, jiri [1]: https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
Re: [josm-dev] Plugin installation without restart
On 12.02.2015 20:43, Malcolm Herring wrote: On 12/02/2015 18:59, Paul Hartmann wrote: There is a guide [1] on how to get your plugin ready to support this new feature. The good news is that there is usually nothing or very little to change, but it still needs to be tested. OK, I followed the instructions built a renamed test version installed it on the latest JOSM, No restart prompt appeared, using the plugin, it seemed to be working OK. Great! Out of the 12 plugins I've adapted so far, only 3 actually needed a change in the source code, so you might be lucky. The question is, what are the key things to test? Is there a particular operation that would be expected to fail if the plugin were not compatible? Mostly it was related to missed layer change events when the layer was already present at time of installation. For example in the photo_adjust plugin, you couldn't move the photos with the mouse when the photo layer was already active at installation time. You should also check that the disabling and enabling of buttons and menu entries works as expected. What I did was read the source code of the constructor and mapFrameInitialized method of the plugin main class and look for something that might not work when a MapFrame already exists and layers are open. Paul ___ josm-dev mailing list josm-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/josm-dev
Re: [josm-dev] Plugin installation without restart
On 12/02/2015 18:59, Paul Hartmann wrote: There is a guide [1] on how to get your plugin ready to support this new feature. The good news is that there is usually nothing or very little to change, but it still needs to be tested. OK, I followed the instructions built a renamed test version installed it on the latest JOSM, No restart prompt appeared, using the plugin, it seemed to be working OK. The question is, what are the key things to test? Is there a particular operation that would be expected to fail if the plugin were not compatible? ___ josm-dev mailing list josm-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/josm-dev
[josm-dev] Plugin installation without restart
Hi, Since version r8024, JOSM can load plugins at runtime. This means that after installation, there is no need to restart the application, but the plugins can be used immediately. There is a guide [1] on how to get your plugin ready to support this new feature. The good news is that there is usually nothing or very little to change, but it still needs to be tested. Please help with the adaption! We have more than 100 plugins, so this is too much work for just the core team. :) If you fix a plugin, please mention it in ticket #11090 [2], which lists all the changes that have been made so far. [1] https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart [2] https://josm.openstreetmap.de/ticket/11090 Paul ___ josm-dev mailing list josm-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/josm-dev