JBoss Tools SVN: r31051 - in trunk: cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-03 18:46:54 -0400 (Tue, 03 May 2011)
New Revision: 31051
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java
Log:
https://issues.jboss.org/browse/JBIDE-8798
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-05-03 22:41:46 UTC (rev 31050)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-05-03 22:46:54 UTC (rev 31051)
@@ -25,5 +25,6 @@
org.jboss.tools.jst.jsp.base.test,
org.eclipse.ltk.core.refactoring,
org.eclipse.search;bundle-version="3.7.0",
- org.jboss.tools.common.el.core;bundle-version="3.3.0"
+ org.jboss.tools.common.el.core;bundle-version="3.3.0",
+ org.jboss.tools.jst.web.kb
Export-Package: org.jboss.tools.cdi.ui.test
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-05-03 22:41:46 UTC (rev 31050)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-03 22:46:54 UTC (rev 31051)
@@ -10,43 +10,32 @@
************************************************************************************/
package org.jboss.tools.cdi.ui.test.marker;
-
import java.io.IOException;
import java.io.InputStream;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.AddSerializableInterfaceMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllDisposerDuplicantMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllInjectedConstructorsMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.MakeBeanScopedDependentMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.MakeFieldProtectedMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.MakeInjectedPointUnambiguousMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.SelectBeanMarkerResolution;
-import org.jboss.tools.cdi.ui.marker.TestableResolutionWithDialog;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
-import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
* @author Daniel Azarov
@@ -55,22 +44,23 @@
public class CDIMarkerResolutionTest extends ValidationTest {
public static final String MARKER_TYPE = "org.jboss.tools.cdi.core.cdiproblem";
- private void checkResolution(String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
- checkResolution(fileNames, new String[]{}, markerType, idName, id, resolutionClass);
+ private void checkResolution(IProject project, String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
+ checkResolution(project, fileNames, new String[]{}, markerType, idName, id, resolutionClass);
}
- private void checkResolution(String[] fileNames, String[] results, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
- IFile file = tckProject.getFile(fileNames[0]);
-
+ private void checkResolution(IProject project, String[] fileNames, String[] results, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
+ IFile file = project.getFile(fileNames[0]);
+
assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
-
- copyFiles(fileNames);
- tckProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ ValidatorManager.setStatus("TESTING");
+ copyFiles(project, fileNames);
+ waitForIdle(project);
try{
+ file = project.getFile(fileNames[0]);
IMarker[] markers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
-
+
for (int i = 0; i < markers.length; i++) {
IMarker marker = markers[i];
Integer attribute = ((Integer) marker
@@ -78,13 +68,14 @@
if (attribute != null){
int messageId = attribute.intValue();
if(messageId == id){
- //String text = (String)marker.getAttribute(IMarker.MESSAGE,"none");
-
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {
+
+ ValidatorManager.setStatus("TESTING");
+
if(resolution instanceof TestableResolutionWithRefactoringProcessor){
RefactoringProcessor processor = ((TestableResolutionWithRefactoringProcessor)resolution).getRefactoringProcessor();
@@ -94,48 +85,34 @@
// for(RefactoringStatusEntry entry : entries){
// System.out.println("Refactor status - "+entry.getMessage());
// }
-
+
assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
-
+
status = processor.checkFinalConditions(new NullProgressMonitor(), null);
-
+
// entries = status.getEntries();
// for(RefactoringStatusEntry entry : entries){
// System.out.println("Refactor status - "+entry.getMessage());
// }
-
+
assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
-
-
+
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
-
- for(Change change : rootChange.getChildren()){
- if(change instanceof TextFileChange){
- IFile cFile = ((TextFileChange)change).getFile();
- ICompilationUnit cUnit = EclipseUtil.getCompilationUnit(cFile);
- ICompilationUnit compilationUnit = cUnit.getWorkingCopy(new NullProgressMonitor());
-
- compilationUnit.applyTextEdit(((TextFileChange)change).getEdit(), new NullProgressMonitor());
-
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
- }
- }
-
+
rootChange.perform(new NullProgressMonitor());
- }else if(resolution instanceof TestableResolutionWithDialog){
- ((TestableResolutionWithDialog)resolution).runForTest(marker);
- }else{
+ } else {
resolution.run(marker);
}
-
- refresh();
-
- IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
-
+
+ waitForIdle(project);
+
+ file = project.getFile(fileNames[0]);
+ IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
+
assertTrue("Marker resolution did not decrease number of problems. was: "+markers.length+" now: "+newMarkers.length, newMarkers.length < markers.length);
-
- checkResults(fileNames, results);
+
+ checkResults(project, fileNames, results);
+
return;
}
}
@@ -145,28 +122,30 @@
}
fail("Problem marker with id: "+id+" not found");
}finally{
- restoreFiles(fileNames);
-
- refresh();
+ restoreFiles(project, fileNames);
+ waitForIdle(project);
}
}
-
- private void refresh() throws CoreException{
- tckProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle(2000);
- tckProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
- JobUtils.waitForIdle(2000);
-
+
+ private void waitForIdle(IProject project) throws CoreException{
+ JobUtils.waitForIdle();
+ for (int i = 0; i < 50; i++) {
+ if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
+ break;
+ }
+ JobUtils.delay(100);
+ JobUtils.waitForIdle();
+ }
}
-
- private void copyFiles(String[] fileNames) throws CoreException{
+
+ private void copyFiles(IProject project, String[] fileNames) throws CoreException{
for(String fileName : fileNames){
- IFile file = tckProject.getFile(fileName);
- IFile copyFile = tckProject.getFile(fileName+".copy");
-
+ IFile file = project.getFile(fileName);
+ IFile copyFile = project.getFile(fileName+".copy");
+
if(copyFile.exists())
copyFile.delete(true, null);
-
+
InputStream is = null;
try{
is = file.getContents();
@@ -182,11 +161,11 @@
}
}
}
-
- private void restoreFiles(String[] fileNames) throws CoreException {
+
+ private void restoreFiles(IProject project, String[] fileNames) throws CoreException {
for(String fileName : fileNames){
- IFile file = tckProject.getFile(fileName);
- IFile copyFile = tckProject.getFile(fileName+".copy");
+ IFile file = project.getFile(fileName);
+ IFile copyFile = project.getFile(fileName+".copy");
InputStream is = null;
try{
is = copyFile.getContents();
@@ -203,22 +182,21 @@
copyFile.delete(true, null);
}
}
-
- private void checkResults(String[] fileNames, String[] results) throws CoreException{
+
+ private void checkResults(IProject project, String[] fileNames, String[] results) throws CoreException{
for(int i = 0; i < results.length; i++){
- IFile file = tckProject.getFile(fileNames[i]);
- IFile resultFile = tckProject.getFile(results[i]);
-
+ IFile file = project.getFile(fileNames[i]);
+ IFile resultFile = project.getFile(results[i]);
+
String fileContent = FileUtil.readStream(file);
String resultContent = FileUtil.readStream(resultFile);
-
+
assertEquals("Wrong result of resolution", resultContent, fileContent);
}
-
}
-
+
public void testMakeProducerFieldStaticResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java"
},
@@ -230,9 +208,10 @@
CDIValidationErrorManager.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID,
MakeFieldStaticMarkerResolution.class);
}
-
+
public void testMakeProducerMethodBusinessResolution() throws CoreException {
checkResolution(
+ tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java",
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerLocal.java"
@@ -246,9 +225,10 @@
CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
MakeMethodBusinessMarkerResolution.class);
}
-
+
public void testAddLocalBeanResolution() throws CoreException {
checkResolution(
+ tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java"
},
@@ -262,7 +242,7 @@
}
public void testMakeProducerMethodPublicResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.java"
},
@@ -276,7 +256,7 @@
}
public void testMakeObserverParamMethodBusinessResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java",
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Terrier.java"
@@ -292,7 +272,7 @@
}
public void testAddLocalBeanResolution2() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java"
},
@@ -306,7 +286,7 @@
}
public void testMakeObserverParamMethodPublicResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java"
},
@@ -320,7 +300,7 @@
}
public void testMakeDisposerParamMethodBusinessResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java",
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/LocalInt.java"
@@ -336,7 +316,7 @@
}
public void testAddLocalBeanResolution3() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java"
},
@@ -350,7 +330,7 @@
}
public void testMakeDisposerParamMethodPublicResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java"
},
@@ -364,7 +344,7 @@
}
public void testDeleteAllDisposerDuplicantsResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TimestampLogger_Broken.java"
},
@@ -378,7 +358,7 @@
}
public void testDeleteAllInjectedConstructorsResolution() throws CoreException {
- checkResolution(
+ checkResolution(tckProject,
new String[]{
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Goose_Broken.java"
},
@@ -391,178 +371,4 @@
DeleteAllInjectedConstructorsMarkerResolution.class);
}
- public void testSpecifyBeanWhenMultipleBeansAreEligibleForInjectedFieldResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Farm_Broken1.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cow.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sheep.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Dog.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.AMBIGUOUS_INJECTION_POINTS_ID,
- MakeInjectedPointUnambiguousMarkerResolution.class);
- }
-
- public void testSelectBeanWhenMultipleBeansAreEligibleForInjectedFieldResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Office_Broken1.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Armchair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Chair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Couch.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cupboard.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Desk.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/HighStool.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sofa.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Stool.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.AMBIGUOUS_INJECTION_POINTS_ID,
- SelectBeanMarkerResolution.class);
- }
-
- public void testSpecifyBeanWhenNoBeanIsEligibleForInjectedFieldResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Farm_Broken2.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cow.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sheep.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Dog.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID,
- MakeInjectedPointUnambiguousMarkerResolution.class);
- }
-
- public void testSelectBeanWhenNoBeanIsEligibleForInjectedFieldResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Office_Broken2.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Armchair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Chair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Couch.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cupboard.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Desk.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/HighStool.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sofa.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Stool.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID,
- SelectBeanMarkerResolution.class);
- }
-
- public void testSpecifyBeanWhenMultipleBeansAreEligibleForInjectedParameterResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Farm_Broken3.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cow.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sheep.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Dog.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.AMBIGUOUS_INJECTION_POINTS_ID,
- MakeInjectedPointUnambiguousMarkerResolution.class);
- }
-
- public void testSelectBeanWhenMultipleBeansAreEligibleForInjectedParameterResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Office_Broken3.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Armchair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Chair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Couch.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cupboard.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Desk.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/HighStool.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sofa.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Stool.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.AMBIGUOUS_INJECTION_POINTS_ID,
- SelectBeanMarkerResolution.class);
- }
-
- public void testSpecifyBeanWhenNoBeanIsEligibleForInjectedParameterResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Farm_Broken4.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cow.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sheep.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Dog.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID,
- MakeInjectedPointUnambiguousMarkerResolution.class);
- }
-
- public void testSelectBeanWhenNoBeanIsEligibleForInjectedParameterResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Office_Broken4.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Armchair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Chair.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Couch.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Cupboard.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Desk.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/HighStool.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Sofa.java",
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Stool.java"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID,
- SelectBeanMarkerResolution.class);
- }
-
- public void testAddSerializableInterfaceResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Hamina_Broken.java"
- },
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Hamina_Broken.qfxresult"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.NOT_PASSIVATION_CAPABLE_BEAN_ID,
- AddSerializableInterfaceMarkerResolution.class);
- }
-
- public void testMakeFieldProtectedResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Leopard_Broken.java"
- },
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Leopard_Broken1.qfxresult"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD_ID,
- MakeFieldProtectedMarkerResolution.class);
- }
-
- public void testMakeBeanScopedDependentResolution() throws CoreException {
- checkResolution(
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Leopard_Broken.java"
- },
- new String[]{
- "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Leopard_Broken2.qfxresult"
- },
- MARKER_TYPE,
- CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
- CDIValidationErrorManager.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD_ID,
- MakeBeanScopedDependentMarkerResolution.class);
- }
-
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java 2011-05-03 22:41:46 UTC (rev 31050)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java 2011-05-03 22:46:54 UTC (rev 31051)
@@ -38,8 +38,8 @@
public class ValidatorManager implements IValidatorJob {
private static Set<IProject> validatingProjects = new HashSet<IProject>();
- private static final String SLEEPING = "Sleeping"; //$NON-NLS-1$
- private static final String RUNNING = "Running"; //$NON-NLS-1$
+ public static final String SLEEPING = "Sleeping"; //$NON-NLS-1$
+ public static final String RUNNING = "Running"; //$NON-NLS-1$
private static String STATUS = SLEEPING;
public ValidatorManager() {
13 years, 8 months
JBoss Tools SVN: r31050 - in branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test: src/org/jboss/tools/cdi/ui/test/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-03 18:41:46 -0400 (Tue, 03 May 2011)
New Revision: 31050
Modified:
branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8798
Modified: branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-05-03 22:37:47 UTC (rev 31049)
+++ branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-05-03 22:41:46 UTC (rev 31050)
@@ -20,5 +20,6 @@
org.eclipse.jdt.ui,
org.eclipse.ui.ide,
org.jboss.tools.jst.jsp.base.test,
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.100"
+ org.eclipse.ltk.core.refactoring,
+ org.jboss.tools.jst.web.kb
Export-Package: org.jboss.tools.cdi.ui.test
Modified: branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-03 22:37:47 UTC (rev 31049)
+++ branches/jbosstools-3.2.x/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-03 22:41:46 UTC (rev 31050)
@@ -10,7 +10,6 @@
************************************************************************************/
package org.jboss.tools.cdi.ui.test.marker;
-
import java.io.IOException;
import java.io.InputStream;
@@ -23,7 +22,6 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
@@ -37,6 +35,7 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
import org.jboss.tools.test.util.JobUtils;
/**
@@ -55,11 +54,12 @@
assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
+ ValidatorManager.setStatus("TESTING");
copyFiles(project, fileNames);
+ waitForIdle(project);
- tckProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
-
try{
+ file = project.getFile(fileNames[0]);
IMarker[] markers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
for (int i = 0; i < markers.length; i++) {
@@ -74,6 +74,9 @@
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {
+
+ ValidatorManager.setStatus("TESTING");
+
if(resolution instanceof TestableResolutionWithRefactoringProcessor){
RefactoringProcessor processor = ((TestableResolutionWithRefactoringProcessor)resolution).getRefactoringProcessor();
@@ -83,35 +86,34 @@
// for(RefactoringStatusEntry entry : entries){
// System.out.println("Refactor status - "+entry.getMessage());
// }
-
+
assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
-
+
status = processor.checkFinalConditions(new NullProgressMonitor(), null);
-
+
// entries = status.getEntries();
// for(RefactoringStatusEntry entry : entries){
// System.out.println("Refactor status - "+entry.getMessage());
// }
-
+
assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
-
-
+
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
-
+
rootChange.perform(new NullProgressMonitor());
- }else{
+ } else {
resolution.run(marker);
}
-
- refresh(project);
-
+
+ waitForIdle(project);
+
+ file = project.getFile(fileNames[0]);
IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
-
+
assertTrue("Marker resolution did not decrease number of problems. was: "+markers.length+" now: "+newMarkers.length, newMarkers.length < markers.length);
-
+
checkResults(project, fileNames, results);
-
-
+
return;
}
}
@@ -122,27 +124,29 @@
fail("Problem marker with id: "+id+" not found");
}finally{
restoreFiles(project, fileNames);
-
- refresh(project);
+ waitForIdle(project);
}
}
-
- private void refresh(IProject project) throws CoreException{
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ private void waitForIdle(IProject project) throws CoreException{
JobUtils.waitForIdle();
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
- JobUtils.waitForIdle();
-
+ for (int i = 0; i < 50; i++) {
+ if(ValidatorManager.getStatus().equals("Sleeping")) {
+ break;
+ }
+ JobUtils.delay(100);
+ JobUtils.waitForIdle();
+ }
}
-
+
private void copyFiles(IProject project, String[] fileNames) throws CoreException{
for(String fileName : fileNames){
IFile file = project.getFile(fileName);
IFile copyFile = project.getFile(fileName+".copy");
-
+
if(copyFile.exists())
copyFile.delete(true, null);
-
+
InputStream is = null;
try{
is = file.getContents();
@@ -158,7 +162,7 @@
}
}
}
-
+
private void restoreFiles(IProject project, String[] fileNames) throws CoreException {
for(String fileName : fileNames){
IFile file = project.getFile(fileName);
@@ -179,20 +183,19 @@
copyFile.delete(true, null);
}
}
-
+
private void checkResults(IProject project, String[] fileNames, String[] results) throws CoreException{
for(int i = 0; i < results.length; i++){
IFile file = project.getFile(fileNames[i]);
IFile resultFile = project.getFile(results[i]);
-
+
String fileContent = FileUtil.readStream(file);
String resultContent = FileUtil.readStream(resultFile);
-
+
assertEquals("Wrong result of resolution", resultContent, fileContent);
}
-
}
-
+
public void testMakeProducerFieldStaticResolution() throws CoreException {
checkResolution(tckProject,
new String[]{
@@ -206,7 +209,7 @@
CDIValidationErrorManager.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID,
MakeFieldStaticMarkerResolution.class);
}
-
+
public void testMakeProducerMethodBusinessResolution() throws CoreException {
checkResolution(
tckProject,
@@ -223,7 +226,7 @@
CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
MakeMethodBusinessMarkerResolution.class);
}
-
+
public void testAddLocalBeanResolution() throws CoreException {
checkResolution(
tckProject,
13 years, 8 months
JBoss Tools SVN: r31049 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-03 18:37:47 -0400 (Tue, 03 May 2011)
New Revision: 31049
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlinkPartitioner.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties
Log:
JBIDE-8841
https://issues.jboss.org/browse/JBIDE-8841
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/META-INF/MANIFEST.MF 2011-05-03 22:37:12 UTC (rev 31048)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/META-INF/MANIFEST.MF 2011-05-03 22:37:47 UTC (rev 31049)
@@ -13,6 +13,9 @@
org.eclipse.jface.text;bundle-version="3.5.0",
org.eclipse.jdt.ui;bundle-version="3.5.0",
org.jboss.tools.cdi.ui;bundle-version="1.2.0",
+ org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.seam.config.core,
+ org.jboss.tools.jst.text.ext,
org.jboss.tools.jst.web;bundle-version="3.2.0"
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/plugin.xml 2011-05-03 22:37:12 UTC (rev 31048)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/plugin.xml 2011-05-03 22:37:47 UTC (rev 31049)
@@ -10,6 +10,48 @@
name="%CDISeamResourceLoadingHyperlinkDetector"
targetId="org.eclipse.jdt.ui.javaCode">
</hyperlinkDetector>
+
</extension>
+ <extension
+ point="org.jboss.tools.common.text.ext.hyperlinkPartitioner"
+ id="org.jboss.tools.cdi.text.ext.hyperlinkPartitioner"
+ name="org.jboss.tools.cdi.text.ext.hyperlinkPartitioner">
+ <hyperlinkPartitioner
+ id="org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlinkPartitioner"
+ class="org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlinkPartitioner">
+ <contentType id="org.jboss.tools.common.model.ui.xml">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT">
+ <axis path="/beans/*"/>
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.core.runtime.xml">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT">
+ <axis path="/beans/*"/>
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+ </extension>
+
+<extension
+ point="org.jboss.tools.common.text.ext.hyperlink"
+ id="org.jboss.tools.common.text.ext.hyperlink"
+ name="org.jboss.tools.common.text.ext.hyperlink">
+
+ <hyperlink
+ class="org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlink"
+ id="org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlink">
+ <contenttypeidentifier id="org.eclipse.wst.xml.core.xmlsource">
+ <partitiontype id="org.jboss.tools.common.text.ext.jsp.SEAM_CONFIG_TAG_NAME" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.eclipse.core.runtime.xml">
+ <partitiontype id="org.jboss.tools.common.text.ext.jsp.SEAM_CONFIG_TAG_NAME" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
+ <partitiontype id="org.jboss.tools.common.text.ext.jsp.SEAM_CONFIG_TAG_NAME" />
+ </contenttypeidentifier>
+ </hyperlink>
+
+</extension>
+
</plugin>
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java 2011-05-03 22:37:12 UTC (rev 31048)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java 2011-05-03 22:37:47 UTC (rev 31049)
@@ -20,4 +20,5 @@
}
public static String CDI_SEAM_EXT_PLUGIN_NO_MESSAGE;
public static String CDI_SEAM_RESOURCE_LOADING_HYPERLINK;
+ public static String CDI_SEAM_CONFIG_OPEN_TAG;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlink.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlink.java 2011-05-03 22:37:47 UTC (rev 31049)
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.seam.text.ext.hyperlink;
+
+import java.text.MessageFormat;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.seam.text.ext.CDISeamExtMessages;
+import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
+import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.common.util.EclipseJavaUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamFieldDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamMemberDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamMethodDefinition;
+import org.jboss.tools.cdi.seam.config.core.util.Util;
+
+/**
+ * @author Jeremy
+ */
+public class SeamConfigTagNameHyperlink extends AbstractHyperlink {
+
+ /**
+ * @see com.ibm.sse.editor.AbstractHyperlink#doHyperlink(org.eclipse.jface.text.IRegion)
+ */
+ protected void doHyperlink(IRegion region) {
+ IFile documentFile = getFile();
+ if(documentFile == null) return;
+
+ IProject project = documentFile.getProject();
+ CDICoreNature cdi = CDICorePlugin.getCDI(project, true);
+ if(cdi == null) return;
+
+ String tagName = getTagName(region);
+ if(tagName == null) return;
+ int at = tagName.indexOf('@');
+ String attrName = null;
+ if(at >= 0) {
+ attrName = tagName.substring(at + 1);
+ tagName = tagName.substring(0, at);
+ }
+ String uri = getURI(region);
+
+ IJavaElement element = null;
+
+ IType type = Util.resolveType(tagName, uri, cdi);
+ if(type != null) {
+ element = type;
+ if(attrName != null) {
+ try {
+ if(type.isAnnotation()) {
+ IMethod m = type.getMethod(attrName, new String[0]);
+ if(m != null && m.exists()) element = m;
+ } else {
+ IField f = type.getField(attrName);
+ if(f != null && f.exists()) {
+ element = f;
+ }
+ }
+ } catch (CoreException e) {
+
+ }
+ }
+ } else {
+ SeamMemberDefinition def = find(cdi, region, documentFile);
+ if(def instanceof SeamFieldDefinition) {
+ element = ((SeamFieldDefinition)def).getField();
+ } else if(def instanceof SeamMethodDefinition) {
+ element = ((SeamMethodDefinition)def).getMethod();
+ }
+ }
+ if(element != null) {
+ try {
+ JavaUI.openInEditor(element);
+ } catch (JavaModelException e) {
+ } catch (PartInitException e) {
+
+ }
+ }
+ }
+
+ SeamMemberDefinition find(CDICoreNature cdi, IRegion region, IFile documentFile) {
+ CDISeamConfigExtension ext = CDISeamConfigExtension.getExtension(cdi);
+ if(ext == null) return null;
+ SeamBeansDefinition def = ext.getContext().getDefinition(documentFile.getFullPath());
+ if(def == null) return null;
+ return def.findExactly(region.getOffset());
+ }
+
+ private IType resolve(IJavaProject jp, String tagName, String uri) {
+ return null;
+ }
+
+ private String getURI(IRegion region) {
+ return getURI(region, getDocument());
+ }
+
+ public static String getURI(IRegion region, IDocument document) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(document);
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+ Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
+ if(n instanceof Attr) {
+ n = ((Attr)n).getOwnerElement();
+ }
+ if (!(n instanceof Element)) return null;
+ return getURI(n, document, region.getOffset());
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ public static String getURI(Node node, IDocument document, int offset) {
+ String nodeName = node.getNodeName();
+ if (nodeName.indexOf(':') == -1) return null;
+ String nodePrefix = nodeName.substring(0, nodeName.indexOf(":")); //$NON-NLS-1$
+ if (nodePrefix == null || nodePrefix.length() == 0) return null;
+ Map trackers = JSPRootHyperlinkPartitioner.getTrackersMap(document, offset);
+ return (String)(trackers == null ? null : trackers.get(nodePrefix));
+ }
+
+ private String getTagName(IRegion region) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(getDocument());
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ Node node = Utils.findNodeForOffset(xmlDocument, region.getOffset());
+
+ Attr attr = null;
+ Element elem = null;
+
+ if (node instanceof Element) {
+ elem = (Element)node;
+ } else if(node instanceof Attr) {
+ attr = (Attr)node;
+ elem = attr.getOwnerElement();
+ }
+
+ if(elem == null) return null;
+
+ String tagName = elem.getNodeName();
+ if (tagName.indexOf(':') == -1) return null;
+
+ tagName = tagName.substring(tagName.indexOf(':') + 1);
+ if(attr != null) {
+ tagName += "@" + attr.getName();
+ }
+
+ return tagName;
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ IRegion fLastRegion = null;
+ /**
+ * @see com.ibm.sse.editor.AbstractHyperlink#doGetHyperlinkRegion(int)
+ */
+ protected IRegion doGetHyperlinkRegion(int offset) {
+ fLastRegion = getRegion(offset);
+ return fLastRegion;
+ }
+
+ protected IRegion getRegion (int offset) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(getDocument());
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
+
+ if (n == null || !(n instanceof IDOMElement)) return null;
+
+ IDOMElement elem = (IDOMElement)n;
+ String tagName = elem.getTagName();
+ int start = elem.getStartOffset();
+ final int nameStart = start + (elem.isEndTag() ? "</" : "<").length(); //$NON-NLS-1$ //$NON-NLS-2$
+ final int nameEnd = nameStart + tagName.length();
+
+ if (nameStart > offset || nameEnd <= offset) return null;
+
+ return new Region(nameStart,nameEnd - nameStart);
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see IHyperlink#getHyperlinkText()
+ */
+ public String getHyperlinkText() {
+ String tagName = getTagName(fLastRegion);
+ if (tagName == null)
+ return CDISeamExtMessages.CDI_SEAM_CONFIG_OPEN_TAG;
+
+ return MessageFormat.format(CDISeamExtMessages.CDI_SEAM_CONFIG_OPEN_TAG, tagName);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlink.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlinkPartitioner.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlinkPartitioner.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlinkPartitioner.java 2011-05-03 22:37:47 UTC (rev 31049)
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.seam.text.ext.hyperlink;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
+import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
+import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkPartitionRecognizer;
+import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
+import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
+
+import org.jboss.tools.cdi.seam.config.core.util.Util;
+
+/**
+ * @author Jeremy
+ */
+public class SeamConfigTagNameHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
+ public static final String SEAM_CONFIG_TAG_NAME_PARTITION = "org.jboss.tools.common.text.ext.jsp.SEAM_CONFIG_TAG_NAME"; //$NON-NLS-1$
+
+ /**
+ * @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
+ */
+ protected IHyperlinkRegion parse(IDocument document, IHyperlinkRegion superRegion) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(document);
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
+ IRegion r = getRegion(document, superRegion.getOffset());
+ if (r == null) return null;
+
+ String axis = getAxis(document, superRegion);
+ String contentType = superRegion.getContentType();
+ String type = SEAM_CONFIG_TAG_NAME_PARTITION;
+ int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
+ int offset = superRegion.getOffset();
+
+ IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
+ return region;
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ /**
+ * @see com.ibm.sse.editor.extensions.hyperlink.IHyperlinkPartitionRecognizer#recognize(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
+ */
+ public boolean recognize(IDocument document, IHyperlinkRegion region) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(document);
+ try {
+ IFile documentFile = smw.getFile();
+ if(documentFile==null) {
+ return false;
+ }
+ IProject project = documentFile.getProject();
+ if(project == null) {
+ return false;
+ }
+ return true;
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ protected IRegion getRegion(IDocument document, final int offset) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ smw.init(document);
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
+ if(n == null) return null;
+ IDOMAttr attr = null;
+ IDOMElement elem = null;
+ if(n instanceof IDOMElement) {
+ elem = (IDOMElement)n;
+ } else if(n instanceof IDOMAttr) {
+ attr = (IDOMAttr)n;
+ if(attr.getOwnerElement() instanceof IDOMElement) {
+ elem = (IDOMElement)attr.getOwnerElement();
+ }
+ }
+
+ if (elem == null) return null;
+
+ String tagName = elem.getTagName();
+ String uri = SeamConfigTagNameHyperlink.getURI(elem, document, offset);
+ String[] pks = Util.getPackages(uri);
+ if(pks.length == 0) return null;;
+
+ if(attr != null) {
+ int nameStart = ((IndexedRegion)attr).getStartOffset();
+ int nameEnd = nameStart + attr.getName().length();
+ return new Region(nameStart,nameEnd - nameStart);
+ }
+
+ int start = Utils.getValueStart(elem);
+
+ int nameStart = start + (elem.isEndTag() ? "</" : "<").length(); //$NON-NLS-1$ //$NON-NLS-2$
+ int nameEnd = nameStart + tagName.length();
+
+ if (nameStart > offset || nameEnd <= offset) return null;
+
+ return new Region(nameStart,nameEnd - nameStart);
+ } finally {
+ smw.dispose();
+ }
+
+ }
+
+ protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
+ if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) + "/"; //$NON-NLS-1$
+ }
+ return superRegion.getAxis();
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigTagNameHyperlinkPartitioner.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties 2011-05-03 22:37:12 UTC (rev 31048)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties 2011-05-03 22:37:47 UTC (rev 31049)
@@ -1,2 +1,3 @@
CDI_SEAM_EXT_PLUGIN_NO_MESSAGE=No message
-CDI_SEAM_RESOURCE_LOADING_HYPERLINK=Open Resource ''{0}''
\ No newline at end of file
+CDI_SEAM_RESOURCE_LOADING_HYPERLINK=Open Resource ''{0}''
+CDI_SEAM_CONFIG_OPEN_TAG=Open Seam Config tag {0}
13 years, 8 months
JBoss Tools SVN: r31048 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core: definition and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-03 18:37:12 -0400 (Tue, 03 May 2011)
New Revision: 31048
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeanDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/Location.java
Log:
JBIDE-8841
https://issues.jboss.org/browse/JBIDE-8841
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -44,11 +44,19 @@
ConfigFileSet fileSet = new ConfigFileSet();
+ public static CDISeamConfigExtension getExtension(CDICoreNature project) {
+ Set<ICDIExtension> es = project.getExtensionManager().getExtensions(IBuildParticipantFeature.class);
+ for (ICDIExtension ext: es) {
+ if(ext instanceof CDISeamConfigExtension) return (CDISeamConfigExtension)ext;
+ }
+ return null;
+ }
+
public void setProject(CDICoreNature n) {
project = n;
}
- public IDefinitionContextExtension getContext() {
+ public ConfigDefinitionContext getContext() {
return context;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeanDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeanDefinition.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeanDefinition.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -52,10 +52,12 @@
public void addField(SeamFieldDefinition field) {
fields.add(field);
+ field.setParent(this);
}
public void addMethod(SeamMethodDefinition method) {
methods.add(method);
+ method.setParent(this);
}
public SeamFieldDefinition getField(String name) {
@@ -80,4 +82,15 @@
return null;
}
+ public SeamMemberDefinition findExactly(int offset) {
+ if(node.getLocation().includes(offset)) return this;
+ for (SeamFieldDefinition f: fields) {
+ if(f.getNode().getLocation().includes(offset)) return f;
+ }
+ for (SeamMethodDefinition m: methods) {
+ if(m.getNode().getLocation().includes(offset)) return m;
+ }
+ return null;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -117,6 +117,14 @@
}
}
+ public SeamMemberDefinition findExactly(int offset) {
+ for (SeamBeanDefinition b: beanDefinitions) {
+ SeamMemberDefinition d = b.findExactly(offset);
+ if(d != null) return d;
+ }
+ return null;
+ }
+
private void mergeTypeDefinition(SeamBeanDefinition def, TypeDefinition typeDef, ConfigDefinitionContext context) {
mergeAnnotations(def, typeDef, context);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -28,6 +28,8 @@
protected SAXElement replaces = null;
protected SAXElement modifies = null;
protected Map<String, IJavaAnnotation> annotations = new HashMap<String, IJavaAnnotation>();
+
+ protected SeamMemberDefinition parent;
public SeamMemberDefinition() {}
@@ -39,6 +41,13 @@
return node;
}
+ public void setParent(SeamMemberDefinition parent) {
+ this.parent = parent;
+ }
+
+ public SeamMemberDefinition getParent() {
+ return parent;
+ }
public void setReplaces(SAXElement replaces) {
this.replaces = replaces;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -94,7 +94,7 @@
}
public static IType resolveType(SAXElement element, CDICoreNature project) {
- return resolveType(element.getURI(), element.getLocalName(), project);
+ return resolveType(element.getLocalName(), element.getURI(), project);
}
public static IType resolveType(String name, String uri, CDICoreNature project) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/Location.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/Location.java 2011-05-03 22:18:31 UTC (rev 31047)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/Location.java 2011-05-03 22:37:12 UTC (rev 31048)
@@ -34,4 +34,8 @@
return length;
}
+ public boolean includes(int offset) {
+ return start <= offset && start + length >= offset;
+ }
+
}
13 years, 8 months
JBoss Tools SVN: r31047 - trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-05-03 18:18:31 -0400 (Tue, 03 May 2011)
New Revision: 31047
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
Log:
https://issues.jboss.org/browse/JBDS-1646 jBPM upload URL is: "/jbpm-console/upload" but it should be "/gpd-deployer/upload" in JBDS 4
replaced deprecated constructor with DefaultScope.INSTANCE
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 21:01:25 UTC (rev 31046)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 22:18:31 UTC (rev 31047)
@@ -8,7 +8,7 @@
@Override
public void initializeDefaultPreferences() {
- IEclipsePreferences preferenceStore = new DefaultScope().getNode("org.jbpm.gd.jpdl");
+ IEclipsePreferences preferenceStore = DefaultScope.INSTANCE.getNode("org.jbpm.gd.jpdl");
preferenceStore.put(SERVER_NAME, "localhost");
preferenceStore.put(SERVER_PORT, "8080");
preferenceStore.put(SERVER_DEPLOYER, "/jbpm-console/upload");
13 years, 8 months
JBoss Tools SVN: r31046 - trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-05-03 17:01:25 -0400 (Tue, 03 May 2011)
New Revision: 31046
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
Log:
https://issues.jboss.org/browse/JBDS-1646 jBPM upload URL is: "/jbpm-console/upload" but it should be "/gpd-deployer/upload" in JBDS 4
fix for preferences initialization using plugin_customization.ini
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 21:00:57 UTC (rev 31045)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 21:01:25 UTC (rev 31046)
@@ -1,20 +1,20 @@
package org.jbpm.gd.jpdl.prefs;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.jbpm.gd.jpdl.Plugin;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
public class Initializer extends AbstractPreferenceInitializer implements PreferencesConstants {
@Override
public void initializeDefaultPreferences() {
- IPreferenceStore preferenceStore = Plugin.getDefault().getPreferenceStore();
- preferenceStore.setValue(SERVER_NAME, "localhost");
- preferenceStore.setValue(SERVER_PORT, "8080");
- preferenceStore.setValue(SERVER_DEPLOYER, "/jbpm-console/upload");
- preferenceStore.setValue(USE_CREDENTIALS, false);
- preferenceStore.setValue(USER_NAME, "user name");
- preferenceStore.setValue(PASSWORD, "password");
+ IEclipsePreferences preferenceStore = new DefaultScope().getNode("org.jbpm.gd.jpdl");
+ preferenceStore.put(SERVER_NAME, "localhost");
+ preferenceStore.put(SERVER_PORT, "8080");
+ preferenceStore.put(SERVER_DEPLOYER, "/jbpm-console/upload");
+ preferenceStore.putBoolean(USE_CREDENTIALS, false);
+ preferenceStore.put(USER_NAME, "user name");
+ preferenceStore.put(PASSWORD, "password");
}
}
13 years, 8 months
JBoss Tools SVN: r31045 - branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-05-03 17:00:57 -0400 (Tue, 03 May 2011)
New Revision: 31045
Modified:
branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
Log:
https://issues.jboss.org/browse/JBDS-1646 jBPM upload URL is: "/jbpm-console/upload" but it should be "/gpd-deployer/upload" in JBDS 4
fix for preferences initialization using plugin_customization.ini
Modified: branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
===================================================================
--- branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 20:16:44 UTC (rev 31044)
+++ branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2011-05-03 21:00:57 UTC (rev 31045)
@@ -1,20 +1,20 @@
package org.jbpm.gd.jpdl.prefs;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.jbpm.gd.jpdl.Plugin;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
public class Initializer extends AbstractPreferenceInitializer implements PreferencesConstants {
@Override
public void initializeDefaultPreferences() {
- IPreferenceStore preferenceStore = Plugin.getDefault().getPreferenceStore();
- preferenceStore.setValue(SERVER_NAME, "localhost");
- preferenceStore.setValue(SERVER_PORT, "8080");
- preferenceStore.setValue(SERVER_DEPLOYER, "/jbpm-console/upload");
- preferenceStore.setValue(USE_CREDENTIALS, false);
- preferenceStore.setValue(USER_NAME, "user name");
- preferenceStore.setValue(PASSWORD, "password");
+ IEclipsePreferences preferenceStore = new DefaultScope().getNode("org.jbpm.gd.jpdl");
+ preferenceStore.put(SERVER_NAME, "localhost");
+ preferenceStore.put(SERVER_PORT, "8080");
+ preferenceStore.put(SERVER_DEPLOYER, "/jbpm-console/upload");
+ preferenceStore.putBoolean(USE_CREDENTIALS, false);
+ preferenceStore.put(USER_NAME, "user name");
+ preferenceStore.put(PASSWORD, "password");
}
}
13 years, 8 months
JBoss Tools SVN: r31044 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core: scanner and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-03 16:16:44 -0400 (Tue, 03 May 2011)
New Revision: 31044
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-03 20:16:26 UTC (rev 31043)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-03 20:16:44 UTC (rev 31044)
@@ -17,6 +17,7 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
@@ -28,7 +29,9 @@
import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.seam.config.core.ConfigDefinitionContext;
+import org.jboss.tools.cdi.seam.config.core.xml.Location;
import org.jboss.tools.cdi.seam.config.core.xml.SAXNode;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -36,6 +39,7 @@
*
*/
public class SeamBeansDefinition {
+ IResource resource;
Map<SAXNode, String> unresolvedNodes = new HashMap<SAXNode, String>();
Set<SeamBeanDefinition> beanDefinitions = new HashSet<SeamBeanDefinition>();
@@ -46,6 +50,14 @@
public SeamBeansDefinition() {}
+ public void setResource(IResource resource) {
+ this.resource = resource;
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+
public Map<SAXNode, String> getUnresolvedNodes() {
return unresolvedNodes;
}
@@ -91,7 +103,6 @@
if(replaces) flags |= AbstractMemberDefinition.FLAG_NO_ANNOTATIONS;
typeDef.setType(type, context.getRootContext(), flags);
- System.out.println("--merge type def-->" + def.getType().getFullyQualifiedName());
mergeTypeDefinition(def, typeDef, context);
typeDefinitions.add(typeDef);
@@ -115,6 +126,7 @@
String n = fieldDef.getField().getElementName();
SeamFieldDefinition f = def.getField(n);
if(f != null) {
+ fieldDef.setOriginalDefinition(new TextSourceReference(f.getNode().getLocation()));
mergeAnnotations(f, fieldDef, context);
}
}
@@ -152,4 +164,25 @@
}
}
+ class TextSourceReference implements ITextSourceReference {
+ Location location;
+
+ public TextSourceReference(Location location) {
+ this.location = location;
+ }
+
+ public int getStartPosition() {
+ return location.getStartPosition();
+ }
+
+ public int getLength() {
+ return location.getLength();
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-05-03 20:16:26 UTC (rev 31043)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-05-03 20:16:44 UTC (rev 31044)
@@ -63,6 +63,7 @@
this.resource = resource;
result = new SeamBeansDefinition();
+ result.setResource(resource);
if(document.get().indexOf("<") >= 0) { // file can be empty
SAXParser parser = new SAXParser();
String text = document.get();
@@ -124,6 +125,7 @@
}
private SeamBeanDefinition scanBean(SAXElement element, IType type, boolean inline) {
+ addDependency(type);
SeamBeanDefinition def = new SeamBeanDefinition();
def.setInline(inline);
def.setNode(element);
@@ -421,6 +423,7 @@
TypeCheck typeCheck = new TypeCheck(type, element);
if(typeCheck.isCorrupted) return null;
if(typeCheck.isAnnotation) {
+ addDependency(type);
context.getRootContext().getAnnotationKind(type); // kick it
String value = null;
SAXText text = element.getTextNode();
@@ -475,4 +478,13 @@
return new AnnotationLiteral(resource, forElement.getLocation().getStartPosition(), forElement.getLocation().getLength(), null, 0, type);
}
+ private void addDependency(IType type) {
+ if(!type.exists() || type.isBinary()) return;
+ if(!resource.exists() || resource.getName().endsWith(".jar")) return;
+ //beans.xml depends on type
+ context.getRootContext().addDependency(type.getResource().getFullPath(), resource.getFullPath());
+ //though type does not depend on beans.xml it has to be revalidated. Maybe it should be method addValidationDependency.
+ context.getRootContext().addDependency(resource.getFullPath(), type.getResource().getFullPath());
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-05-03 20:16:26 UTC (rev 31043)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-05-03 20:16:44 UTC (rev 31044)
@@ -94,11 +94,13 @@
}
public static IType resolveType(SAXElement element, CDICoreNature project) {
- String uri = element.getURI();
+ return resolveType(element.getURI(), element.getLocalName(), project);
+ }
+
+ public static IType resolveType(String name, String uri, CDICoreNature project) {
if(uri == null || !uri.startsWith(CDISeamConfigConstants.URI_PREFIX)) {
return null;
}
- String name = element.getLocalName();
String[] packages = getPackages(uri);
for (String pkg: packages) {
if(pkg.length() == 0) continue;
13 years, 8 months
JBoss Tools SVN: r31043 - 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-05-03 16:16:26 -0400 (Tue, 03 May 2011)
New Revision: 31043
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/Dependencies.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IRootDefinitionContext.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/definition/AbstractMemberDefinition.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/validation/CDICoreValidator.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -25,7 +25,9 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -42,6 +44,7 @@
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationHelper;
+import org.jboss.tools.cdi.internal.core.impl.definition.Dependencies;
import org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.common.EclipseUtil;
@@ -304,6 +307,29 @@
if(n != null) n.clean();
}
+ /**
+ * Returns files directly dependent on path which are not included into visited set.
+ *
+ * @param path
+ * @param visited
+ * @return
+ */
+ Set<IFile> getDependentFiles(IPath path, Set<IPath> visited) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ Dependencies d = getCDICoreNature().getDefinitions().getWorkingCopy().getDependencies();
+ Set<IFile> result = new HashSet<IFile>();
+
+ // we do not need to recurse: that will be done by visitor.
+ Set<IPath> ps = d.getDirectDependencies(path);
+ if(ps != null) for (IPath p: ps) {
+ if(visited.contains(p)) continue;
+ IFile f = root.getFile(p);
+ if(f != null && f.exists()) result.add(f);
+ }
+
+ return result;
+ }
+
class SampleDeltaVisitor implements IResourceDeltaVisitor {
/*
* @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
@@ -408,6 +434,8 @@
addBeansXML(f, fileSet);
}
for (IBuildParticipantFeature p: buildParticipants) p.visit(f, srcs[i], null);
+ Set<IFile> ds = getDependentFiles(path, visited);
+ if(ds != null) for (IFile d: ds) visit(d);
return false;
}
}
@@ -417,6 +445,9 @@
}
for (IBuildParticipantFeature p: buildParticipants) p.visit(f, null, webinf);
}
+
+ Set<IFile> ds = getDependentFiles(path, visited);
+ if(ds != null) for (IFile d: ds) visit(d);
}
if(resource instanceof IFolder) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IRootDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IRootDefinitionContext.java 2011-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IRootDefinitionContext.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -53,4 +53,6 @@
public Set<IDefinitionContextExtension> getExtensions();
+ public void addDependency(IPath source, IPath target);
+
}
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 2011-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
@@ -97,7 +98,17 @@
return typeDeclaration;
}
+ public IResource getResource() {
+ if(definition.getOriginalDefinition() != null) {
+ return definition.getOriginalDefinition().getResource();
+ }
+ return super.getResource();
+ }
+
public int getLength() {
+ if(definition.getOriginalDefinition() != null) {
+ return definition.getOriginalDefinition().getLength();
+ }
ISourceRange r = null;
try {
getSourceMember().getSourceRange();
@@ -108,6 +119,9 @@
}
public int getStartPosition() {
+ if(definition.getOriginalDefinition() != null) {
+ return definition.getOriginalDefinition().getStartPosition();
+ }
ISourceRange r = null;
try {
getSourceMember().getSourceRange();
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-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -16,11 +16,13 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotatable;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICoreNature;
@@ -51,6 +53,8 @@
protected IAnnotatable member;
protected Map<String, AnnotationDeclaration> annotationsByType = new HashMap<String, AnnotationDeclaration>();
protected IResource resource;
+
+ protected ITextSourceReference originalDefinition = null;
public AbstractMemberDefinition() {}
@@ -63,6 +67,10 @@
}
}
+ public void setOriginalDefinition(ITextSourceReference def) {
+ originalDefinition = def;
+ }
+
public IAnnotatable getMember() {
return member;
}
@@ -98,8 +106,19 @@
a.setProject(context.getProject());
a.setDeclaration(ja);
addAnnotation(a, context);
+ addDependency(ja.getType(), context);
}
+ protected void addDependency(IMember reference, IRootDefinitionContext context) {
+ if(reference == null || reference.isBinary()) return;
+ if(!(resource instanceof IFile)) return;
+ IFile target = (IFile)resource;
+ IFile source = (IFile)reference.getResource();
+ if(target.exists() && source != null && source.exists()) {
+ context.addDependency(source.getFullPath(), target.getFullPath());
+ }
+ }
+
private void addAnnotation(AnnotationDeclaration a, IRootDefinitionContext context) {
AnnotationDeclaration b = null;
int kind = context.getAnnotationKind(a.getType());
@@ -204,4 +223,8 @@
public IResource getResource() {
return resource;
}
+
+ public ITextSourceReference getOriginalDefinition() {
+ return originalDefinition;
+ }
}
\ No newline at end of file
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 2011-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -48,6 +48,8 @@
Set<IDefinitionContextExtension> extensions = new HashSet<IDefinitionContextExtension>();
+ private Dependencies dependencies = new Dependencies();
+
private DefinitionContext workingCopy;
private DefinitionContext original;
@@ -99,6 +101,7 @@
}
}
copy.beanXMLs.putAll(beanXMLs);
+ copy.dependencies = dependencies;
}
return copy;
@@ -208,6 +211,7 @@
}
for (IDefinitionContextExtension e: extensions) e.clean();
+ dependencies.clean();
}
public void clean(IPath path) {
@@ -230,6 +234,7 @@
}
for (IDefinitionContextExtension e: extensions) e.clean(path);
+ dependencies.clean(path);
}
public void clean(String typeName) {
@@ -357,6 +362,7 @@
packages = workingCopy.packages;
packageDefinitions = workingCopy.packageDefinitions;
beanXMLs = workingCopy.beanXMLs;
+ dependencies = workingCopy.dependencies;
Set<IProcessAnnotatedTypeFeature> fs = project.getExtensionManager().getProcessAnnotatedTypeFeature();
if(fs != null && !fs.isEmpty()) {
@@ -458,6 +464,14 @@
TypeDefinition d = typeDefinitions.get(type.getFullyQualifiedName());
if(d != null) d.unveto();
}
+
+ public void addDependency(IPath source, IPath target) {
+ dependencies.addDependency(source, target);
+ }
+
+ public Dependencies getDependencies() {
+ return dependencies;
+ }
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/Dependencies.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/Dependencies.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/Dependencies.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -0,0 +1,51 @@
+package org.jboss.tools.cdi.internal.core.impl.definition;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+
+public class Dependencies {
+ protected Map<IPath, Set<IPath>> direct = new HashMap<IPath, Set<IPath>>();
+ protected Map<IPath, Set<IPath>> reverse = new HashMap<IPath, Set<IPath>>();
+
+ public Dependencies() {}
+
+ public void addDependency(IPath source, IPath target) {
+ Set<IPath> ps = direct.get(source);
+ if(ps == null) {
+ ps = new HashSet<IPath>();
+ direct.put(source, ps);
+ }
+ ps.add(target);
+
+ ps = reverse.get(target);
+ if(ps == null) {
+ ps = new HashSet<IPath>();
+ reverse.put(target, ps);
+ }
+ ps.add(source);
+ }
+
+ public void clean() {
+ direct.clear();
+ reverse.clear();
+ }
+
+ public void clean(IPath path) {
+ Set<IPath> ps = reverse.remove(path);
+ if(ps != null) {
+ for (IPath p: ps) {
+ Set<IPath> ps1 = direct.get(p);
+ if(ps1 != null) ps1.remove(path);
+ }
+ }
+ }
+
+ public Set<IPath> getDirectDependencies(IPath path) {
+ return direct.get(path);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/Dependencies.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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-05-03 18:36:30 UTC (rev 31042)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-03 20:16:26 UTC (rev 31043)
@@ -90,6 +90,7 @@
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
import org.jboss.tools.cdi.internal.core.impl.Parameter;
import org.jboss.tools.cdi.internal.core.impl.SessionBean;
+import org.jboss.tools.cdi.internal.core.impl.definition.Dependencies;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -270,6 +271,26 @@
// linked again during validation.
getValidationContext().removeLinkedCoreResources(SHORT_ID, resources);
+ Dependencies ds = cdiProject.getNature().getDefinitions().getDependencies();
+ Set<IFile> dependentFiles = new HashSet<IFile>();
+ for(IFile file: filesToValidate) {
+ Set<IPath> dd = ds.getDirectDependencies(file.getFullPath());
+ if(dd != null && !dd.isEmpty()) {
+ for (IPath p: dd) {
+ IFile f = cdiProject.getNature().getProject().getParent().getFile(p);
+ if(f != null && f.exists() && !filesToValidate.contains(f)) dependentFiles.add(f);
+ }
+ }
+ }
+ if(!dependentFiles.isEmpty()) {
+ System.out.println("Dependencies=" + dependentFiles.size());
+ filesToValidate.addAll(dependentFiles);
+ }
+
+ // We should remove markers from the source files at first
+ for(IFile file: filesToValidate) {
+ removeAllMessagesFromResource(file);
+ }
// Then we can validate them
for (IFile file : filesToValidate) {
validateResource(file);
@@ -340,6 +361,10 @@
}
}
+ // We should remove markers from the source files at first
+ for(IFile file: filesToValidate) {
+ removeAllMessagesFromResource(file);
+ }
for (IFile file : filesToValidate) {
validateResource(file);
}
@@ -359,9 +384,6 @@
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
coreHelper.getValidationContextManager().addValidatedProject(this, file.getProject());
- // We should remove markers from the source file at first
- removeAllMessagesFromResource(file);
-
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
// TODO should we check the path of the beans.xml? Or it's better to check the every beans.xml even if it is not in META-INF or WEB-INF.
beansXmlValidator.validateBeansXml(file);
13 years, 8 months
JBoss Tools SVN: r31042 - branches/jbosstools-3.2.x/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-05-03 14:36:30 -0400 (Tue, 03 May 2011)
New Revision: 31042
Modified:
branches/jbosstools-3.2.x/build/parent/pom.xml
Log:
removed maven-osgi-source-plugin from 3.2.x branch
Modified: branches/jbosstools-3.2.x/build/parent/pom.xml
===================================================================
--- branches/jbosstools-3.2.x/build/parent/pom.xml 2011-05-03 16:58:23 UTC (rev 31041)
+++ branches/jbosstools-3.2.x/build/parent/pom.xml 2011-05-03 18:36:30 UTC (rev 31042)
@@ -205,25 +205,7 @@
</configuration>
</plugin>
- <!-- these two plugins copied in from Chris Aniszczyk's Minerva parent
- pom; also need org.sonatype.tycho:maven-osgi-compiler-plugin, above -->
<plugin>
- <!-- TODO remove workaround when https://issues.sonatype.org/browse/TYCHO-473
- is fixed -->
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-source-plugin</artifactId>
- <version>${tychoVersion}</version>
- <executions>
- <execution>
- <id>attach-source</id>
- <phase>process-classes</phase>
- <goals>
- <goal>plugin-source</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.1</version>
13 years, 8 months