Changeset 8024 in josm


Ignore:
Timestamp:
2015-02-09T14:54:35+01:00 (10 years ago)
Author:
bastiK
Message:

see #11090 - make sure plugin preference tab is shown after runtime load

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r8017 r8024  
    143143    // all created tabs
    144144    private final List<PreferenceTab> tabs = new ArrayList<>();
    145     private static final Collection<PreferenceSettingFactory> settingsFactory = new LinkedList<>();
     145    private static final Collection<PreferenceSettingFactory> settingsFactories = new LinkedList<>();
     146    private static final PreferenceSettingFactory advancedPreferenceFactory = new AdvancedPreference.Factory();
    146147    private final List<PreferenceSetting> settings = new ArrayList<>();
    147148
     
    424425
    425426    public void buildGui() {
    426         for (PreferenceSettingFactory factory : settingsFactory) {
     427        Collection<PreferenceSettingFactory> factories = new ArrayList<>(settingsFactories);
     428        factories.addAll(PluginHandler.getPreferenceSetting());
     429        factories.add(advancedPreferenceFactory);
     430
     431        for (PreferenceSettingFactory factory : factories) {
    427432            PreferenceSetting setting = factory.createPreferenceSetting();
    428433            if (setting != null) {
     
    509514    static {
    510515        // order is important!
    511         settingsFactory.add(new DisplayPreference.Factory());
    512         settingsFactory.add(new DrawingPreference.Factory());
    513         settingsFactory.add(new ColorPreference.Factory());
    514         settingsFactory.add(new LafPreference.Factory());
    515         settingsFactory.add(new LanguagePreference.Factory());
    516         settingsFactory.add(new ServerAccessPreference.Factory());
    517         settingsFactory.add(new AuthenticationPreference.Factory());
    518         settingsFactory.add(new ProxyPreference.Factory());
    519         settingsFactory.add(new MapPreference.Factory());
    520         settingsFactory.add(new ProjectionPreference.Factory());
    521         settingsFactory.add(new MapPaintPreference.Factory());
    522         settingsFactory.add(new TaggingPresetPreference.Factory());
    523         settingsFactory.add(new BackupPreference.Factory());
    524         settingsFactory.add(new PluginPreference.Factory());
    525         settingsFactory.add(Main.toolbar);
    526         settingsFactory.add(new AudioPreference.Factory());
    527         settingsFactory.add(new ShortcutPreference.Factory());
    528         settingsFactory.add(new ValidatorPreference.Factory());
    529         settingsFactory.add(new ValidatorTestsPreference.Factory());
    530         settingsFactory.add(new ValidatorTagCheckerRulesPreference.Factory());
    531         settingsFactory.add(new RemoteControlPreference.Factory());
    532         settingsFactory.add(new ImageryPreference.Factory());
    533 
    534         PluginHandler.getPreferenceSetting(settingsFactory);
    535 
    536         // always the last: advanced tab
    537         settingsFactory.add(new AdvancedPreference.Factory());
     516        settingsFactories.add(new DisplayPreference.Factory());
     517        settingsFactories.add(new DrawingPreference.Factory());
     518        settingsFactories.add(new ColorPreference.Factory());
     519        settingsFactories.add(new LafPreference.Factory());
     520        settingsFactories.add(new LanguagePreference.Factory());
     521        settingsFactories.add(new ServerAccessPreference.Factory());
     522        settingsFactories.add(new AuthenticationPreference.Factory());
     523        settingsFactories.add(new ProxyPreference.Factory());
     524        settingsFactories.add(new MapPreference.Factory());
     525        settingsFactories.add(new ProjectionPreference.Factory());
     526        settingsFactories.add(new MapPaintPreference.Factory());
     527        settingsFactories.add(new TaggingPresetPreference.Factory());
     528        settingsFactories.add(new BackupPreference.Factory());
     529        settingsFactories.add(new PluginPreference.Factory());
     530        settingsFactories.add(Main.toolbar);
     531        settingsFactories.add(new AudioPreference.Factory());
     532        settingsFactories.add(new ShortcutPreference.Factory());
     533        settingsFactories.add(new ValidatorPreference.Factory());
     534        settingsFactories.add(new ValidatorTestsPreference.Factory());
     535        settingsFactories.add(new ValidatorTagCheckerRulesPreference.Factory());
     536        settingsFactories.add(new RemoteControlPreference.Factory());
     537        settingsFactories.add(new ImageryPreference.Factory());
    538538    }
    539539
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8020 r8024  
    10571057    }
    10581058
    1059     public static void getPreferenceSetting(Collection<PreferenceSettingFactory> settings) {
     1059    public static Collection<PreferenceSettingFactory> getPreferenceSetting() {
     1060        Collection<PreferenceSettingFactory> settings = new ArrayList<>();
    10601061        for (PluginProxy plugin : pluginList) {
    10611062            settings.add(new PluginPreferenceFactory(plugin));
    10621063        }
     1064        return settings;
    10631065    }
    10641066
Note: See TracChangeset for help on using the changeset viewer.