01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.xslt.project.wizard;
21:
22: import org.openide.util.NbBundle;
23: import org.openide.util.NbPreferences;
24:
25: public class FoldersListSettings {
26:
27: private static final String LAST_EXTERNAL_SOURCE_ROOT = "srcRoot"; //NOI18N
28:
29: private static final String NEW_PROJECT_COUNT = "newProjectCount"; //NOI18N
30:
31: private static final String SHOW_AGAIN_BROKEN_REF_ALERT = "showAgainBrokenRefAlert"; //NOI18N
32:
33: private static FoldersListSettings INSTANCE = new FoldersListSettings();
34:
35: private FoldersListSettings() {
36: }
37:
38: public String displayName() {
39: return NbBundle.getMessage(FoldersListSettings.class,
40: "TXT_WebProjectFolderList"); //NOI18N
41: }
42:
43: public String getLastExternalSourceRoot() {
44: return NbPreferences.forModule(FoldersListSettings.class).get(
45: LAST_EXTERNAL_SOURCE_ROOT, null);
46: }
47:
48: public void setLastExternalSourceRoot(String path) {
49: if (path != null) {
50: NbPreferences.forModule(FoldersListSettings.class).put(
51: LAST_EXTERNAL_SOURCE_ROOT, path);
52: } else {
53: NbPreferences.forModule(FoldersListSettings.class).remove(
54: LAST_EXTERNAL_SOURCE_ROOT);
55: }
56: }
57:
58: public int getNewProjectCount() {
59: return NbPreferences.forModule(FoldersListSettings.class)
60: .getInt(NEW_PROJECT_COUNT, 0);
61: }
62:
63: public void setNewProjectCount(int count) {
64: NbPreferences.forModule(FoldersListSettings.class).putInt(
65: NEW_PROJECT_COUNT, count);
66: }
67:
68: public boolean isShowAgainBrokenRefAlert() {
69: return NbPreferences.forModule(FoldersListSettings.class)
70: .getBoolean(SHOW_AGAIN_BROKEN_REF_ALERT, true);
71: }
72:
73: public void setShowAgainBrokenRefAlert(boolean again) {
74: NbPreferences.forModule(FoldersListSettings.class).putBoolean(
75: SHOW_AGAIN_BROKEN_REF_ALERT, again);
76: }
77:
78: public static FoldersListSettings getDefault() {
79: return INSTANCE;
80: }
81: }
|