1 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 LAST_EXTERNAL_SOURCE_ROOT = "srcRoot"; 30 private static final String NEW_PROJECT_COUNT = "newProjectCount"; 32 private static final String SHOW_AGAIN_BROKEN_REF_ALERT = "showAgainBrokenRefAlert"; 34 private static final String SHOW_AGAIN_BROKEN_SERVER_ALERT = "showAgainBrokenServerAlert"; 36 private static final String AGREED_SET_JDK_14 = "agreeSetJdk14"; 38 private static final String AGREED_SET_SOURCE_LEVEL_14 = "agreeSetSourceLevel14"; 40 private static final String AGREED_SET_JDK_15 = "agreeSetJdk15"; 42 private static final String AGREED_SET_SOURCE_LEVEL_15 = "agreeSetSourceLevel15"; 44 45 private static final String LAST_USED_SERVER = "lastUsedServer"; 47 public String displayName() { 48 return NbBundle.getMessage (FoldersListSettings.class, "TXT_EarProjectFolderList"); } 50 51 public String getLastExternalSourceRoot () { 52 return (String ) getProperty(LAST_EXTERNAL_SOURCE_ROOT); 53 } 54 55 public void setLastExternalSourceRoot (String path) { 56 putProperty (LAST_EXTERNAL_SOURCE_ROOT, path, true); 57 } 58 59 public int getNewProjectCount () { 60 Integer value = (Integer ) 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 b = (Boolean )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 b = (Boolean )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 b = (Boolean )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 b = (Boolean )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 b = (Boolean )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 b = (Boolean )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 serverInstanceID) { 128 putProperty(LAST_USED_SERVER, serverInstanceID, true); 129 } 130 131 public String getLastUsedServer() { 132 return (String ) getProperty(LAST_USED_SERVER); 133 } 134 } 135 | Popular Tags |