KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > earproject > ui > FoldersListSettings


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * 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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.earproject.ui;
20
21 import org.openide.options.SystemOption;
22 import org.openide.util.NbBundle;
23
24 public class FoldersListSettings extends SystemOption {
25
26     static final long serialVersionUID = -4905094097265543015L;
27
28     private static final String JavaDoc LAST_EXTERNAL_SOURCE_ROOT = "srcRoot"; //NOI18N
29

30     private static final String JavaDoc NEW_PROJECT_COUNT = "newProjectCount"; //NOI18N
31

32     private static final String JavaDoc SHOW_AGAIN_BROKEN_REF_ALERT = "showAgainBrokenRefAlert"; //NOI18N
33

34     private static final String JavaDoc SHOW_AGAIN_BROKEN_SERVER_ALERT = "showAgainBrokenServerAlert"; //NOI18N
35

36     private static final String JavaDoc AGREED_SET_JDK_14 = "agreeSetJdk14"; // NOI18N
37

38     private static final String JavaDoc AGREED_SET_SOURCE_LEVEL_14 = "agreeSetSourceLevel14"; // NOI18N
39

40     private static final String JavaDoc AGREED_SET_JDK_15 = "agreeSetJdk15"; // NOI18N
41

42     private static final String JavaDoc AGREED_SET_SOURCE_LEVEL_15 = "agreeSetSourceLevel15"; // NOI18N
43

44     
45     private static final String JavaDoc LAST_USED_SERVER = "lastUsedServer"; // NOI18N
46

47     public String JavaDoc displayName() {
48         return NbBundle.getMessage (FoldersListSettings.class, "TXT_EarProjectFolderList"); //NOI18N
49
}
50
51     public String JavaDoc getLastExternalSourceRoot () {
52         return (String JavaDoc) getProperty(LAST_EXTERNAL_SOURCE_ROOT);
53     }
54
55     public void setLastExternalSourceRoot (String JavaDoc path) {
56         putProperty (LAST_EXTERNAL_SOURCE_ROOT, path, true);
57     }
58
59     public int getNewProjectCount () {
60         Integer JavaDoc value = (Integer JavaDoc) getProperty (NEW_PROJECT_COUNT);
61         return value == null ? 0 : value.intValue();
62     }
63
64     public void setNewProjectCount (int count) {
65         this.putProperty(NEW_PROJECT_COUNT, count, true);
66     }
67     
68     public boolean isShowAgainBrokenRefAlert() {
69         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(SHOW_AGAIN_BROKEN_REF_ALERT);
70         return b == null ? true : b.booleanValue();
71     }
72     
73     public void setShowAgainBrokenRefAlert(boolean again) {
74         this.putProperty(SHOW_AGAIN_BROKEN_REF_ALERT, Boolean.valueOf(again), true);
75     }
76     
77     
78     public boolean isShowAgainBrokenServerAlert() {
79         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(SHOW_AGAIN_BROKEN_SERVER_ALERT);
80         return b == null ? true : b.booleanValue();
81     }
82     
83     public void setShowAgainBrokenServerAlert(boolean again) {
84         this.putProperty(SHOW_AGAIN_BROKEN_SERVER_ALERT, Boolean.valueOf(again), true);
85     }
86
87     public static FoldersListSettings getDefault () {
88         return (FoldersListSettings) SystemOption.findObject (FoldersListSettings.class, true);
89     }
90     
91     public boolean isAgreedSetJdk14() {
92         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(AGREED_SET_JDK_14);
93         return b == null ? true : b.booleanValue();
94     }
95     
96     public void setAgreedSetJdk14(boolean agreed) {
97         this.putProperty(AGREED_SET_JDK_14, Boolean.valueOf(agreed), true);
98     }
99     
100     public boolean isAgreedSetSourceLevel14() {
101         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(AGREED_SET_SOURCE_LEVEL_14);
102         return b == null ? true : b.booleanValue();
103     }
104     
105     public void setAgreedSetSourceLevel14(boolean agreed) {
106         this.putProperty(AGREED_SET_SOURCE_LEVEL_14, Boolean.valueOf(agreed), true);
107     }
108
109     public boolean isAgreedSetJdk15() {
110         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(AGREED_SET_JDK_15);
111         return b == null ? true : b.booleanValue();
112     }
113     
114     public void setAgreedSetJdk15(boolean agreed) {
115         this.putProperty(AGREED_SET_JDK_15, Boolean.valueOf(agreed), true);
116     }
117     
118     public boolean isAgreedSetSourceLevel15() {
119         Boolean JavaDoc b = (Boolean JavaDoc)getProperty(AGREED_SET_SOURCE_LEVEL_15);
120         return b == null ? true : b.booleanValue();
121     }
122     
123     public void setAgreedSetSourceLevel15(boolean agreed) {
124         this.putProperty(AGREED_SET_SOURCE_LEVEL_15, Boolean.valueOf(agreed), true);
125     }
126
127     public void setLastUsedServer(String JavaDoc serverInstanceID) {
128         putProperty(LAST_USED_SERVER, serverInstanceID, true);
129     }
130
131     public String JavaDoc getLastUsedServer() {
132         return (String JavaDoc) getProperty(LAST_USED_SERVER);
133     }
134 }
135
Popular Tags