- Timestamp:
- 2014-04-11T00:58:44+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java
r6830 r6969 26 26 private final Class<? extends SubPreferenceSetting> subTab; 27 27 28 private PreferencesAction(String name, String tooltip,28 private PreferencesAction(String name, String icon, String tooltip, 29 29 Class<? extends TabPreferenceSetting> tab, Class<? extends SubPreferenceSetting> subTab) { 30 super(name, "preference", tooltip, null, false, "preference_" + Utils.<Class>firstNonNull(tab, subTab).getName(), false);30 super(name, icon, tooltip, null, false, "preference_" + Utils.<Class>firstNonNull(tab, subTab).getName(), false); 31 31 this.tab = tab; 32 32 this.subTab = subTab; 33 33 } 34 34 35 /** 36 * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given tab, with default icon. 37 * @param name The action name 38 * @param tooltip The action tooltip 39 * @param tab The preferences tab to select 40 * @return The created action 41 */ 35 42 public static PreferencesAction forPreferenceTab(String name, String tooltip, Class<? extends TabPreferenceSetting> tab) { 36 CheckParameterUtil.ensureParameterNotNull(tab); 37 return new PreferencesAction(name, tooltip, tab, null); 43 return forPreferenceTab(name, tooltip, tab, "preference"); 38 44 } 39 45 46 /** 47 * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given tab, with custom icon. 48 * @param name The action name 49 * @param tooltip The action tooltip 50 * @param tab The preferences tab to select 51 * @param icon The action icon 52 * @return The created action 53 * @since 6969 54 */ 55 public static PreferencesAction forPreferenceTab(String name, String tooltip, Class<? extends TabPreferenceSetting> tab, String icon) { 56 CheckParameterUtil.ensureParameterNotNull(tab); 57 return new PreferencesAction(name, icon, tooltip, tab, null); 58 } 59 60 /** 61 * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given subtab, with default icon. 62 * @param name The action name 63 * @param tooltip The action tooltip 64 * @param subTab The preferences subtab to select 65 * @return The created action 66 */ 40 67 public static PreferencesAction forPreferenceSubTab(String name, String tooltip, Class<? extends SubPreferenceSetting> subTab) { 68 return forPreferenceSubTab(name, tooltip, subTab, "preference"); 69 } 70 71 /** 72 * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given subtab, with custom icon. 73 * @param name The action name 74 * @param tooltip The action tooltip 75 * @param subTab The preferences subtab to select 76 * @param icon The action icon 77 * @return The created action 78 * @since 6969 79 */ 80 public static PreferencesAction forPreferenceSubTab(String name, String tooltip, Class<? extends SubPreferenceSetting> subTab, String icon) { 41 81 CheckParameterUtil.ensureParameterNotNull(subTab); 42 return new PreferencesAction(name, tooltip, null, subTab);82 return new PreferencesAction(name, icon, tooltip, null, subTab); 43 83 } 44 84 -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r6920 r6969 94 94 95 95 public static final JosmAction PREFERENCE_ACTION = PreferencesAction.forPreferenceSubTab( 96 tr("Map paint preferences"), null, MapPaintPreference.class );96 tr("Map paint preferences"), null, MapPaintPreference.class, "dialogs/mappaintpreference"); 97 97 98 98 /** … … 102 102 super(tr("Map Paint Styles"), "mapstyle", tr("configure the map painting style"), 103 103 Shortcut.registerShortcut("subwindow:mappaint", tr("Toggle: {0}", tr("MapPaint")), 104 KeyEvent.VK_M, Shortcut.ALT_SHIFT), 150 );104 KeyEvent.VK_M, Shortcut.ALT_SHIFT), 150, false, MapPaintPreference.class); 105 105 build(); 106 106 }
Note:
See TracChangeset
for help on using the changeset viewer.