1 19 20 package org.netbeans.modules.exceptions.settings; 21 22 import java.util.prefs.Preferences ; 23 import org.openide.util.NbPreferences; 24 import org.openide.util.NbBundle; 25 26 30 public class ExceptionsSettings { 31 32 public static final String userProp = "UserName"; public static final String passwdProp = "Password"; public static final String savePassword = "SavePassword"; 36 37 38 public ExceptionsSettings() { 39 } 40 41 private static Preferences prefs() { 42 return NbPreferences.forModule(ExceptionsSettings.class); 43 } 44 45 public String displayName() { 46 return NbBundle.getMessage(ExceptionsAdvancedOption.class, "AdvancedOption_DisplayName"); 47 } 48 49 public String getUserName() { 50 return prefs().get(userProp, ""); 51 } 52 53 public String getPassword() { 54 return prefs().get(passwdProp, ""); 55 } 56 57 public Boolean getSavePassword(){ 58 return prefs().getBoolean(savePassword, false); 59 } 60 61 public void setUserName(String userName) { 62 prefs().put(userProp, userName); 63 } 64 65 public void setPassword(String passwd) { 66 if (passwd!=null) prefs().put(passwdProp, passwd); 67 else prefs().remove(passwdProp); 68 } 69 70 public void setSavePassword(Boolean b){ 71 prefs().putBoolean(savePassword, b); 72 } 73 74 } | Popular Tags |