Changeset 12928 in josm for trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
- Timestamp:
- 2017-10-06T15:17:51+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
r12841 r12928 24 24 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 25 25 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 26 import org.openstreetmap.josm.spi.preferences.Config; 26 27 import org.openstreetmap.josm.tools.CheckParameterUtil; 27 28 import org.openstreetmap.josm.tools.ImageProvider; … … 257 258 * Initializes the panel from the values in the preferences <code>preferences</code>. 258 259 * 260 * @param paramApiUrl the API URL. Must not be null. 261 * @throws IllegalArgumentException if paramApiUrl is null 262 */ 263 public void initialize(String paramApiUrl) { 264 CheckParameterUtil.ensureParameterNotNull(paramApiUrl, "paramApiUrl"); 265 setApiUrl(paramApiUrl); 266 boolean useDefault = Config.getPref().getBoolean("oauth.settings.use-default", true); 267 ilUseDefault.setEnabled(false); 268 if (useDefault) { 269 resetToDefaultSettings(); 270 } else { 271 setAdvancedParameters(OAuthParameters.createFromApiUrl(paramApiUrl)); 272 } 273 ilUseDefault.setEnabled(true); 274 } 275 276 /** 277 * Initializes the panel from the values in the preferences <code>preferences</code>. 278 * 259 279 * @param pref the preferences. Must not be null. 260 280 * @throws IllegalArgumentException if pref is null 261 */ 281 * @deprecated (since 12928) replaced by {@link #initialize(java.lang.String)} 282 */ 283 @Deprecated 262 284 public void initFromPreferences(Preferences pref) { 263 285 CheckParameterUtil.ensureParameterNotNull(pref, "pref"); … … 275 297 /** 276 298 * Remembers the current values in the preferences <code>pref</code>. 299 */ 300 public void rememberPreferences() { 301 Config.getPref().putBoolean("oauth.settings.use-default", cbUseDefaults.isSelected()); 302 if (cbUseDefaults.isSelected()) { 303 new OAuthParameters(null, null, null, null, null, null, null).rememberPreferences(); 304 } else { 305 getAdvancedParameters().rememberPreferences(); 306 } 307 } 308 309 /** 310 * Remembers the current values in the preferences <code>pref</code>. 277 311 * 278 312 * @param pref the preferences. Must not be null. 279 313 * @throws IllegalArgumentException if pref is null. 280 */ 314 * @deprecated (since 12928) replaced by {@link #rememberPreferences()} 315 */ 316 @Deprecated 281 317 public void rememberPreferences(Preferences pref) { 282 318 CheckParameterUtil.ensureParameterNotNull(pref, "pref");
Note:
See TracChangeset
for help on using the changeset viewer.