Ignore:
Timestamp:
2018-08-27T20:12:16+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16682 - add new plugin property Minimum-Java-Version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r14153 r14186  
    636636    }
    637637
     638    private static void logJavaUpdateRequired(String plugin, int requiredVersion) {
     639        Logging.warn(
     640                tr("Plugin {0} requires Java version {1}. The current Java version is {2}. "
     641                        +"You have to update Java in order to use this plugin.",
     642                        plugin, Integer.toString(requiredVersion), Utils.getJavaVersion()
     643                ));
     644    }
     645
    638646    private static void alertJOSMUpdateRequired(Component parent, String plugin, int requiredVersion) {
    639647        HelpAwareOptionPane.showOptionDialog(
     
    651659    /**
    652660     * Checks whether all preconditions for loading the plugin <code>plugin</code> are met. The
    653      * current JOSM version must be compatible with the plugin and no other plugins this plugin
     661     * current Java and JOSM versions must be compatible with the plugin and no other plugins this plugin
    654662     * depends on should be missing.
    655663     *
     
    661669    public static boolean checkLoadPreconditions(Component parent, Collection<PluginInformation> plugins, PluginInformation plugin) {
    662670
     671        // make sure the plugin is compatible with the current Java version
     672        if (plugin.localminjavaversion > Utils.getJavaVersion()) {
     673            // Just log a warning until we switch to Java 11 so that openjfx plugin does not trigger a popup
     674            logJavaUpdateRequired(plugin.name, plugin.localminjavaversion);
     675            return false;
     676        }
     677
    663678        // make sure the plugin is compatible with the current JOSM version
    664         //
    665679        int josmVersion = Version.getInstance().getVersion();
    666680        if (plugin.localmainversion > josmVersion && josmVersion != Version.JOSM_UNKNOWN_VERSION) {
Note: See TracChangeset for help on using the changeset viewer.