JBoss Tools SVN: r34075 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-18 18:30:04 -0400 (Thu, 18 Aug 2011)
New Revision: 34075
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIElement.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/CDIElement.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/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-9564
https://issues.jboss.org/browse/JBIDE-9564
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIElement.java 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIElement.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -48,4 +48,12 @@
* @return resource
*/
IResource getResource();
+
+ /**
+ * Returns true while declarations of this object exist and can be found in sources
+ * by stored handles.
+ *
+ * @return
+ */
+ boolean exists();
}
\ 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 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -56,6 +56,11 @@
public AbstractBeanElement() {}
+ @Override
+ public boolean exists() {
+ return getDefinition().exists();
+ }
+
public void setDefinition(AbstractMemberDefinition definition) {
this.definition = definition;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -31,10 +31,12 @@
protected CDIElement parent;
protected IPath source;
+ @Override
public CDIProject getCDIProject() {
return parent != null ? parent.getCDIProject() : null;
}
+ @Override
public ICDIProject getDeclaringProject() {
return parent != null ? parent.getDeclaringProject() : null;
}
@@ -62,6 +64,7 @@
return parent;
}
+ @Override
public IResource getResource() {
IPath path = getSourcePath();
if(path == null) return null;
@@ -70,6 +73,7 @@
return r;
}
+ @Override
public IPath getSourcePath() {
return source != null ? source : parent != null ? parent.getSourcePath() : null;
}
@@ -78,4 +82,8 @@
this.source = source;
}
+ @Override
+ public boolean exists() {
+ return parent != null && parent.exists();
+ }
}
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 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -104,14 +104,21 @@
public CDIProject() {}
+ @Override
public CDICoreNature getNature() {
return n;
}
+ @Override
public void setNature(CDICoreNature n) {
this.n = n;
}
+ @Override
+ public boolean exists() {
+ return n != null && n.getProject() != null && n.getProject().isAccessible();
+ }
+
/*
* (non-Javadoc)
* @see org.jboss.tools.cdi.core.IBeanManager#getBeans()
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 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -66,6 +66,12 @@
public ClassBean() {}
+ @Override
+ public boolean exists() {
+ IType t = getBeanClass();
+ return t != null && t.exists();
+ }
+
public void setDefinition(TypeDefinition definition) {
setSourcePath(definition.getType().getPath());
super.setDefinition(definition);
@@ -132,7 +138,6 @@
return result;
}
-
public Set<IBeanMethod> getBeanConstructors() {
Set<IBeanMethod> result = new HashSet<IBeanMethod>();
IBeanMethod defaultConstructor = null;
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 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -232,4 +232,8 @@
public ITextSourceReference getOriginalDefinition() {
return originalDefinition;
}
+
+ public boolean exists() {
+ return member instanceof IJavaElement && ((IJavaElement)member).exists();
+ }
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-18 21:49:57 UTC (rev 34074)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-18 22:30:04 UTC (rev 34075)
@@ -507,7 +507,7 @@
if (reporter.isCancelled()) {
return;
}
- if(!shouldValidateType(bean.getBeanClass())) {
+ if(!bean.exists() || !shouldValidateType(bean.getBeanClass())) {
return;
}
String beanPath = bean.getResource().getFullPath().toOSString();
@@ -541,7 +541,9 @@
if(type!=null && !type.isBinary()) {
getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, type.getPath(), false);
}
- validateInjectionPoint(point);
+ if(point.exists()) {
+ validateInjectionPoint(point);
+ }
}
if (bean instanceof IInterceptor) {
@@ -965,7 +967,7 @@
Set<IBeanMethod> boundDisposers = new HashSet<IBeanMethod>();
Set<IProducer> producers = bean.getProducers();
for (IProducer producer : producers) {
- if (producer instanceof IProducerMethod) {
+ if (producer instanceof IProducerMethod && producer.exists()) {
IProducerMethod producerMethod = (IProducerMethod) producer;
Set<IBeanMethod> disposerMethods = producer.getCDIProject().resolveDisposers(producerMethod);
boundDisposers.addAll(disposerMethods);
@@ -985,6 +987,9 @@
}
for (IBeanMethod disposer : disposers) {
+ if(!disposer.exists()) {
+ continue;
+ }
List<IParameter> params = disposer.getParameters();
/*
@@ -994,7 +999,7 @@
Set<ITextSourceReference> disposerDeclarations = new HashSet<ITextSourceReference>();
for (IParameter param : params) {
ITextSourceReference declaration = param.getAnnotationPosition(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
- if (declaration != null) {
+ if (declaration != null && param.exists()) {
disposerDeclarations.add(declaration);
}
}
@@ -1016,7 +1021,7 @@
declarations.addAll(disposerDeclarations);
for (IParameter param : params) {
ITextSourceReference declaration = param.getAnnotationPosition(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
- if (declaration != null) {
+ if (declaration != null && param.exists()) {
declarations.add(declaration);
observesExists = true;
}
14 years, 8 months
JBoss Tools SVN: r34074 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-08-18 17:49:57 -0400 (Thu, 18 Aug 2011)
New Revision: 34074
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
Log:
https://issues.jboss.org/browse/JBIDE-7636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java 2011-08-18 21:08:56 UTC (rev 34073)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java 2011-08-18 21:49:57 UTC (rev 34074)
@@ -76,7 +76,7 @@
IJavaElement element = cu.getElementAt(offset);
if(element != null){
if(element instanceof IField){
- IAnnotation annotation = MarkerResolutionUtils.getAnnotation(element, RESOURCE_ANNOTATION);
+ IAnnotation annotation = MarkerResolutionUtils.findAnnotation(element, RESOURCE_ANNOTATION);
if(annotation != null && annotation.exists()){
IRegion annotationRegion = getAnnotationRegion(document, annotation);
String text = getValue(annotation);
14 years, 8 months
JBoss Tools SVN: r34073 - in branches/jbosstools-3.2.x/ws/docs/reference/en-US: images/topdown and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-18 17:08:56 -0400 (Thu, 18 Aug 2011)
New Revision: 34073
Modified:
branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml
branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_ws_creation2.png
branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml
Log:
updated to revert TOOLSDOC-189 for JBDS 4.1
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml 2011-08-18 20:57:43 UTC (rev 34072)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml 2011-08-18 21:08:56 UTC (rev 34073)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>10</pubsnumber>
+ <pubsnumber>11</pubsnumber>
<abstract>
<para>The JBoss Web Services User Guide explains how to use the JBoss Web Services module to implement web services in Java.</para>
</abstract>
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_ws_creation2.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml 2011-08-18 20:57:43 UTC (rev 34072)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml 2011-08-18 21:08:56 UTC (rev 34073)
@@ -304,60 +304,9 @@
</mediaobject>
</figure>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis> <property>WSDL Service</property> </emphasis> : display the services in your WSDL file, you can select one to generate Web Service.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Source Folder</property> </emphasis> : display the source codes folder in your web project, you can select one to generate java codes.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Package name</property> </emphasis> : input a package name. You can click the Browse button to choose one. If you don't input a package name, system will generate one for you.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>JAX-WS specificaiton</property> </emphasis> : display the supported JAX-WS version, include, 2.0, 2.1, 2.2
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Catalog file</property> </emphasis> : specify a catalog file.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Binding files</property> </emphasis> : specify some binding files that are used by your WSDL file
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Enable binding extension support (Only available for JBossWS 3.0 or later)</property> </emphasis> : select it if you need the binding extension support. Only work based on JBossWS 3.0 or later.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Generate default Web Service implementation classes</property> </emphasis> : select it if you want to generate empty implementation classes for the selected WSDL Service.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Update the default Web.xml</property> </emphasis> : update the Web.xml file with your Web Service servlets configured.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis> <property>Additional Options</property> </emphasis> : the senior options for the generating process. Only for the senior user.
- </para>
- </listitem>
- </itemizedlist>
+
<para>
- Click on the <emphasis> <property>Next</property> </emphasis> or on the <emphasis> <property>Finish</property> </emphasis> button to generate code.
+ On this page, the default package name comes from the namespace of the WSDL document, you also can change it to any valid package name you want. JAX-WS specification should be set to 2.0 if your JBossWS runtime in JBoss Server is JBossWS native runtime. You can specify a catalog file and binding files if you have them. If you want the wizard to generate empty implementation classes for the Web Service, check the <guilabel>Generate default Web Service implementation classes</guilabel> check box. If you want to update the default <filename>Web.xml</filename> file with the Web Service servlets configured, check the <guilabel>Update the default Web.xml</guilabel> check box. Click on the <guibutton>Next</guibutton> or on the <guibutton>Finish</guibutton> button to generate code.
</para>
<para>
14 years, 8 months
JBoss Tools SVN: r34072 - in branches/jbosstools-3.2.x/ws/docs/reference/en-US/images: topdown and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-18 16:57:43 -0400 (Thu, 18 Aug 2011)
New Revision: 34072
Modified:
branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/preference/Jbossws_preference.png
branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/preference/Jbossws_preference_new.png
branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_facet.png
branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_newruntime.png
Log:
replacing new images with old as part of reversion for TOOLSDOC-193 for JBDS 4.1
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/preference/Jbossws_preference.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/preference/Jbossws_preference_new.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_facet.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/images/topdown/jbossws_newruntime.png
===================================================================
(Binary files differ)
14 years, 8 months
JBoss Tools SVN: r34071 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-08-18 16:43:39 -0400 (Thu, 18 Aug 2011)
New Revision: 34071
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotype.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-08-18 19:34:52 UTC (rev 34070)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -677,7 +677,7 @@
private boolean isMethodExists(IType interfaceType, IMethod method){
IMethod existingMethod = interfaceType.getMethod(method.getElementName(), method.getParameterTypes());
- if(existingMethod != null && existingMethod.exists())
+ if(existingMethod.exists())
return true;
return false;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-08-18 19:34:52 UTC (rev 34070)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -174,7 +174,7 @@
IMember workingCopyMember = (IMember) workingCopyElement;
- IAnnotation annotation = getAnnotation(workingCopyMember, qualifiedName);
+ IAnnotation annotation = findAnnotation(workingCopyMember, qualifiedName);
if(annotation != null && annotation.exists())
return;
@@ -204,7 +204,7 @@
public static void addQualifier(String qualifiedName, ICompilationUnit compilationUnit, IJavaElement element) throws JavaModelException{
if(!(element instanceof ISourceReference))
return;
- IAnnotation annotation = getAnnotation(element, qualifiedName);
+ IAnnotation annotation = findAnnotation(element, qualifiedName);
if(annotation != null && annotation.exists())
return;
@@ -218,7 +218,7 @@
if(duplicateShortName)
shortName = qualifiedName;
- annotation = getAnnotation(element, CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
+ annotation = findAnnotation(element, CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
if(annotation != null && annotation.exists())
buffer.replace(annotation.getSourceRange().getOffset()+annotation.getSourceRange().getLength(), 0, lineDelim+AT+shortName);
else
@@ -257,11 +257,11 @@
return list;
}
- public static IAnnotation getAnnotation(IJavaElement element, String qualifiedName){
+ public static IAnnotation findAnnotation(IJavaElement element, String qualifiedName){
if(element instanceof IAnnotatable){
String name = getShortName(qualifiedName);
IAnnotation annotation = ((IAnnotatable)element).getAnnotation(qualifiedName);
- if (annotation == null || !annotation.exists()) {
+ if (!annotation.exists()) {
annotation = ((IAnnotatable)element).getAnnotation(name);
}
IType type=null;
@@ -294,10 +294,10 @@
String fullName = qualifier.getSourceType().getFullyQualifiedName();
String shortName = getShortName(fullName);
IAnnotation annotation = ((IAnnotatable)element).getAnnotation(fullName);
- if(annotation == null || !annotation.exists()){
+ if(!annotation.exists()){
annotation = ((IAnnotatable)element).getAnnotation(shortName);
}
- if(annotation != null && annotation.exists()){
+ if(annotation.exists()){
IBuffer buffer = compilationUnit.getBuffer();
buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), "");
@@ -538,7 +538,7 @@
if(workingCopyElement == null)
return;
- IAnnotation annotation = getAnnotation(workingCopyElement, qualifiedName);
+ IAnnotation annotation = findAnnotation(workingCopyElement, qualifiedName);
if(annotation != null){
IBuffer buffer = compilationUnit.getBuffer();
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotype.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotype.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotype.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@Inherited
+@Named
+@interface NamedStereotype {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotype.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+@Decorator
+@NamedStereotype
+public class NamedStereotypedDecoratorBroken {
+
+ @Inject @Delegate @Any Object logger;
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.interceptor.Interceptor;
+import javax.interceptor.InterceptorBinding;
+
+@Interceptor
+@NamedStereotype
+public class NamedStereotypedInterceptorBroken {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-08-18 19:34:52 UTC (rev 34070)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -768,6 +768,18 @@
DeleteAnnotationMarkerResolution.class);
}
+ public void testNamedStereotypedInterceptorResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NamedStereotypedInterceptorBroken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NamedStereotype.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.INTERCEPTOR_HAS_NAME_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
public void testNamedInDecoratorResolution() throws CoreException{
checkResolution(tckProject,
new String[]{
@@ -782,6 +794,18 @@
DeleteAnnotationMarkerResolution.class);
}
+ public void testNamedStereotypedDecoratorResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NamedStereotypedDecoratorBroken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NamedStereotype.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.DECORATOR_HAS_NAME_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
public void testTypedInStereotypeResolution() throws CoreException{
checkResolution(tckProject,
new String[]{
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-08-18 19:34:52 UTC (rev 34070)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-08-18 20:43:39 UTC (rev 34071)
@@ -182,6 +182,7 @@
matches.add(new MatchStructure(InjectionPointField.class, "FieldInjectionPointBean.injectedBean"));
matches.add(new MatchStructure(InjectionPointField.class, "NamedDecoratorBroken.logger"));
matches.add(new MatchStructure(InjectionPointField.class, "NamedStereotypedDecoratorBroken.logger"));
+ matches.add(new MatchStructure(InjectionPointField.class, "NamedStereotypedDecoratorBroken.logger"));
matches.add(new MatchStructure(InjectionPointField.class, "TransientFieldInjectionPointBean.injectedBean"));
matches.add(new MatchStructure(InjectionPointField.class, "SpecializingDecoratorBroken.logger"));
matches.add(new MatchStructure(InjectionPointField.class, "ObserverMethodInDecoratorBroken.logger"));
14 years, 8 months
JBoss Tools SVN: r34070 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-18 15:34:52 -0400 (Thu, 18 Aug 2011)
New Revision: 34070
Modified:
trunk/build/publish.sh
Log:
remove commented location because can't have -- inside a comment
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2011-08-18 18:40:36 UTC (rev 34069)
+++ trunk/build/publish.sh 2011-08-18 19:34:52 UTC (rev 34070)
@@ -362,12 +362,12 @@
<?compositeArtifactRepository version='1.0.0'?>
<repository name='JBoss Tools Staging - ${JOB_NAME} Composite' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'> " > ${STAGINGDIR}/all/compositeArtifacts.xml
metadata="<properties size='2'><property name='p2.compressed' value='true'/><property name='p2.timestamp' value='"${now}"'/></properties>
-<children size='3'>
+<children size='2'>
<child location='../../../staging/${JOB_NAME}/all/repo/'/>
<child location='../../../staging.previous/${JOB_NAME}/all/repo/'/>
-<!-- <child location='../../../staging.previous/${JOB_NAME}.2/all/repo/'/> -->
</children>
-</repository>"
+</repository>
+"
echo $metadata >> ${STAGINGDIR}/all/compositeContent.xml
echo $metadata >> ${STAGINGDIR}/all/compositeArtifacts.xml
date; rsync -arzq ${STAGINGDIR}/all/composite*.xml $DESTINATION/builds/staging/${JOB_NAME}/all/
14 years, 8 months
JBoss Tools SVN: r34069 - trunk/jst/features/org.jboss.tools.jst.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-08-18 14:40:36 -0400 (Thu, 18 Aug 2011)
New Revision: 34069
Modified:
trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
Log:
https://issues.jboss.org/browse/JBIDE-9397
Modified: trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
===================================================================
--- trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2011-08-18 18:07:19 UTC (rev 34068)
+++ trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2011-08-18 18:40:36 UTC (rev 34069)
@@ -73,4 +73,16 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.jboss.tools.jst.web.tiles"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.tiles.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
14 years, 8 months
JBoss Tools SVN: r34068 - trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-18 14:07:19 -0400 (Thu, 18 Aug 2011)
New Revision: 34068
Modified:
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLTestSetup.java
Log:
test code cleanup
Modified: trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2011-08-18 17:37:47 UTC (rev 34067)
+++ trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2011-08-18 18:07:19 UTC (rev 34068)
@@ -25,31 +25,17 @@
public class SeamXMLModelTest extends TestCase {
IProject project = null;
- public IProject getTestProject() {
- if(project==null) {
- try {
- project = findTestProject();
- assertNotNull("Project Test is not found.", project);
- assertTrue("Project Test is not accessible.", project.isAccessible());
- } catch (Exception e) {
- e.printStackTrace();
- fail("Can't import Seam XML test project: " + e.getMessage());
- }
- }
- return project;
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("Test");
}
- public static IProject findTestProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject("Test");
- }
-
/**
* This test is to check different cases of declaring components in xml.
* It does not check interaction of xml declaration with other declarations.
*/
public void testXMLModel() {
- IFile f = getTestProject().getFile(new Path("components22.xml"));
- assertNotNull("File components22.xml is not found in Test project.", f);
+ IFile f = project.getFile(new Path("components22.xml"));
assertTrue("File components22.xml is not accessible in Test project.", f.isAccessible());
XModelObject fileObject = EclipseResourceUtil.createObjectForResource(f);
@@ -68,16 +54,13 @@
}
protected XModelObject getComponents22Object() {
- assertNotNull(getTestProject());
- IFile f = getTestProject().getFile(new Path("components22.xml"));
- assertNotNull(f);
+ IFile f = project.getFile(new Path("components22.xml"));
assertTrue(f.exists());
return EclipseResourceUtil.createObjectForResource(f);
}
protected XModelObject getComponent22Object() {
- assertNotNull(getTestProject());
- IFile f = getTestProject().getFile(new Path("XYZ.component.xml"));
+ IFile f = project.getFile(new Path("XYZ.component.xml"));
assertNotNull(f);
assertTrue(f.exists());
return EclipseResourceUtil.createObjectForResource(f);
Modified: trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLTestSetup.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLTestSetup.java 2011-08-18 17:37:47 UTC (rev 34067)
+++ trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLTestSetup.java 2011-08-18 18:07:19 UTC (rev 34068)
@@ -33,8 +33,6 @@
protected void setUp() throws Exception {
project = ResourcesUtils.importProject(
"org.jboss.tools.seam.xml.test","/projects/Test" , new NullProgressMonitor());
-// project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-// EditorTestHelper.joinBackgroundActivities();
JobUtils.waitForIdle();
}
14 years, 8 months
JBoss Tools SVN: r34067 - trunk/forge/plugins/org.jboss.tools.forge.runtime.ext.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-08-18 13:37:47 -0400 (Thu, 18 Aug 2011)
New Revision: 34067
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties
Log:
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties 2011-08-18 17:31:09 UTC (rev 34066)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties 2011-08-18 17:37:47 UTC (rev 34067)
@@ -1,5 +1,5 @@
+source.. = .
+output.. = .
bin.includes = META-INF/,\
- modules/
-source../bin/ = src/
-output../bin/ = bin/
-jars.compile.order = ./bin/
+ modules/,\
+ .
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r34066 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-08-18 13:31:09 -0400 (Thu, 18 Aug 2011)
New Revision: 34066
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFacesAdapterFactory.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCollapsibleSubTableTogglerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToggleControlTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateSafeWrapper.java
Log:
https://issues.jboss.org/browse/JBIDE-9555 , IAdaptable was added to VpeTemplateSafeWrapper in order to enable toggling.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/plugin.xml 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/plugin.xml 2011-08-18 17:31:09 UTC (rev 34066)
@@ -5,7 +5,7 @@
point="org.jboss.tools.vpe.templates">
<templates
decsription="VPE Templates for RichFaces components"
- name="ajax4jsf"
+ name="richfaces"
path="templates/vpe-templates-richfaces.xml"/>
</extension>
@@ -15,4 +15,14 @@
resource="org/jboss/tools/jsf/vpe/richfaces/richfaces-palette.xml" priority="9">
</contribution>
</extension>
+
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ class="org.jboss.tools.jsf.vpe.richfaces.template.util.RichFacesAdapterFactory"
+ adaptableType="org.jboss.tools.vpe.editor.template.VpeTemplateSafeWrapper">
+ <adapter type="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesTogglePanelTemplate"/>
+ <adapter type="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesCollapsibleSubTableTemplate"/>
+ </factory>
+ </extension>
+
</plugin>
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCollapsibleSubTableTogglerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCollapsibleSubTableTogglerTemplate.java 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCollapsibleSubTableTogglerTemplate.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -19,7 +19,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.template.VpeTemplate;
+import org.jboss.tools.vpe.editor.template.VpeTemplateSafeWrapper;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -30,12 +30,17 @@
public class RichFacesCollapsibleSubTableTogglerTemplate extends
VpeAbstractTemplate implements VpeToggableTemplate {
+ final private static String CSS_TOP_SPAN="rf-csttg"; //$NON-NLS-1$
+ final private static String CSS_SPAN_COLLAPSED="rf-csttg-colps"; //$NON-NLS-1$
+ final private static String CSS_SPAN_EXPANDED="rf-csttg-exp"; //$NON-NLS-1$
+
@Override
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
nsIDOMElement topSpan = visualDocument.createElement(HTML.TAG_SPAN);
topSpan.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, "1"); //$NON-NLS-1$
+ topSpan.setAttribute(HTML.ATTR_CLASS, CSS_TOP_SPAN);
nsIDOMElement imgSpan = visualDocument.createElement(HTML.TAG_SPAN);
imgSpan.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_LOOKUP_PARENT, "true"); //$NON-NLS-1$
@@ -46,8 +51,10 @@
img.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, "3"); //$NON-NLS-1$
if (RichFaces.readCollapsedStateFromSourceNode(sourceNode)) {
+ imgSpan.setAttribute(HTML.ATTR_CLASS, CSS_SPAN_COLLAPSED);
ComponentUtil.setImg(img, "/collapsibleSubTableToggler/upIcon.gif"); //$NON-NLS-1$
} else {
+ imgSpan.setAttribute(HTML.ATTR_CLASS, CSS_SPAN_EXPANDED);
ComponentUtil.setImg(img, "/collapsibleSubTableToggler/downIcon.gif"); //$NON-NLS-1$
}
imgSpan.appendChild(img);
@@ -56,14 +63,14 @@
VpeCreationData creationData = new VpeCreationData(topSpan);
return creationData;
}
-
+
@Override
public void toggle(VpeVisualDomBuilder builder, Node sourceNode,
String toggleId) {
Element csttgElement = (Element) sourceNode;
String forTable = ""; //$NON-NLS-1$
- if (csttgElement.hasAttribute("for")) { //$NON-NLS-1$
- forTable = csttgElement.getAttribute("for"); //$NON-NLS-1$
+ if (csttgElement.hasAttribute(HTML.ATTR_FOR)) {
+ forTable = csttgElement.getAttribute(HTML.ATTR_FOR);
}
if (!"".equalsIgnoreCase(forTable)) { //$NON-NLS-1$
List<Element> sourceElements = RichFaces.findElementsById(
@@ -73,9 +80,10 @@
if (builder != null) {
VpeElementMapping elementMapping = (VpeElementMapping)builder.getDomMapping().getNodeMapping(el);
if (elementMapping != null) {
- VpeTemplate template = elementMapping.getTemplate();
- if (template instanceof RichFacesCollapsibleSubTableTemplate) {
- ((RichFacesCollapsibleSubTableTemplate)template).toggle(el, toggleId);
+ RichFacesCollapsibleSubTableTemplate cstTemplate = (RichFacesCollapsibleSubTableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(RichFacesCollapsibleSubTableTemplate.class);
+ if (cstTemplate != null) {
+ cstTemplate.toggle(el, toggleId);
if (RichFaces.readCollapsedStateFromSourceNode(sourceNode)) {
sourceNode.setUserData(RichFaces.COLLAPSED_STATE, "false", null); //$NON-NLS-1$
} else {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToggleControlTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToggleControlTemplate.java 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToggleControlTemplate.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -27,9 +27,10 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.template.VpeTemplate;
+import org.jboss.tools.vpe.editor.template.VpeTemplateSafeWrapper;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -37,7 +38,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-public class RichFacesToggleControlTemplate extends VpeAbstractTemplate implements VpeToggableTemplate {
+public class RichFacesToggleControlTemplate extends VpeAbstractTemplate implements VpeToggableTemplate {
private static Map toggleMap = new HashMap();
private static nsIDOMElement storedSwitchSpan = null;
@@ -113,32 +114,34 @@
}
public void toggle(VpeVisualDomBuilder builder, Node sourceNode, String toggleId) {
+ /*
+ * Actually, toggling mechanism should be updated for this template.
+ * Because it's very old and not functioning now.
+ */
toggleMap.put(sourceNode, toggleId);
-
Element sourceElement = (Element)(sourceNode instanceof Element ? sourceNode : sourceNode.getParentNode());
-
- String forAttrName = "for"; //$NON-NLS-1$
- if (!sourceElement.hasAttribute(forAttrName)) return;
-
- String forIds = sourceElement.getAttribute(forAttrName);
+ if (!sourceElement.hasAttribute(HTML.ATTR_FOR)) {
+ return;
+ }
+ String forIds = sourceElement.getAttribute(HTML.ATTR_FOR);
StringTokenizer st = new StringTokenizer(forIds.trim(), ",", false); //$NON-NLS-1$
while (st.hasMoreElements()) {
String id = st.nextToken().trim();
- if (null == id) continue;
-
+ if (null == id) {
+ continue;
+ }
id = id.trim();
-
List<Element> sourceElements = RichFaces.findElementsById(
(Element) sourceElement.getOwnerDocument()
.getDocumentElement(), id, ":togglePanel"); //$NON-NLS-1$
-
for (Element el : sourceElements) {
if (builder != null) {
VpeElementMapping elementMapping = (VpeElementMapping)builder.getDomMapping().getNodeMapping(el);
if (elementMapping != null) {
- VpeTemplate template = elementMapping.getTemplate();
- if (template instanceof RichFacesTogglePanelTemplate) {
- ((RichFacesTogglePanelTemplate)template).toggle(el, toggleId);
+ RichFacesTogglePanelTemplate tpTemplate = (RichFacesTogglePanelTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(RichFacesTogglePanelTemplate.class);
+ if (tpTemplate != null) {
+ tpTemplate.toggle(el, toggleId);
builder.updateNode(el);
}
}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFacesAdapterFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFacesAdapterFactory.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFacesAdapterFactory.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template.util;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.jsf.vpe.richfaces.template.RichFacesCollapsibleSubTableTemplate;
+import org.jboss.tools.jsf.vpe.richfaces.template.RichFacesTogglePanelTemplate;
+import org.jboss.tools.vpe.editor.template.VpeTemplateSafeWrapper;
+
+public class RichFacesAdapterFactory implements IAdapterFactory {
+
+ private static final Class[] types = {
+ RichFacesCollapsibleSubTableTemplate.class, RichFacesTogglePanelTemplate.class
+ };
+
+ @Override
+ public Class[] getAdapterList() {
+ return types;
+ }
+
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ Object result = null;
+ if (adaptableObject instanceof VpeTemplateSafeWrapper) {
+ VpeTemplateSafeWrapper wrapper = (VpeTemplateSafeWrapper) adaptableObject;
+ if (adapterType == RichFacesCollapsibleSubTableTemplate.class) {
+ result = wrapper.castDelegateTo(RichFacesCollapsibleSubTableTemplate.class);
+ } else if (adapterType == RichFacesTogglePanelTemplate.class) {
+ result = wrapper.castDelegateTo(RichFacesTogglePanelTemplate.class);
+ }
+ }
+ return result;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -53,6 +53,7 @@
import org.jboss.tools.vpe.editor.template.VpeTagDescription;
import org.jboss.tools.vpe.editor.template.VpeTemplate;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.template.VpeTemplateSafeWrapper;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
import org.jboss.tools.vpe.editor.util.Docbook;
@@ -934,10 +935,10 @@
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
.getNodeMapping(sourceElement);
if (elementMapping != null) {
- VpeTemplate template = elementMapping.getTemplate();
-
- if (template instanceof VpeToggableTemplate) {
- ((VpeToggableTemplate) template).stopToggling(sourceElement);
+ VpeToggableTemplate toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ if (toggableTemplate != null) {
+ toggableTemplate.stopToggling(sourceElement);
}
}
}
@@ -1012,14 +1013,14 @@
.getAttributeNode(VPE_USER_TOGGLE_LOOKUP_PARENT);
if (toggleLookupAttr != null) {
toggleLookup = "true".equals(toggleLookupAttr.getNodeValue()); //$NON-NLS-1$
+ } else {
+ toggleLookup = false;
}
// end of fix
-
if (elementMapping != null) {
- VpeTemplate template = elementMapping.getTemplate();
-
- while (toggleLookup && sourceElement != null
- && !(template instanceof VpeToggableTemplate)) {
+ VpeToggableTemplate toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ while (toggleLookup && (sourceElement != null) && (toggableTemplate == null)) {
sourceElement = (Element) sourceElement.getParentNode();
if (sourceElement == null) {
break;
@@ -1033,12 +1034,11 @@
if (elementMapping == null) {
continue;
}
- template = elementMapping.getTemplate();
+ toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
}
-
- if (template instanceof VpeToggableTemplate) {
- ((VpeToggableTemplate) template).toggle(this, sourceElement,
- toggleId);
+ if (toggableTemplate != null) {
+ toggableTemplate.toggle(this, sourceElement, toggleId);
updateElement(sourceElement);
return sourceElement;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -1064,11 +1064,13 @@
}
if (template != null) {
template.init(templateElement, caseSensitive);
+ template.setPriority(Double.parseDouble(priority));
template = new VpeTemplateSafeWrapper(template);
}
- if (template != null) {
- template.setPriority(Double.parseDouble(priority));
- }
+ /*
+ * In any case VpeTemplateSafeWrapper will be return,
+ * or null.
+ */
return template;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateSafeWrapper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateSafeWrapper.java 2011-08-18 17:20:56 UTC (rev 34065)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateSafeWrapper.java 2011-08-18 17:31:09 UTC (rev 34066)
@@ -1,5 +1,7 @@
package org.jboss.tools.vpe.editor.template;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.text.IRegion;
import org.eclipse.swt.graphics.Point;
@@ -8,6 +10,7 @@
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeSourceDropInfo;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
+import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.NodeData;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -22,7 +25,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public class VpeTemplateSafeWrapper implements VpeTemplate {
+public class VpeTemplateSafeWrapper implements VpeTemplate, IAdaptable {
VpeTemplate delegate;
@@ -591,10 +594,47 @@
return null;
};
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.editor.template.VpeTemplate#getPriority()
+ */
public double getPriority() {
- return delegate.getPriority();
+ try {
+ return delegate.getPriority();
+ } catch (Exception ex) {
+ VpePlugin.getPluginLog().logError(ex);
+ }
+ return 0.0;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.editor.template.VpeTemplate#setPriority(double)
+ */
public void setPriority(double priority) {
- delegate.setPriority(priority);
+ try {
+ delegate.setPriority(priority);
+ } catch (Exception ex) {
+ VpePlugin.getPluginLog().logError(ex);
+ }
}
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == VpeToggableTemplate.class) {
+ return castDelegateTo(VpeToggableTemplate.class);
+ }
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ public Object castDelegateTo(Class adapter) {
+ Object result = null;
+ try {
+ if (adapter.isInstance(delegate)) {
+ result = adapter.cast(delegate);
+ }
+ } catch (Exception ex) {
+ VpePlugin.getPluginLog().logError(ex);
+ }
+ return result;
+ }
+
}
14 years, 8 months