JBoss Tools SVN: r19281 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-15 11:39:28 -0500 (Tue, 15 Dec 2009)
New Revision: 19281
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointMethod.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointMethod.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointMethod.java 2009-12-15 16:39:28 UTC (rev 19281)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core;
+
+/**
+ * Represents an injection point which is a method of a bean class.
+ *
+ * @author Alexey Kazakov
+ */
+public interface IInjectionPointMethod extends IInjectionPoint, IBeanMethod {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss Tools SVN: r19280 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-15 10:42:55 -0500 (Tue, 15 Dec 2009)
New Revision: 19280
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/SessionBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationHelper.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -15,6 +15,7 @@
public String STEREOTYPE_ANNOTATION_TYPE_NAME = "javax.enterprise.inject.Stereotype";
public String MODEL_STEREOTYPE_TYPE_NAME = "javax.enterprise.inject.Model";
public String DECORATOR_STEREOTYPE_TYPE_NAME = "javax.decorator.Decorator";
+ public String DELEGATE_STEREOTYPE_TYPE_NAME = "javax.decorator.Delegate";
public String TYPED_ANNOTATION_TYPE_NAME = "javax.enterprise.inject.Typed";
@@ -40,6 +41,7 @@
public String SPECIALIZES_ANNOTATION_TYPE_NAME = "javax.enterprise.inject.Specializes";
- public String DELEGATE_STEREOTYPE_TYPE_NAME = "javax.decorator.Delegate";
+ public String STATEFUL_ANNOTATION_TYPE_NAME = "javax.ejb.Stateful";
+ public String STATELESS_ANNOTATION_TYPE_NAME = "javax.ejb.Stateless";
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -45,12 +45,12 @@
boolean isDelegate();
/**
- * Returns the @Decorator annotation of this injection point field or
+ * Returns the @Delegate annotation of this injection point field or
* parameter of injection point method. Should not return null if
* isDelegate() returns "true".
*
- * @return the @Decorator annotation of this injection point field or
+ * @return the @Delegate annotation of this injection point field or
* parameter of injection point method. May be null.
*/
- IAnnotationDeclaration getDecoratorAnnotation();
+ IAnnotationDeclaration getDelegateAnnotation();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -14,11 +14,17 @@
import java.util.List;
import java.util.Set;
-import org.jboss.tools.cdi.core.CDIConstants;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
*
@@ -28,43 +34,18 @@
public class AbstractBeanElement extends CDIElement {
protected AbstractMemberDefinition definition;
- protected AnnotationDeclaration named;
- protected AnnotationDeclaration alternative;
- protected AnnotationDeclaration specializes;
- protected AnnotationDeclaration typed;
- protected AnnotationDeclaration decorator;
- protected AnnotationDeclaration interceptor;
- protected AnnotationDeclaration delegate;
-
public AbstractBeanElement() {}
public void setDefinition(AbstractMemberDefinition definition) {
this.definition = definition;
- setAnnotations(definition.getAnnotations());
}
- protected void setAnnotations(List<AnnotationDeclaration> ds) {
- for (AnnotationDeclaration d: ds) {
- String typeName = d.getTypeName();
- if(CDIConstants.NAMED_QUALIFIER_TYPE_NAME.equals(typeName)) {
- named = d;
- } else if(CDIConstants.ALTERNATIVE_ANNOTATION_TYPE_NAME.equals(typeName)) {
- alternative = d;
- } else if(CDIConstants.SPECIALIZES_ANNOTATION_TYPE_NAME.equals(typeName)) {
- specializes = d;
- } else if(CDIConstants.TYPED_ANNOTATION_TYPE_NAME.equals(typeName)) {
- typed = d;
- } else if(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME.equals(typeName)) {
- decorator = d;
- } else if(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME.equals(typeName)) {
- delegate = d;
- } else if(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME.equals(typeName)) {
- interceptor = d;
- }
- }
+ public AbstractMemberDefinition getDefinition() {
+ return definition;
}
protected AnnotationDeclaration findNamedAnnotation() {
+ AnnotationDeclaration named = getDefinition().getNamedAnnotation();
if(named != null) return named;
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
@@ -98,4 +79,36 @@
return result;
}
+ public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
+ Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
+ AnnotationDeclaration typed = getDefinition().getTypedAnnotation();
+ if(typed != null) {
+ IAnnotation a = typed.getDeclaration();
+ try {
+ IMemberValuePair[] ps = a.getMemberValuePairs();
+ if(ps == null || ps.length == 0) return result;
+ Object value = ps[0].getValue();
+ if(value instanceof Object[]) {
+ Object[] os = (Object[])value;
+ for (int i = 0; i < os.length; i++) {
+ String typeName = os[i].toString();
+ IType type = EclipseJavaUtil.findType(getCDIProject().getNature().getDefinitions().getJavaProject(), typeName);
+ if(type != null) {
+ result.add(new TypeDeclaration(type, -1, 0));
+ }
+ }
+ } else if(value != null) {
+ String typeName = value.toString();
+ IType type = EclipseJavaUtil.findType(getCDIProject().getNature().getDefinitions().getJavaProject(), typeName);
+ if(type != null) {
+ result.add(new TypeDeclaration(type, -1, 0));
+ }
+ }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+ return result;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -30,6 +30,10 @@
setField(definition.getField());
}
+ public FieldDefinition getDefinition() {
+ return (FieldDefinition)definition;
+ }
+
public IField getField() {
return field;
}
@@ -43,7 +47,4 @@
return getField();
}
- public FieldDefinition getDefinition() {
- return (FieldDefinition)definition;
- }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -18,6 +18,7 @@
import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.ITypeDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
@@ -31,6 +32,10 @@
public BeanMember() {}
+ public BeanMemberDefinition getDefinition() {
+ return (BeanMemberDefinition)definition;
+ }
+
protected void setMember(IMember member) {
try {
String returnType = EclipseJavaUtil.getMemberTypeAsString(member);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -380,6 +380,9 @@
synchronized (beansByName) {
beansByName.clear();
}
+ synchronized (namedBeans) {
+ namedBeans.clear();
+ }
List<TypeDefinition> typeDefinitions = n.getDefinitions().getTypeDefinitions();
for (TypeDefinition typeDefinition : typeDefinitions) {
ClassBean bean = null;
@@ -387,9 +390,12 @@
bean = new InterceptorBean();
} else if(typeDefinition.getDecoratorAnnotation() != null) {
bean = new DecoratorBean();
+ } else if(typeDefinition.getStatefulAnnotation() != null || typeDefinition.getStatelessAnnotation() != null) {
+ bean = new SessionBean();
} else {
bean = new ClassBean();
}
+ bean.setParent(this);
bean.setDefinition(typeDefinition);
addBean(bean);
Set<IProducer> ps = bean.getProducers();
@@ -397,6 +403,9 @@
addBean(producer);
}
}
+ System.out.println("Project=" + getNature().getProject());
+ System.out.println("Named beans=" + beansByName.size());
+ System.out.println("Bean paths=" + beansByPath.size());
}
void addBean(IBean bean) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -53,7 +53,6 @@
public void setDefinition(TypeDefinition definition) {
setSourcePath(definition.getType().getPath());
super.setDefinition(definition);
- setAnnotations(definition.getAnnotations());
List<MethodDefinition> ms = definition.getMethods();
for (MethodDefinition m: ms) {
BeanMethod bm = null;
@@ -84,6 +83,10 @@
}
}
+ public TypeDefinition getDefinition() {
+ return (TypeDefinition)definition;
+ }
+
public Set<IBeanMethod> getBeanConstructor() {
Set<IBeanMethod> result = new HashSet<IBeanMethod>();
for (BeanMethod m: methods) {
@@ -141,7 +144,7 @@
}
public IAnnotationDeclaration getAlternativeDeclaration() {
- return alternative;
+ return getDefinition().getAlternativeAnnotation();
}
public IType getBeanClass() {
@@ -191,29 +194,27 @@
}
public ITextSourceReference getNameLocation() {
+ AnnotationDeclaration named = getDefinition().getNamedAnnotation();
if(named != null) {
return ValueInfo.getValueInfo(named.getDeclaration(), null);
}
return null;
}
- public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
- // TODO Auto-generated method stub
- return null;
- }
-
public IBean getSpecializedBean() {
+ if(getDefinition().getSpecializesAnnotation() == null) {
+ return null;
+ }
// TODO Auto-generated method stub
return null;
}
public IAnnotationDeclaration getSpecializesAnnotationDeclaration() {
- // TODO Auto-generated method stub
- return null;
+ return getDefinition().getSpecializesAnnotation();
}
public boolean isAlternative() {
- if(alternative != null) return true;
+ if(getDefinition().getAlternativeAnnotation() != null) return true;
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
@@ -233,7 +234,7 @@
}
public boolean isSpecializing() {
- return specializes != null;
+ return getDefinition().getSpecializesAnnotation() != null;
}
public IType getScope() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -30,7 +30,7 @@
}
public IAnnotationDeclaration getDecoratorAnnotation() {
- return decorator;
+ return getDefinition().getDecoratorAnnotation();
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -23,8 +23,8 @@
public InjectionPointField() {}
- public IAnnotationDeclaration getDecoratorAnnotation() {
- return decorator;
+ public IAnnotationDeclaration getDelegateAnnotation() {
+ return getDefinition().getDelegateAnnotation();
}
public IType getType() {
@@ -32,7 +32,7 @@
}
public boolean isDelegate() {
- return delegate != null;
+ return getDelegateAnnotation() != null;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBean.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBean.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -23,7 +23,7 @@
public InterceptorBean() {}
public IAnnotationDeclaration getInterceptorAnnotation() {
- return interceptor;
+ return getDefinition().getInterceptorAnnotation();
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -31,7 +31,6 @@
public void setDefinition(AnnotationDefinition definition) {
this.definition = definition;
-// setAnnotations(definition.getAnnotations());
}
public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -52,7 +52,7 @@
}
public IAnnotationDeclaration getAlternativeDeclaration() {
- return alternative;
+ return getDefinition().getAlternativeAnnotation();
}
public IType getBeanClass() {
@@ -98,37 +98,6 @@
return null;
}
- public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
- Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
- if(typed != null) {
- IAnnotation a = typed.getDeclaration();
- try {
- IMemberValuePair[] ps = a.getMemberValuePairs();
- if(ps == null || ps.length == 0) return result;
- Object value = ps[0].getValue();
- if(value instanceof Object[]) {
- Object[] os = (Object[])value;
- for (int i = 0; i < os.length; i++) {
- String typeName = os[i].toString();
- IType type = EclipseJavaUtil.findType(getField().getJavaProject(), typeName);
- if(type != null) {
- result.add(new TypeDeclaration(type, -1, 0));
- }
- }
- } else if(value != null) {
- String typeName = value.toString();
- IType type = EclipseJavaUtil.findType(getField().getJavaProject(), typeName);
- if(type != null) {
- result.add(new TypeDeclaration(type, -1, 0));
- }
- }
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- }
- }
- return result;
- }
-
public IBean getSpecializedBean() {
return null;
}
@@ -138,7 +107,7 @@
}
public boolean isAlternative() {
- if(alternative != null) return true;
+ if(getDefinition().getAlternativeAnnotation() != null) return true;
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -58,7 +58,7 @@
}
public IAnnotationDeclaration getAlternativeDeclaration() {
- return alternative;
+ return getDefinition().getAlternativeAnnotation();
}
public IType getBeanClass() {
@@ -109,40 +109,8 @@
return null;
}
- //similar to ProducerField.getRestrictedTypeDeclaratios
- public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
- Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
- if(typed != null) {
- IAnnotation a = typed.getDeclaration();
- try {
- IMemberValuePair[] ps = a.getMemberValuePairs();
- if(ps == null || ps.length == 0) return result;
- Object value = ps[0].getValue();
- if(value instanceof Object[]) {
- Object[] os = (Object[])value;
- for (int i = 0; i < os.length; i++) {
- String typeName = os[i].toString();
- IType type = EclipseJavaUtil.findType(getMethod().getJavaProject(), typeName);
- if(type != null) {
- result.add(new TypeDeclaration(type, -1, 0));
- }
- }
- } else if(value != null) {
- String typeName = value.toString();
- IType type = EclipseJavaUtil.findType(getMethod().getJavaProject(), typeName);
- if(type != null) {
- result.add(new TypeDeclaration(type, -1, 0));
- }
- }
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- }
- }
- return result;
- }
-
public IBean getSpecializedBean() {
- if(specializes == null) {
+ if(getDefinition().getSpecializesAnnotation() == null) {
return null;
}
//TODO find producer method in super type
@@ -151,11 +119,11 @@
}
public IAnnotationDeclaration getSpecializesAnnotationDeclaration() {
- return specializes;
+ return getDefinition().getSpecializesAnnotation();
}
public boolean isAlternative() {
- if(alternative != null) return true;
+ if(getDefinition().getAlternativeAnnotation() != null) return true;
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
@@ -175,7 +143,7 @@
}
public boolean isSpecializing() {
- return specializes != null;
+ return getDefinition().getSpecializesAnnotation() != null;
}
//same as ProducerField.getScope
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/SessionBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/SessionBean.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/SessionBean.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -0,0 +1,18 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.jboss.tools.cdi.core.ISessionBean;
+
+public class SessionBean extends ClassBean implements ISessionBean {
+
+ public IAnnotation getStatefulDeclaration() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isStateful() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/SessionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -30,33 +30,19 @@
*/
public class StereotypeElement extends CDIElement implements IStereotype {
AnnotationDefinition definition;
- protected AnnotationDeclaration named;
- protected AnnotationDeclaration alternative;
public StereotypeElement() {}
public void setDefinition(AnnotationDefinition definition) {
this.definition = definition;
- setAnnotations(definition.getAnnotations());
}
- protected void setAnnotations(List<AnnotationDeclaration> ds) {
- for (AnnotationDeclaration d: ds) {
- String typeName = d.getTypeName();
- if(CDIConstants.NAMED_QUALIFIER_TYPE_NAME.equals(typeName)) {
- named = d;
- } else if(CDIConstants.ALTERNATIVE_ANNOTATION_TYPE_NAME.equals(typeName)) {
- alternative = d;
- }
- }
- }
-
public AnnotationDeclaration getAlternativeDeclaration() {
- return alternative;
+ return definition.getAlternativeAnnotation();
}
public AnnotationDeclaration getNameDeclaration() {
- return named;
+ return definition.getNamedAnnotation();
}
public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
@@ -71,7 +57,7 @@
}
public IAnnotation getNameLocation() {
- return named != null ? named.getDeclaration() : null;
+ return getNameDeclaration() != null ? getNameDeclaration().getDeclaration() : null;
}
public IType getSourceType() {
@@ -89,7 +75,7 @@
}
public boolean isAlternative() {
- if(alternative != null) return true;
+ if(getAlternativeDeclaration() != null) return true;
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -11,7 +11,9 @@
package org.jboss.tools.cdi.internal.core.impl.definition;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotatable;
@@ -31,8 +33,7 @@
public abstract class AbstractMemberDefinition {
protected List<AnnotationDeclaration> annotations = new ArrayList<AnnotationDeclaration>();
protected IAnnotatable member;
- protected AnnotationDeclaration injectAnnotation;
- protected AnnotationDeclaration producesAnnotation;
+ protected Map<String, AnnotationDeclaration> annotationsByType = new HashMap<String, AnnotationDeclaration>();
public AbstractMemberDefinition() {}
@@ -57,11 +58,7 @@
a = new InterceptorBindingDeclaration(a);
}
annotations.add(a);
- if(CDIConstants.INJECT_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
- injectAnnotation = a;
- } else if(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
- producesAnnotation = a;
- }
+ annotationsByType.put(a.getTypeName(), a);
}
}
@@ -69,16 +66,20 @@
return annotations;
}
- public boolean isCDIAnnotated() {
- return injectAnnotation != null || producesAnnotation != null;
+ public AnnotationDeclaration getNamedAnnotation() {
+ return annotationsByType.get(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
}
- public AnnotationDeclaration getProducesAnnotation() {
- return producesAnnotation;
+ public AnnotationDeclaration getTypedAnnotation() {
+ return annotationsByType.get(CDIConstants.TYPED_ANNOTATION_TYPE_NAME);
}
- public AnnotationDeclaration getInjectAnnotation() {
- return injectAnnotation;
+ public AnnotationDeclaration getAlternativeAnnotation() {
+ return annotationsByType.get(CDIConstants.ALTERNATIVE_ANNOTATION_TYPE_NAME);
}
+ public AnnotationDeclaration getSpecializesAnnotation() {
+ return annotationsByType.get(CDIConstants.SPECIALIZES_ANNOTATION_TYPE_NAME);
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationHelper.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationHelper.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationHelper.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -31,6 +31,9 @@
BASIC_ANNOTATION_TYPES.add(TARGET_ANNOTATION_TYPE_NAME);
BASIC_ANNOTATION_TYPES.add(RETENTION_ANNOTATION_TYPE_NAME);
+ BASIC_ANNOTATION_TYPES.add(STATEFUL_ANNOTATION_TYPE_NAME);
+ BASIC_ANNOTATION_TYPES.add(STATELESS_ANNOTATION_TYPE_NAME);
+
SCOPE_ANNOTATION_TYPES.add(APPLICATION_SCOPED_ANNOTATION_TYPE_NAME);
SCOPE_ANNOTATION_TYPES.add(CONVERSATION_SCOPED_ANNOTATION_TYPE_NAME);
SCOPE_ANNOTATION_TYPES.add(REQUEST_SCOPED_ANNOTATION_TYPE_NAME);
@@ -39,6 +42,7 @@
STEREOTYPE_ANNOTATION_TYPES.add(MODEL_STEREOTYPE_TYPE_NAME);
STEREOTYPE_ANNOTATION_TYPES.add(DECORATOR_STEREOTYPE_TYPE_NAME);
+ STEREOTYPE_ANNOTATION_TYPES.add(DELEGATE_STEREOTYPE_TYPE_NAME);
CDI_ANNOTATION_TYPES.add(QUALIFIER_ANNOTATION_TYPE_NAME);
CDI_ANNOTATION_TYPES.add(NAMED_QUALIFIER_TYPE_NAME);
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -0,0 +1,22 @@
+package org.jboss.tools.cdi.internal.core.impl.definition;
+
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
+
+public class BeanMemberDefinition extends AbstractMemberDefinition {
+
+ public BeanMemberDefinition() {}
+
+ public boolean isCDIAnnotated() {
+ return getInjectAnnotation() != null || getProducesAnnotation() != null;
+ }
+
+ public AnnotationDeclaration getProducesAnnotation() {
+ return annotationsByType.get(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME);
+ }
+
+ public AnnotationDeclaration getInjectAnnotation() {
+ return annotationsByType.get(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -168,7 +168,6 @@
if(underConstruction.contains(name)) {
return AnnotationDefinition.BASIC;
}
- System.out.println(name);
return createAnnotation(annotationType, name);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -11,13 +11,15 @@
package org.jboss.tools.cdi.internal.core.impl.definition;
import org.eclipse.jdt.core.IField;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class FieldDefinition extends AbstractMemberDefinition {
+public class FieldDefinition extends BeanMemberDefinition {
IField field;
public FieldDefinition() {}
@@ -31,4 +33,8 @@
return field;
}
+ public AnnotationDeclaration getDelegateAnnotation() {
+ return annotationsByType.get(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -19,7 +19,7 @@
* @author Viacheslav Kabanovich
*
*/
-public class MethodDefinition extends AbstractMemberDefinition {
+public class MethodDefinition extends BeanMemberDefinition {
IMethod method;
boolean isConstructor;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-15 15:37:35 UTC (rev 19279)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-15 15:42:55 UTC (rev 19280)
@@ -32,6 +32,8 @@
List<MethodDefinition> methods = new ArrayList<MethodDefinition>();
AnnotationDeclaration decoratorAnnotation;
AnnotationDeclaration interceptorAnnotation;
+ AnnotationDeclaration statefulAnnotation;
+ AnnotationDeclaration statelessAnnotation;
public TypeDefinition() {
}
@@ -41,13 +43,8 @@
super.init(contextType, context);
isAbstract = Flags.isAbstract(type.getFlags());
for (AnnotationDeclaration a: annotations) {
- int kind = context.getAnnotationKind(a.getType());
- //TODO do we need to create members for specific annotations?
- if(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME.equals(a.getTypeName())) {
- decoratorAnnotation = a;
- } else if(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
- interceptorAnnotation = a;
- }
+ //provide initialization
+ context.getAnnotationKind(a.getType());
}
IField[] fs = getType().getFields();
for (int i = 0; i < fs.length; i++) {
@@ -80,11 +77,19 @@
}
public AnnotationDeclaration getDecoratorAnnotation() {
- return decoratorAnnotation;
+ return annotationsByType.get(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
}
public AnnotationDeclaration getInterceptorAnnotation() {
- return interceptorAnnotation;
+ return annotationsByType.get(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
}
+ public AnnotationDeclaration getStatefulAnnotation() {
+ return annotationsByType.get(CDIConstants.STATEFUL_ANNOTATION_TYPE_NAME);
+ }
+
+ public AnnotationDeclaration getStatelessAnnotation() {
+ return annotationsByType.get(CDIConstants.STATELESS_ANNOTATION_TYPE_NAME);
+ }
+
}
15 years, 1 month
JBoss Tools SVN: r19279 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-15 10:37:35 -0500 (Tue, 15 Dec 2009)
New Revision: 19279
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF
Log:
Version restriction of org.eclipse.wst.sse.core made softer.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF 2009-12-15 14:35:36 UTC (rev 19278)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF 2009-12-15 15:37:35 UTC (rev 19279)
@@ -16,7 +16,7 @@
org.mozilla.xpcom;bundle-version="1.9.1",
org.jboss.tools.jsf.vpe.jsf;bundle-version="2.1.0",
org.eclipse.jface.text;bundle-version="3.5.0",
- org.eclipse.wst.sse.core;bundle-version="1.1.401"
+ org.eclipse.wst.sse.core;bundle-version="1.1.4"
Bundle-Vendor: %Bundle-Vendor.0
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/antlr.jar,
15 years, 1 month
JBoss Tools SVN: r19278 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-15 09:35:36 -0500 (Tue, 15 Dec 2009)
New Revision: 19278
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularChildren.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularChildren.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularChildren.java 2009-12-15 13:57:19 UTC (rev 19277)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularChildren.java 2009-12-15 14:35:36 UTC (rev 19278)
@@ -99,7 +99,9 @@
public Map<String, XModelObject> getObjectsMap() {
Map<String, XModelObject> result = new HashMap<String, XModelObject>();
if (objects != null) {
- result.putAll(objects.getMap());
+ synchronized(objects) {
+ result.putAll(objects.getMap());
+ }
}
return result;
}
@@ -246,7 +248,9 @@
}
public void put(String key, XModelObject value) {
- entries.put(key, value);
+ synchronized(entries) {
+ entries.put(key, value);
+ }
if(cache != null) {
synchronized(this) {
cache = null;
@@ -264,7 +268,9 @@
}
private XModelObject[] values() {
- return entries.values().toArray(RegularChildren.EMPTY);
+ synchronized(entries) {
+ return entries.values().toArray(RegularChildren.EMPTY);
+ }
}
/**
@@ -291,7 +297,9 @@
}
public void remove(String key) {
- entries.remove(key);
+ synchronized(entries) {
+ entries.remove(key);
+ }
if(cache != null) {
synchronized(this) {
cache = null;
@@ -306,9 +314,11 @@
*/
public int getChildrenCount(String entity) {
int k = 0;
- for (XModelObject r : entries.values()) {
- String e = r.getModelEntity().getName();
- if (entity.equals(e)) ++k;
+ synchronized(entries) {
+ for (XModelObject r : entries.values()) {
+ String e = r.getModelEntity().getName();
+ if (entity.equals(e)) ++k;
+ }
}
return k;
}
15 years, 1 month
JBoss Tools SVN: r19277 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-12-15 08:57:19 -0500 (Tue, 15 Dec 2009)
New Revision: 19277
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5241 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-12-15 13:07:54 UTC (rev 19276)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-12-15 13:57:19 UTC (rev 19277)
@@ -195,6 +195,7 @@
NewConfigurationWizardPage_session_factory_name=&Session factory name:
NewConfigurationWizardPage_this_wizard_creates=This wizard creates a new configuration file to use with Hibernate.
NewConfigurationWizardPage_user_name=User&name:
+NewHibernateMappingElementsSelectionPage_select=Select compilation units or containers.
NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file=Create Hibernate Reverse Engineering file (reveng.xml)
NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml=Create a new hibernate.reveng.xml.
15 years, 1 month
JBoss Tools SVN: r19276 - trunk/vpe/plugins/org.jboss.tools.vpe.html/templates.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-12-15 08:07:54 -0500 (Tue, 15 Dec 2009)
New Revision: 19276
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
Log:
minor change: now BODY tag can be container for D&D in the VPE
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2009-12-15 13:00:07 UTC (rev 19275)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2009-12-15 13:07:54 UTC (rev 19276)
@@ -297,8 +297,8 @@
<vpe:height height-attr="style.height" />
</vpe:resize>
<vpe:dnd>
- <vpe:drag start-enable="yes" />
- <vpe:drop container="no"></vpe:drop>
+ <vpe:drag start-enable="no" />
+ <vpe:drop container="yes"></vpe:drop>
</vpe:dnd>
</vpe:template>
</vpe:tag>
15 years, 1 month
JBoss Tools SVN: r19275 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-12-15 08:00:07 -0500 (Tue, 15 Dec 2009)
New Revision: 19275
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5460 fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-12-15 12:42:13 UTC (rev 19274)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-12-15 13:00:07 UTC (rev 19275)
@@ -46,6 +46,7 @@
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
@@ -155,7 +156,7 @@
if (!project.exists() || !project.isOpen()) return false;
for (int i = 0; i < JSF_PROJECT_NATURES.length; i++) {
- if (project.getNature(JSF_PROJECT_NATURES[i]) != null)
+ if (project.hasNature(JSF_PROJECT_NATURES[i]))
return true;
}
} catch (CoreException e) {
15 years, 1 month
JBoss Tools SVN: r19274 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-12-15 07:42:13 -0500 (Tue, 15 Dec 2009)
New Revision: 19274
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputScriptTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5382/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5382/OpenOnJsf20.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnJsf20Test_JBIDE5382.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
Log:
issue JBIDE-5382: add openOn action for name param for h:outputStylesheet, h:outputScript jsf 2.0 tags.
https://jira.jboss.org/jira/browse/JBIDE-5382
- added support of openOn for source nodes
- added support of openOn for visual nodes
- created JUnit tests for this functionality
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/plugin.xml 2009-12-15 11:37:27 UTC (rev 19273)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/plugin.xml 2009-12-15 12:42:13 UTC (rev 19274)
@@ -407,9 +407,17 @@
class="org.jboss.tools.jsf.text.ext.hyperlink.JSFJSPLinkHyperlinkPartitioner">
<contentType id="org.eclipse.jst.jsp.core.jspsource">
<partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_LINK" />
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://java.sun.com/jsf/html]:outputStylesheet/name/" />
+ <axis path="*/[http://java.sun.com/jsf/html]:outputScript/name/" />
+ </partitionType>
</contentType>
<contentType id="org.eclipse.wst.html.core.htmlsource">
<partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_LINK" />
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://java.sun.com/jsf/html]:outputStylesheet/name/" />
+ <axis path="*/[http://java.sun.com/jsf/html]:outputScript/name/" />
+ </partitionType>
</contentType>
</hyperlinkPartitioner>
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputScriptTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputScriptTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputScriptTemplate.java 2009-12-15 12:42:13 UTC (rev 19274)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.template;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+/**
+ * Template for h:outputScript .
+ *
+ * @author yradtsevich
+ */
+public class JsfOutputScriptTemplate extends VpeAbstractTemplate {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ // invisible tag
+ return new VpeCreationData(null);
+ }
+
+ @Override
+ public IRegion getSourceRegionForOpenOn(VpePageContext pageContext,
+ Node sourceNode, nsIDOMNode domNode) {
+ IRegion region = null;
+ Node node = sourceNode.getAttributes().getNamedItem(JSF.ATTR_NAME);
+ if (node != null) {
+ region = new Region(NodesManagingUtil.getStartOffsetNode(node),
+ NodesManagingUtil.getNodeLength(node));
+ }
+ return region;
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-12-15 11:37:27 UTC (rev 19273)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-12-15 12:42:13 UTC (rev 19274)
@@ -901,19 +901,23 @@
becouse it's not specified correctly in jsf lib, mareshkau -->
<!-- <vpe:if test="tld_version('min=2.0')"> -->
- <vpe:template children="no" modify="no"/>
+ <vpe:template children="no" modify="no"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputScriptTemplate"/>
<!-- </vpe:if> -->
</vpe:tag>
<!--
Tag h:outputStylesheet can have any of next attributes: name, library, target.
Value of target could be either 'head' or 'body'.
- Mojarra 2.0 EDR1 implementation of JSF 2.0 links a stylesheet as follows:
+ Mojarra 2.0 EDR1 implementation of JSF 2.0 links a stylesheet as follows:
<link type="text/css" rel="stylesheet"
href="{facesContext.getApplication().getResourceHandler().createResource(name, library).getRequestPath()}"/>
+
+ NOTE: See VpeHtmlTemplate.getSourceRegionForOpenOn(...)
+ for OpenOn implementation.
-->
<vpe:tag name="h:outputStylesheet" case-sensitive="yes">
- <!-- Checks for min tld version has been comented,
+ <!-- Checks for min tld version has been comented,
becouse it's not specified correctly in jsf lib, mareshkau -->
<!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="no" modify="no">
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-15 11:37:27 UTC (rev 19273)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-15 12:42:13 UTC (rev 19274)
@@ -55,29 +55,11 @@
Node sourceNode, String parentName) {
Node parentNode = sourceNode.getParentNode();
+ VpeTemplateManager templateManager = VpeTemplateManager.getInstance();
while (parentNode != null) {
- String parentSourcePrefix = parentNode.getPrefix();
- if (parentSourcePrefix == null) {
- parentSourcePrefix = ""; //$NON-NLS-1$
- }
- List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
- pageContext);
- TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
- parentSourcePrefix, taglibs);
-
- String parentNodeName = parentNode.getNodeName();
- if (sourceNodeTaglib != null) {
- String sourceNodeUri = sourceNodeTaglib.getUri();
- String templateTaglibPrefix = VpeTemplateManager.getInstance()
- .getTemplateTaglibPrefix(sourceNodeUri);
-
- if (templateTaglibPrefix != null) {
- parentNodeName = templateTaglibPrefix
- + ":" + parentNode.getLocalName(); //$NON-NLS-1$
- }
- }
- if (parentNodeName.equals(parentName)) {
+ if (parentName.equals(
+ templateManager.getTemplateName(pageContext, parentNode))) {
return parentNode;
}
parentNode = parentNode.getParentNode();
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5382/OpenOnJsf20.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5382/OpenOnJsf20.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5382/OpenOnJsf20.xhtml 2009-12-15 12:42:13 UTC (rev 19274)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html">
+<h:head />
+<h:body>
+ <h:outputScript name="/resources/scripts/f1.js" id="outputScript1"/>
+ <h:outputStylesheet name="/resources/css/stylesRed.css" id="outputStylesheet1"/>
+ <h:outputStylesheet name="/resources/css/stylesBlue.css" id="outputStylesheetBlue"/>
+ <span>Blue text</span>
+</h:body>
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-15 11:37:27 UTC (rev 19273)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-15 12:42:13 UTC (rev 19274)
@@ -67,6 +67,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4509Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4510Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4534Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnJsf20Test_JBIDE5382;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestFViewLocaleAttribute_JBIDE5218;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
@@ -110,6 +111,7 @@
// $JUnit-BEGIN$
suite.addTestSuite(TestForUsingComponentsLibrariesWithDefaultNamespace.class);
suite.addTestSuite(EditingSPecialSymbolsVPE_JBIDE3810.class);
+ suite.addTestSuite(OpenOnJsf20Test_JBIDE5382.class);
suite.addTestSuite(MozDirtyTest_JBIDE5105.class);
suite.addTestSuite(VpeI18nTest_JBIDE4887.class);
suite.addTestSuite(JsfComponentTest.class);
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnJsf20Test_JBIDE5382.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnJsf20Test_JBIDE5382.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnJsf20Test_JBIDE5382.java 2009-12-15 12:42:13 UTC (rev 19274)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
+import org.jboss.tools.vpe.ui.test.OpenOnUtil;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Tests for the OpenOn actions in JSF 2.0 projects.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class OpenOnJsf20Test_JBIDE5382 extends VpeTest {
+ private static final String OUTPUT_STYLESHEET_ELEMENT_ID
+ = "outputStylesheet1"; //$NON-NLS-1$
+ private static final String OUTPUT_SCRIPT_ELEMENT_ID
+ = "outputScript1"; //$NON-NLS-1$
+ private static final String SCRIPT_FILE_NAME = "f1.js"; //$NON-NLS-1$
+ private static final String STYLESHEET_FILE_NAME
+ = "stylesRed.css"; //$NON-NLS-1$
+ private static final String TEST_FILE_PATH
+ = "JBIDE/5382/OpenOnJsf20.xhtml"; //$NON-NLS-1$
+ private VpeController vpeController;
+ private Document sourceDocument;
+
+ public OpenOnJsf20Test_JBIDE5382(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ vpeController = openInVpe(JsfAllTests.IMPORT_JSF_20_PROJECT_NAME,
+ TEST_FILE_PATH);
+ sourceDocument = getSourceDocument(vpeController);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // JUNIT TESTING METHODS
+
+ public void testSourceOpenOnOutputStylesheet() throws Throwable {
+ openOnSourceNode(getOutputStylesheetNode()
+ .getAttributeNode(JSF.ATTR_NAME));
+ assertActiveEditorInputNameEquals(STYLESHEET_FILE_NAME);
+ }
+
+ public void testSourceOpenOnOutputScript() throws Throwable {
+ openOnSourceNode(getOutputScriptNode().getAttributeNode(JSF.ATTR_NAME));
+ assertActiveEditorInputNameEquals(SCRIPT_FILE_NAME);
+ }
+
+ public void testVisualOpenOnOutputStylesheet() {
+ showInvisibleTags();
+ openOnCorrespondingVisualNode(getOutputStylesheetNode());
+ assertActiveEditorInputNameEquals(STYLESHEET_FILE_NAME);
+ }
+
+ public void testVisualOpenOnOutputScript() {
+ showInvisibleTags();
+ openOnCorrespondingVisualNode(getOutputScriptNode());
+ assertActiveEditorInputNameEquals(SCRIPT_FILE_NAME);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PRIVATE METHODS
+
+ private Element getOutputScriptNode() {
+ return sourceDocument.getElementById(OUTPUT_SCRIPT_ELEMENT_ID);
+ }
+
+ private Element getOutputStylesheetNode() {
+ return sourceDocument.getElementById(OUTPUT_STYLESHEET_ELEMENT_ID);
+ }
+
+ private void openOnSourceNode(Node sourceNode) throws Throwable {
+ int offset = NodesManagingUtil.getStartOffsetNode(sourceNode);
+ OpenOnUtil.performOpenOnAction(vpeController.getSourceEditor(), offset);
+ }
+
+ private void openOnCorrespondingVisualNode(Node sourceNode) {
+ nsIDOMNode visualNode = vpeController.getDomMapping()
+ .getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(visualNode);
+ }
+
+ private void showInvisibleTags() {
+ vpeController.getVisualBuilder().setShowInvisibleTags(true);
+ vpeController.visualRefresh();
+ TestUtil.waitForIdle();
+ }
+
+ private void assertActiveEditorInputNameEquals(String expectedName) {
+ IEditorPart activeEditorPart = (IEditorPart) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getActivePart();
+ String actualName = activeEditorPart.getEditorInput().getName();
+
+ assertEquals("No file is opened or a wrong file " //$NON-NLS-1$
+ + "is opened on the OpenOn action .", //$NON-NLS-1$
+ expectedName, actualName);
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2009-12-15 11:37:27 UTC (rev 19273)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2009-12-15 12:42:13 UTC (rev 19274)
@@ -554,16 +554,23 @@
public IRegion getSourceRegionForOpenOn(VpePageContext pageContext,
Node sourceNode, nsIDOMNode domNode) {
if(sourceNode != null && sourceNode instanceof Element) {
+ Element sourceElement = (Element) sourceNode;
+ String templateName = VpeTemplateManager.getInstance()
+ .getTemplateName(pageContext, sourceElement);
+
Attr file = null;
- if ("jsp:directive.include".equals(sourceNode.getNodeName())) { //$NON-NLS-1$
- file = ((Element)sourceNode).getAttributeNode("file"); //$NON-NLS-1$
- } else if ("jsp:include".equals(sourceNode.getNodeName())) { //$NON-NLS-1$
- file = ((Element)sourceNode).getAttributeNode("page"); //$NON-NLS-1$
- } else if(HTML.TAG_A.equalsIgnoreCase(sourceNode.getNodeName())) {
- file = ((Element)sourceNode).getAttributeNode(HTML.ATTR_HREF);
+ if ("jsp:directive.include".equals(templateName)) { //$NON-NLS-1$
+ file = sourceElement.getAttributeNode("file"); //$NON-NLS-1$
+ } else if ("jsp:include".equals(templateName)) { //$NON-NLS-1$
+ file = sourceElement.getAttributeNode("page"); //$NON-NLS-1$
+ } else if (HTML.TAG_A.equalsIgnoreCase(templateName)) {
+ file = sourceElement.getAttributeNode(HTML.ATTR_HREF);
+ } else if ("h:outputStylesheet".equals(templateName)) { //$NON-NLS-1$
+ file = sourceElement.getAttributeNode("name"); //$NON-NLS-1$
}
- if(file!=null) {
- return new Region(NodesManagingUtil.getStartOffsetNode(file),0);
+
+ if(file != null) {
+ return new Region(NodesManagingUtil.getStartOffsetNode(file), 0);
}
}
return null;
15 years, 1 month
JBoss Tools SVN: r19273 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-15 06:37:27 -0500 (Tue, 15 Dec 2009)
New Revision: 19273
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5467
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-12-15 11:08:41 UTC (rev 19272)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-12-15 11:37:27 UTC (rev 19273)
@@ -30,6 +30,7 @@
@Override
protected void init(IPageContext context) {
provider = WebPromptingProvider.getInstance();
+ xModel = null;
IModelNature nature = EclipseResourceUtil.getModelNature(context.getResource().getProject());
if(nature!=null) {
xModel = nature.getModel();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-12-15 11:08:41 UTC (rev 19272)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-12-15 11:37:27 UTC (rev 19273)
@@ -63,6 +63,7 @@
@Override
protected void init(IPageContext context) {
super.init(context);
+ webRootResource = null;
if(xModel != null) {
XModelObject webInf = FileSystemsHelper.getWebInf(xModel);
XModelObject webRoot = FileSystemsHelper.getWebRoot(xModel);
15 years, 1 month
JBoss Tools SVN: r19272 - in branches/jbosstools-3.1.0.RC1/hibernatetools/plugins: org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-15 06:08:41 -0500 (Tue, 15 Dec 2009)
New Revision: 19272
Modified:
branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5403
Modified: branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-12-15 09:37:55 UTC (rev 19271)
+++ branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-12-15 11:08:41 UTC (rev 19272)
@@ -224,7 +224,7 @@
return button;
}
- private void handleButtonPressed(Button button) {
+ protected void handleButtonPressed(Button button) {
if (button == removeButton) {
handleRemove();
} else if (button == upButton) {
Modified: branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-12-15 09:37:55 UTC (rev 19271)
+++ branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-12-15 11:08:41 UTC (rev 19272)
@@ -15,6 +15,7 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
@@ -25,7 +26,7 @@
*/
public class NewHibernateMappingElementsSelectionPage2 extends WizardPage {
- AddRemoveTableComposite addRemoveTableComposite;
+ private AddRemoveTableComposite addRemoveTableComposite;
private IStructuredSelection selection;
@@ -36,7 +37,13 @@
}
public void createControl(Composite parent) {
- addRemoveTableComposite = new AddRemoveTableComposite(parent, SWT.NONE);
+ addRemoveTableComposite = new AddRemoveTableComposite(parent, SWT.NONE){
+ @Override
+ protected void handleButtonPressed(Button button) {
+ super.handleButtonPressed(button);
+ itemsChanged();
+ }
+ };
addRemoveTableComposite.getTableViewer().setInput(selection.toArray());
setControl(addRemoveTableComposite);
}
@@ -49,5 +56,9 @@
}
return new StructuredSelection(data);
}
+
+ protected void itemsChanged(){
+ getContainer().updateButtons();
+ }
}
Modified: branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-12-15 09:37:55 UTC (rev 19271)
+++ branches/jbosstools-3.1.0.RC1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-12-15 11:08:41 UTC (rev 19272)
@@ -427,5 +427,10 @@
HibernateConsolePlugin.getDefault().log(e);
}
}
+ }
+
+ @Override
+ public boolean canFinish() {
+ return !page0.getSelection().isEmpty() || cPage.isPageComplete();
}
}
15 years, 1 month