- Timestamp:
- 2018-08-27T20:12:16+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r14153 r14186 636 636 } 637 637 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 638 646 private static void alertJOSMUpdateRequired(Component parent, String plugin, int requiredVersion) { 639 647 HelpAwareOptionPane.showOptionDialog( … … 651 659 /** 652 660 * Checks whether all preconditions for loading the plugin <code>plugin</code> are met. The 653 * current J OSM versionmust be compatible with the plugin and no other plugins this plugin661 * current Java and JOSM versions must be compatible with the plugin and no other plugins this plugin 654 662 * depends on should be missing. 655 663 * … … 661 669 public static boolean checkLoadPreconditions(Component parent, Collection<PluginInformation> plugins, PluginInformation plugin) { 662 670 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 663 678 // make sure the plugin is compatible with the current JOSM version 664 //665 679 int josmVersion = Version.getInstance().getVersion(); 666 680 if (plugin.localmainversion > josmVersion && josmVersion != Version.JOSM_UNKNOWN_VERSION) { -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r14160 r14186 50 50 /** The lowest JOSM version required by this plugin (from locally available jar). **/ 51 51 public int localmainversion; 52 /** The lowest Java version required by this plugin (from plugin list). **/ 53 public int minjavaversion; 54 /** The lowest Java version required by this plugin (from locally available jar). **/ 55 public int localminjavaversion; 52 56 /** The plugin class name. */ 53 57 public String className; … … 162 166 public void updateFromPluginSite(PluginInformation other) { 163 167 this.mainversion = other.mainversion; 168 this.minjavaversion = other.minjavaversion; 164 169 this.className = other.className; 165 170 this.requires = other.requires; … … 237 242 } catch (NumberFormatException e) { 238 243 Logging.warn(tr("Invalid plugin main version ''{0}'' in plugin {1}", s, name)); 244 Logging.trace(e); 239 245 } 240 246 } else { 241 247 Logging.warn(tr("Missing plugin main version in plugin {0}", name)); 248 } 249 s = attr.getValue("Minimum-Java-Version"); 250 if (s != null) { 251 try { 252 minjavaversion = Integer.parseInt(s); 253 } catch (NumberFormatException e) { 254 Logging.warn(tr("Invalid Java version ''{0}'' in plugin {1}", s, name)); 255 Logging.trace(e); 256 } 242 257 } 243 258 author = attr.getValue("Author"); … … 543 558 544 559 /** 545 * Updates the local fields ({@link #localversion}, {@link #localmainversion}, {@link #localrequires}) 546 * to values contained in the up-to-date fields ({@link #version}, {@link #mainversion}, {@link #requires}) 560 * Updates the local fields 561 * ({@link #localversion}, {@link #localmainversion}, {@link #localminjavaversion}, {@link #localrequires}) 562 * to values contained in the up-to-date fields 563 * ({@link #version}, {@link #mainversion}, {@link #minjavaversion}, {@link #requires}) 547 564 * of the given PluginInformation. 548 565 * @param info The plugin information to get the data from. … … 553 570 this.localversion = info.version; 554 571 this.localmainversion = info.mainversion; 572 this.localminjavaversion = info.minjavaversion; 555 573 this.localrequires = info.requires; 556 574 }
Note:
See TracChangeset
for help on using the changeset viewer.