JBoss Tools SVN: r41274 - in trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui: skin/ios and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-05-23 05:36:54 -0400 (Wed, 23 May 2012)
New Revision: 41274
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
Log:
https://issues.jboss.org/browse/JBIDE-11966 : BrowserSim: taskbar icon is not shown on Ubuntu with Unity shell
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-05-23 09:32:30 UTC (rev 41273)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-05-23 09:36:54 UTC (rev 41274)
@@ -268,6 +268,7 @@
skin.pageTitleChanged(event.title);
}
});
+ shell.open();
}
private void setShellAttibutes() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-05-23 09:32:30 UTC (rev 41273)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-05-23 09:36:54 UTC (rev 41274)
@@ -133,7 +133,6 @@
browser = browserFactory.createBrowser(browserContainer, SWT.NONE);
shell.setSize(/*shell.computeSize(SWT.DEFAULT, SWT.DEFAULT)*/ 384, 727);
- shell.open();
setShellRegion();
}
12 years, 7 months
JBoss Tools SVN: r41273 - in trunk/maven/plugins: org.jboss.tools.maven.sourcelookup.ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-05-23 05:32:30 -0400 (Wed, 23 May 2012)
New Revision: 41273
Removed:
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/bin/
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.ui/bin/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.ui/
Log:
remove bin and add ignores
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core
___________________________________________________________________
Added: svn:ignore
+ bin
build
target
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.ui
___________________________________________________________________
Added: svn:ignore
+ bin
build
target
12 years, 7 months
JBoss Tools SVN: r41272 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal: ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-23 04:48:16 -0400 (Wed, 23 May 2012)
New Revision: 41272
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/CartridgeNameComparator.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
Log:
[JBIDE-11221] moved cartridge sorting to model
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/CartridgeNameComparator.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/CartridgeNameComparator.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/CartridgeNameComparator.java 2012-05-23 08:48:16 UTC (rev 41272)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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.openshift.express.internal.core;
+
+import java.text.Collator;
+import java.util.Comparator;
+
+import com.openshift.client.ICartridge;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class CartridgeNameComparator implements Comparator<ICartridge> {
+
+ private Collator collator;
+
+ public CartridgeNameComparator() {
+ this.collator = Collator.getInstance();
+ }
+
+ @Override
+ public int compare(ICartridge thisCartridge, ICartridge thatCartridge) {
+ if (thisCartridge == null) {
+ if (thatCartridge == null) {
+ return 0;
+ } else {
+ return -1;
+ }
+ } else if (thatCartridge == null) {
+ if (thisCartridge == null) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ return collator.compare(thisCartridge.getName(), thatCartridge.getName());
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/CartridgeNameComparator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-23 07:05:18 UTC (rev 41271)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-23 08:48:16 UTC (rev 41272)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
+ * 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,
@@ -12,7 +12,6 @@
import java.lang.reflect.InvocationTargetException;
import java.net.SocketTimeoutException;
-import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.databinding.DataBindingContext;
@@ -639,27 +638,12 @@
// reacting to model changes while wizard runnable is
// run. We force another update
dbc.updateModels();
- // sort
- String[] items = newAppCartridgeCombo.getItems();
- Arrays.sort(items);
- newAppCartridgeCombo.setItems(items);
- selectJBossAS7();
}
});
}
}.start();
}
}
-
- private void selectJBossAS7(){
- String[] items = newAppCartridgeCombo.getItems();
- for(int index = 0; index < items.length; index++){
- if("jbossas-7".equals(items[index])){
- newAppCartridgeCombo.select(index);
- }
- }
- }
-
@Override
protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-23 07:05:18 UTC (rev 41271)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-23 08:48:16 UTC (rev 41272)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.internal.core.CartridgeNameComparator;
import org.jboss.tools.openshift.express.internal.core.CreateApplicationOperation;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
@@ -206,9 +207,14 @@
}
public void setCartridges(List<ICartridge> cartridges) {
+ sort(cartridges);
firePropertyChange(PROPERTY_CARTRIDGES, this.cartridges, this.cartridges = cartridges);
}
+ private void sort(List<ICartridge> cartridges) {
+ Collections.sort(cartridges, new CartridgeNameComparator());
+ }
+
public List<ICartridge> getCartridges() {
return cartridges;
}
@@ -419,6 +425,7 @@
return wizardModel.getUser().getDefaultDomain();
}
+ @Override
public IApplication createJenkinsApplication(String name, IProgressMonitor monitor) throws OpenShiftException {
IApplication application =
new CreateApplicationOperation(getUser()).execute(
@@ -429,5 +436,4 @@
monitor);
return application;
}
-
}
12 years, 7 months
JBoss Tools SVN: r41271 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7 and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-23 03:05:18 -0400 (Wed, 23 May 2012)
New Revision: 41271
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXServerLifecycleListener.java
Log:
incorrect job name when adding deployment scanners
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2012-05-23 00:44:26 UTC (rev 41270)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2012-05-23 07:05:18 UTC (rev 41271)
@@ -106,6 +106,8 @@
public static String JBossConfigurationFolderDoesNotExist;
public static String JBossAS7ConfigurationFileDoesNotExist;
+ public static String UpdateDeploymentScannerJobName;
+
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2012-05-23 00:44:26 UTC (rev 41270)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2012-05-23 07:05:18 UTC (rev 41271)
@@ -84,4 +84,5 @@
ServerMissingRuntime=Server {0} has no designated runtime.
RuntimeFolderDoesNotExist=The server's runtime folder does not exist: {0}
JBossConfigurationFolderDoesNotExist=The server's configuration folder does not exist: {0}
-JBossAS7ConfigurationFileDoesNotExist=The server's configuration file does not exist: {0}
\ No newline at end of file
+JBossAS7ConfigurationFileDoesNotExist=The server's configuration file does not exist: {0}
+UpdateDeploymentScannerJobName=Updating Deployment Scanners for Server: {0}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-23 00:44:26 UTC (rev 41270)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-23 07:05:18 UTC (rev 41271)
@@ -22,6 +22,7 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
@@ -121,7 +122,7 @@
public void serverChanged(final ServerEvent event) {
if( accepts(event.getServer()) && serverSwitchesToState(event, IServer.STATE_STARTED)){
- new Job("Update AS7 Deployment Scanners") { //$NON-NLS-1$
+ new Job(getJobName(event.getServer())) {
protected IStatus run(IProgressMonitor monitor) {
modifyDeploymentScanners(event);
return Status.OK_STATUS;
@@ -130,6 +131,10 @@
}
}
+ protected String getJobName(IServer server) {
+ return Messages.bind(Messages.UpdateDeploymentScannerJobName, server.getName() );
+ }
+
protected void modifyDeploymentScanners(ServerEvent event){
String[] folders = getDeployLocationFolders(event.getServer());
ensureScannersAdded(event.getServer(), folders);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXServerLifecycleListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXServerLifecycleListener.java 2012-05-23 00:44:26 UTC (rev 41270)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXServerLifecycleListener.java 2012-05-23 07:05:18 UTC (rev 41271)
@@ -77,7 +77,8 @@
String asURL = encode(folders2[i]);
Trace.trace(Trace.STRING_FINER, "Adding Deployment Scanner: " + asURL);
ObjectName name = new ObjectName(IJBossRuntimeConstants.DEPLOYMENT_SCANNER_MBEAN_NAME);
- connection.invoke(name, IJBossRuntimeConstants.addURL, new Object[] { asURL }, new String[] {String.class.getName()});
+ Object o = connection.invoke(name, IJBossRuntimeConstants.addURL, new Object[] { asURL }, new String[] {String.class.getName()});
+ System.out.println(o);
}
}
12 years, 7 months
JBoss Tools SVN: r41270 - in trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core: src/org/jboss/tools/cdi/deltaspike/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-05-22 20:44:26 -0400 (Tue, 22 May 2012)
New Revision: 41270
Added:
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/DeltaspikeSecurityDefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferenceInitializer.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties
Modified:
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/DeltaspikeConstants.java
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/DeltaspikeSeverityPreferences.java
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Initial implementation of deltaspike security extension.
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-23 00:25:01 UTC (rev 41269)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml 2012-05-23 00:44:26 UTC (rev 41270)
@@ -26,4 +26,8 @@
</cdiextension>
</extension>
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeSeverityPreferenceInitializer"/>
+ </extension>
+
</plugin>
Added: 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 (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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 java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DeltaspikeAuthorityMethod {
+ MethodDefinition method;
+ IPath path;
+ String declaringTypeName;
+
+ Map<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration> bindings = new HashMap<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration>();
+
+ public DeltaspikeAuthorityMethod(MethodDefinition method) {
+ this.method = method;
+ IType type = method.getTypeDefinition().getType();
+ if(type != null) {
+ path = type.getPath();
+ declaringTypeName = type.getFullyQualifiedName();
+ }
+ }
+
+ public MethodDefinition getMethod() {
+ return method;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+ public String getDeclaringTypeName() {
+ return declaringTypeName;
+ }
+
+ public void addBinding(IAnnotationDeclaration d, DeltaspikeSecurityBindingConfiguration c) {
+ bindings.put(d, c);
+ }
+
+ public Map<IAnnotationDeclaration, DeltaspikeSecurityBindingConfiguration> getBindings() {
+ return bindings;
+ }
+
+ public boolean isMatching(IAnnotationDeclaration d) throws CoreException {
+ if(bindings.isEmpty()) {
+ return false;
+ }
+ String key = CDIProject.getAnnotationDeclarationKey(d);
+ for (IAnnotationDeclaration d2: bindings.keySet()) {
+ if(d2.getTypeName().equals(d.getTypeName())) {
+ if(key.equals(CDIProject.getAnnotationDeclarationKey(d2))) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeAuthorityMethod.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java 2012-05-23 00:25:01 UTC (rev 41269)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -10,6 +10,11 @@
******************************************************************************/
package org.jboss.tools.cdi.deltaspike.core;
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public interface DeltaspikeConstants {
public String CONFIG_PROPERTY_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.config.annotation.ConfigProperty"; //$NON-NLS-1$
@@ -30,6 +35,8 @@
public String SECURITY_BINDING_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.SecurityBindingType"; //$NON-NLS-1$
public String SECURITY_PARAM_BINDING_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.SecurityParameterBinding"; //$NON-NLS-1$
- public String MESSAGE_BUNDLE_ANNOTATION_KIND = "messageBundleAnnotation";
+ public String MESSAGE_BUNDLE_ANNOTATION_KIND = "messageBundleAnnotation"; //$NON-NLS-1$
+ public String SECURITY_BINDING_ANNOTATION_KIND = "securityBindingAnnotation"; //$NON-NLS-1$
+ public String SECURES_ANNOTATION_KIND = "securesAnnotation"; //$NON-NLS-1$
}
Added: 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 (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,72 @@
+package org.jboss.tools.cdi.deltaspike.core;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+public class DeltaspikeSecurityBindingConfiguration {
+ String securityBindingTypeName;
+ AnnotationDefinition securityBindingType;
+
+ Map<AbstractMemberDefinition, IAnnotationDeclaration> boundMembers = new HashMap<AbstractMemberDefinition, IAnnotationDeclaration>();
+ Set<DeltaspikeAuthorityMethod> authorizerMembers = new HashSet<DeltaspikeAuthorityMethod>();
+
+ Set<IPath> involvedResources = new HashSet<IPath>();
+
+ public DeltaspikeSecurityBindingConfiguration(String securityBindingTypeName) {
+ this.securityBindingTypeName = securityBindingTypeName;
+ }
+
+ public void setSecurityBundingTypeDefinition(AnnotationDefinition securityBindingType, DeltaspikeSecurityDefinitionContext context) {
+ this.securityBindingType = securityBindingType;
+ }
+
+ public void clear(IPath path) {
+ involvedResources.remove(path);
+ }
+
+ public void clear(String typeName) {
+ Iterator<AbstractMemberDefinition> it = boundMembers.keySet().iterator();
+ while(it.hasNext()) {
+ if(typeName.equals(it.next().getTypeDefinition().getQualifiedName())) {
+ it.remove();
+ }
+ }
+ Iterator<DeltaspikeAuthorityMethod> it2 = authorizerMembers.iterator();
+ while(it2.hasNext()) {
+ if(typeName.equals(it2.next().getDeclaringTypeName())) {
+ it2.remove();
+ }
+ }
+ }
+
+ Map<AbstractMemberDefinition, IAnnotationDeclaration> getBoundMembers() {
+ return boundMembers;
+ }
+
+ Set<DeltaspikeAuthorityMethod> getAuthorizerMembers() {
+ return authorizerMembers;
+ }
+
+ public String getSecurityBindingTypeName() {
+ return securityBindingTypeName;
+ }
+
+ public AnnotationDefinition getSecurityBindingTypeDefinition() {
+ return securityBindingType;
+ }
+
+ public Set<IPath> getInvolvedTypes() {
+ return involvedResources;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityBindingConfiguration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityDefinitionContext.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityDefinitionContext.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,108 @@
+package org.jboss.tools.cdi.deltaspike.core;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+
+public class DeltaspikeSecurityDefinitionContext extends AbstractDefinitionContextExtension implements DeltaspikeConstants {
+
+ Map<String, DeltaspikeSecurityBindingConfiguration> securityBindingConfigurations = new HashMap<String, DeltaspikeSecurityBindingConfiguration>();
+ DeltaspikeSecurityBindingConfiguration allAuthorizerMethods = new DeltaspikeSecurityBindingConfiguration(""); //$NON-NLS-1$
+
+ @Override
+ protected AbstractDefinitionContextExtension copy(boolean clean) {
+ DeltaspikeSecurityDefinitionContext copy = new DeltaspikeSecurityDefinitionContext();
+ copy.root = root;
+ if(!clean) {
+ copy.securityBindingConfigurations.putAll(securityBindingConfigurations);
+ allAuthorizerMethods = copy.allAuthorizerMethods;
+ }
+ return copy;
+ }
+
+ @Override
+ protected void doApplyWorkingCopy() {
+ DeltaspikeSecurityDefinitionContext copy = (DeltaspikeSecurityDefinitionContext)workingCopy;
+ securityBindingConfigurations = copy.securityBindingConfigurations;
+ allAuthorizerMethods = copy.allAuthorizerMethods;
+
+ }
+
+ @Override
+ public void clean() {
+ securityBindingConfigurations.clear();
+ allAuthorizerMethods.getAuthorizerMembers().clear();
+ }
+
+ @Override
+ public void clean(IPath path) {
+ for (DeltaspikeSecurityBindingConfiguration c: securityBindingConfigurations.values()) {
+ c.clear(path);
+ }
+ allAuthorizerMethods.clear(path);
+ }
+
+ @Override
+ public void clean(String typeName) {
+ securityBindingConfigurations.remove(typeName);
+ for (DeltaspikeSecurityBindingConfiguration c: securityBindingConfigurations.values()) {
+ c.clear(typeName);
+ }
+ allAuthorizerMethods.clear(typeName);
+ }
+
+ @Override
+ public void computeAnnotationKind(AnnotationDefinition annotation) {
+ if(SECURES_ANNOTATION_TYPE_NAME.equals(annotation.getType().getFullyQualifiedName())) {
+ annotation.setExtendedKind(SECURES_ANNOTATION_KIND);
+ } else if(annotation.isAnnotationPresent(SECURITY_BINDING_ANNOTATION_TYPE_NAME)) {
+ annotation.setExtendedKind(SECURITY_BINDING_ANNOTATION_KIND);
+ String qn = annotation.getType().getFullyQualifiedName();
+ DeltaspikeSecurityBindingConfiguration c = getConfiguration(qn);
+ c.setSecurityBundingTypeDefinition(annotation, this);
+ if(!annotation.getType().isBinary()) {
+ IPath newPath = annotation.getType().getResource().getFullPath();
+ Set<IPath> ps = c.getInvolvedTypes();
+ for (IPath p: ps) {
+ getRootContext().addDependency(p, newPath);
+ getRootContext().addDependency(newPath, p);
+ }
+ ps.add(newPath);
+ }
+ }
+ }
+
+ public boolean isSecurityBindingTypeAnnotation(IType type) {
+ return (securityBindingConfigurations.containsKey(type.getFullyQualifiedName()));
+ }
+
+ public Map<String, DeltaspikeSecurityBindingConfiguration> getConfigurations() {
+ return securityBindingConfigurations;
+ }
+
+ public DeltaspikeSecurityBindingConfiguration getConfiguration(String typeName) {
+ DeltaspikeSecurityBindingConfiguration result = securityBindingConfigurations.get(typeName);
+ if(result == null) {
+ result = new DeltaspikeSecurityBindingConfiguration(typeName);
+ securityBindingConfigurations.put(typeName, result);
+ }
+ return result;
+ }
+
+ public Set<DeltaspikeAuthorityMethod> getAuthorityMethods(IPath path) {
+ Set<DeltaspikeAuthorityMethod> result = new HashSet<DeltaspikeAuthorityMethod>();
+ for(DeltaspikeAuthorityMethod m: allAuthorizerMethods.getAuthorizerMembers()) {
+ if(path.equals(m.getPath())) {
+ result.add(m);
+ }
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityDefinitionContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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-23 00:25:01 UTC (rev 41269)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -10,7 +10,37 @@
******************************************************************************/
package org.jboss.tools.cdi.deltaspike.core;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IRootDefinitionContext;
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;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
+import org.jboss.tools.cdi.deltaspike.core.validation.DeltaspikeValidationMessages;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
+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.IAnnotationDeclaration;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.preferences.SeverityPreferences;
/**
* Runtime
@@ -18,6 +48,183 @@
*
* @author Viacheslav Kabanovich
*/
-public class DeltaspikeSecurityExtension implements ICDIExtension {
+public class DeltaspikeSecurityExtension implements ICDIExtension, IBuildParticipantFeature, IProcessAnnotatedTypeFeature, IProcessAnnotatedMemberFeature, IValidatorFeature, DeltaspikeConstants {
+ DeltaspikeSecurityDefinitionContext context = new DeltaspikeSecurityDefinitionContext();
+ @Override
+ public IDefinitionContextExtension getContext() {
+ return context;
+ }
+
+ @Override
+ public void beginVisiting() {}
+
+ @Override
+ public void visitJar(IPath path, IPackageFragmentRoot root, XModelObject beansXML) {}
+
+ @Override
+ public void visit(IFile file, IPath src, IPath webinf) {}
+
+ @Override
+ public void buildDefinitions() {}
+
+ @Override
+ public void buildDefinitions(FileSet fileSet) {}
+
+ @Override
+ public void buildBeans(CDIProject target) {}
+
+ @Override
+ public void processAnnotatedMember(BeanMemberDefinition memberDefinition,
+ IRootDefinitionContext context) {
+ if(!(memberDefinition instanceof MethodDefinition)) {
+ return;
+ }
+ if(memberDefinition.isAnnotationPresent(SECURES_ANNOTATION_TYPE_NAME)) {
+ MethodDefinition method = (MethodDefinition)memberDefinition;
+ method.setCDIAnnotated(true);
+ DeltaspikeAuthorityMethod authorizer = new DeltaspikeAuthorityMethod(method);
+ ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy()).allAuthorizerMethods.getAuthorizerMembers().add(authorizer);
+ List<IAnnotationDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(memberDefinition);
+ for (IAnnotationDeclaration d: ds) {
+ DeltaspikeSecurityBindingConfiguration c = ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy()).getConfiguration(d.getTypeName());
+ authorizer.addBinding(d, c);
+ c.getAuthorizerMembers().add(authorizer);
+ addToDependencies(c, authorizer.getMethod(), context);
+ }
+ } else {
+ addSecurityMember(memberDefinition, context);
+ }
+ }
+
+ @Override
+ public void processAnnotatedType(TypeDefinition typeDefinition,
+ IRootDefinitionContext context) {
+ addSecurityMember(typeDefinition, context);
+ }
+
+ private void addSecurityMember(AbstractMemberDefinition def, IRootDefinitionContext context) {
+ List<IAnnotationDeclaration> ds = findAnnotationAnnotatedWithSecurityBindingType(def);
+ for (IAnnotationDeclaration d: ds) {
+ addBoundMember(def, d, context);
+ }
+ }
+
+ private void addBoundMember(AbstractMemberDefinition def, IAnnotationDeclaration d, IRootDefinitionContext context) {
+ String securityBindingType = d.getTypeName();
+ if(def instanceof MethodDefinition) {
+ ((MethodDefinition)def).setCDIAnnotated(true);
+ }
+ DeltaspikeSecurityBindingConfiguration c = ((DeltaspikeSecurityDefinitionContext)this.context.getWorkingCopy()).getConfiguration(securityBindingType);
+
+ c.getBoundMembers().put(def, d);
+
+ addToDependencies(c, def, context);
+ }
+
+
+ private void addToDependencies(DeltaspikeSecurityBindingConfiguration c, AbstractMemberDefinition def, IRootDefinitionContext context) {
+ IResource r = def.getResource();
+ if(r != null && r.exists() && !c.getInvolvedTypes().contains(r.getFullPath())) {
+ IPath newPath = r.getFullPath();
+ Set<IPath> ps = c.getInvolvedTypes();
+ for (IPath p: ps) {
+ context.addDependency(p, newPath);
+ context.addDependency(newPath, p);
+ }
+ ps.add(newPath);
+ }
+ }
+
+ static List<IAnnotationDeclaration> EMPTY = Collections.<IAnnotationDeclaration>emptyList();
+
+ private List<IAnnotationDeclaration> findAnnotationAnnotatedWithSecurityBindingType(AbstractMemberDefinition m) {
+ List<IAnnotationDeclaration> result = null;
+ List<IAnnotationDeclaration> ds = m.getAnnotations();
+ for (IAnnotationDeclaration d: ds) {
+ if(d.getTypeName() != null) {
+ AnnotationDefinition a = context.getRootContext().getAnnotation(d.getTypeName());
+ if(a != null && a.isAnnotationPresent(SECURITY_BINDING_ANNOTATION_TYPE_NAME)) {
+ if(result == null) {
+ result = new ArrayList<IAnnotationDeclaration>();
+ }
+ result.add(d);
+ }
+ }
+ }
+ return result == null ? EMPTY : result;
+ }
+
+ @Override
+ public void validateResource(IFile file, CDICoreValidator validator) {
+ Set<DeltaspikeAuthorityMethod> authorizers = context.getAuthorityMethods(file.getFullPath());
+ for (DeltaspikeAuthorityMethod authorizer: authorizers) {
+ IAnnotationDeclaration a = authorizer.getMethod().getAnnotation(SECURES_ANNOTATION_TYPE_NAME);
+ if(authorizer.getBindings().isEmpty()) {
+ validator.addError(DeltaspikeValidationMessages.INVALID_AUTHORIZER_NO_BINDINGS,
+ DeltaspikeSeverityPreferences.INVALID_AUTHORIZER,
+ new String[]{authorizer.getMethod().getMethod().getElementName()},
+ a, file);
+ } else if(authorizer.getBindings().size() > 1) {
+ validator.addError(DeltaspikeValidationMessages.INVALID_AUTHORIZER_MULTIPLE_BINDINGS,
+ DeltaspikeSeverityPreferences.INVALID_AUTHORIZER,
+ new String[]{authorizer.getMethod().getMethod().getElementName()},
+ a, file);
+ }
+ try {
+ String returnType = authorizer.getMethod().getMethod().getReturnType();
+ if(!"Z".equals(returnType)) { //$NON-NLS-1$
+ validator.addError(DeltaspikeValidationMessages.INVALID_AUTHORIZER_NOT_BOOLEAN,
+ DeltaspikeSeverityPreferences.INVALID_AUTHORIZER,
+ new String[]{authorizer.getMethod().getMethod().getElementName()},
+ a, file);
+ }
+
+ } catch (JavaModelException e) {
+ DeltaspikeCorePlugin.getDefault().logError(e);
+ }
+
+ }
+
+ for (DeltaspikeSecurityBindingConfiguration c: context.getConfigurations().values()) {
+ if(c.getInvolvedTypes().contains(file.getFullPath())) {
+ Set<DeltaspikeAuthorityMethod> authorizers2 = c.getAuthorizerMembers();
+ Map<AbstractMemberDefinition, IAnnotationDeclaration> 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);
+ int k = 0;
+ for (DeltaspikeAuthorityMethod a: authorizers2) {
+ try {
+ if(a.isMatching(dc)) k++;
+ } catch (CoreException e) {
+ DeltaspikeCorePlugin.getDefault().logError(e);
+ }
+ }
+ if(k == 0) {
+ validator.addError(DeltaspikeValidationMessages.UNRESOLVED_AUTHORIZER,
+ DeltaspikeSeverityPreferences.UNRESOLVED_AUTHORIZER,
+ new String[]{dc.getTypeName(), name},
+ dc, file);
+ } else if(k > 1) {
+ validator.addError(DeltaspikeValidationMessages.AMBIGUOUS_AUTHORIZER,
+ DeltaspikeSeverityPreferences.AMBIGUOUS_AUTHORIZER,
+ new String[]{dc.getTypeName(), name},
+ dc, file);
+ }
+
+ }
+ }
+ }
+ }
+ //
+ }
+
+ @Override
+ public SeverityPreferences getSeverityPreferences() {
+ return DeltaspikeSeverityPreferences.getInstance();
+ }
+
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferenceInitializer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferenceInitializer.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferenceInitializer.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeSeverityPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(DeltaspikeCorePlugin.PLUGIN_ID);
+ for (String name : DeltaspikeSeverityPreferences.SEVERITY_OPTION_NAMES) {
+ defaultPreferences.put(name, SeverityPreferences.WARNING);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferenceInitializer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java 2012-05-23 00:25:01 UTC (rev 41269)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -27,6 +27,9 @@
public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
public static final String WARNING_GROUP_ID = "deltaspike"; //$NON-NLS-1$
+ public static final String AMBIGUOUS_AUTHORIZER = INSTANCE.createSeverityOption("ambiguousAuthorizer", "ambiguous-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String UNRESOLVED_AUTHORIZER = INSTANCE.createSeverityOption("unresolvedAuthorizer", "unresolved-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String INVALID_AUTHORIZER = INSTANCE.createSeverityOption("invalidAuthorizer", "invalid-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
public static DeltaspikeSeverityPreferences getInstance() {
return INSTANCE;
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DeltaspikeValidationMessages extends NLS {
+ private static final String BUNDLE_NAME = DeltaspikeValidationMessages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
+
+ public static String AMBIGUOUS_AUTHORIZER;
+ public static String UNRESOLVED_AUTHORIZER;
+ public static String INVALID_AUTHORIZER_MULTIPLE_BINDINGS;
+ public static String INVALID_AUTHORIZER_NO_BINDINGS;
+ public static String INVALID_AUTHORIZER_NOT_BOOLEAN;
+
+ public static String INVALID_AUTHORIZER;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, DeltaspikeValidationMessages.class);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties 2012-05-23 00:44:26 UTC (rev 41270)
@@ -0,0 +1,5 @@
+AMBIGUOUS_AUTHORIZER=Ambiguous authorizers found for security binding type {0} on method {1}.
+UNRESOLVED_AUTHORIZER=No matching authorizer found for security binding type {0} on method {1}.
+INVALID_AUTHORIZER_MULTIPLE_BINDINGS=Authorizer method {0} declares multiple security binding types.
+INVALID_AUTHORIZER_NO_BINDINGS=Authorizer method {0} does not declare a security binding type.
+INVALID_AUTHORIZER_NOT_BOOLEAN=Authorizer method {0} does not return a boolean.
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r41269 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl: definition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-05-22 20:25:01 -0400 (Tue, 22 May 2012)
New Revision: 41269
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Nonbinding members are added for annotation types used by CDI extensions.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2012-05-22 23:16:42 UTC (rev 41268)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2012-05-23 00:25:01 UTC (rev 41269)
@@ -11,6 +11,8 @@
package org.jboss.tools.cdi.internal.core.impl;
import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.common.java.IAnnotationType;
/**
*
@@ -35,4 +37,16 @@
this.project = project;
}
+ public IAnnotationType getAnnotation() {
+ AnnotationDefinition def = project.getDefinitions().getAnnotation(getTypeName());
+ if(def != null && def.getKind() == AnnotationDefinition.EXTENDED) {
+ CDIAnnotationElement result = new CDIAnnotationElement();
+ result.setParent((CDIElement)project.getDelegate());
+ result.setDefinition(def);
+ result.setSourcePath(def.getType().getPath());
+ return result;
+ }
+ return null;
+ }
+
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2012-05-22 23:16:42 UTC (rev 41268)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2012-05-23 00:25:01 UTC (rev 41269)
@@ -82,7 +82,7 @@
}
public void revalidateKind(IRootDefinitionContext context) {
- boolean hasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING) > 0;
+ boolean hasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING) > 0 || kind == EXTENDED;
kind = NON_RELEVANT;
Map<String, AnnotationDeclaration> ds = new HashMap<String, AnnotationDeclaration>();
@@ -123,7 +123,7 @@
}
}
- boolean newHasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING) > 0;
+ boolean newHasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING) > 0 || kind == EXTENDED;
if(newHasMembers != hasMembers) {
methods.clear();
try {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2012-05-22 23:16:42 UTC (rev 41268)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2012-05-23 00:25:01 UTC (rev 41269)
@@ -25,6 +25,7 @@
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IRootDefinitionContext;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
import org.jboss.tools.common.java.IAnnotationDeclaration;
@@ -76,12 +77,17 @@
if(ps.length == 0) return;
if(contextType == null) return;
+ Set<IProcessAnnotatedMemberFeature> extensions = context.getProject().getExtensionManager().getProcessAnnotatedMemberFeatures();
+
ParameterDefinition[] ds = new ParameterDefinition[ps.length];
for (int i = 0; i < ps.length; i++) {
ParameterDefinition pd = new ParameterDefinition();
pd.setMethodDefinition(this);
pd.index = i;
pd.setLocalVariable(ps[i], context, flags);
+ for (IProcessAnnotatedMemberFeature e: extensions) {
+ e.processAnnotatedMember(pd, context);
+ }
if(pd.isAnnotationPresent(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME)
|| pd.isAnnotationPresent(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)) {
parametersAreInjectionPoints = true;
12 years, 7 months
JBoss Tools SVN: r41267 - trunk/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 18:28:42 -0400 (Tue, 22 May 2012)
New Revision: 41267
Modified:
trunk/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: trunk/build/aggregate/soa-site/site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 22:26:00 UTC (rev 41266)
+++ trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 22:28:42 UTC (rev 41267)
@@ -40,7 +40,7 @@
<category name="SOATools" />
</feature>
<!-- ESB requires zest -->
- <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclise.zest.feature" version="0.0.0"/>
+ <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclipse.zest.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: r41266 - branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 18:26:00 -0400 (Tue, 22 May 2012)
New Revision: 41266
Modified:
branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
===================================================================
--- branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 21:38:09 UTC (rev 41265)
+++ branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 22:26:00 UTC (rev 41266)
@@ -40,7 +40,7 @@
<category name="SOATools" />
</feature>
<!-- ESB requires zest -->
- <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclise.zest" version="0.0.0"/>
+ <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclipse.zest" 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: r41265 - trunk/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 17:38:09 -0400 (Tue, 22 May 2012)
New Revision: 41265
Modified:
trunk/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: trunk/build/aggregate/soa-site/site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 21:34:42 UTC (rev 41264)
+++ trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 21:38:09 UTC (rev 41265)
@@ -40,7 +40,7 @@
<category name="SOATools" />
</feature>
<!-- ESB requires zest -->
- <feature url="features/org.eclipse.zest.feature_0.0.0.jar" id="org.eclise.zest.feature" version="0.0.0"/>
+ <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclise.zest.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