Plugin installation without restart

Jiri Vlasak jiri.hubacek at gmail.com
Wed Feb 27 12:33:49 UTC 2019


Hi Gerd,

thanks for your time. I am pretty sure I miss something trivial.

On Sat, Feb 23, 2019 at 08:10:12AM +0000, 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 <jiri.hubacek at gmail.com>
> Gesendet: Dienstag, 19. Februar 2019 07:47
> An: josm-dev at 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
> 



More information about the josm-dev mailing list