Changeset 16974 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-08-29T21:28:44+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r16961 r16974 871 871 setupCallbacks(); 872 872 873 if (!skipLoadingPlugins) { 874 PluginHandler.loadVeryEarlyPlugins(); 875 } 873 876 // Configure Look and feel before showing SplashScreen (#19290) 874 877 setupUIManager(); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r16921 r16974 902 902 903 903 /** 904 * Loads plugins from <code>plugins</code> which have the flag {@link PluginInformation#early} set to true. 904 * Loads plugins from <code>plugins</code> which have the flag {@link PluginInformation#early} set to true 905 * <i>and</i> a negative {@link PluginInformation#stage} value. 906 * 907 * This is meant for plugins that provide additional {@link javax.swing.LookAndFeel}. 908 */ 909 public static void loadVeryEarlyPlugins() { 910 List<PluginInformation> veryEarlyPlugins = PluginHandler.buildListOfPluginsToLoad(null, null) 911 .stream() 912 .filter(pi -> pi.early && pi.stage < 0) 913 .collect(Collectors.toList()); 914 loadPlugins(null, veryEarlyPlugins, null); 915 } 916 917 /** 918 * Loads plugins from <code>plugins</code> which have the flag {@link PluginInformation#early} set to true 919 * <i>and</i> a non-negative {@link PluginInformation#stage} value. 905 920 * 906 921 * @param parent The parent component to be used for the displayed dialog … … 909 924 */ 910 925 public static void loadEarlyPlugins(Component parent, Collection<PluginInformation> plugins, ProgressMonitor monitor) { 911 List<PluginInformation> earlyPlugins = new ArrayList<>(plugins.size()); 912 for (PluginInformation pi: plugins) { 913 if (pi.early) { 914 earlyPlugins.add(pi); 915 } 916 } 926 List<PluginInformation> earlyPlugins = plugins.stream() 927 .filter(pi -> pi.early && pi.stage >= 0) 928 .collect(Collectors.toList()); 917 929 loadPlugins(parent, earlyPlugins, monitor); 918 930 } … … 926 938 */ 927 939 public static void loadLatePlugins(Component parent, Collection<PluginInformation> plugins, ProgressMonitor monitor) { 928 List<PluginInformation> latePlugins = new ArrayList<>(plugins.size()); 929 for (PluginInformation pi: plugins) { 930 if (!pi.early) { 931 latePlugins.add(pi); 932 } 933 } 940 List<PluginInformation> latePlugins = plugins.stream() 941 .filter(pi -> !pi.early) 942 .collect(Collectors.toList()); 934 943 loadPlugins(parent, latePlugins, monitor); 935 944 } … … 1023 1032 } 1024 1033 } 1025 if (!plugins.isEmpty() ) {1034 if (!plugins.isEmpty() && parent != null) { 1026 1035 alertMissingPluginInformation(parent, plugins); 1027 1036 }
Note:
See TracChangeset
for help on using the changeset viewer.