Changeset 4987 in josm for trunk


Ignore:
Timestamp:
2012-02-18T17:24:05+01:00 (12 years ago)
Author:
bastiK
Message:

expose imagery preference tab for plugin

Location:
trunk/src/org/openstreetmap/josm/gui/preferences
Files:
3 edited

Legend:

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

    r4974 r4987  
    6868        boolean validatePreferences();
    6969    }
    70    
     70
    7171    private static interface PreferenceTab {
    7272        public TabPreferenceSetting getTabPreferenceSetting();
    7373        public Component getComponent();
    7474    }
    75    
     75
    7676    public static class PreferencePanel extends JPanel implements PreferenceTab {
    7777        private final TabPreferenceSetting preferenceSetting;
     
    8383            buildPanel();
    8484        }
    85        
     85
    8686        protected void buildPanel() {
    8787            setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     
    132132    private final static Collection<PreferenceSettingFactory> settingsFactory = new LinkedList<PreferenceSettingFactory>();
    133133    private final List<PreferenceSetting> settings = new ArrayList<PreferenceSetting>();
    134    
     134
    135135    // distinct list of tabs that have been initialized (we do not initialize tabs until they are displayed to speed up dialog startup)
    136136    private final List<PreferenceSetting> settingsInitialized = new ArrayList<PreferenceSetting>();
     
    179179        public boolean identify(TabPreferenceSetting tps, Object param);
    180180    }
    181    
     181
    182182    private void selectTabBy(TabIdentifier method, Object param) {
    183183        for (int i=0; i<getTabCount(); i++) {
     
    192192        }
    193193    }
    194    
     194
    195195    public void selectTabByName(String name) {
    196196        selectTabBy(new TabIdentifier(){
     
    208208            }}, clazz);
    209209    }
    210    
     210
    211211    public final DisplayPreference getDisplayPreference() {
    212212        return getSetting(DisplayPreference.class);
    213213    }
    214    
     214
    215215    public final MapPreference getMapPreference() {
    216216        return getSetting(MapPreference.class);
    217217    }
    218    
     218
    219219    public final PluginPreference getPluginPreference() {
    220220        return getSetting(PluginPreference.class);
     221    }
     222
     223    public final ImageryPreference getImageryPreference() {
     224        return getSetting(ImageryPreference.class);
    221225    }
    222226
     
    329333        }
    330334    }
    331    
     335
    332336    private void insertGUITabsForSetting(Icon icon, TabPreferenceSetting tps, int index) {
    333337        int position = index;
     
    338342        }
    339343    }
    340    
     344
    341345    private void addGUITabs(boolean clear) {
    342346        boolean expert = ExpertToggleAction.isExpert();
     
    369373        } catch (IllegalArgumentException e) {}
    370374    }
    371    
     375
    372376    @Override
    373377    public void expertChanged(boolean isExpert) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java

    r4968 r4987  
    22package org.openstreetmap.josm.gui.preferences;
    33
     4/**
     5 * Preference settings, that do *not* display a top level tab.
     6 *
     7 * This preference setting's addGui method is called after the user clicked the parent tab
     8 * (returned by getTabPreferenceSetting).
     9 */
    410public interface SubPreferenceSetting extends PreferenceSetting {
    5    
     11
    612    /**
    713     * Returns the preference setting (displayed in the specified preferences tab pane) that contains this preference setting.
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r4968 r4987  
    9494        }
    9595    }
    96    
     96
    9797    private ImageryPreference() {
    9898        super("imagery", tr("Imagery Preferences"), tr("Modify list of imagery layers displayed in the Imagery menu"));
    9999    }
    100    
     100
    101101    private ImageryProvidersPanel imageryProviders;
    102102    private ImageryLayerInfo layerInfo;
Note: See TracChangeset for help on using the changeset viewer.