1 19 package org.netbeans.modules.java.examples; 20 21 import java.util.prefs.Preferences ; 22 import org.netbeans.modules.java.examples.FoldersListSettings; 23 import org.openide.util.NbBundle; 24 import org.openide.util.NbPreferences; 25 26 27 public class FoldersListSettings { 28 private static final FoldersListSettings INSTANCE = new FoldersListSettings(); 29 private static final String LAST_EXTERNAL_SOURCE_ROOT = "srcRoot"; private static final String NEW_PROJECT_COUNT = "newProjectCount"; 32 33 public String displayName() { 34 return NbBundle.getMessage (FoldersListSettings.class, "TXT_J2SEProjectFolderList"); } 36 37 private static Preferences getPreferences() { 38 return NbPreferences.forModule(FoldersListSettings.class); 39 } 40 41 public String getLastExternalSourceRoot () { 42 return getPreferences().get(LAST_EXTERNAL_SOURCE_ROOT, null); 43 } 44 45 public void setLastExternalSourceRoot (String path) { 46 getPreferences().put(LAST_EXTERNAL_SOURCE_ROOT, path); 47 } 48 49 public int getNewProjectCount () { 50 return getPreferences().getInt(NEW_PROJECT_COUNT, 0); 51 } 52 53 public void setNewProjectCount (int count) { 54 getPreferences().putInt(NEW_PROJECT_COUNT, count); 55 } 56 57 58 public static FoldersListSettings getDefault () { 59 return INSTANCE; 60 } 61 } 62 | Popular Tags |