KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > ejbcore > naming > EJBNameOptions


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
20 package org.netbeans.modules.j2ee.ejbcore.naming;
21
22 import java.util.prefs.Preferences JavaDoc;
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 /**
29  * EJB naming preferences.
30  * {@link http://java.sun.com/blueprints/code/namingconventions.html}
31  *
32  * @author Martin Adamek
33  */

34 public final class EJBNameOptions extends AdvancedOption {
35     
36     private static final String JavaDoc SESSION_EJBCLASS_PREFIX = "sessionEjbClassPrefix"; // NOI18N
37
private static final String JavaDoc SESSION_EJBCLASS_SUFFIX = "sessionEjbClassSuffix"; // NOI18N
38
private static final String JavaDoc SESSION_LOCAL_PREFIX = "sessionLocalPrefix"; // NOI18N
39
private static final String JavaDoc SESSION_LOCAL_SUFFIX = "sessionLocalSuffix"; // NOI18N
40
private static final String JavaDoc SESSION_REMOTE_PREFIX = "sessionRemotePrefix"; // NOI18N
41
private static final String JavaDoc SESSION_REMOTE_SUFFIX = "sessionRemoteSuffix"; // NOI18N
42
private static final String JavaDoc SESSION_LOCALHOME_PREFIX = "sessionLocalHomePrefix"; // NOI18N
43
private static final String JavaDoc SESSION_LOCALHOME_SUFFIX = "sessionLocalHomeSuffix"; // NOI18N
44
private static final String JavaDoc SESSION_REMOTEHOME_PREFIX = "sessionRemoteHomePrefix"; // NOI18N
45
private static final String JavaDoc SESSION_REMOTEHOME_SUFFIX = "sessionRemoteHomeSuffix"; // NOI18N
46
private static final String JavaDoc SESSION_EJBNAME_PREFIX = "sessionEjbNamePrefix"; // NOI18N
47
private static final String JavaDoc SESSION_EJBNAME_SUFFIX = "sessionEjbNameSuffix"; // NOI18N
48
private static final String JavaDoc SESSION_DISPLAYNAME_PREFIX = "sessionDisplayNamePrefix"; // NOI18N
49
private static final String JavaDoc SESSION_DISPLAYNAME_SUFFIX = "sessionDisplayNameSuffix"; // NOI18N
50

51     private static final String JavaDoc ENTITY_EJBCLASS_PREFIX = "entityEjbClassPrefix"; // NOI18N
52
private static final String JavaDoc ENTITY_EJBCLASS_SUFFIX = "entityEjbClassSuffix"; // NOI18N
53
private static final String JavaDoc ENTITY_LOCAL_PREFIX = "entityLocalPrefix"; // NOI18N
54
private static final String JavaDoc ENTITY_LOCAL_SUFFIX = "entityLocalSuffix"; // NOI18N
55
private static final String JavaDoc ENTITY_REMOTE_PREFIX = "entityRemotePrefix"; // NOI18N
56
private static final String JavaDoc ENTITY_REMOTE_SUFFIX = "entityRemoteSuffix"; // NOI18N
57
private static final String JavaDoc ENTITY_LOCALHOME_PREFIX = "entityLocalHomePrefix"; // NOI18N
58
private static final String JavaDoc ENTITY_LOCALHOME_SUFFIX = "entityLocalHomeSuffix"; // NOI18N
59
private static final String JavaDoc ENTITY_REMOTEHOME_PREFIX = "entityRemoteHomePrefix"; // NOI18N
60
private static final String JavaDoc ENTITY_REMOTEHOME_SUFFIX = "entityRemoteHomeSuffix"; // NOI18N
61
private static final String JavaDoc ENTITY_EJBNAME_PREFIX = "entityEjbNamePrefix"; // NOI18N
62
private static final String JavaDoc ENTITY_EJBNAME_SUFFIX = "entityEjbNameSuffix"; // NOI18N
63
private static final String JavaDoc ENTITY_DISPLAYNAME_PREFIX = "entityDisplayNamePrefix"; // NOI18N
64
private static final String JavaDoc ENTITY_DISPLAYNAME_SUFFIX = "entityDisplayNameSuffix"; // NOI18N
65

66     private static final String JavaDoc MESSAGEDRIVEN_EJBCLASS_PREFIX = "messageDrivenEjbClassPrefix"; // NOI18N
67
private static final String JavaDoc MESSAGEDRIVEN_EJBCLASS_SUFFIX = "messageDrivenEjbClassSuffix"; // NOI18N
68
private static final String JavaDoc MESSAGEDRIVEN_EJBNAME_PREFIX = "messageDrivenEjbNamePrefix"; // NOI18N
69
private static final String JavaDoc MESSAGEDRIVEN_EJBNAME_SUFFIX = "messageDrivenEjbNameSuffix"; // NOI18N
70
private static final String JavaDoc MESSAGEDRIVEN_DISPLAYNAME_PREFIX = "messageDrivenDisplayNamePrefix"; // NOI18N
71
private static final String JavaDoc MESSAGEDRIVEN_DISPLAYNAME_SUFFIX = "messageDrivenDisplayNameSuffix"; // NOI18N
72

73     @Override JavaDoc
74     public String JavaDoc getDisplayName() {
75         return NbBundle.getMessage(EJBNameOptions.class, "AdvancedOption_DisplayName");
76     }
77     
78     @Override JavaDoc
79     public String JavaDoc getTooltip() {
80         return NbBundle.getMessage(EJBNameOptions.class, "AdvancedOption_Tooltip");
81     }
82
83     @Override JavaDoc
84     public OptionsPanelController create() {
85         return new EJBNameOptionsPanelController();
86     }
87     
88     // Session
89

90     public String JavaDoc getSessionEjbClassPrefix() { return prefs().get(SESSION_EJBCLASS_PREFIX, ""); } // NOI18N
91
public void setSessionEjbClassPrefix(String JavaDoc prefix) { prefs().put(SESSION_EJBCLASS_PREFIX, prefix); }
92     
93     public String JavaDoc getSessionEjbClassSuffix() { return prefs().get(SESSION_EJBCLASS_SUFFIX, "Bean"); } // NOI18N
94
public void setSessionEjbclassSuffix(String JavaDoc suffix) { prefs().put(SESSION_EJBCLASS_SUFFIX, suffix); }
95     
96     public String JavaDoc getSessionLocalPrefix() { return prefs().get(SESSION_LOCAL_PREFIX, ""); } // NOI18N
97
public void setSessionLocalPrefix(String JavaDoc prefix) { prefs().put(SESSION_LOCAL_PREFIX, prefix); }
98     
99     public String JavaDoc getSessionLocalSuffix() { return prefs().get(SESSION_LOCAL_SUFFIX, "Local"); } // NOI18N
100
public void setSessionLocalSuffix(String JavaDoc suffix) { prefs().put(SESSION_LOCAL_SUFFIX, suffix); }
101     
102     public String JavaDoc getSessionRemotePrefix() { return prefs().get(SESSION_REMOTE_PREFIX, ""); } // NOI18N
103
public void setSessionRemotePrefix(String JavaDoc prefix) { prefs().put(SESSION_REMOTE_PREFIX, prefix); }
104     
105     public String JavaDoc getSessionRemoteSuffix() { return prefs().get(SESSION_REMOTE_SUFFIX, "Remote"); } // NOI18N
106
public void setSessionRemoteSuffix(String JavaDoc suffix) { prefs().put(SESSION_REMOTE_SUFFIX, suffix); }
107     
108     public String JavaDoc getSessionLocalHomePrefix() { return prefs().get(SESSION_LOCALHOME_PREFIX, ""); } // NOI18N
109
public void setSessionLocalHomePrefix(String JavaDoc prefix) { prefs().put(SESSION_LOCALHOME_PREFIX, prefix); }
110     
111     public String JavaDoc getSessionLocalHomeSuffix() { return prefs().get(SESSION_LOCALHOME_SUFFIX, "LocalHome"); } // NOI18N
112
public void setSessionLocalHomeSuffix(String JavaDoc suffix) { prefs().put(SESSION_LOCALHOME_SUFFIX, suffix); }
113     
114     public String JavaDoc getSessionRemoteHomePrefix() { return prefs().get(SESSION_REMOTEHOME_PREFIX, ""); } // NOI18N
115
public void setSessionRemoteHomePrefix(String JavaDoc prefix) { prefs().put(SESSION_REMOTEHOME_PREFIX, prefix); }
116     
117     public String JavaDoc getSessionRemoteHomeSuffix() { return prefs().get(SESSION_REMOTEHOME_SUFFIX, "RemoteHome"); } // NOI18N
118
public void setSessionRemoteHomeSuffix(String JavaDoc suffix) { prefs().put(SESSION_REMOTEHOME_SUFFIX, suffix); }
119     
120     public String JavaDoc getSessionEjbNamePrefix() { return prefs().get(SESSION_EJBNAME_PREFIX, ""); } // NOI18N
121
public void setSessionEjbNamePrefix(String JavaDoc prefix) { prefs().put(SESSION_EJBNAME_PREFIX, prefix); }
122     
123     public String JavaDoc getSessionEjbNameSuffix() { return prefs().get(SESSION_EJBNAME_SUFFIX, "Bean"); } // NOI18N
124
public void setSessionEjbNameSuffix(String JavaDoc suffix) { prefs().put(SESSION_EJBNAME_SUFFIX, suffix); }
125     
126     public String JavaDoc getSessionDisplayNamePrefix() { return prefs().get(SESSION_DISPLAYNAME_PREFIX, ""); } // NOI18N
127
public void setSessionDisplayNamePrefix(String JavaDoc prefix) { prefs().put(SESSION_DISPLAYNAME_PREFIX, prefix); }
128     
129     public String JavaDoc getSessionDisplayNameSuffix() { return prefs().get(SESSION_DISPLAYNAME_SUFFIX, "SB"); } // NOI18N
130
public void setSessionDisplayNameSuffix(String JavaDoc suffix) { prefs().put(SESSION_DISPLAYNAME_SUFFIX, suffix); }
131     
132     // Entity
133

134     public String JavaDoc getEntityEjbClassPrefix() { return prefs().get(ENTITY_EJBCLASS_PREFIX, ""); } // NOI18N
135
public void setEntityEjbClassPrefix(String JavaDoc prefix) { prefs().put(ENTITY_EJBCLASS_PREFIX, prefix); }
136     
137     public String JavaDoc getEntityEjbClassSuffix() { return prefs().get(ENTITY_EJBCLASS_SUFFIX, "Bean"); } // NOI18N
138
public void setEntityEjbClassSuffix(String JavaDoc suffix) { prefs().put(ENTITY_EJBCLASS_SUFFIX, suffix); }
139     
140     public String JavaDoc getEntityLocalPrefix() { return prefs().get(ENTITY_LOCAL_PREFIX, ""); } // NOI18N
141
public void setEntityLocalPrefix(String JavaDoc prefix) { prefs().put(ENTITY_LOCAL_PREFIX, prefix); }
142     
143     public String JavaDoc getEntityLocalSuffix() { return prefs().get(ENTITY_LOCAL_SUFFIX, "Local"); } // NOI18N
144
public void setEntityLocalSuffix(String JavaDoc suffix) { prefs().put(ENTITY_LOCAL_SUFFIX, suffix); }
145     
146     public String JavaDoc getEntityRemotePrefix() { return prefs().get(ENTITY_REMOTE_PREFIX, ""); } // NOI18N
147
public void setEntityRemotePrefix(String JavaDoc prefix) { prefs().put(ENTITY_REMOTE_PREFIX, prefix); }
148     
149     public String JavaDoc getEntityRemoteSuffix() { return prefs().get(ENTITY_REMOTE_SUFFIX, "Remote"); } // NOI18N
150
public void setEntityRemoteSuffix(String JavaDoc suffix) { prefs().put(ENTITY_REMOTE_SUFFIX, suffix); }
151     
152     public String JavaDoc getEntityLocalHomePrefix() { return prefs().get(ENTITY_LOCALHOME_PREFIX, ""); } // NOI18N
153
public void setEntityLocalHomePrefix(String JavaDoc prefix) { prefs().put(ENTITY_LOCALHOME_PREFIX, prefix); }
154     
155     public String JavaDoc getEntityLocalHomeSuffix() { return prefs().get(ENTITY_LOCALHOME_SUFFIX, "LocalHome"); } // NOI18N
156
public void setEntityLocalHomeSuffix(String JavaDoc suffix) { prefs().put(ENTITY_LOCALHOME_SUFFIX, suffix); }
157     
158     public String JavaDoc getEntityRemoteHomePrefix() { return prefs().get(ENTITY_REMOTEHOME_PREFIX, ""); } // NOI18N
159
public void setEntityRemoteHomePrefix(String JavaDoc prefix) { prefs().put(ENTITY_REMOTEHOME_PREFIX, prefix); }
160     
161     public String JavaDoc getEntityRemoteHomeSuffix() { return prefs().get(ENTITY_REMOTEHOME_SUFFIX, "RemoteHome"); } // NOI18N
162
public void setEntityHomeRemoteSuffix(String JavaDoc suffix) { prefs().put(ENTITY_REMOTEHOME_SUFFIX, suffix); }
163     
164     public String JavaDoc getEntityEjbNamePrefix() { return prefs().get(ENTITY_EJBNAME_PREFIX, ""); } // NOI18N
165
public void setEntityEjbNamePrefix(String JavaDoc prefix) { prefs().put(ENTITY_EJBNAME_PREFIX, prefix); }
166     
167     public String JavaDoc getEntityEjbNameSuffix() { return prefs().get(ENTITY_EJBNAME_SUFFIX, "Bean"); } // NOI18N
168
public void setEntityEjbNameSuffix(String JavaDoc suffix) { prefs().put(ENTITY_EJBNAME_SUFFIX, suffix); }
169     
170     public String JavaDoc getEntityDisplayNamePrefix() { return prefs().get(ENTITY_DISPLAYNAME_PREFIX, ""); } // NOI18N
171
public void setEntityDisplayNamePrefix(String JavaDoc prefix) { prefs().put(ENTITY_DISPLAYNAME_PREFIX, prefix); }
172     
173     public String JavaDoc getEntityDisplayNameSuffix() { return prefs().get(ENTITY_DISPLAYNAME_SUFFIX, "EB"); } // NOI18N
174
public void setEntityDisplayNameSuffix(String JavaDoc suffix) { prefs().put(ENTITY_DISPLAYNAME_SUFFIX, suffix); }
175     
176     // MessageDriven
177

178     public String JavaDoc getMessageDrivenEjbClassPrefix() { return prefs().get(MESSAGEDRIVEN_EJBCLASS_PREFIX, ""); } // NOI18N
179
public void setMessageDrivenEjbClassPrefix(String JavaDoc prefix) { prefs().put(MESSAGEDRIVEN_EJBCLASS_PREFIX, prefix); }
180     
181     public String JavaDoc getMessageDrivenEjbClassSuffix() { return prefs().get(MESSAGEDRIVEN_EJBCLASS_SUFFIX, "Bean"); } // NOI18N
182
public void setMessageDrivenEjbClassSuffix(String JavaDoc suffix) { prefs().put(MESSAGEDRIVEN_EJBCLASS_SUFFIX, suffix); }
183     
184     public String JavaDoc getMessageDrivenEjbNamePrefix() { return prefs().get(MESSAGEDRIVEN_EJBNAME_PREFIX, ""); } // NOI18N
185
public void setMessageDrivenEjbNamePrefix(String JavaDoc prefix) { prefs().put(MESSAGEDRIVEN_EJBNAME_PREFIX, prefix); }
186     
187     public String JavaDoc getMessageDrivenEjbNameSuffix() { return prefs().get(MESSAGEDRIVEN_EJBNAME_SUFFIX, "Bean"); } // NOI18N
188
public void setMessageDrivenEjbNameSuffix(String JavaDoc suffix) { prefs().put(MESSAGEDRIVEN_EJBNAME_SUFFIX, suffix); }
189
190     public String JavaDoc getMessageDrivenDisplayNamePrefix() { return prefs().get(MESSAGEDRIVEN_DISPLAYNAME_PREFIX, ""); } // NOI18N
191
public void setMessageDrivenDisplayNamePrefix(String JavaDoc prefix) { prefs().put(MESSAGEDRIVEN_DISPLAYNAME_PREFIX, prefix); }
192     
193     public String JavaDoc getMessageDrivenDisplayNameSuffix() { return prefs().get(MESSAGEDRIVEN_DISPLAYNAME_SUFFIX, "MDB"); } // NOI18N
194
public void setMessageDrivenDisplayNameSuffix(String JavaDoc suffix) { prefs().put(MESSAGEDRIVEN_DISPLAYNAME_SUFFIX, suffix); }
195     
196     // helpers
197

198     private Preferences JavaDoc prefs() {
199         return NbPreferences.forModule(EJBNameOptions.class);
200     }
201     
202 }
203
Popular Tags