JBoss Tools SVN: r41364 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-05-24 14:07:27 -0400 (Thu, 24 May 2012)
New Revision: 41364
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/XMLModelObjectFinder.java
Log:
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/XMLModelObjectFinder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/XMLModelObjectFinder.java 2012-05-24 18:02:26 UTC (rev 41363)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/XMLModelObjectFinder.java 2012-05-24 18:07:27 UTC (rev 41364)
@@ -84,6 +84,15 @@
XModelObject res = findModelObject(chain, cs[i]);
if(res != cs[i]) return res;
}
+ XModelObject x = o.getChildByPath(chain.name + ((chain.index == 0) ? "" : chain.index));
+ if(x != null) {
+ XModelObject res = findModelObject(chain.child, x);
+ if(res != null) {
+ return res;
+ } else {
+ return x;
+ }
+ }
return o;
}
}
12 years, 7 months
JBoss Tools SVN: r41363 - in trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-05-24 14:02:26 -0400 (Thu, 24 May 2012)
New Revision: 41363
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/SecurityBindingDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/AuthorizerHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/JavaElementHyperlink.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Open-on of authorizer method from security binding type annotation is implemented.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF 2012-05-24 18:02:26 UTC (rev 41363)
@@ -14,6 +14,8 @@
org.jboss.tools.cdi.core,
org.jboss.tools.common.ui,
org.jboss.tools.cdi.ui,
+ org.jboss.tools.common.text.ext,
+ org.eclipse.jface.text,
org.jboss.tools.cdi.seam.solder.core,
org.eclipse.jdt.core;bundle-version="3.7.0"
Bundle-ActivationPolicy: lazy
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties 2012-05-24 18:02:26 UTC (rev 41363)
@@ -0,0 +1 @@
+AuthorizerHyperlinkDetector=Deltaspike Authorizer
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml 2012-05-24 18:02:26 UTC (rev 41363)
@@ -47,4 +47,14 @@
</provider>
</extension>
+ <extension
+ point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+ <hyperlinkDetector
+ class="org.jboss.tools.cdi.deltaspike.text.ext.AuthorizerHyperlinkDetector"
+ id="org.jboss.tools.cdi.deltaspike.text.ext.AuthorizerHyperlinkDetector"
+ name="%AuthorizerHyperlinkDetector"
+ targetId="org.eclipse.jdt.ui.javaCode">
+ </hyperlinkDetector>
+
+ </extension>
</plugin>
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -30,7 +30,7 @@
IPath path;
String declaringTypeName;
- Map<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration> bindings = new HashMap<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration>();
+ Map<SecurityBindingDeclaration, DeltaspikeSecurityBindingConfiguration> bindings = new HashMap<SecurityBindingDeclaration, DeltaspikeSecurityBindingConfiguration>();
public DeltaspikeAuthorityMethod(MethodDefinition method) {
this.method = method;
@@ -53,11 +53,11 @@
return declaringTypeName;
}
- public void addBinding(IAnnotationDeclaration d, DeltaspikeSecurityBindingConfiguration c) {
+ public void addBinding(SecurityBindingDeclaration d, DeltaspikeSecurityBindingConfiguration c) {
bindings.put(d, c);
}
- public Map<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration> getBindings() {
+ public Map<SecurityBindingDeclaration, DeltaspikeSecurityBindingConfiguration> getBindings() {
return bindings;
}
@@ -66,9 +66,9 @@
return false;
}
String key = CDIProject.getAnnotationDeclarationKey(d);
- for (IAnnotationDeclaration d2: bindings.keySet()) {
- if(d2.getTypeName().equals(d.getTypeName())) {
- if(key.equals(CDIProject.getAnnotationDeclarationKey(d2))) {
+ for (SecurityBindingDeclaration d2: bindings.keySet()) {
+ if(d2.getBinding().getTypeName().equals(d.getTypeName())) {
+ if(key.equals(CDIProject.getAnnotationDeclarationKey(d2.getBinding()))) {
return true;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -17,7 +17,7 @@
String securityBindingTypeName;
AnnotationDefinition securityBindingType;
- Map<AbstractMemberDefinition, IAnnotationDeclaration> boundMembers = new HashMap<AbstractMemberDefinition, IAnnotationDeclaration>();
+ Map<AbstractMemberDefinition, SecurityBindingDeclaration> boundMembers = new HashMap<AbstractMemberDefinition, SecurityBindingDeclaration>();
Set<DeltaspikeAuthorityMethod> authorizerMembers = new HashSet<DeltaspikeAuthorityMethod>();
Set<IPath> involvedResources = new HashSet<IPath>();
@@ -49,11 +49,11 @@
}
}
- Map<AbstractMemberDefinition, IAnnotationDeclaration> getBoundMembers() {
+ public Map<AbstractMemberDefinition, SecurityBindingDeclaration> getBoundMembers() {
return boundMembers;
}
- Set<DeltaspikeAuthorityMethod> getAuthorizerMembers() {
+ public Set<DeltaspikeAuthorityMethod> getAuthorizerMembers() {
return authorizerMembers;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java 2012-05-24 17:17:00 UTC (rev 41362)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -22,7 +22,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.IRootDefinitionContext;
+import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
@@ -38,6 +40,7 @@
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.common.java.IAnnotated;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.preferences.SeverityPreferences;
@@ -49,8 +52,13 @@
* @author Viacheslav Kabanovich
*/
public class DeltaspikeSecurityExtension implements ICDIExtension, IBuildParticipantFeature, IProcessAnnotatedTypeFeature, IProcessAnnotatedMemberFeature, IValidatorFeature, DeltaspikeConstants {
+ public static String ID = "org.apache.deltaspike.security.impl.authorization.SecurityExtension"; //$NON-NLS-1$
DeltaspikeSecurityDefinitionContext context = new DeltaspikeSecurityDefinitionContext();
+ public static DeltaspikeSecurityExtension getExtension(CDICoreNature project) {
+ return (DeltaspikeSecurityExtension)project.getExtensionManager().getExtensionByRuntime(ID);
+ }
+
@Override
public IDefinitionContextExtension getContext() {
return context;
@@ -86,9 +94,9 @@
DeltaspikeAuthorityMethod authorizer = new DeltaspikeAuthorityMethod(method);
DeltaspikeSecurityDefinitionContext contextCopy = ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy());
contextCopy.allAuthorizerMethods.getAuthorizerMembers().add(authorizer);
- List<IAnnotationDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(memberDefinition, contextCopy.getRootContext());
- for (IAnnotationDeclaration d: ds) {
- DeltaspikeSecurityBindingConfiguration c = ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy()).getConfiguration(d.getTypeName());
+ List<SecurityBindingDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(memberDefinition, contextCopy.getRootContext());
+ for (SecurityBindingDeclaration d: ds) {
+ DeltaspikeSecurityBindingConfiguration c = ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy()).getConfiguration(d.getBinding().getTypeName());
authorizer.addBinding(d, c);
c.getAuthorizerMembers().add(authorizer);
addToDependencies(c, authorizer.getMethod(), context);
@@ -105,14 +113,14 @@
}
private void addSecurityMember(AbstractMemberDefinition def, IRootDefinitionContext context) {
- List<IAnnotationDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(def, context);
- for (IAnnotationDeclaration d: ds) {
+ List<SecurityBindingDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(def, context);
+ for (SecurityBindingDeclaration d: ds) {
addBoundMember(def, d, context);
}
}
- private void addBoundMember(AbstractMemberDefinition def, IAnnotationDeclaration d, IRootDefinitionContext context) {
- String securityBindingType = d.getTypeName();
+ private void addBoundMember(AbstractMemberDefinition def, SecurityBindingDeclaration d, IRootDefinitionContext context) {
+ String securityBindingType = d.getBinding().getTypeName();
if(def instanceof MethodDefinition) {
((MethodDefinition)def).setCDIAnnotated(true);
}
@@ -137,24 +145,67 @@
}
}
- static List<IAnnotationDeclaration> EMPTY = Collections.<IAnnotationDeclaration>emptyList();
+ static List<SecurityBindingDeclaration> EMPTY = Collections.<SecurityBindingDeclaration>emptyList();
- private List<IAnnotationDeclaration> findAnnotationAnnotatedWithSecurityBindingType(AbstractMemberDefinition m, IRootDefinitionContext context) {
- List<IAnnotationDeclaration> result = null;
+ private List<SecurityBindingDeclaration> findAnnotationAnnotatedWithSecurityBindingType(AbstractMemberDefinition m, IRootDefinitionContext context) {
+ List<SecurityBindingDeclaration> result = null;
List<IAnnotationDeclaration> ds = m.getAnnotations();
for (IAnnotationDeclaration d: ds) {
+ if(d instanceof IStereotypeDeclaration) {
+ AnnotationDefinition t = context.getAnnotation(d.getTypeName());
+ if(t != null) {
+ List<IAnnotationDeclaration> ds1 = findSecurityBindingAnnotations(t, null, context);
+ if(ds1 != null) {
+ for (IAnnotationDeclaration d1: ds1) {
+ result.add(new SecurityBindingDeclaration(d, d1));
+ }
+ }
+ }
+ } else if(d.getTypeName() != null) {
+ AnnotationDefinition a = context.getAnnotation(d.getTypeName());
+ if(a != null && a.isAnnotationPresent(SECURITY_BINDING_ANNOTATION_TYPE_NAME)) {
+ if(result == null) {
+ result = new ArrayList<SecurityBindingDeclaration>();
+ }
+ result.add(new SecurityBindingDeclaration(d, d));
+ } else if(a != null && d instanceof IStereotypeDeclaration) {
+ List<IAnnotationDeclaration> ds1 = findSecurityBindingAnnotations(a, null, context);
+ if(ds1 != null) {
+ if(result == null) {
+ result = new ArrayList<SecurityBindingDeclaration>();
+ }
+ for (IAnnotationDeclaration d1: ds1) {
+ result.add(new SecurityBindingDeclaration(d, d1));
+ }
+ }
+ }
+ }
+ }
+ return result == null ? EMPTY : result;
+ }
+
+ private List<IAnnotationDeclaration> findSecurityBindingAnnotations(IAnnotated s, List<IAnnotationDeclaration> result, IRootDefinitionContext context) {
+ List<IAnnotationDeclaration> ds = s.getAnnotations();
+ for (IAnnotationDeclaration d: ds) {
if(d.getTypeName() != null) {
-// context.getAnnotationKind(d.getType());
AnnotationDefinition a = context.getAnnotation(d.getTypeName());
if(a != null && a.isAnnotationPresent(SECURITY_BINDING_ANNOTATION_TYPE_NAME)) {
if(result == null) {
result = new ArrayList<IAnnotationDeclaration>();
}
result.add(d);
+ } else if(a != null && d instanceof IStereotypeDeclaration) {
+ List<IAnnotationDeclaration> ds1 = findSecurityBindingAnnotations(a, null, context);
+ if(ds1 != null) {
+ if(result == null) {
+ result = new ArrayList<IAnnotationDeclaration>();
+ }
+ result.addAll(ds1);
+ }
}
}
- }
- return result == null ? EMPTY : result;
+ }
+ return result;
}
@Override
@@ -191,16 +242,16 @@
for (DeltaspikeSecurityBindingConfiguration c: context.getConfigurations().values()) {
if(c.getInvolvedTypes().contains(file.getFullPath())) {
Set<DeltaspikeAuthorityMethod> authorizers2 = c.getAuthorizerMembers();
- Map<AbstractMemberDefinition, IAnnotationDeclaration> bound = c.getBoundMembers();
+ Map<AbstractMemberDefinition, SecurityBindingDeclaration> bound = c.getBoundMembers();
for (AbstractMemberDefinition d: bound.keySet()) {
String name = d instanceof MethodDefinition ? ((MethodDefinition)d).getMethod().getElementName()
: d instanceof TypeDefinition ? ((TypeDefinition)d).getQualifiedName() : "";
if(file.getFullPath().equals(d.getTypeDefinition().getType().getPath())) {
- IAnnotationDeclaration dc = bound.get(d);
+ SecurityBindingDeclaration dc = bound.get(d);
int k = 0;
for (DeltaspikeAuthorityMethod a: authorizers2) {
try {
- if(a.isMatching(dc)) k++;
+ if(a.isMatching(dc.getBinding())) k++;
} catch (CoreException e) {
DeltaspikeCorePlugin.getDefault().logError(e);
}
@@ -208,13 +259,13 @@
if(k == 0) {
validator.addError(DeltaspikeValidationMessages.UNRESOLVED_AUTHORIZER,
DeltaspikeSeverityPreferences.UNRESOLVED_AUTHORIZER,
- new String[]{dc.getTypeName(), name},
- dc, file);
+ new String[]{dc.getBinding().getTypeName(), name},
+ dc.getDeclaration(), file);
} else if(k > 1) {
validator.addError(DeltaspikeValidationMessages.AMBIGUOUS_AUTHORIZER,
DeltaspikeSeverityPreferences.AMBIGUOUS_AUTHORIZER,
- new String[]{dc.getTypeName(), name},
- dc, file);
+ new String[]{dc.getBinding().getTypeName(), name},
+ dc.getDeclaration(), file);
}
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/SecurityBindingDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/SecurityBindingDeclaration.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/SecurityBindingDeclaration.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+/**
+ *
+ * @author Viacheslav Kabanovih
+ *
+ */
+public class SecurityBindingDeclaration {
+ IAnnotationDeclaration declaration;
+ IAnnotationDeclaration binding;
+
+ public SecurityBindingDeclaration(IAnnotationDeclaration declaration, IAnnotationDeclaration binding) {
+ this.declaration = declaration;
+ this.binding = binding;
+ }
+
+ public IAnnotationDeclaration getDeclaration() {
+ return declaration;
+ }
+
+ public IAnnotationDeclaration getBinding() {
+ return binding;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/SecurityBindingDeclaration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/AuthorizerHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/AuthorizerHyperlinkDetector.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/AuthorizerHyperlinkDetector.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.deltaspike.text.ext;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeAuthorityMethod;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeCorePlugin;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityBindingConfiguration;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityDefinitionContext;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityExtension;
+import org.jboss.tools.cdi.deltaspike.core.SecurityBindingDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+public class AuthorizerHyperlinkDetector extends AbstractHyperlinkDetector{
+ protected IRegion region;
+ protected IDocument document;
+ protected ITextViewer viewer;
+
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
+ IRegion region, boolean canShowMultipleHyperlinks) {
+ this.region = region;
+ this.viewer = textViewer;
+
+ ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
+ if (region == null || !canShowMultipleHyperlinks || !(textEditor instanceof JavaEditor))
+ return null;
+
+ int offset= region.getOffset();
+
+ ITypeRoot input = EditorUtility.getEditorInputJavaElement(textEditor, false);
+ if (input == null)
+ return null;
+
+ document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ IRegion wordRegion= JavaWordFinder.findWord(document, offset);
+ if (wordRegion == null)
+ return null;
+
+ IProject project = null;
+
+ project = input.getJavaProject().getProject();
+
+ if(project == null)
+ return null;
+
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(project);
+ if(cdiNature == null)
+ return null;
+
+ IJavaElement[] elements = null;
+ IType annotationType = null;
+
+ try {
+ elements = input.codeSelect(wordRegion.getOffset(), wordRegion.getLength());
+ if (elements == null)
+ return null;
+ if(elements.length != 1)
+ return null;
+
+ ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
+ int position = 0;
+ if(elements[0] instanceof IType){
+ annotationType = (IType)elements[0];
+ if(!annotationType.isAnnotation()) {
+ annotationType = null;
+ }
+ elements[0] = input.getElementAt(wordRegion.getOffset());
+ if(elements[0] == null)
+ return null;
+
+ if(elements[0] instanceof IMethod){
+ position = offset;
+ }
+ }
+
+ findAuthorizerMethods(cdiNature, elements[0], annotationType, position, input.getPath(), hyperlinks);
+
+ if (hyperlinks != null && !hyperlinks.isEmpty()) {
+ return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
+ }
+ } catch (JavaModelException jme) {
+ DeltaspikeCorePlugin.getDefault().logError(jme);
+ }
+ return null;
+ }
+
+ protected void findAuthorizerMethods(CDICoreNature nature, IJavaElement element, IType annotationType, int offset, IPath path, ArrayList<IHyperlink> hyperlinks){
+ ICDIProject cdiProject = nature.getDelegate();
+
+ if(cdiProject == null) {
+ return;
+ }
+
+ DeltaspikeSecurityExtension extension = DeltaspikeSecurityExtension.getExtension(nature);
+ if(extension == null) return;
+
+ DeltaspikeSecurityDefinitionContext context = (DeltaspikeSecurityDefinitionContext)extension.getContext();
+
+ Map<String, DeltaspikeSecurityBindingConfiguration> cs = context.getConfigurations();
+
+ for (DeltaspikeSecurityBindingConfiguration c: cs.values()) {
+ Map<AbstractMemberDefinition, SecurityBindingDeclaration> ms = c.getBoundMembers();
+ Set<DeltaspikeAuthorityMethod> as = c.getAuthorizerMembers();
+ Set<String> authorityMethods = new HashSet<String>();
+ for (AbstractMemberDefinition m: ms.keySet()) {
+ if(element.equals(m.getMember())) {
+ for (DeltaspikeAuthorityMethod a: as) {
+ try {
+ IAnnotationDeclaration b = ms.get(m).getBinding();
+ IAnnotationDeclaration d = ms.get(m).getDeclaration();
+ if(annotationType != null && !annotationType.getFullyQualifiedName().equals(d.getTypeName())) {
+ continue;
+ }
+ if(a.isMatching(b)) {
+ IMethod method = a.getMethod().getMethod();
+ if(authorityMethods.contains(method.getSignature())) {
+ continue;
+ }
+ authorityMethods.add(method.getSignature());
+ JavaElementHyperlink h = new JavaElementHyperlink(region, method, document);
+ hyperlinks.add(h);
+ }
+ } catch (CoreException e) {
+ DeltaspikeCorePlugin.getDefault().logError(e);
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/AuthorizerHyperlinkDetector.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/JavaElementHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/JavaElementHyperlink.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/JavaElementHyperlink.java 2012-05-24 18:02:26 UTC (rev 41363)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.deltaspike.text.ext;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+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.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.cdi.deltaspike.core.DeltaspikeCorePlugin;
+import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+
+public class JavaElementHyperlink extends AbstractHyperlink {
+ protected IJavaElement element;
+
+ public JavaElementHyperlink(IRegion region, IJavaElement element, IDocument document){
+ this.element = element;
+ setRegion(region);
+ setDocument(document);
+ }
+
+ public void doHyperlink(IRegion region) {
+ IEditorPart part = null;
+
+ if(element != null && element.exists() && element.getAncestor(IJavaElement.TYPE) != null) {
+ try{
+ part = JavaUI.openInEditor(element.getAncestor(IJavaElement.TYPE));
+ }catch(JavaModelException ex){
+ DeltaspikeCorePlugin.getDefault().logError(ex);
+ }catch(PartInitException ex){
+ DeltaspikeCorePlugin.getDefault().logError(ex);
+ }
+
+ if (part != null) {
+ JavaUI.revealInEditor(part, element);
+ }
+ }
+ if (part == null)
+ openFileFailed();
+ }
+
+ @Override
+ public String getHyperlinkText() {
+ String s = "";
+ if(element instanceof IMethod) {
+ IMethod m = (IMethod)element;
+ s = m.getDeclaringType().getElementName() + "." + m.getElementName() + "()";
+ }
+ String text = "Open authorizer method " + s;
+ return text;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/text/ext/JavaElementHyperlink.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r41362 - trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-05-24 13:17:00 -0400 (Thu, 24 May 2012)
New Revision: 41362
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java
Log:
https://issues.jboss.org/browse/JBIDE-11995 : BrowserSim: messages don't block parent window
- applied patch created by Ilya Buziuk
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java 2012-05-24 16:27:34 UTC (rev 41361)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java 2012-05-24 17:17:00 UTC (rev 41362)
@@ -48,7 +48,7 @@
}
protected void createWidgets() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM);
+ shell = new Shell(getParent(), SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
GridLayout shellLayout = new GridLayout(1, true);
shellLayout.marginHeight = 0;
shellLayout.marginWidth = 0;
12 years, 7 months
JBoss Tools SVN: r41361 - trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-05-24 12:27:34 -0400 (Thu, 24 May 2012)
New Revision: 41361
Added:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java
Log:
JBIDE-11124: Removing project via forge is not working properly
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java 2012-05-24 16:21:42 UTC (rev 41360)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java 2012-05-24 16:27:34 UTC (rev 41361)
@@ -29,6 +29,7 @@
POST_PROCESSORS.put("open", new OpenPostProcessor());
POST_PROCESSORS.put("field", new FieldPostProcessor());
POST_PROCESSORS.put("cd", new CdPostProcessor());
+ POST_PROCESSORS.put("rm", new RmPostProcessor());
}
return POST_PROCESSORS;
}
Added: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java 2012-05-24 16:27:34 UTC (rev 41361)
@@ -0,0 +1,49 @@
+package org.jboss.tools.forge.ui.console;
+
+import java.util.Map;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.forge.ui.ForgeUIPlugin;
+
+
+public class RmPostProcessor implements ForgeCommandPostProcessor {
+
+ private String getResourceToDelete(Map<String, String> commandDetails) {
+ return commandDetails.get("crn");
+ }
+
+ @Override
+ public void postProcess(Map<String, String> commandDetails) {
+ String crn = getResourceToDelete(commandDetails);
+ if (crn == null) return;
+ IPath path = new Path(crn);
+ IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(crn));
+ IFileInfo fileInfo = fileStore.fetchInfo();
+ if (!fileInfo.exists()) return;
+ IResource resource = null;
+ if (fileInfo.isDirectory()) {
+ resource = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
+ } else {
+ resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ }
+ if (resource != null) {
+ delete(resource);
+ }
+ }
+
+ private void delete(IResource resource) {
+ try {
+ resource.delete(true, null);
+ } catch (CoreException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r41360 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-24 12:21:42 -0400 (Thu, 24 May 2012)
New Revision: 41360
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
Log:
JBIDE-11989 - very dumb coding error
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-05-24 16:18:49 UTC (rev 41359)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-05-24 16:21:42 UTC (rev 41360)
@@ -108,10 +108,13 @@
protected String getArgsOverrideExposedManagement(IServer server, String preArgs) {
boolean overrides = LaunchCommandPreferences.exposesManagement(server);
- String newVal = overrides ? server.getHost() : null;
- String vmArguments = ArgsUtil.setArg(preArgs, null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_EXPOSE_MANAGEMENT, newVal );
- return vmArguments;
+ if( overrides ) {
+ String newVal = overrides ? server.getHost() : null;
+ String vmArguments = ArgsUtil.setArg(preArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_EXPOSE_MANAGEMENT, newVal );
+ return vmArguments;
+ }
+ return preArgs;
}
12 years, 7 months
JBoss Tools SVN: r41359 - in trunk/maven/plugins/org.jboss.tools.maven.core: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-24 12:18:49 -0400 (Thu, 24 May 2012)
New Revision: 41359
Added:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenLibraryProviderInstallOperationConfig.java
Log:
JBIDE-11624 fix for "The variable jpaPlatform is not defined" error when importing Java EE Projects.
This fix requires adding a dependency on Dali (in order to implement a Library Validator).
Most likely, the Hibernate templates and Lib providers will have to be moved to the maven hibernate plugin,
in order to remain Dali agnostic in the future.
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-05-24 16:13:32 UTC (rev 41358)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-05-24 16:18:49 UTC (rev 41359)
@@ -24,7 +24,9 @@
org.eclipse.m2e.model.edit;bundle-version="[1.0,1.2)";visibility:=reexport,
org.eclipse.core.expressions,
org.maven.ide.eclipse.wtp;bundle-version="[0.13.0,0.17.0)";visibility:=reexport,
- org.eclipse.jdt.ui;bundle-version="3.7.0"
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.jpt.jpa.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-05-24 16:13:32 UTC (rev 41358)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-05-24 16:18:49 UTC (rev 41359)
@@ -4,6 +4,7 @@
JBoss_Maven_Integration=JBoss Maven Integration
Adds_support_for_Maven=Adds support for Maven.
Maven_library_provider=Maven library provider
+Maven_Hibernate_library_provider=Maven Hibernate library provider
Maven_JSF_1_2_Libraries=Maven JSF 1.2 Libraries
Maven_JSF_1_1_Libraries=Maven JSF 1.1 Libraries
Maven_JSF_2_0_Libraries=Maven JSF 2.0 Libraries
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-05-24 16:13:32 UTC (rev 41358)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-05-24 16:18:49 UTC (rev 41359)
@@ -75,6 +75,15 @@
</action>
</provider>
+
+ <provider id="maven-hibernate-library-provider" abstract="true" extends="maven-library-provider">
+ <label>%Maven_Hibernate_library_provider</label>
+ <priority>500</priority>
+ <action type="INSTALL">
+ <config class="org.jboss.tools.maven.core.libprov.MavenHibernateLibraryProviderInstallOperationConfig"/>
+ <operation class="org.jboss.tools.maven.core.libprov.MavenLibraryProviderInstallOperation"/>
+ </action>
+ </provider>
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
@@ -138,7 +147,7 @@
</provider>
</extension>
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate332-maven-library-provider" extends="maven-library-provider">
+ <provider id="hibernate332-maven-library-provider" extends="maven-hibernate-library-provider">
<label>%Hibernate_3_3_2_Libraries</label>
<param name="template" value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate332-template.xml"/>
<enablement>
@@ -157,7 +166,7 @@
</provider>
</extension>
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate41X-maven-library-provider" extends="maven-library-provider">
+ <provider id="hibernate41X-maven-library-provider" extends="maven-hibernate-library-provider">
<label>%Hibernate_4_1_X_Libraries</label>
<param name="template" value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate41X-template.xml"/>
<enablement>
@@ -168,15 +177,12 @@
<with variable="requestingProjectFacet">
<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:2.0" forcePluginActivation="true"/>
</with>
- <with variable="jpaPlatform">
- <equals value="hibernate2_0"/>
- </with>
</and>
</enablement>
</provider>
</extension>
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate36X-maven-library-provider" extends="maven-library-provider">
+ <provider id="hibernate36X-maven-library-provider" extends="maven-hibernate-library-provider">
<label>%Hibernate_3_6_X_Libraries</label>
<param name="template" value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate36X-template.xml"/>
<enablement>
@@ -188,9 +194,6 @@
<with variable="requestingProjectFacet">
<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:2.0" forcePluginActivation="true"/>
</with>
- <with variable="jpaPlatform">
- <equals value="hibernate2_0"/>
- </with>
</and>
<and>
<with variable="projectFacets">
@@ -199,14 +202,36 @@
<with variable="requestingProjectFacet">
<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:1.0" forcePluginActivation="true"/>
</with>
- <with variable="jpaPlatform">
- <equals value="hibernate"/>
- </with>
</and>
</or>
</enablement>
</provider>
</extension>
+
+ <extension
+ point="org.eclipse.jpt.common.core.libraryValidators">
+ <!-- Using a noop validator to fix https://issues.jboss.org/browse/JBIDE-11624 -->
+ <libraryValidator
+ id="jpaMavenLibraryValidator"
+ class="org.jboss.tools.maven.core.libprov.HibernateLibValidator">
+ <enablement>
+ <or>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.common.core.extendsId" value="hibernate41X-maven-library-provider"/>
+ </with>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.common.core.extendsId" value="hibernate36X-maven-library-provider"/>
+ </with>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.common.core.extendsId" value="hibernate332-maven-library-provider"/>
+ </with>
+ </or>
+ </enablement>
+ </libraryValidator>
+ </extension>
+
+
+
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="portlet10-maven-library-provider" extends="maven-library-provider">
<label>%Maven_Portlet_1_0_Libraries</label>
Added: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java 2012-05-24 16:18:49 UTC (rev 41359)
@@ -0,0 +1,34 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.core.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
+import org.eclipse.jpt.common.core.libval.LibraryValidator;
+import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
+import org.jboss.tools.maven.core.MavenCoreActivator;
+
+public class HibernateLibValidator implements LibraryValidator {
+
+ @SuppressWarnings("nls")
+ public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
+ JpaLibraryProviderInstallOperationConfig jpaConfig = (JpaLibraryProviderInstallOperationConfig) config;
+ IStatus status;
+ if (jpaConfig.getJpaPlatform().getId().contains("hibernate")) {
+ status = Status.OK_STATUS;
+ } else {
+ status = new Status(IStatus.ERROR, MavenCoreActivator.PLUGIN_ID, "This JPA implementation requires an Hibernate-based Platform");
+ }
+ return status;
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java 2012-05-24 16:18:49 UTC (rev 41359)
@@ -0,0 +1,54 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.core.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.core.libval.LibraryValidator;
+import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
+import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
+
+/**
+ * @author Fred Bricon
+ *
+ */
+public class MavenHibernateLibraryProviderInstallOperationConfig extends MavenLibraryProviderInstallOperationConfig implements JpaLibraryProviderInstallOperationConfig {
+
+ private JpaPlatformDescription jpaPlatformDescription;
+
+ public JpaPlatformDescription getJpaPlatform() {
+ return jpaPlatformDescription;
+ }
+
+ public void setJpaPlatform(JpaPlatformDescription jpaPlatform) {
+ this.jpaPlatformDescription = jpaPlatform;
+ }
+
+ @Override
+ public synchronized IStatus validate() {
+ IStatus status = super.validate();
+ if (! status.isOK()) {
+ return status;
+ }
+ if (getJpaPlatform() != null) {
+ for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
+ status = libraryValidator.validate(this);
+ if (! status.isOK()) {
+ return status;
+ }
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenLibraryProviderInstallOperationConfig.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenLibraryProviderInstallOperationConfig.java 2012-05-24 16:13:32 UTC (rev 41358)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenLibraryProviderInstallOperationConfig.java 2012-05-24 16:18:49 UTC (rev 41359)
@@ -17,8 +17,7 @@
* @author snjeza
*
*/
-public class MavenLibraryProviderInstallOperationConfig extends
- LibraryProviderInstallOperationConfig {
+public class MavenLibraryProviderInstallOperationConfig extends LibraryProviderInstallOperationConfig {
private Model model;
12 years, 7 months
JBoss Tools SVN: r41358 - trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-24 12:13:32 -0400 (Thu, 24 May 2012)
New Revision: 41358
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
Log:
Set maven-compiler-plugin version to 2.4
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-05-24 15:18:40 UTC (rev 41357)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-05-24 16:13:32 UTC (rev 41358)
@@ -716,7 +716,7 @@
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
plugin.setArtifactId("maven-compiler-plugin"); //$NON-NLS-1$
- plugin.setVersion("2.3.2");
+ plugin.setVersion("2.4");
Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
Xpp3Dom source = new Xpp3Dom("source"); //$NON-NLS-1$
source.setValue(compilerLevel); //$NON-NLS-1$
12 years, 7 months
JBoss Tools SVN: r41357 - trunk/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-24 11:18:40 -0400 (Thu, 24 May 2012)
New Revision: 41357
Modified:
trunk/build/aggregate/soa-site/site/site.xml
Log:
[JBDS-2165] Fixed zest dependency
Modified: trunk/build/aggregate/soa-site/site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site/site.xml 2012-05-24 14:55:08 UTC (rev 41356)
+++ trunk/build/aggregate/soa-site/site/site.xml 2012-05-24 15:18:40 UTC (rev 41357)
@@ -40,7 +40,7 @@
<category name="SOATools" />
</feature>
<!-- ESB requires zest -->
- <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclipse.zest.feature" version="0.0.0"/>
+ <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclipse.feature" version="0.0.0"/>
<feature url="features/org.jboss.tools.bpel.feature_0.0.0.jar" id="org.jboss.tools.bpel.feature" version="0.0.0">
<category name="SOATools" />
12 years, 7 months
JBoss Tools SVN: r41356 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-24 10:55:08 -0400 (Thu, 24 May 2012)
New Revision: 41356
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
Log:
JBDS-2135 - Paths added during installation are not added when JBDS starts with existing workspace
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-05-24 13:40:53 UTC (rev 41355)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-05-24 14:55:08 UTC (rev 41356)
@@ -18,6 +18,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IStartup;
@@ -38,8 +40,11 @@
if ("true".equals(skipRuntimeScanner)) {
return;
}
- final boolean firstStart = RuntimeUIActivator.getDefault().
+ boolean firstStartWorkspace = RuntimeUIActivator.getDefault().
getPreferenceStore().getBoolean(RuntimeUIActivator.FIRST_START);
+ IEclipsePreferences configurationNode = ConfigurationScope.INSTANCE.getNode(RuntimeUIActivator.PLUGIN_ID);
+ boolean firstStartConfiguration = configurationNode.getBoolean(RuntimeUIActivator.FIRST_START, true);
+ final boolean firstStart = firstStartWorkspace || firstStartConfiguration;
Job runtimeJob = new Job("Searching runtimes...") {
@Override
@@ -77,6 +82,7 @@
runtimeJob.schedule(1000);
RuntimeUIActivator.getDefault().getPreferenceStore().setValue(RuntimeUIActivator.FIRST_START, false);
+ configurationNode.putBoolean(RuntimeUIActivator.FIRST_START, false);
}
private boolean runtimeExists(boolean firstStart, IProgressMonitor monitor) {
12 years, 7 months
JBoss Tools SVN: r41355 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test: context and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-24 09:40:53 -0400 (Thu, 24 May 2012)
New Revision: 41355
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchivePublishSettingsDialog.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
Log:
DeployingArchiveTest is now included in suite + refactoring
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -27,7 +27,7 @@
CreatingArchiveTest.class,
DeletingArchiveTest.class,
ModifyingArchiveTest.class,
-// DeployingArchiveTest.class,
+ DeployingArchiveTest.class,
})
public class ArchivesAllBotTests {
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -10,12 +10,15 @@
******************************************************************************/
package org.jboss.tools.archives.ui.bot.test;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.archives.ui.bot.test.explorer.ProjectArchivesExplorer;
import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.helper.ImportHelper;
+import org.jboss.tools.ui.bot.ext.view.ServersView;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -61,6 +64,43 @@
assertFalse(explorer.itemExists(path));
}
+ protected void assertArchiveIsDeployed(String archive) {
+ ServersView serversView = showServersView();
+ SWTBotTreeItem server = findConfiguredServer(serversView);
+ server.collapse();
+ server.expand();
+ boolean found = false;
+ for (SWTBotTreeItem ti : server.getItems()) {
+ if (ti.getText().contains(archive)) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue(archive + " was not deployed", found);
+ }
+
+ protected void removeArchiveFromServer(String archive) {
+ ServersView serversView = showServersView();
+ serversView.removeProjectFromServers(archive);
+ }
+
+ protected SWTBotTreeItem findConfiguredServer(ServersView serversView) {
+ SWTBotTreeItem server = null;
+ try {
+ server = serversView. findServerByName(serversView.bot().tree(),
+ configuredState.getServer().name);
+ } catch (WidgetNotFoundException exc) {
+ fail("Server is not configured - missing in servers view");
+ }
+ return server;
+ }
+
+ private ServersView showServersView() {
+ ServersView serversView = new ServersView();
+ serversView.show();
+ return serversView;
+ }
+
protected static void importProject(String projectName) {
String location = "/resources/prj/" + projectName;
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -55,31 +55,43 @@
@Test
public void testCreatingArchivetWithView() {
+
+ /* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
/* creating JAR archive from project - standard way */
NewJarDialog dialog = view.createNewJarArchive(project);
createArchive(dialog, ARCHIVE_STANDARD_1, true);
+
+ /* test archive was created */
assertItemExistsInView(view, project, ARCHIVE_STANDARD_1_PATH);
/* creating JAR archive from project - no compression way */
dialog = view.createNewJarArchive(project);
createArchive(dialog, ARCHIVE_NO_COMPRESSION_1, false);
+
+ /* test archive was created */
assertItemExistsInView(view, project, ARCHIVE_NO_COMPRESSION_1_PATH);
}
@Test
public void testCreatingArchiveWithExplorer() {
+
+ /* prepare explorer for testing */
ProjectArchivesExplorer explorer = explorerForProject(project);
/* creating JAR archive from project - standard way */
NewJarDialog dialog = explorer.createNewJarArchive();
createArchive(dialog, ARCHIVE_STANDARD_2, true);
+
+ /* test archive was created */
assertItemExistsInExplorer(explorer, ARCHIVE_STANDARD_2_PATH);
/* creating JAR archive from project - no compression way */
dialog = explorer.createNewJarArchive();
createArchive(dialog, ARCHIVE_NO_COMPRESSION_2, false);
+
+ /* test archive was created */
assertItemExistsInExplorer(explorer, ARCHIVE_NO_COMPRESSION_2_PATH);
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -40,15 +40,27 @@
@Test
public void testDeletingArchivetWithView() {
+
+ /* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
+
+ /* delete archive in view */
view.deleteArchive(project, PATH_ARCHIVE_1);
+
+ /* test archive was deleted */
assertItemNotExistsInView(view, project, PATH_ARCHIVE_1);
}
@Test
public void testDeletingArchiveWithExplorer() {
+
+ /* prepare explorer for testing */
ProjectArchivesExplorer explorer = explorerForProject(project);
+
+ /* delete archive in explorer */
explorer.deleteArchive(PATH_ARCHIVE_2);
+
+ /* test archive was deleted */
assertItemNotExistsInExplorer(explorer, PATH_ARCHIVE_2);
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -50,22 +50,30 @@
@Test
public void testModifyingArchivetWithView() {
+
+ /* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
/* modifying archive name with Project Archive view */
EditArchiveDialog dialog = view.editArchive(project, PATH_ARCHIVE_1);
editArchive(dialog, ARCHIVE_NAME_1_NEW);
+
+ /* test archive was modified */
assertItemNotExistsInView(view, project, PATH_ARCHIVE_1);
assertItemExistsInView(view, project, PATH_ARCHIVE_1_NEW);
}
@Test
public void testModifyingArchiveWithExplorer() {
+
+ /* prepare explorer for testing */
ProjectArchivesExplorer explorer = new ProjectArchivesExplorer(project);
/* modifying archive name with Project Archive explorer */
EditArchiveDialog dialog = explorer.editArchive(PATH_ARCHIVE_2);
editArchive(dialog, ARCHIVE_NAME_2_NEW);
+
+ /* test archive was modified */
assertItemNotExistsInExplorer(explorer, PATH_ARCHIVE_2);
assertItemExistsInExplorer(explorer, PATH_ARCHIVE_2_NEW);
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -70,12 +70,16 @@
}
public ArchivePublishSettingsDialog publishToServer(SWTBotTree tree,
- SWTBotTreeItem item) {
+ SWTBotTreeItem item, boolean returnDialog) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.
getContextMenu(tree, "Publish To Server", false));
menu.click();
- return new ArchivePublishSettingsDialog();
+ if (returnDialog) {
+ return new ArchivePublishSettingsDialog();
+ } else {
+ return null;
+ }
}
public ArchivePublishSettingsDialog editPublishSettings(SWTBotTree tree,
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchivePublishSettingsDialog.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchivePublishSettingsDialog.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchivePublishSettingsDialog.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -78,6 +78,11 @@
return this;
}
+ public ArchivePublishSettingsDialog unselectAllServers() {
+ table().unselect();
+ return this;
+ }
+
public ArchivePublishSettingsDialog checkAlwaysPublish() {
this.bot.checkBox(0).select();
return this;
@@ -108,6 +113,7 @@
public void finish() {
bot.button("Finish").click();
+ SWTBotFactory.getUtil().waitForNonIgnoredJobs();
}
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -67,10 +67,11 @@
contextTool.deleteArchive(tree, treeItem);
}
- public ArchivePublishSettingsDialog publishToServer(String archive) {
+ public ArchivePublishSettingsDialog publishToServer(
+ boolean returnDialog, String archive) {
SWTBotTree tree = this.bot().tree();
SWTBotTreeItem treeItem = explorer.getNode(archive);
- return contextTool.publishToServer(tree, treeItem);
+ return contextTool.publishToServer(tree, treeItem, returnDialog);
}
public ArchivePublishSettingsDialog editPublishSettings(String archive) {
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-05-24 13:40:19 UTC (rev 41354)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-05-24 13:40:53 UTC (rev 41355)
@@ -72,10 +72,11 @@
contextTool.deleteArchive(tree, treeItem);
}
- public ArchivePublishSettingsDialog publishToServer(String... pathToArchive) {
+ public ArchivePublishSettingsDialog publishToServer(boolean returnDialog,
+ String... pathToArchive) {
SWTBotTree tree = this.bot().tree();
SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
- return contextTool.publishToServer(tree, treeItem);
+ return contextTool.publishToServer(tree, treeItem, returnDialog);
}
public ArchivePublishSettingsDialog editPublishSettings(String... pathToArchive) {
12 years, 7 months