Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 159894 Details for
Bug 241667
Optional local business interfaces for EJB 3.1 beans
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
No-interface checkbox
241667_patch.txt (text/plain), 34.59 KB, created by
Kaloyan Raev
on 2010-02-23 04:12:41 EST
(
hide
)
Description:
No-interface checkbox
Filename:
MIME Type:
Creator:
Kaloyan Raev
Created:
2010-02-23 04:12:41 EST
Size:
34.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.ejb.ui >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java,v >retrieving revision 1.13 >diff -u -r1.13 NewSessionBeanClassWizardPage.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java 9 Feb 2010 16:58:49 -0000 1.13 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java 23 Feb 2010 09:10:23 -0000 >@@ -12,6 +12,7 @@ > > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_BUSINESS_INTERFACE; >+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.NO_INTERFACE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_BUSINESS_INTERFACE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.STATE_TYPE; >@@ -38,6 +39,7 @@ > private Combo stateTypeCombo; > private Button remoteCheckbox; > private Button localCheckbox; >+ private Button noInterfaceCheckbox; > private Text remoteInterfaceName; > private Text localInterfaceName; > >@@ -79,12 +81,9 @@ > remoteCheckbox = new Button(group, SWT.CHECK); > remoteCheckbox.setLayoutData(gdhspan(1)); > remoteCheckbox.setText(IEjbWizardConstants.REMOTE_BUSINESS_INTERFACE); >- GridData data2 = new GridData(GridData.FILL_HORIZONTAL); >- data2.horizontalSpan = 1; >- remoteInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER); > synchHelper.synchCheckbox(remoteCheckbox, REMOTE, null); >- >- remoteInterfaceName.setLayoutData(data2); >+ remoteInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER); >+ remoteInterfaceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > synchHelper.synchText(remoteInterfaceName, REMOTE_BUSINESS_INTERFACE, null); > > localCheckbox = new Button(group, SWT.CHECK); >@@ -92,8 +91,13 @@ > localCheckbox.setText(IEjbWizardConstants.LOCAL_BUSINESS_INTERFACE); > synchHelper.synchCheckbox(localCheckbox, LOCAL, null); > localInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER); >- localInterfaceName.setLayoutData(data2); >+ localInterfaceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > synchHelper.synchText(localInterfaceName, LOCAL_BUSINESS_INTERFACE, null); >+ >+ noInterfaceCheckbox = new Button(group, SWT.CHECK); >+ noInterfaceCheckbox.setLayoutData(gdhspan(2)); >+ noInterfaceCheckbox.setText(IEjbWizardConstants.NO_INTERFACE); >+ synchHelper.synchCheckbox(noInterfaceCheckbox, NO_INTERFACE, null); > } > > private static GridData gdhspan(int span) { >@@ -111,6 +115,7 @@ > names.add(INTERFACES); > names.add(LOCAL_BUSINESS_INTERFACE); > names.add(REMOTE_BUSINESS_INTERFACE); >+ names.add(NO_INTERFACE); > > return names.toArray(new String[0]); > } >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java,v >retrieving revision 1.6 >diff -u -r1.6 IEjbWizardConstants.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java 22 May 2008 15:06:49 -0000 1.6 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java 23 Feb 2010 09:10:23 -0000 >@@ -27,6 +27,7 @@ > public static final String REMOTE_BUSINESS_INTERFACE_LABEL = EJBUIMessages.REMOTE_BUSINESS_INTERFACE_LABEL; > public static final String LOCAL_BUSINESS_INTERFACE = EJBUIMessages.LOCAL_BUSINESS_INTERFACE; > public static final String LOCAL_BUSINESS_INTERFACE_LABEL = EJBUIMessages.LOCAL_BUSINESS_INTERFACE_LABEL; >+ public static final String NO_INTERFACE = EJBUIMessages.NO_INTERFACE; > public static final String EJB_NAME = EJBUIMessages.EJB_NAME; > > public final static String TRANSACTION_TYPE_CONTAINER = EJBUIMessages.TRANSACTION_TYPE_CONTAINER; >Index: property_files/ejb_ui.properties >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/property_files/ejb_ui.properties,v >retrieving revision 1.23 >diff -u -r1.23 ejb_ui.properties >--- property_files/ejb_ui.properties 26 Jan 2010 17:30:58 -0000 1.23 >+++ property_files/ejb_ui.properties 23 Feb 2010 09:10:23 -0000 >@@ -58,6 +58,7 @@ > REMOTE_HOME_INTERFACE_LABEL=Remote Home Interface: > LOCAL_BUSINESS_INTERFACE=&Local > LOCAL_BUSINESS_INTERFACE_LABEL=Local Business Interface: >+NO_INTERFACE=No-&interface > LOCAL_HOME_INTERFACE_LABEL=Local Home Interface: > LOCAL_COMPONENT_INTERFACE_CODE=L > LOCAL_HOME_INTERFACE_CODE=LH >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java,v >retrieving revision 1.16 >diff -u -r1.16 EJBUIMessages.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java 25 Jan 2010 17:51:04 -0000 1.16 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java 23 Feb 2010 09:10:23 -0000 >@@ -73,6 +73,7 @@ > public static String LOCAL_BUSINESS_INTERFACE; > public static String LOCAL_BUSINESS_INTERFACE_LABEL; > public static String LOCAL_HOME_INTERFACE_LABEL; >+ public static String NO_INTERFACE; > public static String EJB_NAME; > public static String TRANSACTION_TYPE_CONTAINER; > public static String TRANSACTION_TYPE_BEAN; >#P org.eclipse.jst.j2ee.ejb >Index: ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java,v >retrieving revision 1.12 >diff -u -r1.12 CreateSessionBeanTemplateModel.java >--- ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java 9 Feb 2010 16:58:53 -0000 1.12 >+++ ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java 23 Feb 2010 09:10:27 -0000 >@@ -14,7 +14,7 @@ > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.MAPPED_NAME; > import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.INTERFACES; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME; >-import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_HOME; >+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.*; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.STATE_TYPE; > > import java.util.ArrayList; >@@ -32,6 +32,7 @@ > public static final String QUALIFIED_STATELESS = "javax.ejb.Stateless"; //$NON-NLS-1$ > public static final String QUALIFIED_STATEFUL = "javax.ejb.Stateful"; //$NON-NLS-1$ > public static final String QUALIFIED_SINGLETON = "javax.ejb.Singleton"; //$NON-NLS-1$ >+ public static final String QUALIFIED_LOCAL_BEAN = "javax.ejb.LocalBean"; //$NON-NLS-1$ > public static final String QUALIFIED_LOCAL = "javax.ejb.Local"; //$NON-NLS-1$ > public static final String QUALIFIED_REMOTE = "javax.ejb.Remote"; //$NON-NLS-1$ > public static final String QUALIFIED_REMOTE_HOME = "javax.ejb.RemoteHome"; //$NON-NLS-1$ >@@ -83,6 +84,10 @@ > collection.add(localHomeClassName); > } > >+ if (isNoInterfaceChecked()) { >+ collection.add(QUALIFIED_LOCAL_BEAN); >+ } >+ > List<BusinessInterface> interfaces = getBusinessInterfaces(); > for (BusinessInterface iface : interfaces) { > if (iface.isLocal() && iface.exists()) { >@@ -160,6 +165,10 @@ > public boolean isRemoteHomeChecked() { > return dataModel.getBooleanProperty(REMOTE_HOME); > } >+ >+ public boolean isNoInterfaceChecked() { >+ return dataModel.getBooleanProperty(NO_INTERFACE); >+ } > > public Map<String, String> getClassAnnotationParams() { > Map<String, String> result = new Hashtable<String, String>(); >Index: ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java,v >retrieving revision 1.9 >diff -u -r1.9 INewSessionBeanClassDataModelProperties.java >--- ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java 9 Feb 2010 17:25:48 -0000 1.9 >+++ ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java 23 Feb 2010 09:10:27 -0000 >@@ -29,12 +29,22 @@ > * business interface. The default is false. > */ > public static final String REMOTE = "INewSessionBeanClassDataModelProperties.REMOTE"; //$NON-NLS-1$ >- >+ > /** > * Optional, boolean property used to specify whether to generate a local >- * business interface. The default is true. >+ * business interface. The default is true for EJB 3.0 projects, otherwise - >+ * false. > */ > public static final String LOCAL = "INewSessionBeanClassDataModelProperties.LOCAL"; //$NON-NLS-1$ >+ >+ /** >+ * Optional, boolean property used to specify whether to generate a >+ * no-interface client view. The default is true for EJB 3.1 projects and >+ * later, otherwise - false. >+ * >+ * @since 3.2 >+ */ >+ public static final String NO_INTERFACE = "INewSessionBeanClassDataModelProperties.NO_INTERFACE"; //$NON-NLS-1$ > > /** > * Optional, boolean property used to specify whether to generate a EJB 2.x >Index: ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java,v >retrieving revision 1.4 >diff -u -r1.4 SessionBeanTemplate.java >--- ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java 10 Jun 2009 20:18:31 -0000 1.4 >+++ ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java 23 Feb 2010 09:10:28 -0000 >@@ -39,39 +39,40 @@ > protected final String TEXT_22 = ", "; //$NON-NLS-1$ > protected final String TEXT_23 = ".class"; //$NON-NLS-1$ > protected final String TEXT_24 = " })"; //$NON-NLS-1$ >- protected final String TEXT_25 = NL + "@LocalHome("; //$NON-NLS-1$ >- protected final String TEXT_26 = ".class)"; //$NON-NLS-1$ >- protected final String TEXT_27 = NL + "@RemoteHome("; //$NON-NLS-1$ >- protected final String TEXT_28 = ".class)"; //$NON-NLS-1$ >- protected final String TEXT_29 = NL + "public "; //$NON-NLS-1$ >- protected final String TEXT_30 = "abstract "; //$NON-NLS-1$ >- protected final String TEXT_31 = "final "; //$NON-NLS-1$ >- protected final String TEXT_32 = "class "; //$NON-NLS-1$ >- protected final String TEXT_33 = " extends "; //$NON-NLS-1$ >- protected final String TEXT_34 = " implements "; //$NON-NLS-1$ >- protected final String TEXT_35 = ", "; //$NON-NLS-1$ >- protected final String TEXT_36 = " {"; //$NON-NLS-1$ >- protected final String TEXT_37 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >- protected final String TEXT_38 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- protected final String TEXT_39 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- protected final String TEXT_40 = "#"; //$NON-NLS-1$ >- protected final String TEXT_41 = "("; //$NON-NLS-1$ >- protected final String TEXT_42 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- protected final String TEXT_43 = "("; //$NON-NLS-1$ >- protected final String TEXT_44 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$ >- protected final String TEXT_45 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- protected final String TEXT_46 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ >- protected final String TEXT_47 = "#"; //$NON-NLS-1$ >- protected final String TEXT_48 = "("; //$NON-NLS-1$ >- protected final String TEXT_49 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- protected final String TEXT_50 = " "; //$NON-NLS-1$ >- protected final String TEXT_51 = "("; //$NON-NLS-1$ >- protected final String TEXT_52 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$ >- protected final String TEXT_53 = NL + "\t\t\treturn "; //$NON-NLS-1$ >- protected final String TEXT_54 = ";"; //$NON-NLS-1$ >- protected final String TEXT_55 = NL + " }"; //$NON-NLS-1$ >- protected final String TEXT_56 = NL + NL + "}"; //$NON-NLS-1$ >- protected final String TEXT_57 = NL; >+ protected final String TEXT_25 = NL + "@LocalBean"; //$NON-NLS-1$ >+ protected final String TEXT_26 = NL + "@LocalHome("; //$NON-NLS-1$ >+ protected final String TEXT_27 = ".class)"; //$NON-NLS-1$ >+ protected final String TEXT_28 = NL + "@RemoteHome("; //$NON-NLS-1$ >+ protected final String TEXT_29 = ".class)"; //$NON-NLS-1$ >+ protected final String TEXT_30 = NL + "public "; //$NON-NLS-1$ >+ protected final String TEXT_31 = "abstract "; //$NON-NLS-1$ >+ protected final String TEXT_32 = "final "; //$NON-NLS-1$ >+ protected final String TEXT_33 = "class "; //$NON-NLS-1$ >+ protected final String TEXT_34 = " extends "; //$NON-NLS-1$ >+ protected final String TEXT_35 = " implements "; //$NON-NLS-1$ >+ protected final String TEXT_36 = ", "; //$NON-NLS-1$ >+ protected final String TEXT_37 = " {"; //$NON-NLS-1$ >+ protected final String TEXT_38 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >+ protected final String TEXT_39 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >+ protected final String TEXT_40 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ protected final String TEXT_41 = "#"; //$NON-NLS-1$ >+ protected final String TEXT_42 = "("; //$NON-NLS-1$ >+ protected final String TEXT_43 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ protected final String TEXT_44 = "("; //$NON-NLS-1$ >+ protected final String TEXT_45 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$ >+ protected final String TEXT_46 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >+ protected final String TEXT_47 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$//$NON-NLS-2$ >+ protected final String TEXT_48 = "#"; //$NON-NLS-1$ >+ protected final String TEXT_49 = "("; //$NON-NLS-1$ >+ protected final String TEXT_50 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ protected final String TEXT_51 = " "; //$NON-NLS-1$ >+ protected final String TEXT_52 = "("; //$NON-NLS-1$ >+ protected final String TEXT_53 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$ >+ protected final String TEXT_54 = NL + "\t\t\treturn "; //$NON-NLS-1$ >+ protected final String TEXT_55 = ";"; //$NON-NLS-1$ >+ protected final String TEXT_56 = NL + " }"; //$NON-NLS-1$ >+ protected final String TEXT_57 = NL + NL + "}"; //$NON-NLS-1$ >+ protected final String TEXT_58 = NL; > > public String generate(Object argument) > { >@@ -188,48 +189,54 @@ > > } > >- if (model.isLocalHomeChecked()) { >+ if (model.isNoInterfaceChecked()) { > > stringBuffer.append(TEXT_25); >- stringBuffer.append(model.getLocalHomeClassSimpleName()); >+ >+ } >+ >+ if (model.isLocalHomeChecked()) { >+ > stringBuffer.append(TEXT_26); >+ stringBuffer.append(model.getLocalHomeClassSimpleName()); >+ stringBuffer.append(TEXT_27); > > } > > if (model.isRemoteHomeChecked()) { > >- stringBuffer.append(TEXT_27); >- stringBuffer.append(model.getRemoteHomeClassSimpleName()); > stringBuffer.append(TEXT_28); >+ stringBuffer.append(model.getRemoteHomeClassSimpleName()); >+ stringBuffer.append(TEXT_29); > > } > > > if (model.isPublic()) { > >- stringBuffer.append(TEXT_29); >+ stringBuffer.append(TEXT_30); > > } > > if (model.isAbstract()) { > >- stringBuffer.append(TEXT_30); >+ stringBuffer.append(TEXT_31); > > } > > if (model.isFinal()) { > >- stringBuffer.append(TEXT_31); >+ stringBuffer.append(TEXT_32); > > } > >- stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_33); > stringBuffer.append( model.getClassName() ); > > String superClass = model.getSuperclassName(); > if (superClass != null && superClass.length() > 0) { > >- stringBuffer.append(TEXT_33); >+ stringBuffer.append(TEXT_34); > stringBuffer.append( superClass ); > > } >@@ -237,7 +244,7 @@ > List<String> interfaces = model.getInterfaces(); > if ( interfaces.size() > 0) { > >- stringBuffer.append(TEXT_34); >+ stringBuffer.append(TEXT_35); > > } > >@@ -245,7 +252,7 @@ > String INTERFACE = interfaces.get(i); > if (i > 0) { > >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_36); > > } > >@@ -253,13 +260,13 @@ > > } > >- stringBuffer.append(TEXT_36); >+ stringBuffer.append(TEXT_37); > > if (!model.hasEmptySuperclassConstructor()) { > >- stringBuffer.append(TEXT_37); >- stringBuffer.append( model.getClassName() ); > stringBuffer.append(TEXT_38); >+ stringBuffer.append( model.getClassName() ); >+ stringBuffer.append(TEXT_39); > > } > >@@ -268,19 +275,19 @@ > for (Constructor constructor : constructors) { > if (constructor.isPublic() || constructor.isProtected()) { > >- stringBuffer.append(TEXT_39); >- stringBuffer.append( model.getSuperclassName() ); > stringBuffer.append(TEXT_40); > stringBuffer.append( model.getSuperclassName() ); > stringBuffer.append(TEXT_41); >- stringBuffer.append( constructor.getParamsForJavadoc() ); >+ stringBuffer.append( model.getSuperclassName() ); > stringBuffer.append(TEXT_42); >- stringBuffer.append( model.getClassName() ); >+ stringBuffer.append( constructor.getParamsForJavadoc() ); > stringBuffer.append(TEXT_43); >- stringBuffer.append( constructor.getParamsForDeclaration() ); >+ stringBuffer.append( model.getClassName() ); > stringBuffer.append(TEXT_44); >- stringBuffer.append( constructor.getParamsForCall() ); >+ stringBuffer.append( constructor.getParamsForDeclaration() ); > stringBuffer.append(TEXT_45); >+ stringBuffer.append( constructor.getParamsForCall() ); >+ stringBuffer.append(TEXT_46); > > } > } >@@ -290,36 +297,36 @@ > if (model.shouldImplementAbstractMethods()) { > for (Method method : model.getUnimplementedMethods()) { > >- stringBuffer.append(TEXT_46); >- stringBuffer.append( method.getContainingJavaClass() ); > stringBuffer.append(TEXT_47); >- stringBuffer.append( method.getName() ); >+ stringBuffer.append( method.getContainingJavaClass() ); > stringBuffer.append(TEXT_48); >- stringBuffer.append( method.getParamsForJavadoc() ); >+ stringBuffer.append( method.getName() ); > stringBuffer.append(TEXT_49); >- stringBuffer.append( method.getReturnType() ); >+ stringBuffer.append( method.getParamsForJavadoc() ); > stringBuffer.append(TEXT_50); >- stringBuffer.append( method.getName() ); >+ stringBuffer.append( method.getReturnType() ); > stringBuffer.append(TEXT_51); >- stringBuffer.append( method.getParamsForDeclaration() ); >+ stringBuffer.append( method.getName() ); > stringBuffer.append(TEXT_52); >+ stringBuffer.append( method.getParamsForDeclaration() ); >+ stringBuffer.append(TEXT_53); > > String defaultReturnValue = method.getDefaultReturnValue(); > if (defaultReturnValue != null) { > >- stringBuffer.append(TEXT_53); >- stringBuffer.append( defaultReturnValue ); > stringBuffer.append(TEXT_54); >+ stringBuffer.append( defaultReturnValue ); >+ stringBuffer.append(TEXT_55); > > } > >- stringBuffer.append(TEXT_55); >+ stringBuffer.append(TEXT_56); > > } > } > >- stringBuffer.append(TEXT_56); > stringBuffer.append(TEXT_57); >+ stringBuffer.append(TEXT_58); > return stringBuffer.toString(); > } > } >Index: ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java,v >retrieving revision 1.20 >diff -u -r1.20 NewSessionBeanClassDataModelProvider.java >--- ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java 9 Feb 2010 17:25:48 -0000 1.20 >+++ ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java 23 Feb 2010 09:10:28 -0000 >@@ -15,6 +15,7 @@ > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_COMPONENT_INTERFACE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME_INTERFACE; >+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.NO_INTERFACE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_BUSINESS_INTERFACE; > import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_COMPONENT_INTERFACE; >@@ -32,7 +33,6 @@ > > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > import org.eclipse.jdt.core.IJavaProject; >@@ -57,7 +57,6 @@ > import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider; > import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; > import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; >-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; > > public class NewSessionBeanClassDataModelProvider extends NewEnterpriseBeanClassDataModelProvider { > >@@ -89,6 +88,7 @@ > propertyNames.add(LOCAL_BUSINESS_INTERFACE); > propertyNames.add(REMOTE); > propertyNames.add(LOCAL); >+ propertyNames.add(NO_INTERFACE); > propertyNames.add(STATE_TYPE); > propertyNames.add(REMOTE_HOME); > propertyNames.add(LOCAL_HOME); >@@ -120,17 +120,19 @@ > else if (propertyName.equals(REMOTE)) > return Boolean.FALSE; > else if (propertyName.equals(LOCAL)) >- return Boolean.TRUE; >+ return new Boolean(!ejb31OrLater()); >+ else if (propertyName.equals(NO_INTERFACE)) >+ return new Boolean(ejb31OrLater()); > else if (propertyName.equals(STATE_TYPE)) > return StateType.STATELESS.toString(); > else if (propertyName.equals(INTERFACES)) { > List<BusinessInterface> listResult = new ArrayList<BusinessInterface>(); > String className = getStringProperty(QUALIFIED_CLASS_NAME); >- if ((Boolean) getProperty(REMOTE) && className.length() > 0) { >+ if (getBooleanProperty(REMOTE) && className.length() > 0) { > BusinessInterface remoteInterface = new BusinessInterface(getStringProperty(REMOTE_BUSINESS_INTERFACE), BusinessInterfaceType.REMOTE); > listResult.add(remoteInterface); > } >- if ((Boolean) getProperty(LOCAL) && className.length() > 0) { >+ if (getBooleanProperty(LOCAL) && className.length() > 0) { > BusinessInterface localInterface = new BusinessInterface(getStringProperty(LOCAL_BUSINESS_INTERFACE), BusinessInterfaceType.LOCAL); > listResult.add(localInterface); > } >@@ -188,7 +190,22 @@ > // Call super to set the property on the data model > boolean result = super.propertySet(propertyName, propertyValue); > >- if (propertyName.equals(REMOTE)) { >+ if (PROJECT_NAME.equals(propertyName)) { >+ IDataModel dataModel = getDataModel(); >+ dataModel.notifyPropertyChange(REMOTE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(LOCAL, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(NO_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >+ } else if (CLASS_NAME.equals(propertyName) || JAVA_PACKAGE.equals(propertyName)) { >+ IDataModel dataModel = getDataModel(); >+ dataModel.notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(REMOTE_HOME_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(LOCAL_HOME_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(REMOTE_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG); >+ dataModel.notifyPropertyChange(LOCAL_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG); >+ } else if (propertyName.equals(REMOTE)) { > if (!getDataModel().isPropertySet(INTERFACES)) { > getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG); > } else { >@@ -196,37 +213,22 @@ > } > getDataModel().notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG); > >- } >- if (propertyName.equals(LOCAL)) { >+ } else if (propertyName.equals(LOCAL)) { > if (!getDataModel().isPropertySet(INTERFACES)) { > getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG); > } else { > updateBusinessInterfaces(LOCAL); > } > getDataModel().notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG); >- } >- if (REMOTE_BUSINESS_INTERFACE.equals(propertyName)) >- { >+ } else if (REMOTE_BUSINESS_INTERFACE.equals(propertyName)) { > if(getRemoteProperty() != null){ > getRemoteProperty().setFullyQualifiedName(propertyValue.toString()); > } >- } >- else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) >- { >+ } else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) { > if(getLocalProperty() != null){ > getLocalProperty().setFullyQualifiedName(propertyValue.toString()); > } >- } >- else if (CLASS_NAME.equals(propertyName) || JAVA_PACKAGE.equals(propertyName)) >- { >- IDataModel dataModel = getDataModel(); >- dataModel.notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >- dataModel.notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG); >- dataModel.notifyPropertyChange(REMOTE_HOME_INTERFACE, IDataModel.DEFAULT_CHG); >- dataModel.notifyPropertyChange(LOCAL_HOME_INTERFACE, IDataModel.DEFAULT_CHG); >- dataModel.notifyPropertyChange(REMOTE_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG); >- dataModel.notifyPropertyChange(LOCAL_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG); >- } >+ } > > return result; > } >@@ -262,14 +264,6 @@ > return super.getValidPropertyDescriptors(propertyName); > } > >- private boolean ejb31OrLater() { >- IProject project = getTargetProject(); >- IProjectFacetVersion facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.EJB); >- int version = J2EEVersionUtil.convertVersionStringToInt(facetVersion.getVersionString()); >- int ejb31version = J2EEVersionUtil.convertVersionStringToInt(IJ2EEFacetConstants.EJB_31.getVersionString()); >- return version >= ejb31version; >- } >- > private void updateBusinessInterfaces(String propertyName) { > List<BusinessInterface> list = (List<BusinessInterface>) getProperty(INTERFACES); > if (propertyName.equals(REMOTE)) { >@@ -314,6 +308,10 @@ > public IStatus validate(String propertyName) { > if (STATE_TYPE.equals(propertyName)) { > return validateStateType(); >+ } else if (NO_INTERFACE.equals(propertyName)) { >+ if (getBooleanProperty(NO_INTERFACE)) { >+ return validateNoInterface(); >+ } > } else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) { > if (getBooleanProperty(LOCAL)) { > return validateEjbInterface(getStringProperty(propertyName)); >@@ -337,7 +335,14 @@ > protected IStatus validateStateType() { > String value = getStringProperty(STATE_TYPE); > if (StateType.SINGLETON.toString().equals(value) && !ejb31OrLater()) { >- return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER); >+ return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_SINGLETON_NOT_ALLOWED); >+ } >+ return Status.OK_STATUS; >+ } >+ >+ protected IStatus validateNoInterface() { >+ if (!ejb31OrLater()) { >+ return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_NO_INTERFACE_NOT_ALLOWED); > } > return Status.OK_STATUS; > } >@@ -448,8 +453,8 @@ > > protected IStatus validateInterfacesList() { > List<BusinessInterface> list = (List<BusinessInterface>) getProperty(INTERFACES); >- if (list.isEmpty() && isEJB30Project()) { >- return new Status(IStatus.WARNING, EjbPlugin.PLUGIN_ID, EJBCreationResourceHandler.WRN_NO_BUSINESS_INTERFACE); >+ if (list.isEmpty() && !ejb31OrLater()) { >+ return new Status(IStatus.WARNING, EjbPlugin.PLUGIN_ID, EJBCreationResourceHandler.WRN_NO_CLIENT_VIEW); > } > return Status.OK_STATUS; > } >@@ -493,13 +498,13 @@ > } > return WTPCommonPlugin.OK_STATUS; > } >- >- private boolean isEJB30Project() { >- try { >- return ProjectFacetsManager.create(getTargetProject()).hasProjectFacet(IJ2EEFacetConstants.EJB_30); >- } catch (CoreException e) { >- return false; >- } >- } > >+ private boolean ejb31OrLater() { >+ IProject project = getTargetProject(); >+ IProjectFacetVersion facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.EJB); >+ int version = J2EEVersionUtil.convertVersionStringToInt(facetVersion.getVersionString()); >+ int ejb31version = J2EEVersionUtil.convertVersionStringToInt(IJ2EEFacetConstants.EJB_31.getVersionString()); >+ return version >= ejb31version; >+ } >+ > } >Index: templates/sessionBean_classHeader.template >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/templates/sessionBean_classHeader.template,v >retrieving revision 1.2 >diff -u -r1.2 sessionBean_classHeader.template >--- templates/sessionBean_classHeader.template 27 Mar 2008 19:38:14 -0000 1.2 >+++ templates/sessionBean_classHeader.template 23 Feb 2010 09:10:28 -0000 >@@ -68,6 +68,12 @@ > <% > } > >+ if (model.isNoInterfaceChecked()) { >+%> >+@LocalBean >+<% >+ } >+ > if (model.isLocalHomeChecked()) { > %> > @LocalHome(<%=model.getLocalHomeClassSimpleName()%>.class) >Index: templates/messageDrivenBean_classHeader.template >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template,v >retrieving revision 1.1 >diff -u -r1.1 messageDrivenBean_classHeader.template >--- templates/messageDrivenBean_classHeader.template 25 Mar 2008 14:47:17 -0000 1.1 >+++ templates/messageDrivenBean_classHeader.template 23 Feb 2010 09:10:28 -0000 >@@ -1,6 +1,5 @@ > /** > * Message-Driven Bean implementation class for: <%=model.getClassName()%> >- * > */ > @MessageDriven > <% >Index: property_files/ejbcreation.properties >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties,v >retrieving revision 1.14 >diff -u -r1.14 ejbcreation.properties >--- property_files/ejbcreation.properties 9 Feb 2010 16:58:53 -0000 1.14 >+++ property_files/ejbcreation.properties 23 Feb 2010 09:10:28 -0000 >@@ -148,5 +148,6 @@ > ERR_REMOTE_HOME_NOT_INTERFACE=The specified Remote Home interface is not valid. > ERR_BEAN_ALREADY_EXISTS=Enterprise bean with the same Ejb Name already exists. > WRN_BEAN_NAME_IS_EMPTY=Bean name is empty, the containter will use the name of the bean class. >-WRN_NO_BUSINESS_INTERFACE=No business interface configured. Clients will not be able to access this bean. >-ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER=The 'Singleton' state type is allowed only for EJB projects with version 3.1 and later. >+WRN_NO_CLIENT_VIEW=No client view configured. Clients will not be able to access this bean. >+ERR_SINGLETON_NOT_ALLOWED=The 'Singleton' state type is allowed only for EJB projects with version 3.1 or later. >+ERR_NO_INTERFACE_NOT_ALLOWED=The no-interface client view is allowed only for EJB projects with version 3.1 or later. >Index: ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java,v >retrieving revision 1.13 >diff -u -r1.13 EJBCreationResourceHandler.java >--- ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java 9 Feb 2010 16:58:53 -0000 1.13 >+++ ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java 23 Feb 2010 09:10:28 -0000 >@@ -163,8 +163,9 @@ > public static String ERR_REMOTE_HOME_NOT_INTERFACE; > public static String ERR_NO_MESSAGE_LISTENER_INTERFACE; > public static String WRN_BEAN_NAME_IS_EMPTY; >- public static String WRN_NO_BUSINESS_INTERFACE; >- public static String ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER; >+ public static String WRN_NO_CLIENT_VIEW; >+ public static String ERR_SINGLETON_NOT_ALLOWED; >+ public static String ERR_NO_INTERFACE_NOT_ALLOWED; > > > static {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 241667
:
154964
| 159894 |
159902