JBoss Tools SVN: r37481 - trunk/openshift/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-12-20 23:19:09 -0500 (Tue, 20 Dec 2011)
New Revision: 37481
Modified:
trunk/openshift/docs/reference/en-US/Book_Info.xml
Log:
updated for brew
Modified: trunk/openshift/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/openshift/docs/reference/en-US/Book_Info.xml 2011-12-21 02:21:09 UTC (rev 37480)
+++ trunk/openshift/docs/reference/en-US/Book_Info.xml 2011-12-21 04:19:09 UTC (rev 37481)
@@ -13,7 +13,7 @@
<edition>5.0.0</edition>
- <pubsnumber>3</pubsnumber>
+ <pubsnumber>4</pubsnumber>
<abstract>
<para>
12 years, 5 months
JBoss Tools SVN: r37480 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-20 21:21:09 -0500 (Tue, 20 Dec 2011)
New Revision: 37480
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamCoreValidatorWrapper.java
Log:
https://issues.jboss.org/browse/JBIDE-10533 test failures in seam.core
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamCoreValidatorWrapper.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamCoreValidatorWrapper.java 2011-12-21 01:51:42 UTC (rev 37479)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamCoreValidatorWrapper.java 2011-12-21 02:21:09 UTC (rev 37480)
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.jboss.tools.seam.internal.core.validation.SeamCoreValidator;
@@ -17,7 +18,15 @@
public SeamCoreValidatorWrapper(IProject project) {
this.validatorSupport = new ValidatorSupport(project,this);
}
+
@Override
+ public IMarker addError(String message, int severity, Object[] messageArguments, int lineNumber, int length, int offset, IResource target, TextFileDocumentProvider documentProvider, String markerId, Class markerOwner) {
+ IMarker marker = super.addError(message, severity, messageArguments, lineNumber, length, offset, target, documentProvider, markerId, markerOwner);
+ validatorSupport.add(marker);
+ return marker;
+ }
+
+ @Override
public IMarker addError(String message, int severity,
String[] messageArguments, int lineNumber, int length, int offset,
IResource target) {
12 years, 5 months
JBoss Tools SVN: r37479 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-20 20:51:42 -0500 (Tue, 20 Dec 2011)
New Revision: 37479
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2011-12-21 01:48:08 UTC (rev 37478)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2011-12-21 01:51:42 UTC (rev 37479)
@@ -11,20 +11,24 @@
package org.jboss.tools.seam.internal.core;
import org.eclipse.core.resources.IResource;
-import org.jboss.tools.common.text.ITextSourceReference;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.jboss.tools.common.java.IJavaSourceReference;
/**
* @author Alexey Kazakov
*/
-public class SeamTextSourceReference implements ITextSourceReference {
+public class SeamTextSourceReference implements IJavaSourceReference {
private IResource resource;
private int length;
private int startPosition;
+ private IMember member;
- public SeamTextSourceReference(int length, int startPosition, IResource resource) {
+ public SeamTextSourceReference(IMember member, int length, int startPosition, IResource resource) {
this.length = length;
this.startPosition = startPosition;
this.resource = resource;
+ this.member = member;
}
/* (non-Javadoc)
@@ -59,4 +63,11 @@
return resource;
}
+ public IMember getSourceMember() {
+ return member;
+ }
+
+ public IJavaElement getSourceElement() {
+ return member;
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2011-12-21 01:48:08 UTC (rev 37478)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2011-12-21 01:51:42 UTC (rev 37479)
@@ -798,7 +798,7 @@
return location;
}
- private ITextSourceReference getNameLocation(IJavaSourceReference source) {
+ private IJavaSourceReference getNameLocation(IJavaSourceReference source) {
int length = 0;
int offset = 0;
try {
@@ -807,7 +807,7 @@
} catch (JavaModelException e) {
SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_CORE_VALIDATOR_ERROR_VALIDATING_SEAM_CORE, e);
}
- return new SeamTextSourceReference(length, offset, source.getResource());
+ return new SeamTextSourceReference(source.getSourceMember(), length, offset, source.getResource());
}
private void validateStatefulComponent(ISeamComponent component) {
12 years, 5 months
JBoss Tools SVN: r37478 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-20 20:48:08 -0500 (Tue, 20 Dec 2011)
New Revision: 37478
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELReferenceTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
Log:
JBIDE-10545
https://issues.jboss.org/browse/JBIDE-10545
Test is added.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-12-21 01:45:34 UTC (rev 37477)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-12-21 01:48:08 UTC (rev 37478)
@@ -61,6 +61,7 @@
import org.jboss.tools.cdi.core.test.tck.validation.DependentProjectValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.DeploymentProblemsValidationTests;
import org.jboss.tools.cdi.core.test.tck.validation.DisableCDISupportTest;
+import org.jboss.tools.cdi.core.test.tck.validation.ELReferenceTest;
import org.jboss.tools.cdi.core.test.tck.validation.ELValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.IncrementalValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.SuppressWarningsTests;
@@ -84,6 +85,7 @@
suiteAll.addTestSuite(TypeTest.class);
TestSuite suite = new TestSuite("TCK Tests");
// TCK project tests
+ suite.addTestSuite(ELReferenceTest.class);
suite.addTestSuite(ResolutionByNameTest.class);
suite.addTestSuite(BeanDefinitionTest.class);
suite.addTestSuite(NameDefinitionTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELReferenceTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELReferenceTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELReferenceTest.java 2011-12-21 01:48:08 UTC (rev 37478)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.common.el.core.ELReference;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Viacheslav Kabanovich
+ * See https://issues.jboss.org/browse/JBIDE-10545
+ */
+public class ELReferenceTest extends TCKTest {
+
+ public void testELReference() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ checkFile(file);
+ file = tckProject.getFile("WebContent/tests/jbt/refactoring/HomePage.xhtml");
+ checkFile(file);
+ file = tckProject.getFile("WebContent/tests/lookup/injection/non/contextual/ManagedBeanTestPage.jsp");
+ checkFile(file);
+ }
+
+ void checkFile(IFile file) throws Exception {
+ assertTrue(file.exists());
+ ELContext context = PageContextFactory.getInstance().createPageContext(file);
+ ELReference[] els = context.getELReferences();
+ assertTrue(els.length > 0);
+ for (ELReference el: els) {
+ int start = el.getStartPosition();
+ int length = el.getLength();
+ ELExpression[] exs = el.getEl();
+
+ ELReference el1 = new ELReference();
+ el1.setStartPosition(start);
+ el1.setLength(length);
+ el1.setResource(file);
+ ELExpression[] exs1 = el1.getEl();
+
+ assertEquals(exs.length, exs1.length);
+ for (int i = 0; i < exs.length; i++) {
+ assertEquals(exs[i].toString(), exs1[i].toString());
+ }
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELReferenceTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 5 months
JBoss Tools SVN: r37477 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-20 20:45:34 -0500 (Tue, 20 Dec 2011)
New Revision: 37477
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/ChangeScopeMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
Log:
Java Seam and CDI quick fixes: after quick fix, editor is scrolled to the beginning. If Undo/Redo commands are used, the entire file content gets selected https://issues.jboss.org/browse/JBIDE-10536
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2011-12-21 01:45:34 UTC (rev 37477)
@@ -42,7 +42,8 @@
org.jboss.tools.common.ui,
org.jboss.tools.common.el.ui,
org.hibernate.eclipse.libs;bundle-version="3.4.0",
- org.jboss.tools.common.validation
+ org.jboss.tools.common.validation,
+ org.eclipse.jdt.core.manipulation;bundle-version="1.4.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2011-12-21 01:45:34 UTC (rev 37477)
@@ -11,27 +11,24 @@
package org.jboss.tools.seam.ui.marker;
import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IAnnotatable;
-import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IImportContainer;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.refactoring.CompilationUnitChange;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.ui.IMarkerResolution2;
import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
@@ -62,31 +59,21 @@
ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
IJavaElement javaElement = compilationUnit.getElementAt(start);
- IType type = compilationUnit.findPrimaryType();
- if(javaElement != null && type != null){
- if(javaElement instanceof IAnnotatable){
- IAnnotation annotation = EclipseJavaUtil.findAnnotation(type, (IAnnotatable)javaElement, qualifiedName);
- if(annotation != null){
- IBuffer buffer = compilationUnit.getBuffer();
-
- // delete annotation
- buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), "");
-
- // check and delete import
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- IImportContainer importContainer = compilationUnit.getImportContainer();
- if(importDeclaration != null && importContainer != null){
- int importSize = importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
- String text = buffer.getText(importSize, buffer.getLength()-importSize);
- if(checkImport(text))
- importDeclaration.delete(false, new NullProgressMonitor());
- }
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
- }
+ if(javaElement != null){
+ CompilationUnitChange change = new CompilationUnitChange("", compilationUnit);
+
+ MultiTextEdit edit = new MultiTextEdit();
+
+ change.setEdit(edit);
+
+ MarkerResolutionUtils.deleteAnnotation(qualifiedName, compilationUnit, javaElement, edit);
+
+ if(edit.hasChildren()){
+ change.perform(new NullProgressMonitor());
+ original.reconcile(ICompilationUnit.NO_AST, false, null, new NullProgressMonitor());
}
}
-
+ compilationUnit.discardWorkingCopy();
}catch(CoreException ex){
SeamGuiPlugin.getPluginLog().logError(ex);
}
@@ -102,23 +89,7 @@
return null;
}
- private boolean checkImport(String text){
- String name = getShortName();
-
- Pattern p = Pattern.compile(".*\\W"+name+"\\W.*",Pattern.DOTALL); //$NON-NLS-1$ //$NON-NLS-2$
- Matcher m = p.matcher(text);
- return !m.matches();
- }
- protected String getShortName(){
- int lastDot = qualifiedName.lastIndexOf('.');
- String name;
- if(lastDot < 0)
- name = qualifiedName;
- else
- name = qualifiedName.substring(lastDot+1);
- return name;
- }
protected boolean validateComponentName(String value){
ISeamProject seamProject = getSeamProject();
@@ -151,26 +122,29 @@
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
- final String lineDelim= compilationUnit.findRecommendedLineSeparator();
-
IJavaElement javaElement = compilationUnit.getElementAt(start);
- IType type = getType(javaElement);
- if(type != null){
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- if(importDeclaration == null || !importDeclaration.exists())
- compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
-
- IBuffer buffer = compilationUnit.getBuffer();
-
- String name="";
+ if(javaElement != null){
+ javaElement = compilationUnit.findPrimaryType();
+ String param = "";
if(insertName){
- name="(\""+generateComponentName(compilationUnit.findPrimaryType().getElementName())+"\")";
+ param= "(\""+generateComponentName(compilationUnit.findPrimaryType().getElementName())+"\")";
}
- buffer.replace(type.getSourceRange().getOffset(), 0, annotationString+name+lineDelim);
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
+ CompilationUnitChange change = new CompilationUnitChange("", compilationUnit);
+
+ MultiTextEdit edit = new MultiTextEdit();
+
+ change.setEdit(edit);
+
+ MarkerResolutionUtils.addAnnotation(qualifiedName, compilationUnit, javaElement, param, edit);
+
+
+ if(edit.hasChildren()){
+ change.perform(new NullProgressMonitor());
+ original.reconcile(ICompilationUnit.NO_AST, false, null, new NullProgressMonitor());
+ }
}
+ compilationUnit.discardWorkingCopy();
}catch(CoreException ex){
SeamGuiPlugin.getPluginLog().logError(ex);
}
@@ -189,7 +163,7 @@
if(importDeclaration == null || !importDeclaration.exists())
compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
- String annotation = getShortName();
+ String annotation = MarkerResolutionUtils.getShortName(qualifiedName);
String methodName = annotation.toLowerCase();
IMethod oldMethod = type.getMethod(methodName, new String[]{});
@@ -215,43 +189,36 @@
}
}
- protected void renameAnnotation(String annotationString, String importName, boolean generate){
+ protected void renameAnnotation(String param, String importName, boolean generate){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
IJavaElement javaElement = compilationUnit.getElementAt(start);
- IType type = getType(javaElement);
- if(type != null){
- IAnnotation annotation = EclipseJavaUtil.findAnnotation(type, type, qualifiedName);
- if(annotation != null){
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- if(importDeclaration == null || !importDeclaration.exists())
- compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
- if(importName != null){
- importDeclaration = compilationUnit.getImport(importName);
- if(importDeclaration == null || !importDeclaration.exists())
- compilationUnit.createImport(importName, null, new NullProgressMonitor());
-
- }
+ if(javaElement != null){
+ if(generate){
+ param= "(\""+generateComponentName(compilationUnit.findPrimaryType().getElementName())+"\")";
+ }
- IBuffer buffer = compilationUnit.getBuffer();
-
- String name = "";
- if(generate)
- name= "(\""+generateComponentName(compilationUnit.findPrimaryType().getElementName())+"\")";
-
- buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationString+name);
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
+ CompilationUnitChange change = new CompilationUnitChange("", compilationUnit);
+
+ MultiTextEdit edit = new MultiTextEdit();
+
+ change.setEdit(edit);
+
+ MarkerResolutionUtils.updateAnnotation(qualifiedName, compilationUnit, javaElement, param, edit);
+
+
+ if(edit.hasChildren()){
+ change.perform(new NullProgressMonitor());
+ original.reconcile(ICompilationUnit.NO_AST, false, null, new NullProgressMonitor());
}
}
+ compilationUnit.discardWorkingCopy();
}catch(CoreException ex){
SeamGuiPlugin.getPluginLog().logError(ex);
}
}
-
-
public String getLabel() {
return label;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java 2011-12-21 01:45:34 UTC (rev 37477)
@@ -26,7 +26,7 @@
}
public void run(IMarker marker) {
- addAnnotation("@"+getShortName(), insertName); //$NON-NLS-1$
+ addAnnotation("", insertName); //$NON-NLS-1$
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/ChangeScopeMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/ChangeScopeMarkerResolution.java 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/ChangeScopeMarkerResolution.java 2011-12-21 01:45:34 UTC (rev 37477)
@@ -30,6 +30,6 @@
}
public void run(IMarker marker) {
- renameAnnotation("@Scope("+scopeName+")", "org.jboss.seam.ScopeType", false); //$NON-NLS-1$
+ renameAnnotation("("+scopeName+")", "org.jboss.seam.ScopeType", false); //$NON-NLS-1$
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java 2011-12-21 01:45:34 UTC (rev 37477)
@@ -25,6 +25,6 @@
}
public void run(IMarker marker) {
- renameAnnotation("@"+getShortName(), null, true); //$NON-NLS-1$
+ renameAnnotation("", null, true); //$NON-NLS-1$
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2011-12-21 01:42:46 UTC (rev 37476)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2011-12-21 01:45:34 UTC (rev 37477)
@@ -21,7 +21,6 @@
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamComponent;
-import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamProperty;
12 years, 5 months
JBoss Tools SVN: r37476 - trunk/tests/plugins/org.jboss.tools.tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-20 20:42:46 -0500 (Tue, 20 Dec 2011)
New Revision: 37476
Modified:
trunk/tests/plugins/org.jboss.tools.tests/plugin_customization.ini
Log:
disable usage reporting for tests
Modified: trunk/tests/plugins/org.jboss.tools.tests/plugin_customization.ini
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/plugin_customization.ini 2011-12-21 01:11:01 UTC (rev 37475)
+++ trunk/tests/plugins/org.jboss.tools.tests/plugin_customization.ini 2011-12-21 01:42:46 UTC (rev 37476)
@@ -6,3 +6,6 @@
org.eclipse.ui.workbench/ENABLED_DECORATORS=org.eclipse.wst.server.ui.decorator\:false,org.eclipse.jdt.ui.override.decorator\:false,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:false,org.eclipse.pde.ui.binaryProjectDecorator\:false,org.eclipse.ui.LinkedResourceDecorator\:false,org.eclipse.ui.VirtualResourceDecorator\:false,org.eclipse.ui.ContentTypeDecorator\:false,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:false,org.eclipse.wst.server.ui.navigatorDecorator\:false,
org.eclipse.ui.workbench/PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.equinox.p2.ui.sdk.scheduler;org.eclipse.update.scheduler;
+
+org.jboss.tools.usage/ask_user_for_usage_report_preference=false
+org.jboss.tools.usage/allow_usage_report_preference=false
\ No newline at end of file
12 years, 5 months
JBoss Tools SVN: r37475 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-20 20:11:01 -0500 (Tue, 20 Dec 2011)
New Revision: 37475
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2011-12-21 01:08:02 UTC (rev 37474)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2011-12-21 01:11:01 UTC (rev 37475)
@@ -8,7 +8,6 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.seam.internal.core;
import java.util.List;
@@ -27,7 +26,9 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
@@ -51,6 +52,7 @@
this.javaSource = javaSource;
}
+ @Override
public int getLength() {
if(javaSource == null) return 0;
try {
@@ -62,10 +64,12 @@
}
}
+ @Override
public IResource getResource() {
return javaSource == null || javaSource.getTypeRoot().getResource() == null ? super.getResource() : javaSource.getTypeRoot().getResource();
}
+ @Override
public int getStartPosition() {
if(javaSource == null) return 0;
try {
@@ -90,13 +94,42 @@
return changes;
}
+ @Override
public SeamJavaContextVariable clone() throws CloneNotSupportedException {
SeamJavaContextVariable c = (SeamJavaContextVariable)super.clone();
return c;
}
-
+
+ @Override
+ public ITextSourceReference getLocationFor(String path) {
+ final IValueInfo valueInfo = attributes.get(path);
+ IJavaSourceReference reference = new IJavaSourceReference() {
+ public int getLength() {
+ return valueInfo != null ? valueInfo.getLength() : 0;
+ }
+
+ public int getStartPosition() {
+ return valueInfo != null ? valueInfo.getStartPosition() : 0;
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+
+ public IMember getSourceMember() {
+ return javaSource;
+ }
+
+ public IJavaElement getSourceElement() {
+ return javaSource;
+ }
+ };
+ return reference;
+ }
+
static String TAG_JAVA_SOURCE = "java-source";
+ @Override
public Element toXML(Element parent, Properties context) {
Element element = super.toXML(parent, context);
@@ -112,7 +145,8 @@
return element;
}
-
+
+ @Override
public void loadXML(Element element, Properties context) {
super.loadXML(element, context);
@@ -130,6 +164,7 @@
}
+ @Override
public void open() {
if(javaSource == null) return;
if(!javaSource.exists()) {
@@ -143,5 +178,4 @@
SeamCorePlugin.getPluginLog().logError(e);
}
}
-
-}
+}
\ No newline at end of file
12 years, 5 months
JBoss Tools SVN: r37474 - trunk/openshift/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-12-20 20:08:02 -0500 (Tue, 20 Dec 2011)
New Revision: 37474
Modified:
trunk/openshift/docs/reference/en-US/Creating_an_OpenShift_Express_Application.xml
Log:
updated to move image into correct position
Modified: trunk/openshift/docs/reference/en-US/Creating_an_OpenShift_Express_Application.xml
===================================================================
--- trunk/openshift/docs/reference/en-US/Creating_an_OpenShift_Express_Application.xml 2011-12-21 00:44:06 UTC (rev 37473)
+++ trunk/openshift/docs/reference/en-US/Creating_an_OpenShift_Express_Application.xml 2011-12-21 01:08:02 UTC (rev 37474)
@@ -104,14 +104,6 @@
No underscores or special characters are allowed in the application name.
</para>
</note>
- <para>
- If you clicked <guibutton>Next</guibutton>, you will now see the <guilabel>Embed Cartridges</guilabel> screen. From here you can choose to embed any numbe rof cartridges, or none. Once you have finished your selection click <guibutton>Finish</guibutton>.
- </para>
- <note>
- <para>
- The <guilabel>Embed Cartridges</guilabel> screen can also be access by highlighting a project in the <guilabel>Available Applications</guilabel> section of the <guilabel>Application Selection</guilabel> screen and clicking on the <guibutton>Edit</guibutton> button. To embed your application with a cartridge is to grant the capability to your application. For example, embedding the <guilabel>mysql</guilabel> cartridge will grant your application the capability to use a MySQL database.
- </para>
- </note>
<figure id="application_creation_05a">
<title>Embed Cartridges</title>
<mediaobject>
@@ -125,6 +117,14 @@
</textobject>
</mediaobject>
</figure>
+ <para>
+ If you clicked <guibutton>Next</guibutton>, you will now see the <guilabel>Embed Cartridges</guilabel> screen. From here you can choose to embed any numbe rof cartridges, or none. Once you have finished your selection click <guibutton>Finish</guibutton>.
+ </para>
+ <note>
+ <para>
+ The <guilabel>Embed Cartridges</guilabel> screen can also be access by highlighting a project in the <guilabel>Available Applications</guilabel> section of the <guilabel>Application Selection</guilabel> screen and clicking on the <guibutton>Edit</guibutton> button. To embed your application with a cartridge is to grant the capability to your application. For example, embedding the <guilabel>mysql</guilabel> cartridge will grant your application the capability to use a MySQL database.
+ </para>
+ </note>
<figure id="application_creation_06">
<title>Created application availability</title>
<mediaobject>
12 years, 5 months
JBoss Tools SVN: r37473 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-20 19:44:06 -0500 (Tue, 20 Dec 2011)
New Revision: 37473
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-10545
https://issues.jboss.org/browse/JBIDE-10545
Loading of stored ELReference objects is fixed.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-12-21 00:43:40 UTC (rev 37472)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-12-21 00:44:06 UTC (rev 37473)
@@ -279,26 +279,13 @@
context.setElResolvers(ELResolverFactoryManager.getInstance().getResolvers(file));
String content = FileUtil.getContentFromEditorOrFile(file);
if(content.indexOf('{')>-1 && content.indexOf("#{") >-1 || content.indexOf("${")>-1 ) { //$NON-NLS-1$
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(content);
- List<SyntaxError> errors = model.getSyntaxErrors();
- for (ELInstance instance : model.getInstances()) {
- for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELReference elReference = new ValidationELReference();
- elReference.setResource(file);
- elReference.setEl(new ELExpression[]{ie});
- elReference.setLength(ie.getLength());
- elReference.setStartPosition(0);
- List<SyntaxError> elErrors = new ArrayList<SyntaxError>();
- for (SyntaxError error : errors) {
- if(error.getPosition()>=ie.getStartPosition() && error.getPosition()<=ie.getEndPosition()) {
- elErrors.add(error);
- }
- }
- elReference.setSyntaxErrors(elErrors);
- context.addELReference(elReference);
- }
- }
+ ELReference elReference = new ValidationELReference();
+ elReference.setResource(file);
+ elReference.setLength(content.length());
+ elReference.setStartPosition(0);
+ elReference.init(content);
+ context.addELReference(elReference);
+
}
return context;
}
@@ -329,21 +316,17 @@
startEl = value.indexOf("${"); //$NON-NLS-1$
}
if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(value);
- List<ELInstance> is = model.getInstances();
-
ELReference elReference = new ValidationELReference();
+ elReference.setResource(file);
+ elReference.setLength(value.length());
+ elReference.setStartPosition(offset);
+ elReference.init(value);
+
try {
elReference.setLineNumber(document.getLineOfOffset(startEl));
} catch (BadLocationException e) {
WebKbPlugin.getDefault().logError(e);
}
- elReference.setResource(file);
- elReference.setEl(is);
- elReference.setLength(value.length());
- elReference.setStartPosition(offset);
- elReference.setSyntaxErrors(model.getSyntaxErrors());
context.addELReference(elReference);
}
}
@@ -644,17 +627,14 @@
int offset = regionNode.getStartOffset() + region.getStart();
if (context.getELReference(offset) != null) return; // prevent the duplication of EL references while iterating thru the regions
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(text);
- List<ELInstance> is = model.getInstances();
ELReference elReference = new ValidationELReference();
elReference.setResource(context.getResource());
- elReference.setEl(is);
elReference.setLength(text.length());
elReference.setStartPosition(offset);
+ elReference.init(text);
try {
if(Node.TEXT_NODE == node.getNodeType()) {
- if(is.size()==1) {
+ if(elReference.getEl().length == 1) {
elReference.setLineNumber(document.getLineOfOffset(elReference.getStartPossitionOfFirstEL()) + 1);
}
} else {
@@ -663,7 +643,6 @@
} catch (BadLocationException e) {
WebKbPlugin.getDefault().logError(e);
}
- elReference.setSyntaxErrors(model.getSyntaxErrors());
context.addELReference(elReference);
}
}
12 years, 5 months
JBoss Tools SVN: r37472 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-20 19:43:40 -0500 (Tue, 20 Dec 2011)
New Revision: 37472
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
Log:
JBIDE-10545
https://issues.jboss.org/browse/JBIDE-10545
Loading of stored ELReference objects is fixed.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2011-12-20 22:12:08 UTC (rev 37471)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2011-12-21 00:43:40 UTC (rev 37472)
@@ -153,31 +153,29 @@
}
/**
+ * Helper method, text should be the segment of file content determined by startPosition and length.
+ * Check is not done, because it would affect performance.
+ *
+ * @param text
+ */
+ public void init(String text) {
+ ELParser parser = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = parser.parse(text);
+ setSyntaxErrors(model.getSyntaxErrors());
+ setEl(model.getInstances());
+ }
+
+ /**
* @return the el
*/
public ELExpression[] getEl() {
- if(el==null) {
- Set<ELExpression> exps = new HashSet<ELExpression>();
- String elText = FileUtil.getContentFromEditorOrFile(resource);
- int startEl = elText.indexOf("#{"); //$NON-NLS-1$
- if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(elText);
- List<SyntaxError> errors = model.getSyntaxErrors();
- if(!errors.isEmpty()) {
- ELCorePlugin.getDefault().logWarning("ELObject hold incorrect information. Maybe resource " + getResource() + " has been changed.");
- return new ELExpression[0];
- }
- List<ELInstance> is = model.getInstances();
- for (ELInstance i : is) {
- if(!i.getErrors().isEmpty()) {
- ELCorePlugin.getDefault().logWarning("ELObject hold incorrect information. Maybe resource " + getResource() + " has been changed.");
- continue;
- }
- exps.add(i.getExpression());
- }
+ if(el == null) {
+ String text = FileUtil.getContentFromEditorOrFile(resource);
+ if(getStartPosition() >= 0 && getLength() >= 0 && text.length() >= getStartPosition() + getLength()) {
+ init(text.substring(getStartPosition(), getStartPosition() + getLength()));
+ } else {
+ el = new ELExpression[0];
}
- el = exps.toArray(new ELExpression[0]);
}
return el;
}
12 years, 5 months