1 19 20 package org.netbeans.modules.j2ee.ejbcore.naming; 21 22 import java.util.prefs.Preferences ; 23 import org.netbeans.spi.options.AdvancedOption; 24 import org.netbeans.spi.options.OptionsPanelController; 25 import org.openide.util.NbBundle; 26 import org.openide.util.NbPreferences; 27 28 34 public final class EJBNameOptions extends AdvancedOption { 35 36 private static final String SESSION_EJBCLASS_PREFIX = "sessionEjbClassPrefix"; private static final String SESSION_EJBCLASS_SUFFIX = "sessionEjbClassSuffix"; private static final String SESSION_LOCAL_PREFIX = "sessionLocalPrefix"; private static final String SESSION_LOCAL_SUFFIX = "sessionLocalSuffix"; private static final String SESSION_REMOTE_PREFIX = "sessionRemotePrefix"; private static final String SESSION_REMOTE_SUFFIX = "sessionRemoteSuffix"; private static final String SESSION_LOCALHOME_PREFIX = "sessionLocalHomePrefix"; private static final String SESSION_LOCALHOME_SUFFIX = "sessionLocalHomeSuffix"; private static final String SESSION_REMOTEHOME_PREFIX = "sessionRemoteHomePrefix"; private static final String SESSION_REMOTEHOME_SUFFIX = "sessionRemoteHomeSuffix"; private static final String SESSION_EJBNAME_PREFIX = "sessionEjbNamePrefix"; private static final String SESSION_EJBNAME_SUFFIX = "sessionEjbNameSuffix"; private static final String SESSION_DISPLAYNAME_PREFIX = "sessionDisplayNamePrefix"; private static final String SESSION_DISPLAYNAME_SUFFIX = "sessionDisplayNameSuffix"; 51 private static final String ENTITY_EJBCLASS_PREFIX = "entityEjbClassPrefix"; private static final String ENTITY_EJBCLASS_SUFFIX = "entityEjbClassSuffix"; private static final String ENTITY_LOCAL_PREFIX = "entityLocalPrefix"; private static final String ENTITY_LOCAL_SUFFIX = "entityLocalSuffix"; private static final String ENTITY_REMOTE_PREFIX = "entityRemotePrefix"; private static final String ENTITY_REMOTE_SUFFIX = "entityRemoteSuffix"; private static final String ENTITY_LOCALHOME_PREFIX = "entityLocalHomePrefix"; private static final String ENTITY_LOCALHOME_SUFFIX = "entityLocalHomeSuffix"; private static final String ENTITY_REMOTEHOME_PREFIX = "entityRemoteHomePrefix"; private static final String ENTITY_REMOTEHOME_SUFFIX = "entityRemoteHomeSuffix"; private static final String ENTITY_EJBNAME_PREFIX = "entityEjbNamePrefix"; private static final String ENTITY_EJBNAME_SUFFIX = "entityEjbNameSuffix"; private static final String ENTITY_DISPLAYNAME_PREFIX = "entityDisplayNamePrefix"; private static final String ENTITY_DISPLAYNAME_SUFFIX = "entityDisplayNameSuffix"; 66 private static final String MESSAGEDRIVEN_EJBCLASS_PREFIX = "messageDrivenEjbClassPrefix"; private static final String MESSAGEDRIVEN_EJBCLASS_SUFFIX = "messageDrivenEjbClassSuffix"; private static final String MESSAGEDRIVEN_EJBNAME_PREFIX = "messageDrivenEjbNamePrefix"; private static final String MESSAGEDRIVEN_EJBNAME_SUFFIX = "messageDrivenEjbNameSuffix"; private static final String MESSAGEDRIVEN_DISPLAYNAME_PREFIX = "messageDrivenDisplayNamePrefix"; private static final String MESSAGEDRIVEN_DISPLAYNAME_SUFFIX = "messageDrivenDisplayNameSuffix"; 73 @Override 74 public String getDisplayName() { 75 return NbBundle.getMessage(EJBNameOptions.class, "AdvancedOption_DisplayName"); 76 } 77 78 @Override 79 public String getTooltip() { 80 return NbBundle.getMessage(EJBNameOptions.class, "AdvancedOption_Tooltip"); 81 } 82 83 @Override 84 public OptionsPanelController create() { 85 return new EJBNameOptionsPanelController(); 86 } 87 88 90 public String getSessionEjbClassPrefix() { return prefs().get(SESSION_EJBCLASS_PREFIX, ""); } public void setSessionEjbClassPrefix(String prefix) { prefs().put(SESSION_EJBCLASS_PREFIX, prefix); } 92 93 public String getSessionEjbClassSuffix() { return prefs().get(SESSION_EJBCLASS_SUFFIX, "Bean"); } public void setSessionEjbclassSuffix(String suffix) { prefs().put(SESSION_EJBCLASS_SUFFIX, suffix); } 95 96 public String getSessionLocalPrefix() { return prefs().get(SESSION_LOCAL_PREFIX, ""); } public void setSessionLocalPrefix(String prefix) { prefs().put(SESSION_LOCAL_PREFIX, prefix); } 98 99 public String getSessionLocalSuffix() { return prefs().get(SESSION_LOCAL_SUFFIX, "Local"); } public void setSessionLocalSuffix(String suffix) { prefs().put(SESSION_LOCAL_SUFFIX, suffix); } 101 102 public String getSessionRemotePrefix() { return prefs().get(SESSION_REMOTE_PREFIX, ""); } public void setSessionRemotePrefix(String prefix) { prefs().put(SESSION_REMOTE_PREFIX, prefix); } 104 105 public String getSessionRemoteSuffix() { return prefs().get(SESSION_REMOTE_SUFFIX, "Remote"); } public void setSessionRemoteSuffix(String suffix) { prefs().put(SESSION_REMOTE_SUFFIX, suffix); } 107 108 public String getSessionLocalHomePrefix() { return prefs().get(SESSION_LOCALHOME_PREFIX, ""); } public void setSessionLocalHomePrefix(String prefix) { prefs().put(SESSION_LOCALHOME_PREFIX, prefix); } 110 111 public String getSessionLocalHomeSuffix() { return prefs().get(SESSION_LOCALHOME_SUFFIX, "LocalHome"); } public void setSessionLocalHomeSuffix(String suffix) { prefs().put(SESSION_LOCALHOME_SUFFIX, suffix); } 113 114 public String getSessionRemoteHomePrefix() { return prefs().get(SESSION_REMOTEHOME_PREFIX, ""); } public void setSessionRemoteHomePrefix(String prefix) { prefs().put(SESSION_REMOTEHOME_PREFIX, prefix); } 116 117 public String getSessionRemoteHomeSuffix() { return prefs().get(SESSION_REMOTEHOME_SUFFIX, "RemoteHome"); } public void setSessionRemoteHomeSuffix(String suffix) { prefs().put(SESSION_REMOTEHOME_SUFFIX, suffix); } 119 120 public String getSessionEjbNamePrefix() { return prefs().get(SESSION_EJBNAME_PREFIX, ""); } public void setSessionEjbNamePrefix(String prefix) { prefs().put(SESSION_EJBNAME_PREFIX, prefix); } 122 123 public String getSessionEjbNameSuffix() { return prefs().get(SESSION_EJBNAME_SUFFIX, "Bean"); } public void setSessionEjbNameSuffix(String suffix) { prefs().put(SESSION_EJBNAME_SUFFIX, suffix); } 125 126 public String getSessionDisplayNamePrefix() { return prefs().get(SESSION_DISPLAYNAME_PREFIX, ""); } public void setSessionDisplayNamePrefix(String prefix) { prefs().put(SESSION_DISPLAYNAME_PREFIX, prefix); } 128 129 public String getSessionDisplayNameSuffix() { return prefs().get(SESSION_DISPLAYNAME_SUFFIX, "SB"); } public void setSessionDisplayNameSuffix(String suffix) { prefs().put(SESSION_DISPLAYNAME_SUFFIX, suffix); } 131 132 134 public String getEntityEjbClassPrefix() { return prefs().get(ENTITY_EJBCLASS_PREFIX, ""); } public void setEntityEjbClassPrefix(String prefix) { prefs().put(ENTITY_EJBCLASS_PREFIX, prefix); } 136 137 public String getEntityEjbClassSuffix() { return prefs().get(ENTITY_EJBCLASS_SUFFIX, "Bean"); } public void setEntityEjbClassSuffix(String suffix) { prefs().put(ENTITY_EJBCLASS_SUFFIX, suffix); } 139 140 public String getEntityLocalPrefix() { return prefs().get(ENTITY_LOCAL_PREFIX, ""); } public void setEntityLocalPrefix(String prefix) { prefs().put(ENTITY_LOCAL_PREFIX, prefix); } 142 143 public String getEntityLocalSuffix() { return prefs().get(ENTITY_LOCAL_SUFFIX, "Local"); } public void setEntityLocalSuffix(String suffix) { prefs().put(ENTITY_LOCAL_SUFFIX, suffix); } 145 146 public String getEntityRemotePrefix() { return prefs().get(ENTITY_REMOTE_PREFIX, ""); } public void setEntityRemotePrefix(String prefix) { prefs().put(ENTITY_REMOTE_PREFIX, prefix); } 148 149 public String getEntityRemoteSuffix() { return prefs().get(ENTITY_REMOTE_SUFFIX, "Remote"); } public void setEntityRemoteSuffix(String suffix) { prefs().put(ENTITY_REMOTE_SUFFIX, suffix); } 151 152 public String getEntityLocalHomePrefix() { return prefs().get(ENTITY_LOCALHOME_PREFIX, ""); } public void setEntityLocalHomePrefix(String prefix) { prefs().put(ENTITY_LOCALHOME_PREFIX, prefix); } 154 155 public String getEntityLocalHomeSuffix() { return prefs().get(ENTITY_LOCALHOME_SUFFIX, "LocalHome"); } public void setEntityLocalHomeSuffix(String suffix) { prefs().put(ENTITY_LOCALHOME_SUFFIX, suffix); } 157 158 public String getEntityRemoteHomePrefix() { return prefs().get(ENTITY_REMOTEHOME_PREFIX, ""); } public void setEntityRemoteHomePrefix(String prefix) { prefs().put(ENTITY_REMOTEHOME_PREFIX, prefix); } 160 161 public String getEntityRemoteHomeSuffix() { return prefs().get(ENTITY_REMOTEHOME_SUFFIX, "RemoteHome"); } public void setEntityHomeRemoteSuffix(String suffix) { prefs().put(ENTITY_REMOTEHOME_SUFFIX, suffix); } 163 164 public String getEntityEjbNamePrefix() { return prefs().get(ENTITY_EJBNAME_PREFIX, ""); } public void setEntityEjbNamePrefix(String prefix) { prefs().put(ENTITY_EJBNAME_PREFIX, prefix); } 166 167 public String getEntityEjbNameSuffix() { return prefs().get(ENTITY_EJBNAME_SUFFIX, "Bean"); } public void setEntityEjbNameSuffix(String suffix) { prefs().put(ENTITY_EJBNAME_SUFFIX, suffix); } 169 170 public String getEntityDisplayNamePrefix() { return prefs().get(ENTITY_DISPLAYNAME_PREFIX, ""); } public void setEntityDisplayNamePrefix(String prefix) { prefs().put(ENTITY_DISPLAYNAME_PREFIX, prefix); } 172 173 public String getEntityDisplayNameSuffix() { return prefs().get(ENTITY_DISPLAYNAME_SUFFIX, "EB"); } public void setEntityDisplayNameSuffix(String suffix) { prefs().put(ENTITY_DISPLAYNAME_SUFFIX, suffix); } 175 176 178 public String getMessageDrivenEjbClassPrefix() { return prefs().get(MESSAGEDRIVEN_EJBCLASS_PREFIX, ""); } public void setMessageDrivenEjbClassPrefix(String prefix) { prefs().put(MESSAGEDRIVEN_EJBCLASS_PREFIX, prefix); } 180 181 public String getMessageDrivenEjbClassSuffix() { return prefs().get(MESSAGEDRIVEN_EJBCLASS_SUFFIX, "Bean"); } public void setMessageDrivenEjbClassSuffix(String suffix) { prefs().put(MESSAGEDRIVEN_EJBCLASS_SUFFIX, suffix); } 183 184 public String getMessageDrivenEjbNamePrefix() { return prefs().get(MESSAGEDRIVEN_EJBNAME_PREFIX, ""); } public void setMessageDrivenEjbNamePrefix(String prefix) { prefs().put(MESSAGEDRIVEN_EJBNAME_PREFIX, prefix); } 186 187 public String getMessageDrivenEjbNameSuffix() { return prefs().get(MESSAGEDRIVEN_EJBNAME_SUFFIX, "Bean"); } public void setMessageDrivenEjbNameSuffix(String suffix) { prefs().put(MESSAGEDRIVEN_EJBNAME_SUFFIX, suffix); } 189 190 public String getMessageDrivenDisplayNamePrefix() { return prefs().get(MESSAGEDRIVEN_DISPLAYNAME_PREFIX, ""); } public void setMessageDrivenDisplayNamePrefix(String prefix) { prefs().put(MESSAGEDRIVEN_DISPLAYNAME_PREFIX, prefix); } 192 193 public String getMessageDrivenDisplayNameSuffix() { return prefs().get(MESSAGEDRIVEN_DISPLAYNAME_SUFFIX, "MDB"); } public void setMessageDrivenDisplayNameSuffix(String suffix) { prefs().put(MESSAGEDRIVEN_DISPLAYNAME_SUFFIX, suffix); } 195 196 198 private Preferences prefs() { 199 return NbPreferences.forModule(EJBNameOptions.class); 200 } 201 202 } 203 | Popular Tags |