JBoss Tools SVN: r14291 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 11:02:03 -0400 (Mon, 23 Mar 2009)
New Revision: 14291
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
Log:
JBIDE-3965
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-03-23 13:59:18 UTC (rev 14290)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-03-23 15:02:03 UTC (rev 14291)
@@ -1081,7 +1081,7 @@
<XActionItem displayName="New" group="1" kind="list" name="CreateActions">
<XActionItem displayName="File" group="1" kind="list" name="CreateFiles">
<XActionItem kind="list" name="ORM">
- <XActionItem HandlerClassName="%SpecialWizard%"
+ <XActionItem HandlerClassName="%SpecialWizard%" HIDE="always"
ICON="main.hibernate.file"
PROPERTIES="entity=FileHibConfig3;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xml"
displayName="Hibernate Configuration 3.0..." kind="action" name="CreateFileHibConfig3">
@@ -1091,6 +1091,10 @@
<AttributeData AttributeName="name"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%WizardInvoker%"
+ ICON="main.hibernate.file"
+ PROPERTIES="plugin=org.hibernate.eclipse.console;wizard=org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
+ displayName="Hibernate Configuration 3.0..." kind="action" name="CreateFileHibConfig3V"/>
</XActionItem>
</XActionItem>
</XActionItem>
@@ -1105,7 +1109,7 @@
<XActionItem displayName="New" group="1" kind="list" name="CreateActions">
<XActionItem displayName="File" group="1" kind="list" name="CreateFiles">
<XActionItem kind="list" name="ORM">
- <XActionItem HandlerClassName="%SpecialWizard%"
+ <XActionItem HandlerClassName="%SpecialWizard%" HIDE="always"
ICON="main.hibernate.file"
PROPERTIES="entity=FileHibConfig3;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xml"
displayName="Hibernate Configuration 3.0..." kind="action" name="CreateFileHibConfig3">
@@ -1115,6 +1119,10 @@
<AttributeData AttributeName="name"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%WizardInvoker%"
+ ICON="main.hibernate.file"
+ PROPERTIES="plugin=org.hibernate.eclipse.console;wizard=org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
+ displayName="Hibernate Configuration 3.0..." kind="action" name="CreateFileHibConfig3V"/>
</XActionItem>
</XActionItem>
</XActionItem>
15 years, 2 months
JBoss Tools SVN: r14290 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 09:59:18 -0400 (Mon, 23 Mar 2009)
New Revision: 14290
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
Log:
JBIDE-4071
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2009-03-23 13:21:35 UTC (rev 14289)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2009-03-23 13:59:18 UTC (rev 14290)
@@ -591,4 +591,36 @@
closeEditor();
}
+
+ private static final String PAGE_HOME_NAME = "/WebContent/home.xhtml";
+
+ public void testContentAssistForInvocationOnString() {
+ openEditor(PAGE_HOME_NAME);
+
+ List<IRegion> regionsToTest = getELRegionsToTest(document);
+ if (regionsToTest != null) {
+ for (IRegion region : regionsToTest) {
+ int startOffset = region.getOffset() + 2;
+ int offset = startOffset + 10;
+
+ ICompletionProposal[] result= null;
+ String errorMessage = null;
+
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offset);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
+ }
+ assertNotNull("Proposals were not created.", result);
+ assertEquals("Incorrect number of proposals for #{'aa'.subst|ring(1)}", 3, result.length);
+ }
+
+ }
+ closeEditor();
+ }
+
}
15 years, 2 months
JBoss Tools SVN: r14289 - trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 09:21:35 -0400 (Mon, 23 Mar 2009)
New Revision: 14289
Modified:
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java
Log:
JBIDE-4071
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java 2009-03-23 13:17:27 UTC (rev 14288)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java 2009-03-23 13:21:35 UTC (rev 14289)
@@ -47,8 +47,10 @@
checkCorrectEL(t, "#{a.b()}");
// 5b. Method invocation with one parameter
checkCorrectEL(t, "#{a.b(c)}");
- // 5b. Method invocation with two parameters
+ // 5c. Method invocation with two parameters
checkCorrectEL(t, "#{a.b(c.d , e['u'])}");
+ // 5d. Method invocation on a string
+ checkCorrectEL(t, "#{'a'.compareTo('c')}");
// 6. Numeric
checkCorrectEL(t, "#{a.b(16.900)}");
// 7. Boolean
15 years, 2 months
JBoss Tools SVN: r14288 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 09:17:27 -0400 (Mon, 23 Mar 2009)
New Revision: 14288
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
JBIDE-4071
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-03-23 13:17:07 UTC (rev 14287)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-03-23 13:17:27 UTC (rev 14288)
@@ -619,7 +619,7 @@
IDocument doc= viewer.getDocument();
if (doc == null || offset > doc.getLength())
return false;
-
+int quotaCount = 0;
while (--offset >= startIndex) {
if ('}' == doc.getChar(offset))
return false;
@@ -630,14 +630,16 @@
backslashCount++;
}
if (backslashCount%2 == 0)
- return false;
+ quotaCount++;
}
if ('{' == doc.getChar(offset) &&
(offset - 1) >= 0 &&
('#' == doc.getChar(offset - 1) ||
'$' == doc.getChar(offset - 1))) {
- return true;
+ if(quotaCount % 2 == 0) {
+ return true;
+ }
}
}
return false;
15 years, 2 months
JBoss Tools SVN: r14287 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 09:17:07 -0400 (Mon, 23 Mar 2009)
New Revision: 14287
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-4071
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-03-23 13:08:16 UTC (rev 14286)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-03-23 13:17:07 UTC (rev 14287)
@@ -15,12 +15,17 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.text.BadLocationException;
@@ -48,17 +53,22 @@
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.kb.KbProposal;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
+import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.el.SeamExpressionResolver.MessagesInfo;
+import org.w3c.dom.Element;
/**
* Utility class used to collect info for EL
@@ -787,6 +797,25 @@
}
return newResolvedVars;
}
+ else if(varName != null && (varName.startsWith("\"") || varName.startsWith("'"))
+ && (varName.endsWith("\"") || varName.endsWith("'"))) {
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(this.project.getProject());
+ try {
+ IType type = jp.findType("java.lang.String");
+ if(type != null) {
+ IMethod m = type.getMethod("toString", new String[0]);
+ if(m != null) {
+ ISeamContextVariable v = new StringVariable(m);
+ List<ISeamContextVariable> newResolvedVars = new ArrayList<ISeamContextVariable>();
+ newResolvedVars.add(v);
+ return newResolvedVars;
+ }
+ }
+ } catch (JavaModelException e) {
+ //ignore
+ }
+
+ }
return new ArrayList<ISeamContextVariable>();
}
@@ -1062,3 +1091,59 @@
}
}
+
+class StringVariable implements ISeamContextVariable, ISeamJavaSourceReference {
+ IMember member;
+ public StringVariable(IMember member) {
+ this.member = member;
+ }
+ public ScopeType getScope() {
+ return ScopeType.APPLICATION;
+ }
+ public void setName(String name) {
+ }
+ public void setScope(ScopeType type) {
+ }
+ public ISeamTextSourceReference getLocationFor(String path) {
+ return null;
+ }
+ public String getName() {
+ return "String";
+ }
+ public ISeamElement getParent() {
+ return null;
+ }
+ public IResource getResource() {
+ return null;
+ }
+ public ISeamProject getSeamProject() {
+ return null;
+ }
+ public IPath getSourcePath() {
+ return null;
+ }
+ public void loadXML(Element element, Properties context) {
+ }
+ public List<Change> merge(ISeamElement s) {
+ return null;
+ }
+ public Element toXML(Element parent, Properties context) {
+ return null;
+ }
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ public IMember getSourceMember() {
+ return member;
+ }
+ public int getLength() {
+ return 0;
+ }
+ public int getStartPosition() {
+ return 0;
+ }
+ public StringVariable clone() throws CloneNotSupportedException {
+ throw new CloneNotSupportedException();
+ }
+}
+
15 years, 2 months
JBoss Tools SVN: r14286 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser: rule and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-23 09:08:16 -0400 (Mon, 23 Mar 2009)
New Revision: 14286
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
Log:
JBIDE-4071
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2009-03-23 04:33:13 UTC (rev 14285)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2009-03-23 13:08:16 UTC (rev 14286)
@@ -152,8 +152,12 @@
case ExprStartTokenDescription.EXPR_START:
case UnaryTokenDescription.UNARY:
return readComplexExpression();
+ case StringTokenDescription.STRING:
+ LexicalToken f = lookUpNextToken(current);
+ if(f != null && f.getType() == DotTokenDescription.DOT) {
+ return readInvocationExpression();
+ }
case PrimitiveValueTokenDescription.PRIMITIVE_VALUE:
- case StringTokenDescription.STRING:
ELExpressionImpl expr = new ELValueExpressionImpl();
expr.setFirstToken(current);
expr.setLastToken(current);
@@ -186,7 +190,9 @@
}
protected ELInvocationExpressionImpl readInvocationExpression() {
- if(current == null || current.getType() != JavaNameTokenDescription.JAVA_NAME) {
+ if(current == null ||
+ (current.getType() != JavaNameTokenDescription.JAVA_NAME &&
+ current.getType() != StringTokenDescription.STRING)) {
return null;
}
ELPropertyInvocationImpl name = new ELPropertyInvocationImpl();
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2009-03-23 04:33:13 UTC (rev 14285)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2009-03-23 13:08:16 UTC (rev 14286)
@@ -55,8 +55,8 @@
case EndELTokenDescription.END_EL:
return STATE_EXPECTING_EL;
case JavaNameTokenDescription.JAVA_NAME:
+ case StringTokenDescription.STRING:
return STATE_EXPECTING_CALL;
- case StringTokenDescription.STRING:
case PrimitiveValueTokenDescription.PRIMITIVE_VALUE:
return STATE_EXPECTING_OPERATION;
case ParamEndTokenDescription.PARAM_END:
15 years, 2 months
JBoss Tools SVN: r14285 - trunk.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-03-23 00:33:13 -0400 (Mon, 23 Mar 2009)
New Revision: 14285
Removed:
trunk/i18n/
Log:
Removing i18n directory; translation working files (eg Gettext PO/POT files) will now be kept elsewhere
15 years, 2 months
JBoss Tools SVN: r14284 - in trunk/seam: plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-03-20 12:50:18 -0400 (Fri, 20 Mar 2009)
New Revision: 14284
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3957 Change "Only Component class can have @Destroy method" Seam validator rule to "Only JavaBeans and stateful session beans support @Destroy methods" - Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -76,11 +76,16 @@
public Set<IBijectedAttribute> getBijectedAttributesByType(BijectedAttributeType type);
/**
- * @return true if component marked as Stateful
+ * @return true if component marked as stateful sessian bean
*/
public boolean isStateful();
/**
+ * @return true if component marked as stateless session bean
+ */
+ public boolean isStateless();
+
+ /**
* @return true if component marked as Entity
*/
public boolean isEntity();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -67,11 +67,16 @@
public boolean isOfType(BeanType type);
/**
- * @return true if class marked as Stateful
+ * @return true if class marked as stateful session bean
*/
public boolean isStateful();
/**
+ * @return true if class marked as stateless session bean
+ */
+ public boolean isStateless();
+
+ /**
* @return true if class marked as Entity
*/
public boolean isEntity();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -84,7 +84,7 @@
// Mark duplicated @Unwrap methods within one component.
public static final String DUPLICATE_UNWRAP = createSeverityOption("duplicateUnwrap"); //$NON-NLS-1$
// Mark all @Destroy methods which are not declared in components' classes.
- public static final String DESTROY_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("destroyDoesNotBelongToComponent"); //$NON-NLS-1$
+ public static final String DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN = createSeverityOption("destroyMethodBelongsToStatelessSessionBean"); //$NON-NLS-1$
// Mark all @Create methods which are not declared in components' classes.
public static final String CREATE_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("createDoesNotBelongToComponent"); //$NON-NLS-1$
// Mark all @Unwrap methods which are not declared in components' classes.
@@ -185,7 +185,7 @@
SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_DESTROY)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_CREATE)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_UNWRAP)) &&
- SeamPreferences.IGNORE.equals(getProjectPreference(project, DESTROY_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, CREATE_DOESNT_BELONG_TO_COMPONENT)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, UNWRAP_DOESNT_BELONG_TO_COMPONENT)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, OBSERVER_DOESNT_BELONG_TO_COMPONENT)) &&
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -164,6 +164,14 @@
}
/**
+ * @see org.jboss.tools.seam.core.ISeamComponent#isStateless()
+ */
+ public boolean isStateless() {
+ ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
+ return (javaDeclaration != null) && javaDeclaration.isStateless();
+ }
+
+ /**
* @see org.jboss.tools.seam.core.ISeamContextVariable#getName()
*/
public String getName() {
@@ -371,5 +379,4 @@
}
}
}
-
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -219,7 +219,11 @@
public boolean isStateful() {
return isOfType(BeanType.STATEFUL);
}
-
+
+ public boolean isStateless() {
+ return isOfType(BeanType.STATELESS);
+ }
+
public void removeBijectedAttribute(IBijectedAttribute attribute) {
bijectedAttributes.remove(attribute);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -75,6 +75,7 @@
protected static final String CREATE_METHOD_SUFIX_MESSAGE_ID = "CREATE"; //$NON-NLS-1$
protected static final String UNWRAP_METHOD_SUFIX_MESSAGE_ID = "UNWRAP"; //$NON-NLS-1$
protected static final String OBSERVER_METHOD_SUFIX_MESSAGE_ID = "OBSERVER"; //$NON-NLS-1$
+ protected static final String DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_ID = "DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN"; //$NON-NLS-1$
protected static final String NONCOMPONENTS_METHOD_SUFIX_MESSAGE_ID = "_DOESNT_BELONG_TO_COMPONENT"; //$NON-NLS-1$
protected static final String STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "STATEFUL_COMPONENT_WRONG_SCOPE"; //$NON-NLS-1$
protected static final String ENTITY_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "ENTITY_COMPONENT_WRONG_SCOPE"; //$NON-NLS-1$
@@ -621,6 +622,7 @@
validateStatefulComponent(component);
validateDuplicateComponentMethods(component);
validateEntityComponent(component);
+ validateDestroyMethod(component);
}
private void validateBijections(ISeamJavaComponentDeclaration declaration) {
@@ -702,7 +704,6 @@
IMember member = declaration.getSourceMember();
try {
if(member!=null && !Flags.isAbstract(member.getFlags())) {
- validateMethodOfUnknownComponent(SeamComponentMethodType.DESTROY, declaration, DESTROY_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DESTROY_DOESNT_BELONG_TO_COMPONENT);
validateMethodOfUnknownComponent(SeamComponentMethodType.CREATE, declaration, CREATE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.CREATE_DOESNT_BELONG_TO_COMPONENT);
validateMethodOfUnknownComponent(SeamComponentMethodType.UNWRAP, declaration, UNWRAP_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.UNWRAP_DOESNT_BELONG_TO_COMPONENT);
validateMethodOfUnknownComponent(SeamComponentMethodType.OBSERVER, declaration, OBSERVER_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.OBSERVER_DOESNT_BELONG_TO_COMPONENT);
@@ -714,6 +715,22 @@
validationContext.removeUnnamedCoreResource(declaration.getSourcePath());
}
+ private void validateDestroyMethod(ISeamComponent component) {
+ if(component.isStateless()) {
+ ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
+ Set<ISeamComponentMethod> methods = javaDeclaration.getMethodsByType(SeamComponentMethodType.DESTROY);
+ for (ISeamComponentMethod method : methods) {
+ IMethod javaMethod = (IMethod)method.getSourceMember();
+ String methodName = javaMethod.getElementName();
+ if(javaDeclaration.getSourcePath().equals(javaMethod.getPath())) {
+ validationContext.addLinkedCoreResource(component.getName(), javaDeclaration.getSourcePath());
+ ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ addError(DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_ID, SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new String[]{methodName}, methodNameLocation, method.getResource());
+ }
+ }
+ }
+ }
+
private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType, ISeamJavaComponentDeclaration declaration, String sufixMessageId, String preferenceKey) {
Set<ISeamComponentMethod> methods = declaration.getMethodsByType(methodType);
if(methods!=null && methods.size()>0) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2009-03-20 16:50:18 UTC (rev 14284)
@@ -24,7 +24,7 @@
DUPLICATE_DESTROY=Duplicate @Destroy method "{0}"
DUPLICATE_CREATE=Duplicate @Create method "{0}"
DUPLICATE_UNWRAP=Duplicate @Unwrap method "{0}"
-DESTROY_DOESNT_BELONG_TO_COMPONENT=Only component class can have @Destroy method "{0}"
+DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN=Only JavaBeans and stateful session beans support @Destroy methods "{0}"
CREATE_DOESNT_BELONG_TO_COMPONENT=Only component class can have @Create method "{0}"
UNWRAP_DOESNT_BELONG_TO_COMPONENT=Only component class can have @Unwrap method "{0}"
OBSERVER_DOESNT_BELONG_TO_COMPONENT=Only component class can have @Observer method "{0}"
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -123,7 +123,7 @@
public static String SeamValidatorConfigurationBlock_pb_duplicateDestroy_label;
public static String SeamValidatorConfigurationBlock_pb_duplicateCreate_label;
public static String SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label;
- public static String SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label;
+ public static String SeamValidatorConfigurationBlock_pb_destroyMethodBelongsToStatelessSessionBean_label;
public static String SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label;
public static String SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label;
public static String SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-03-20 16:50:18 UTC (rev 14284)
@@ -35,10 +35,10 @@
SeamValidatorConfigurationBlock_pb_duplicateDestroy_label=Duplicate @Destroy method:
SeamValidatorConfigurationBlock_pb_duplicateCreate_label=Duplicate @Create method:
SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label=Duplicate @Unwrap method:
-SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label=Only component class can have @Destroy method
-SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label=Only component class can have @Create method
-SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label=Only component class can have @Unwrap method
-SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label=Only component class can have @Observer method
+SeamValidatorConfigurationBlock_pb_destroyMethodBelongsToStatelessSessionBean_label=Only JavaBeans and stateful session beans support @Destroy methods:
+SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label=Only component class can have @Create method:
+SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label=Only component class can have @Unwrap method:
+SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label=Only component class can have @Observer method:
##Section Factories
SeamValidatorConfigurationBlock_section_factory=Factories
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -89,7 +89,7 @@
{SeamPreferences.DUPLICATE_DESTROY, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateDestroy_label},
{SeamPreferences.DUPLICATE_CREATE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateCreate_label},
{SeamPreferences.DUPLICATE_UNWRAP, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label},
- {SeamPreferences.DESTROY_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label},
+ {SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_destroyMethodBelongsToStatelessSessionBean_label},
{SeamPreferences.CREATE_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label},
{SeamPreferences.UNWRAP_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label},
{SeamPreferences.OBSERVER_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label},
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9 2009-03-20 16:50:18 UTC (rev 14284)
@@ -1,10 +1,10 @@
package org.domain.SeamWebWarTestProject.session;
-
-
+import javax.ejb.Stateless;
+import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.log.Log;
-
+@Stateless @Name("statelessComponentWithDestroyMethod")
public class StatefulComponent {
private String abc;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-03-20 14:35:00 UTC (rev 14283)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-03-20 16:50:18 UTC (rev 14284)
@@ -384,8 +384,8 @@
}
refreshProject(project);
- // Only component class can have @Destroy method
- System.out.println("Test - Only component class can have @Destroy method");
+ // Only JavaBeans and stateful session beans support @Destroy methods
+ System.out.println("Test - Only JavaBeans and stateful session beans support @Destroy methods");
final String NEW_CONTENT_FILE_NAME9 = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9";
assertMarkerIsCreated(
15 years, 3 months
JBoss Tools SVN: r14283 - in trunk/seam/plugins/org.jboss.tools.seam.text.ext: src/org/jboss/tools/seam/text/ext/hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-03-20 10:35:00 -0400 (Fri, 20 Mar 2009)
New Revision: 14283
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4002
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/META-INF/MANIFEST.MF 2009-03-20 14:33:14 UTC (rev 14282)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/META-INF/MANIFEST.MF 2009-03-20 14:35:00 UTC (rev 14283)
@@ -27,8 +27,7 @@
org.jboss.tools.jsf,
org.jboss.tools.seam.core,
org.eclipse.jdt.ui,
- org.jboss.tools.jsf.text.ext,
- org.eclipse.jst.j2ee;bundle-version="1.1.200"
+ org.jboss.tools.jsf.text.ext
Export-Package: org.jboss.tools.seam.text.ext,
org.jboss.tools.seam.text.ext.hyperlink
Bundle-Version: 2.0.0
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java 2009-03-20 14:33:14 UTC (rev 14282)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java 2009-03-20 14:35:00 UTC (rev 14283)
@@ -18,9 +18,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
15 years, 3 months
JBoss Tools SVN: r14282 - trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-03-20 10:33:14 -0400 (Fri, 20 Mar 2009)
New Revision: 14282
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4002
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java 2009-03-20 13:58:12 UTC (rev 14281)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/ComponentsHyperlink.java 2009-03-20 14:33:14 UTC (rev 14282)
@@ -24,6 +24,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+import org.jboss.tools.seam.core.SeamProjectsSet;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
import org.w3c.dom.Node;
@@ -96,15 +97,9 @@
}
private IProject getEarProject() {
- IVirtualComponent component = ComponentCore
- .createComponent(getProject());
- IVirtualComponent[] vComponents = component.getReferencingComponents();
- for (IVirtualComponent vc : vComponents) {
- if (vc instanceof EARVirtualComponent) {
- return ((EARVirtualComponent) vc).getProject();
- }
- }
- return null;
+ SeamProjectsSet projectsSet = SeamProjectsSet.create(getProject());
+
+ return projectsSet.getEarProject();
}
private IProject getProject() {
15 years, 3 months