JBoss Tools SVN: r31792 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-06-02 20:19:44 -0400 (Thu, 02 Jun 2011)
New Revision: 31792
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
Log:
JBIDE-9060
https://issues.jboss.org/browse/JBIDE-9060
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java 2011-06-03 00:17:55 UTC (rev 31791)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java 2011-06-03 00:19:44 UTC (rev 31792)
@@ -20,12 +20,22 @@
}
private boolean isComponents(String body) {
- int i = body.indexOf("<html"); //$NON-NLS-1$
- if(i < 0) return false;
- int j = body.indexOf(">", i); //$NON-NLS-1$
- if(j < 0) return false;
- String s = body.substring(i, j);
- return s.indexOf("\"" + COMPOSITE_XMLNS + "\"") > 0; //$NON-NLS-1$ //$NON-NLS-2$
+ String q = "\""; //$NON-NLS-1$
+ int i = body.indexOf(q + COMPOSITE_XMLNS + q);
+ while(i > 0) {
+ int j = body.lastIndexOf("xmlns", i); //$NON-NLS-1$
+ if(j > 0) {
+ int k = body.indexOf("=", j); //$NON-NLS-1$
+ if(k > j && k < i) {
+ int l = body.indexOf(q, k);
+ if(l == i) {
+ return true;
+ }
+ }
+ }
+ i = body.indexOf(q + COMPOSITE_XMLNS + q, i + 1);
+ }
+ return false;
}
-
+
}
13 years, 6 months
JBoss Tools SVN: r31791 - in trunk/jsf/tests/org.jboss.tools.jsf.test: projects/TestKbModel/WebContent/resources and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-06-02 20:17:55 -0400 (Thu, 02 Jun 2011)
New Revision: 31791
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input2.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/KbModelTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
Log:
JBIDE-9060
https://issues.jboss.org/browse/JBIDE-9060
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input.xhtml 2011-06-03 00:17:55 UTC (rev 31791)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<h:commandButton xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <composite:interface>
+ <composite:attribute name="label"/>
+ <composite:attribute name="value" required="true"/>
+ <composite:attribute name="action" required="true" method-signature="java.lang.String f()"/>
+ <composite:attribute name="submitlabel"/>
+ </composite:interface>
+
+ <composite:implementation>
+ <h:form>
+ <h:outputText value="#{cc.attrs.label}" />
+ <h:inputText value="#{cc.attrs.value}" />
+ <h:commandButton action="#{cc.attrs.action}" value="#{cc.attrs.submitlabel}" />
+ </h:form>
+ </composite:implementation>
+</h:commandButton>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input2.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input2.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input2.xhtml 2011-06-03 00:17:55 UTC (rev 31791)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <composite:interface>
+ <composite:attribute name="label2"/>
+ <composite:attribute name="value2" required="true"/>
+ <composite:attribute name="action2" required="true" method-signature="java.lang.String f()"/>
+ <composite:attribute name="submitlabel2"/>
+ </composite:interface>
+
+ <composite:implementation>
+ <h:form>
+ <h:outputText value="#{cc.attrs.label2}" />
+ <h:inputText value="#{cc.attrs.value2}" />
+ <h:commandButton action="#{cc.attrs.action2}" value="#{cc.attrs.submitlabel2}" />
+ </h:form>
+ </composite:implementation>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/TestKbModel/WebContent/resources/demo/input2.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2011-06-02 23:12:37 UTC (rev 31790)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2011-06-03 00:17:55 UTC (rev 31791)
@@ -24,6 +24,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(JsfKbAllTests.class.getName());
suite.addTestSuite(FaceletsKbModelTest.class);
+ suite.addTestSuite(KbModelTest.class);
ProjectImportTestSetup testSetup = new XProjectImportTestSetUp(suite,
"org.jboss.tools.jsf.test",
new String[]{"projects/TestKbModel"},
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/KbModelTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/KbModelTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/KbModelTest.java 2011-06-03 00:17:55 UTC (rev 31791)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.kb.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
+import org.jboss.tools.jst.web.kb.internal.scanner.ScannerException;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.jboss.tools.jst.web.kb.internal.taglib.ELFunction;
+import org.jboss.tools.jst.web.kb.internal.taglib.composite.CompositeTagLibrary;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.IELFunction;
+import org.jboss.tools.jst.web.kb.taglib.IFunctionLibrary;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+import org.jboss.tools.test.util.JUnitUtils;
+
+public class KbModelTest extends TestCase {
+
+ IProject project = null;
+ boolean makeCopy = true;
+
+ public KbModelTest() {
+ super("Kb Model Test");
+ }
+
+ public void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("TestKbModel");
+ assertNotNull("Can't load TestKbModel", project); //$NON-NLS-1$
+ }
+
+ private IKbProject getKbProject() {
+ IKbProject kbProject = null;
+ try {
+ kbProject = (IKbProject)project.getNature(IKbProject.NATURE_ID);
+ } catch (Exception e) {
+ JUnitUtils.fail("Cannot get seam nature.",e);
+ }
+ return kbProject;
+ }
+
+ public void testCompositeComponentLibraries() {
+ IKbProject kbProject = getKbProject();
+ ITagLibrary[] ls = kbProject.getTagLibraries("http://java.sun.com/jsf/composite/demo");
+ assertEquals(1, ls.length);
+ ITagLibrary l = ls[0];
+ assertTrue(l instanceof CompositeTagLibrary);
+
+ //input.xhtml has root element other than <html>
+ IComponent c = l.getComponent("input");
+ assertNotNull(c);
+ assertNotNull(c.getAttribute("label"));
+
+ c = l.getComponent("input2");
+ assertNotNull(c);
+ assertNotNull(c.getAttribute("label2"));
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/KbModelTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
JBoss Tools SVN: r31790 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-06-02 19:12:37 -0400 (Thu, 02 Jun 2011)
New Revision: 31790
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation2.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-06-02 20:29:02 UTC (rev 31789)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-06-02 23:12:37 UTC (rev 31790)
@@ -94,4 +94,5 @@
public String WELD_BEAN_MANAGER_TYPE_NAME = "org.jboss.weld.manager.BeanManagerImpl";
public String SEAM_FACES_INPUT_FIELD_TYPE_NAME = "org.jboss.seam.faces.validation.InputField";
+ public String SEAM_FACES_INPUT_ELEMENT_TYPE_NAME = "org.jboss.seam.faces.validation.InputElement";
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-06-02 20:29:02 UTC (rev 31789)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-06-02 23:12:37 UTC (rev 31790)
@@ -1408,128 +1408,130 @@
* - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
*/
IType type = getTypeOfInjection(injection);
- IAnnotationDeclaration faces = injection.getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
- // If the injection point annotated @InputField then don't try to resolve it.
+ // If the injection point annotated @InputField then don't try to resolve it. Also ignore @Inject InputElement field.
// Despite this annotation is from Seam Faces module and is not part of JSR-299 it's much easy to check this annotation here instead of moving this check to Seam Faces plug-in.
// See https://issues.jboss.org/browse/JBIDE-8576
- if(faces==null && injection instanceof IInjectionPointParameter) {
- IInjectionPointParameter param = (IInjectionPointParameter)injection;
- faces = param.getBeanMethod().getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
- }
- if(faces==null) {
- boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
- Set<IBean> allBeans = cdiProject.getBeans(false, injection);
- for (IBean bean : allBeans) {
- if(!bean.getBeanClass().isReadOnly()) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
- }
+ if(type==null || !CDIConstants.SEAM_FACES_INPUT_ELEMENT_TYPE_NAME.equals(type.getFullyQualifiedName())) {
+ IAnnotationDeclaration faces = injection.getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
+ if(faces==null && injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter param = (IInjectionPointParameter)injection;
+ faces = param.getBeanMethod().getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
}
- if(type!=null && beans.isEmpty() && !instance) {
- addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
- } else if(beans.size()>1 && !instance) {
- addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
- } else if(beans.size()==1) {
- IBean bean = beans.iterator().next();
- if(!bean.getBeanClass().isReadOnly()) {
- /*
- * 5.2.4. Primitive types and null values
- * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
- */
- if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
- addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ if(faces==null) {
+ boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
+ Set<IBean> allBeans = cdiProject.getBeans(false, injection);
+ for (IBean bean : allBeans) {
+ if(!bean.getBeanClass().isReadOnly()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
}
- /*
- * 5.1.4. Inter-module injection
- * - a decorator can not be injected
- * - an interceptor can not be injected
- */
- if(bean instanceof IDecorator) {
- addError(CDIValidationMessages.INJECTED_DECORATOR, CDIPreferences.INJECTED_DECORATOR, reference, injection.getResource());
- } else if(bean instanceof IInterceptor) {
- addError(CDIValidationMessages.INJECTED_INTERCEPTOR, CDIPreferences.INJECTED_INTERCEPTOR, reference, injection.getResource());
- }
- /*
- * 5.4.1. Unproxyable bean types
- * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
- // - Array types cannot be proxied by the container.
- String typeSignature = injection.getType().getSignature();
- int kind = Signature.getTypeSignatureKind(typeSignature);
- if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(injection.getType().isPrimitive()) {
- // - Primitive types cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(bean instanceof IClassBean) {
- try {
- if(Flags.isFinal(bean.getBeanClass().getFlags())) {
- // - Classes which are declared final cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else {
- IMethod[] methods = bean.getBeanClass().getMethods();
- boolean hasDefaultConstructor = false;
- boolean hasConstructor = false;
- for (IMethod method : methods) {
- hasConstructor = hasConstructor || method.isConstructor();
- hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
- if(Flags.isFinal(method.getFlags())) {
- // - Classes which have final methods cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- hasDefaultConstructor = true;
- break;
+ }
+ if(type!=null && beans.isEmpty() && !instance) {
+ addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
+ } else if(beans.size()>1 && !instance) {
+ addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
+ } else if(beans.size()==1) {
+ IBean bean = beans.iterator().next();
+ if(!bean.getBeanClass().isReadOnly()) {
+ /*
+ * 5.2.4. Primitive types and null values
+ * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
+ */
+ if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
+ addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ }
+ /*
+ * 5.1.4. Inter-module injection
+ * - a decorator can not be injected
+ * - an interceptor can not be injected
+ */
+ if(bean instanceof IDecorator) {
+ addError(CDIValidationMessages.INJECTED_DECORATOR, CDIPreferences.INJECTED_DECORATOR, reference, injection.getResource());
+ } else if(bean instanceof IInterceptor) {
+ addError(CDIValidationMessages.INJECTED_INTERCEPTOR, CDIPreferences.INJECTED_INTERCEPTOR, reference, injection.getResource());
+ }
+ /*
+ * 5.4.1. Unproxyable bean types
+ * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
+ // - Array types cannot be proxied by the container.
+ String typeSignature = injection.getType().getSignature();
+ int kind = Signature.getTypeSignatureKind(typeSignature);
+ if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().isPrimitive()) {
+ // - Primitive types cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(bean instanceof IClassBean) {
+ try {
+ if(Flags.isFinal(bean.getBeanClass().getFlags())) {
+ // - Classes which are declared final cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else {
+ IMethod[] methods = bean.getBeanClass().getMethods();
+ boolean hasDefaultConstructor = false;
+ boolean hasConstructor = false;
+ for (IMethod method : methods) {
+ hasConstructor = hasConstructor || method.isConstructor();
+ hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
+ if(Flags.isFinal(method.getFlags())) {
+ // - Classes which have final methods cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ hasDefaultConstructor = true;
+ break;
+ }
}
+ if(!hasDefaultConstructor && hasConstructor) {
+ // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ }
}
- if(!hasDefaultConstructor && hasConstructor) {
- // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
}
- }
- if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
- try {
- IType beanClass = bean.getBeanClass();
- if(Flags.isFinal(beanClass.getFlags())) {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
- // the problem and treats it as a deployment problem.
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- } else {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
- // the container automatically detects the problem and treats it as a deployment problem.
- IType decoratorClass = injection.getClassBean().getBeanClass();
- IMethod[] methods = decoratorClass.getMethods();
- boolean reported = false;
- if(methods!=null) {
- for (IMethod method : methods) {
- if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
- IMethod[] beanMethods = beanClass.findMethods(method);
- if(beanMethods!=null) {
- for (IMethod beanMethod : beanMethods) {
- int flags = beanMethod.getFlags();
- if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
- String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- reported = true;
+ if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
+ try {
+ IType beanClass = bean.getBeanClass();
+ if(Flags.isFinal(beanClass.getFlags())) {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
+ // the problem and treats it as a deployment problem.
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ } else {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
+ // the container automatically detects the problem and treats it as a deployment problem.
+ IType decoratorClass = injection.getClassBean().getBeanClass();
+ IMethod[] methods = decoratorClass.getMethods();
+ boolean reported = false;
+ if(methods!=null) {
+ for (IMethod method : methods) {
+ if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
+ IMethod[] beanMethods = beanClass.findMethods(method);
+ if(beanMethods!=null) {
+ for (IMethod beanMethod : beanMethods) {
+ int flags = beanMethod.getFlags();
+ if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
+ String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ reported = true;
+ break;
+ }
+ }
+ if(reported) {
break;
}
}
- if(reported) {
- break;
- }
}
}
}
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
}
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation2.java 2011-06-02 23:12:37 UTC (rev 31790)
@@ -0,0 +1,17 @@
+package org.jboss.beans.validation.test;
+
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.validation.InputElement;
+
+public class Validation2 {
+
+ @Inject InputElement<MyBean1> bean3Ok;
+
+ @Inject InputElement<String> bean4Ok;
+
+ @Inject
+ public void setMyBeanOk(InputElement<MyBean1> bean, InputElement<String> bean2) {
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-06-02 20:29:02 UTC (rev 31789)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-06-02 23:12:37 UTC (rev 31790)
@@ -17,14 +17,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -57,4 +54,12 @@
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 14);
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 14);
}
+
+ public void testInjectionWInputElemnt() throws Exception {
+ IFile file = getTestProject().getFile("src/org/jboss/beans/validation/test/Validation2.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 11);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 14);
+ }
}
\ No newline at end of file
13 years, 6 months
JBoss Tools SVN: r31789 - in trunk/cdi/tests: org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-06-02 16:29:02 -0400 (Thu, 02 Jun 2011)
New Revision: 31789
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9058
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -1,15 +1,10 @@
package org.jboss.jsr299.tck.tests.jbt.openon;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.New;
import javax.enterprise.inject.Produces;
-/**
- * @author pmuir
- *
- */
-public class CustomProducerImpl implements Producer
+public class CustomProducerImpl
{
private static boolean disposedCorrectly = false;
@@ -23,22 +18,16 @@
}
@Produces
- public Foo produce()
+ public Something produce(Something order)
{
- return new Foo("foo!");
+ return new Something();
}
- @Produces
- public Foo produce2(Foo order)
+ public void dispose(@Disposes Something toDispose)
{
- return new Foo("foo!");
+
}
- public void dispose(@Disposes Foo foo)
- {
- disposedCorrectly = foo.getFoo().equals("decorated");
- }
-
/**
* @return the disposedCorrectly
*/
@@ -46,5 +35,9 @@
{
return disposedCorrectly;
}
+
+ public class Something{
+
+ }
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -3,7 +3,9 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.Region;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.cdi.seam.text.ext.CDISeamExtMessages;
+import org.jboss.tools.cdi.seam.text.ext.hyperlink.CDISeamResourceLoadingHyperlink;
import org.jboss.tools.cdi.seam.text.ext.hyperlink.CDISeamResourceLoadingHyperlinkDetector;
import org.jboss.tools.cdi.text.ext.test.HyperlinkDetectorTest;
import org.jboss.tools.common.util.FileUtil;
@@ -16,12 +18,12 @@
String text = FileUtil.readStream(file);
- ArrayList<Region> regionList = new ArrayList<Region>();
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
int injectPosition = text.indexOf("@Inject");
//System.out.println("injectPosition - "+injectPosition);
if(injectPosition > 0){
- regionList.add(new Region(injectPosition, 58));
+ regionList.add(new TestRegion(injectPosition, 58, new TestHyperlink[]{new TestHyperlink(CDISeamResourceLoadingHyperlink.class, NLS.bind(CDISeamExtMessages.CDI_SEAM_RESOURCE_LOADING_HYPERLINK, "WEB-INF/beans.xml"))}));
}
checkRegions(FILENAME, regionList, new CDISeamResourceLoadingHyperlinkDetector());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -2,37 +2,40 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
import org.jboss.tools.cdi.text.ext.hyperlink.EventAndObserverMethodHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.hyperlink.EventListHyperlink;
+import org.jboss.tools.cdi.text.ext.hyperlink.ObserverMethodListHyperlink;
public class EventAndObserverMethodHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testEventHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(959, 6));
- regionList.add(new Region(967, 16));
- regionList.add(new Region(985, 11));
- regionList.add(new Region(1006, 6));
- regionList.add(new Region(1014, 3));
- regionList.add(new Region(1019, 34));
- regionList.add(new Region(1055, 42));
- regionList.add(new Region(1107, 6));
- regionList.add(new Region(1115, 34));
- regionList.add(new Region(1151, 36));
- regionList.add(new Region(1188, 3));
- regionList.add(new Region(1235, 11));
- regionList.add(new Region(1334, 42));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+
+ regionList.add(new TestRegion(959, 6, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(967, 16, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(985, 11, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1006, 6, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1019, 34, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1055, 42, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1107, 6, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1115, 34, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1151, 36, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1188, 3, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1235, 11, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1334, 42, new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java", regionList, new EventAndObserverMethodHyperlinkDetector());
}
public void testObserverMethodHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(1196, 4));
- regionList.add(new Region(1201, 13));
- regionList.add(new Region(1216, 15));
- regionList.add(new Region(1232, 9));
- regionList.add(new Region(1264, 18));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(1196, 4, new TestHyperlink[]{new TestHyperlink(EventListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1201, 13, new TestHyperlink[]{new TestHyperlink(EventListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1216, 15, new TestHyperlink[]{new TestHyperlink(EventListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1232, 9, new TestHyperlink[]{new TestHyperlink(EventListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1264, 18, new TestHyperlink[]{new TestHyperlink(EventListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/event/observer/checkedException/TeaCupPomeranian.java", regionList, new EventAndObserverMethodHyperlinkDetector());
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -1,5 +1,6 @@
package org.jboss.tools.cdi.text.ext.test;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -35,7 +36,7 @@
import org.jboss.tools.common.text.ext.util.AxisUtil;
public class HyperlinkDetectorTest extends TCKTest {
- protected void checkRegions(String fileName, List<Region> regionList, AbstractHyperlinkDetector elPartitioner) throws Exception {
+ protected void checkRegions(String fileName, List<TestRegion> regionList, AbstractHyperlinkDetector elPartitioner) throws Exception {
IFile file = tckProject.getFile(fileName);
assertNotNull("The file \"" + fileName + "\" is not found", file);
@@ -65,8 +66,8 @@
assertNotNull("The document for the file \"" + fileName + "\" is not loaded", document);
int expected = 0;
- for(Region region : regionList)
- expected += region.getLength()+1;
+ for(TestRegion testRegion : regionList)
+ expected += testRegion.region.getLength()+1;
IEditorPart part = openFileInEditor(file);
ISourceViewer viewer = null;
@@ -85,14 +86,17 @@
if (recognized) {
counter++;
- if(!findOffsetInRegions(i, regionList)){
+ TestRegion testRegion = findOffsetInRegions(i, regionList);
+ if(testRegion == null){
fail("Wrong detection for offset - "+i);
+ }else{
+ checkTestRegion(links, testRegion);
}
} else {
- for(Region region : regionList){
- if(i >= region.getOffset() && i <= region.getOffset()+region.getLength()) {
- int line = document.getLineOfOffset(region.getOffset());
- fail("Wrong detection for region - "+region.getOffset()+" : "+region.getLength()+" region - "+i);
+ for(TestRegion testRegion : regionList){
+ if(i >= testRegion.region.getOffset() && i <= testRegion.region.getOffset()+testRegion.region.getLength()) {
+ int line = document.getLineOfOffset(testRegion.region.getOffset());
+ fail("Wrong detection for region - "+testRegion.region.getOffset()+" : "+testRegion.region.getLength()+" region - "+i);
}
}
}
@@ -102,7 +106,37 @@
documentProvider.disconnect(editorInput);
}
+
+ protected void checkTestRegion(IHyperlink[] links, TestRegion testRegion){
+ for(IHyperlink link : links){
+ TestHyperlink testLink = findTestHyperlink(testRegion.hyperlinks, link);
+ assertNotNull("Unexpected hyperlink - "+link.getHyperlinkText(), testLink);
+ assertEquals("Unexpected hyperlink type", testLink.hyperlink, link.getClass());
+ assertTrue("Validation fails for hyperlink - "+link.getHyperlinkText(), testLink.validateHyperlink(link));
+ }
+
+ for(TestHyperlink testLink : testRegion.hyperlinks){
+ IHyperlink link = findHyperlink(links, testLink);
+ assertNotNull("Hyperlink - "+testLink.name+" not found", link);
+ }
+ }
+
+ protected TestHyperlink findTestHyperlink(List<TestHyperlink> testHyperlinks, IHyperlink link){
+ for(TestHyperlink testLink : testHyperlinks){
+ if(testLink.name.equals(link.getHyperlinkText()))
+ return testLink;
+ }
+ return null;
+ }
+ protected IHyperlink findHyperlink(IHyperlink[] links, TestHyperlink testLink){
+ for(IHyperlink link : links){
+ if(testLink.name.equals(link.getHyperlinkText()))
+ return link;
+ }
+ return null;
+ }
+
protected void checkHyperLinkInXml(String fileName, int offset, String hyperlinkClassName) throws Exception {
checkHyperLinkInXml(fileName, tckProject, offset, hyperlinkClassName);
}
@@ -142,12 +176,12 @@
return null;
}
- protected boolean findOffsetInRegions(int offset, List<Region> regionList){
- for(Region region : regionList){
- if(offset >= region.getOffset() && offset <= region.getOffset()+region.getLength())
- return true;
+ protected TestRegion findOffsetInRegions(int offset, List<TestRegion> regionList){
+ for(TestRegion testRegion : regionList){
+ if(offset >= testRegion.region.getOffset() && offset <= testRegion.region.getOffset()+testRegion.region.getLength())
+ return testRegion;
}
- return false;
+ return null;
}
public static IEditorPart openFileInEditor(IFile input) {
@@ -270,4 +304,30 @@
return null;
}
}
+
+ public class TestRegion{
+ Region region;
+ ArrayList<TestHyperlink> hyperlinks = new ArrayList<TestHyperlink>();
+
+ public TestRegion(int offset, int length, TestHyperlink[] testHyperlinks){
+ region = new Region(offset, length);
+ for(TestHyperlink testHyperlink : testHyperlinks){
+ hyperlinks.add(testHyperlink);
+ }
+ }
+ }
+
+ public class TestHyperlink{
+ Class<? extends IHyperlink> hyperlink;
+ String name;
+
+ public TestHyperlink(Class<? extends IHyperlink> hyperlink, String name){
+ this.hyperlink = hyperlink;
+ this.name = name;
+ }
+
+ public boolean validateHyperlink(IHyperlink hyperlink){
+ return true;
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -2,54 +2,77 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
+import org.jboss.tools.cdi.text.ext.hyperlink.AlternativeInjectedPointListHyperlink;
+import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlinkDetector;
-import org.jboss.tools.cdi.text.ext.hyperlink.ProducerDisposerHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.test.HyperlinkDetectorTest.TestRegion;
+import org.jboss.tools.common.util.FileUtil;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
public class InjectedPointHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testInjectedPointHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(115, 6)); // Inject
- regionList.add(new Region(133, 6)); // Logger
- regionList.add(new Region(140, 6)); // logger
- regionList.add(new Region(196, 6)); // logger
- regionList.add(new Region(250, 6)); // logger
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(115, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // Inject
+ regionList.add(new TestRegion(133, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // Logger
+ regionList.add(new TestRegion(140, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
+ regionList.add(new TestRegion(196, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
+ regionList.add(new TestRegion(250, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java", regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedProducerMethodParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(551, 9)); // order
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java");
+ String text = FileUtil.readStream(file);
+ int orderPosition = text.indexOf("Something order");
+
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(orderPosition, 15, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " CustomProducerImpl.produce()")
+ })); // order
+
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java", regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedConstructorParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(880, 6));
- regionList.add(new Region(894, 3)); // Fox
- regionList.add(new Region(898, 3));
- regionList.add(new Region(975, 3));
- regionList.add(new Region(979, 3));
- regionList.add(new Region(1017, 3));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(880, 6, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")})); // Fox
+ regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(975, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(979, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(1017, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java", regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedInitializerParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(880, 6));
- regionList.add(new Region(894, 3)); // Fox
- regionList.add(new Region(898, 3));
- regionList.add(new Region(972, 3));
- regionList.add(new Region(976, 3));
- regionList.add(new Region(1014, 3));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(880, 6, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")})); // Fox
+ regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(972, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(976, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
+ regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java", regionList, new InjectedPointHyperlinkDetector());
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2011-06-02 20:04:56 UTC (rev 31788)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2011-06-02 20:29:02 UTC (rev 31789)
@@ -2,16 +2,18 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
+import org.jboss.tools.cdi.text.ext.hyperlink.DisposerHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.ProducerDisposerHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.hyperlink.ProducerHyperlink;
public class ProducerDisposerHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testProducerDisposerHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(1199, 8)); // @Produces
- regionList.add(new Region(1222, 7)); // producer
- regionList.add(new Region(1291, 7)); // disposer
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(1199, 8, new TestHyperlink[]{new TestHyperlink(DisposerHyperlink.class, CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ " dispose")})); // @Produces
+ regionList.add(new TestRegion(1222, 7, new TestHyperlink[]{new TestHyperlink(DisposerHyperlink.class, CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ " dispose")})); // producer
+ regionList.add(new TestRegion(1291, 7, new TestHyperlink[]{new TestHyperlink(ProducerHyperlink.class, CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_PRODUCER+ " produce")})); // disposer
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java", regionList, new ProducerDisposerHyperlinkDetector());
}
13 years, 6 months
JBoss Tools SVN: r31788 - in trunk/runtime: plugins and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 16:04:56 -0400 (Thu, 02 Jun 2011)
New Revision: 31788
Modified:
trunk/runtime/features/pom.xml
trunk/runtime/plugins/pom.xml
trunk/runtime/site/site.xml
Log:
JBIDE-9026 Separate specific runtime detection plugins from base core
Modified: trunk/runtime/features/pom.xml
===================================================================
--- trunk/runtime/features/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
+++ trunk/runtime/features/pom.xml 2011-06-02 20:04:56 UTC (rev 31788)
@@ -16,5 +16,9 @@
<module>org.jboss.tools.runtime.core.feature</module>
<module>org.jboss.tools.runtime.feature</module>
<module>org.jboss.tools.runtime.test.feature</module>
+ <module>org.jboss.tools.runtime.as.detector.feature</module>
+ <module>org.jboss.tools.runtime.seam.detector.feature</module>
+ <module>org.jboss.tools.runtime.jbpm.detector.feature</module>
+ <module>org.jboss.tools.runtime.drools.detector.feature</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/runtime/plugins/pom.xml
===================================================================
--- trunk/runtime/plugins/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
+++ trunk/runtime/plugins/pom.xml 2011-06-02 20:04:56 UTC (rev 31788)
@@ -16,5 +16,9 @@
<module>org.jboss.tools.runtime</module>
<module>org.jboss.tools.runtime.core</module>
<module>org.jboss.tools.runtime.ui</module>
+ <module>org.jboss.tools.runtime.as.detector</module>
+ <module>org.jboss.tools.runtime.seam.detector</module>
+ <module>org.jboss.tools.runtime.drools.detector</module>
+ <module>org.jboss.tools.runtime.jbpm.detector</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/runtime/site/site.xml
===================================================================
--- trunk/runtime/site/site.xml 2011-06-02 20:00:22 UTC (rev 31787)
+++ trunk/runtime/site/site.xml 2011-06-02 20:04:56 UTC (rev 31788)
@@ -9,6 +9,18 @@
<feature url="features/org.jboss.tools.runtime.core.feature_0.0.0.jar" id="org.jboss.tools.runtime.core.feature" version="0.0.0">
<category name="JBoss Tools runtime Nightly Build Update Site"/>
</feature>
+ <feature url="features/org.jboss.tools.runtime.as.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature" version="0.0.0">
+ <category name="JBoss Tools runtime Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.drools.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.drools.detector.feature" version="0.0.0">
+ <category name="JBoss Tools runtime Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.jbpm.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature" version="0.0.0">
+ <category name="JBoss Tools runtime Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.seam.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature" version="0.0.0">
+ <category name="JBoss Tools runtime Nightly Build Update Site"/>
+ </feature>
<category-def name="JBoss Tools runtime Nightly Build Update Site" label="JBoss Tools runtime Nightly Build Update Site">
<description>
JBoss Tools runtime Nightly Build Update Site: contains all features in this build.
13 years, 6 months
JBoss Tools SVN: r31787 - in trunk/runtime: features/org.jboss.tools.runtime.drools.detector.feature and 53 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 16:00:22 -0400 (Thu, 02 Jun 2011)
New Revision: 31787
Added:
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/.project
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html
trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/.project
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/build.properties
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.properties
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.xml
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/license.html
trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/.project
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/build.properties
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.properties
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.xml
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/license.html
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.project
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.html
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.classpath
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.project
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.settings/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.settings/org.eclipse.jdt.core.prefs
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/META-INF/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.html
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.ini
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.mappings
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.properties
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/build.properties
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/jboss_about.png
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.properties
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/detector/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/detector/RuntimeDroolsActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/handlers/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/handlers/DroolsHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.classpath
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.project
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.settings/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.settings/org.eclipse.jdt.core.prefs
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/META-INF/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.html
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.ini
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.mappings
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.properties
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/jboss_about.png
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.properties
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/handlers/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/handlers/JbpmHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/detector/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/detector/RuntimeJbpmActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.project
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java
Removed:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java
trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
trunk/runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF
trunk/runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
Log:
JBIDE-9026 Separate specific runtime detection plugins from base core
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/.project
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/.project (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.as.detector.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ license.html,\
+ feature.properties
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-2010 JBoss by Red Hat 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.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Runtime AS Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime AS Detector
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.runtime.as.detector.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.runtime.as.detector">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.runtime.as.detector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>features</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.features</groupId>
+ <artifactId>org.jboss.tools.runtime.as.detector.feature</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/.project
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/.project (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.drools.detector.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/build.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/build.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ license.html,\
+ feature.properties
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-2010 JBoss by Red Hat 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.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Runtime Drools Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime Drools Detector
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/feature.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.runtime.drools.detector.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.runtime.drools.detector">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.runtime.drools.detector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/license.html
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/license.html (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/license.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>features</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.features</groupId>
+ <artifactId>org.jboss.tools.runtime.drools.detector.feature</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/.project
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/.project (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.jbpm.detector.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/build.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/build.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-2010 JBoss by Red Hat 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.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Runtime jBPM Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime jBPM Detector
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/feature.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.runtime.jbpm.detector.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.runtime.jbpm.detector">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.runtime.jbpm.detector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/license.html
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/license.html (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/license.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>features</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.features</groupId>
+ <artifactId>org.jboss.tools.runtime.jbpm.detector.feature</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.seam.detector.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ license.html,\
+ feature.properties
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-2010 JBoss by Red Hat 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.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Runtime Seam Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime Seam Detector
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.runtime.seam.detector.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.runtime.seam.detector">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.runtime.seam.detector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml (rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>features</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.features</groupId>
+ <artifactId>org.jboss.tools.runtime.seam.detector.feature</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -5,26 +5,14 @@
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.jboss.tools.runtime.Activator
Bundle-Vendor: %BundleVendor
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.jboss.tools.seam.core,
- org.drools.eclipse;resolution:=optional,
- org.eclipse.ui,
- org.eclipse.wst.server.core,
- org.eclipse.ui.navigator,
- org.eclipse.debug.core,
- org.eclipse.jdt.launching,
- org.eclipse.ui.workbench,
- org.eclipse.datatools.connectivity;visibility:=reexport,
- org.eclipse.datatools.connectivity.db.generic,
- org.jboss.tools.common,
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.0",
+ org.eclipse.ui;bundle-version="3.7.0",
org.jboss.tools.runtime.core,
- org.jboss.ide.eclipse.as.core,
- org.jboss.tools.jbpm.common
+ org.eclipse.ui.navigator;bundle-version="3.5.100"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.jboss.tools.runtime,
- org.jboss.tools.runtime.handlers,
org.jboss.tools.runtime.preferences
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -61,43 +61,4 @@
</extension>
-->
- <extension
- point="org.jboss.tools.runtime.core.runtimeDetectors">
- <runtimeDetector
- id="org.jboss.tools.runtime.handlers.JBossASHandler"
- name="JBoss AS"
- class="org.jboss.tools.runtime.handlers.JBossASHandler"
- preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
- priority="100"/>
- </extension>
-
- <extension
- point="org.jboss.tools.runtime.core.runtimeDetectors">
- <runtimeDetector
- id="org.jboss.tools.runtime.handlers.DroolsHandler"
- name="Drools"
- class="org.jboss.tools.runtime.handlers.DroolsHandler"
- preferenceId="org.drools.eclipse.preferences.DroolsRuntimesPreferencePage"
- priority="300"/>
- </extension>
-
- <extension
- point="org.jboss.tools.runtime.core.runtimeDetectors">
- <runtimeDetector
- id="org.jboss.tools.runtime.handlers.JbpmHandler"
- name="jBPM"
- class="org.jboss.tools.runtime.handlers.JbpmHandler"
- preferenceId="org.jboss.tools.jbpm.locations"
- priority="400"/>
- </extension>
-
- <extension
- point="org.jboss.tools.runtime.core.runtimeDetectors">
- <runtimeDetector
- id="org.jboss.tools.runtime.handlers.SeamHandler"
- name="Seam"
- class="org.jboss.tools.runtime.handlers.SeamHandler"
- preferenceId="org.jboss.tools.common.model.ui.seam"
- priority="200"/>
- </extension>
</plugin>
Deleted: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * 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.runtime;
-
-public interface IJBossRuntimePluginConstants {
- public static final String DEFAULT_DS = "DefaultDS";
- public static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
- public static final String EAP = "EAP"; //$NON-NLS-1$
- public static final String EAP_STD = "EAP_STD"; //$NON-NLS-1$
- public static final String SOA_P = "SOA-P"; //$NON-NLS-1$
- public static final String SOA_P_STD = "SOA-P-STD"; //$NON-NLS-1$
- public static final String EPP = "EPP"; //$NON-NLS-1$
- public static final String EWP = "EWP"; //$NON-NLS-1$
- public static final String SEAM = "SEAM"; // NON-NLS-1$
- public static final String DROOLS = "DROOLS"; // NON-NLS-1$
- public static final String AS = "AS"; //$NON-NLS-1$
- public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
- public static final String JBOSS_EAP_HOME_CONFIGURATION = "../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
- public static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
- public static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
- public static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
- public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
-
- public static final String SEAM_1_2_HOME = "../../../../jboss-eap/seam"; //$NON-NLS-1$
- public static final String SEAM_1_2_HOME_CONFIGURATION = "../../jboss-eap/seam"; //$NON-NLS-1$
- public static final String SEAM_1_2_HOME_CP = "../../../../jboss-eap/seam1"; //$NON-NLS-1$
- public static final String SEAM_1_2_HOME_CONFIGURATION_CP = "../../jboss-eap/seam1"; //$NON-NLS-1$
-
- public static final String SEAM_2_0_HOME = "../../../../jboss-eap/seamfp"; //$NON-NLS-1$
- public static final String SEAM_2_0_HOME_CONFIGURATION = "../../jboss-eap/seamfp"; //$NON-NLS-1$
- public static final String SEAM_2_0_HOME_CP = "../../../../jboss-eap/seam2"; //$NON-NLS-1$
- public static final String SEAM_2_0_HOME_CONFIGURATION_CP = "../../jboss-eap/seam2"; //$NON-NLS-1$
-
- public static final String[] SEAM_HOME_FOLDER_OPTIONS = {"seam","seam1","seam2","seamfp"};
-
- // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
- public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
- "org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.40", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.42", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.50", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.51", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.60", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.eap.43", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.eap.50", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.70" //$NON-NLS-1$
- };
-
- public static final String HSQLDB_DRIVER_JAR_NAME = "hsqldb.jar"; //$NON-NLS-1$
-
- public static final String HSQLDB_DRIVER_3X_4X_LOCATION = "/server/default/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
-
- public static final String HSQLDB_DRIVER_5X_LOCATION = "/common/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
-
- // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
- public static final String JBOSS_AS_HSQL_DRIVER_LOCATION[] = {
- HSQLDB_DRIVER_3X_4X_LOCATION,
- HSQLDB_DRIVER_3X_4X_LOCATION,
- HSQLDB_DRIVER_3X_4X_LOCATION,
- HSQLDB_DRIVER_5X_LOCATION,
- HSQLDB_DRIVER_5X_LOCATION,
- HSQLDB_DRIVER_5X_LOCATION,
- HSQLDB_DRIVER_3X_4X_LOCATION,
- HSQLDB_DRIVER_5X_LOCATION
- };
-
- public static final String JBOSS_AS_TYPE_ID[] = {
- "org.jboss.ide.eclipse.as.32", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.40", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.42", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.50", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.51", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.60", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.eap.43", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.eap.50", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.70" //$NON-NLS-1$
- };
-
- public static final String JBOSS_AS_NAME[] = {
- Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0,
- Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3,
- Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0,
- Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0
- };
-
- public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
-
- public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default"; //$NON-NLS-1$
-
- //public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
-
- public static final String HSQL_DRIVER_DEFINITION_ID
- = "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
-
- public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
-
- public static final String HSQL_DRIVER_TEMPLATE_ID
- = "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
-
- public static final String DTP_DB_URL_PROPERTY_ID
- = "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
-
- public static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
-
- public static final String JBPM = "JBPM";
-
-}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -27,6 +27,8 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -36,25 +38,49 @@
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.navigator.CommonNavigator;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.IRuntimeDetector;
import org.jboss.tools.runtime.core.model.ServerDefinition;
import org.osgi.framework.Bundle;
import org.osgi.service.prefs.BackingStoreException;
-public class JBossRuntimeStartup implements IStartup, IJBossRuntimePluginConstants {
+public class JBossRuntimeStartup implements IStartup {
+ private static final String JBOSS_EAP_HOME = "../../../../jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ private static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
+ private static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+ private static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+
private List<ServerDefinition> serverDefinitions = new ArrayList<ServerDefinition>();
private IEclipsePreferences preferences;
public void earlyStartup() {
if (isJBDS() && willBeInitialized()) {
parseServerFile();
+ initializeIncludedRuntimes();
initializeRuntimes(serverDefinitions);
saveWorkspacePreferences();
}
}
+ private void initializeIncludedRuntimes() {
+ try {
+ String pluginLocation = FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath(); //$NON-NLS-1$
+ File directory = new File(pluginLocation, JBOSS_EAP_HOME);
+ if (directory.isDirectory()) {
+ IPath path = new Path(directory.getAbsolutePath());
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ List<ServerDefinition> definitions = locator.searchForRuntimes(path, new NullProgressMonitor());
+ serverDefinitions.addAll(definitions);
+
+ }
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+
+ }
+
public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
for( IRuntimeDetector detector:detectors) {
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.project
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.project (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.as.detector</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,8 @@
+#Mon May 30 12:32:14 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.as.detector;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.as.detector.RuntimeAsActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.0",
+ org.eclipse.wst.server.core;bundle-version="1.1.302",
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.ui.workbench;bundle-version="3.7.0",
+ org.eclipse.datatools.connectivity;bundle-version="1.2.2";visibility:=reexport,
+ org.eclipse.datatools.connectivity.db.generic;bundle-version="1.0.1",
+ org.jboss.tools.common,
+ org.jboss.tools.runtime.core,
+ org.jboss.ide.eclipse.as.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.runtime.as.detector,
+ org.jboss.tools.runtime.handlers
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.html
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.html (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime AS Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime AS Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime AS Detector
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.JBossASHandler"
+ name="JBoss AS"
+ class="org.jboss.tools.runtime.handlers.JBossASHandler"
+ preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
+ priority="100"/>
+ </extension>
+
+</plugin>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>plugins</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.plugins</groupId>
+ <artifactId>org.jboss.tools.runtime.as.detector</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.runtime.as.detector;
+
+public interface IJBossRuntimePluginConstants {
+ public static final String DEFAULT_DS = "DefaultDS";
+ public static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
+ public static final String EAP = "EAP"; //$NON-NLS-1$
+ public static final String EAP_STD = "EAP_STD"; //$NON-NLS-1$
+ public static final String SOA_P = "SOA-P"; //$NON-NLS-1$
+ public static final String SOA_P_STD = "SOA-P-STD"; //$NON-NLS-1$
+ public static final String EPP = "EPP"; //$NON-NLS-1$
+ public static final String EWP = "EWP"; //$NON-NLS-1$
+ public static final String AS = "AS"; //$NON-NLS-1$
+ public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ public static final String JBOSS_EAP_HOME_CONFIGURATION = "../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ public static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
+ public static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+ public static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+ public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
+
+ // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+ public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.51", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.60", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.eap.43", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.eap.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.70" //$NON-NLS-1$
+ };
+
+ public static final String HSQLDB_DRIVER_JAR_NAME = "hsqldb.jar"; //$NON-NLS-1$
+
+ public static final String HSQLDB_DRIVER_3X_4X_LOCATION = "/server/default/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
+
+ public static final String HSQLDB_DRIVER_5X_LOCATION = "/common/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
+
+ // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+ public static final String JBOSS_AS_HSQL_DRIVER_LOCATION[] = {
+ HSQLDB_DRIVER_3X_4X_LOCATION,
+ HSQLDB_DRIVER_3X_4X_LOCATION,
+ HSQLDB_DRIVER_3X_4X_LOCATION,
+ HSQLDB_DRIVER_5X_LOCATION,
+ HSQLDB_DRIVER_5X_LOCATION,
+ HSQLDB_DRIVER_5X_LOCATION,
+ HSQLDB_DRIVER_3X_4X_LOCATION,
+ HSQLDB_DRIVER_5X_LOCATION
+ };
+
+ public static final String JBOSS_AS_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.51", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.60", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.eap.43", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.eap.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.70" //$NON-NLS-1$
+ };
+
+ public static final String JBOSS_AS_NAME[] = {
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0,
+ Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3,
+ Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0
+ };
+
+ public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default"; //$NON-NLS-1$
+
+ //public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
+
+ public static final String HSQL_DRIVER_DEFINITION_ID
+ = "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_TEMPLATE_ID
+ = "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
+
+ public static final String DTP_DB_URL_PROPERTY_ID
+ = "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
+
+ public static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.runtime.as.detector;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.runtime.as.detector.messages"; //$NON-NLS-1$
+ public static String JBossRuntimeStartup_JBoss_Application_Server_6_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_7_0;
+ public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
+ public static String JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile;
+ public static String JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_1;
+ public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
+ public static String JBossRuntimeStartup_JBoss_EAP_Server_5_0;
+ public static String JBossRuntimeStartup_Runtime;
+ public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.runtime.as.detector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeAsActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.runtime.as.detector"; //$NON-NLS-1$
+
+ // The shared instance
+ private static RuntimeAsActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public RuntimeAsActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RuntimeAsActivator getDefault() {
+ return plugin;
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ getDefault().getLog().log(status);
+ }
+
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
+JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_Application_Server_6_0=JBoss Application Server 6.0
+JBossRuntimeStartup_JBoss_Application_Server_7_0=JBoss Application Server 7.0
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_JBoss_EAP_Server_5_0=JBoss EAP Server 5.0
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
Added: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,500 @@
+/*******************************************************************************
+ * 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.runtime.handlers;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ConnectionProfileException;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
+import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
+import org.eclipse.datatools.connectivity.drivers.IPropertySet;
+import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
+import org.jboss.ide.eclipse.as.core.server.bean.ServerBean;
+import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
+import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
+import org.jboss.tools.runtime.as.detector.Messages;
+import org.jboss.tools.runtime.as.detector.RuntimeAsActivator;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.ServerDefinition;
+import org.osgi.framework.Bundle;
+
+public class JBossASHandler extends AbstractRuntimeDetector implements IJBossRuntimePluginConstants {
+
+ private static final int JBOSS_AS7_INDEX = 8;
+ private static String[] hasIncludedRuntimes = new String[] {SOA_P, EAP, EPP, EWP, SOA_P_STD};
+ private static final String DROOLS = "DROOLS"; // NON-NLS-1$
+
+ public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+ // FIXME
+ //createInitialJBossServer();
+ createJBossServerFromDefinitions(serverDefinitions);
+ }
+
+// public static void createInitialJBossServer(){
+// try {
+// String pluginLocation = FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath(); //$NON-NLS-1$
+// File jbossASDir = new File(pluginLocation, JBOSS_EAP_HOME);
+// if (!jbossASDir.isDirectory()) {
+// Location configLocation = Platform.getConfigurationLocation();
+// URL configURL = configLocation.getURL();
+// String configuration = FileLocator.resolve(configURL).getPath();
+// jbossASDir = new File(configuration, JBOSS_EAP_HOME_CONFIGURATION).getCanonicalFile();
+// } else {
+// jbossASDir = jbossASDir.getCanonicalFile();
+// }
+// if (jbossASDir.isDirectory()) {
+// int index = getJBossASVersion(jbossASDir);
+// createJBossServer(jbossASDir,index, "jboss-eap", "jboss-eap " + RUNTIME); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// } catch (IOException e) {
+// Activator.log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
+// }
+// }
+
+ private static File getLocation(ServerDefinition serverDefinition) {
+ String type = serverDefinition.getType();
+ if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)) {
+ return new File(serverDefinition.getLocation(), "jboss-as");
+ }
+ if (SOA_P_STD.equals(type)) {
+ return new File(serverDefinition.getLocation(),"jboss-esb"); //$NON-NLS-1$
+ }
+ if(EWP.equals(type)) {
+ return new File(serverDefinition.getLocation(),"jboss-as-web"); //$NON-NLS-1$
+ }
+ if (AS.equals(type) || EAP_STD.equals(type)) {
+ return serverDefinition.getLocation();
+ }
+ return null;
+ }
+
+ public static void createJBossServerFromDefinitions(List<ServerDefinition> serverDefinitions) {
+ for (ServerDefinition serverDefinition:serverDefinitions) {
+ if (!serverDefinition.isEnabled()) {
+ continue;
+ }
+ File asLocation = getLocation(serverDefinition);
+ if (asLocation == null || !asLocation.isDirectory()) {
+ continue;
+ }
+ String type = serverDefinition.getType();
+ if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)
+ || SOA_P_STD.equals(type) || EWP.equals(type)
+ || EAP_STD.equals(type)) {
+ String name = serverDefinition.getName();
+ String runtimeName = name + " " + RUNTIME; //$NON-NLS-1$
+ int index = getJBossASVersion(asLocation);
+ createJBossServer(asLocation, index, name, runtimeName);
+ } else if (AS.equals(type)){
+ String version = serverDefinition.getVersion();
+ int index = 2;
+ if ("3.2".equals(version)) { //$NON-NLS-1$
+ index = 0;
+ } else if ("4.0".equals(version)) { //$NON-NLS-1$
+ index = 1;
+ } else if ("4.2".equals(version)) { //$NON-NLS-1$
+ index = 2;
+ } else if ("5.0".equals(version)) { //$NON-NLS-1$
+ index = 3;
+ } else if ("5.1".equals(version)) { //$NON-NLS-1$
+ index = 4;
+ } else if ("6.0".equals(version)) { //$NON-NLS-1$
+ index = 5;
+ } else if ("7.0".equals(version)) { //$NON-NLS-1$
+ index = 8;
+ }
+ createJBossServer(serverDefinition.getLocation(),index,serverDefinition.getName(),serverDefinition.getName() + " " + RUNTIME); //$NON-NLS-1$
+ }
+ createJBossServerFromDefinitions(serverDefinition.getIncludedServerDefinitions());
+ }
+ }
+
+ private static int getJBossASVersion(File asLocation) {
+ int index = -1;
+ String fullVersion = new ServerBeanLoader().getFullServerVersion(new File(asLocation, JBossServerType.AS.getSystemJarPath()));
+ if(fullVersion != null ) {
+ String version = fullVersion.substring(0, 3);
+ if ("4.3".equals(version)) { //$NON-NLS-1$
+ index = 6;
+ } else if ("5.0".equals(version)) { //$NON-NLS-1$
+ index = 7;
+ } else if ("5.1".equals(version)) { //$NON-NLS-1$
+ // FIXME - this needs to be changed when adding a new runtime type for JBoss EAP 5.1
+ index = 7;
+ }
+ }
+ return index;
+ }
+
+ private static void createJBossServer(File asLocation, int index, String name, String runtimeName) {
+ if (asLocation == null || !asLocation.isDirectory() || index==-1) {
+ return;
+ }
+ IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
+
+ IServer[] servers = ServerCore.getServers();
+ for (int i = 0; i < servers.length; i++) {
+ IRuntime runtime = servers[i].getRuntime();
+ if(runtime != null && runtime.getLocation() != null && runtime.getLocation().equals(jbossAsLocationPath)) {
+ return;
+ }
+ }
+
+ IRuntime runtime = null;
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for (int i = 0; i < runtimes.length; i++) {
+ if (runtimes[i] == null || runtimes[i].getLocation() == null) {
+ continue;
+ }
+ if (runtimes[i].getLocation().equals(jbossAsLocationPath)) {
+ runtime = runtimes[i].createWorkingCopy();
+ break;
+ }
+ }
+
+ IProgressMonitor progressMonitor = new NullProgressMonitor();
+ try {
+ if (runtime == null) {
+ runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor, index);
+ }
+ if (runtime != null) {
+ createServer(progressMonitor, runtime, index, name);
+ }
+
+ createDriver(asLocation.getAbsolutePath(), index);
+ } catch (CoreException e) {
+ RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
+ } catch (ConnectionProfileException e) {
+ RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile);
+ }
+ }
+ /**
+ * Creates new JBoss AS Runtime, Server and hsqldb driver
+ * @param jbossASLocation location of JBoss Server
+ * @param progressMonitor to report progress
+ * @return server working copy
+ * @throws CoreException
+ * @throws ConnectionProfileException
+ */
+// public static IServerWorkingCopy initJBossAS(String jbossASLocation, IProgressMonitor progressMonitor) throws CoreException, ConnectionProfileException {
+// IRuntime runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+// IServerWorkingCopy server = null;
+// if (runtime != null) {
+// server = createServer(progressMonitor, runtime, 2, null);
+// }
+// createDriver(jbossASLocation);
+// return server;
+// }
+
+ /**
+ * Creates new JBoss AS Runtime
+ * @param jbossASLocation location of JBoss AS
+ * @param progressMonitor
+ * @return runtime working copy
+ * @throws CoreException
+ */
+ private static IRuntime createRuntime(String runtimeName, String jbossASLocation, IProgressMonitor progressMonitor, int index) throws CoreException {
+ IRuntimeWorkingCopy runtime = null;
+ String type = null;
+ String version = null;
+ String runtimeId = null;
+ IPath jbossAsLocationPath = new Path(jbossASLocation);
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, JBOSS_AS_RUNTIME_TYPE_ID[index]);
+ if (runtimeTypes.length > 0) {
+ runtime = runtimeTypes[0].createRuntime(runtimeId, progressMonitor);
+ runtime.setLocation(jbossAsLocationPath);
+ if(runtimeName!=null) {
+ runtime.setName(runtimeName);
+ }
+// to fix https://jira.jboss.org/jira/browse/JBDS-852 VM attributes initialization below was commented
+// IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
+ // IJBossServerRuntime.PROPERTY_VM_ID
+// ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID", defaultVM.getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_VM_TYPE_ID
+// ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID", defaultVM.getVMInstallType().getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME
+ ((RuntimeWorkingCopy) runtime).setAttribute("org.jboss.ide.eclipse.as.core.runtime.configurationName", JBOSS_AS_DEFAULT_CONFIGURATION_NAME); //$NON-NLS-1$
+
+ return runtime.save(false, progressMonitor);
+ }
+ return runtime;
+ }
+
+ /**
+ * Creates new JBoss Server
+ * @param progressMonitor
+ * @param runtime parent JBoss AS Runtime
+ * @return server working copy
+ * @throws CoreException
+ */
+ private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
+ if (name == null) {
+ name = JBOSS_AS_NAME[index];
+ }
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server:servers) {
+ if (name.equals(server.getName()) ) {
+ return null;
+ }
+ }
+ IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
+ IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
+
+ server.setHost(JBOSS_AS_HOST);
+ server.setName(name);
+
+ if (index != JBOSS_AS7_INDEX) {
+ // JBossServer.DEPLOY_DIRECTORY
+ // JBIDE-7822
+ //String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+ //((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
+ ((ServerWorkingCopy) server).setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_SERVER);
+
+ // IDeployableServer.TEMP_DEPLOY_DIRECTORY
+ String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal); //$NON-NLS-1$
+
+ // If we'd need to set up a username / pw for JMX, do it here.
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+ }
+ server.save(false, progressMonitor);
+ return server;
+ }
+
+ /**
+ * Creates HSQL DB Driver
+ * @param jbossASLocation location of JBoss AS
+ * @param index
+ * @throws ConnectionProfileException
+ * @return driver instance
+ */
+ private static void createDriver(String jbossASLocation, int index) throws ConnectionProfileException {
+ if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
+ // Don't create the driver a few times
+ return;
+ }
+ String driverPath;
+ try {
+ driverPath = new File(jbossASLocation + JBOSS_AS_HSQL_DRIVER_LOCATION[index]).getCanonicalPath(); //$NON-NLS-1$
+ } catch (IOException e) {
+ RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
+ RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver, e));
+ return;
+ }
+
+ DriverInstance driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver == null) {
+ TemplateDescriptor descr = TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME, HSQL_DRIVER_DEFINITION_ID);
+ instance.setName(HSQL_DRIVER_NAME);
+ instance.setID(HSQL_DRIVER_DEFINITION_ID);
+ Properties props = new Properties();
+
+ IConfigurationElement[] template = descr.getProperties();
+ for (int i = 0; i < template.length; i++) {
+ IConfigurationElement prop = template[i];
+ String id = prop.getAttribute("id"); //$NON-NLS-1$
+
+ String value = prop.getAttribute("value"); //$NON-NLS-1$
+ props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
+ }
+ props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:."); //$NON-NLS-1$
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+
+ instance.setBaseProperties(props);
+ DriverManager.getInstance().removeDriverInstance(instance.getID());
+ System.gc();
+ DriverManager.getInstance().addDriverInstance(instance);
+ }
+
+ driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
+ // create profile
+ Properties props = new Properties();
+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
+ props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, ""); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, ""); //$NON-NLS-1$
+ props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ }
+
+ public ServerDefinition getServerDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null || !isEnabled()) {
+ return null;
+ }
+ ServerBeanLoader loader = new ServerBeanLoader();
+ ServerBean serverBean = loader.loadFromLocation(root);
+
+ if (!JBossServerType.UNKNOWN.equals(serverBean.getType())) {
+ ServerDefinition serverDefinition = new ServerDefinition(serverBean.getName(),
+ serverBean.getVersion(), serverBean.getType().getId(), new File(serverBean.getLocation()));
+ calculateIncludedServerDefinition(serverDefinition, monitor);
+ return serverDefinition;
+ }
+ return null;
+ }
+
+ private void calculateIncludedServerDefinition(
+ ServerDefinition serverDefinition, IProgressMonitor monitor) {
+ if (serverDefinition == null || serverDefinition.getType() == null) {
+ return;
+ }
+ String type = serverDefinition.getType();
+ if (!hasIncludedRuntimes(type)) {
+ return;
+ }
+ serverDefinition.getIncludedServerDefinitions().clear();
+ List<ServerDefinition> serverDefinitions = serverDefinition
+ .getIncludedServerDefinitions();
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ final File location = getLocation(serverDefinition);
+ File[] directories = serverDefinition.getLocation().listFiles(
+ new FileFilter() {
+
+ @Override
+ public boolean accept(File file) {
+ if (!file.isDirectory() || file.equals(location)) {
+ return false;
+ }
+ return true;
+ }
+ });
+ boolean saved = isEnabled();
+ try {
+ setEnabled(false);
+ for (File directory : directories) {
+ List<ServerDefinition> definitions = new ArrayList<ServerDefinition>();
+ locator.searchDirectory(directory, definitions, 1, monitor);
+ for (ServerDefinition definition:definitions) {
+ definition.setParent(serverDefinition);
+ }
+ serverDefinitions.addAll(definitions);
+ }
+ if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
+ Bundle drools = Platform.getBundle("org.drools.eclipse");
+ Bundle droolsDetector = Platform
+ .getBundle("org.jboss.tools.runtime.drools.detector");
+ if (drools != null && droolsDetector != null) {
+ File droolsRoot = serverDefinition.getLocation();
+ if (droolsRoot.isDirectory()) {
+ String name = "Drools - " + serverDefinition.getName();
+ ServerDefinition droolsDefinition = new ServerDefinition(
+ name, serverDefinition.getVersion(), DROOLS,
+ droolsRoot);
+ droolsDefinition.setParent(serverDefinition);
+ serverDefinition.getIncludedServerDefinitions().add(
+ droolsDefinition);
+ }
+ }
+ }
+ } finally {
+ setEnabled(saved);
+ }
+ }
+
+ private boolean hasIncludedRuntimes(String type) {
+ for (String t:hasIncludedRuntimes) {
+ if (t.equals(type)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean exists(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return false;
+ }
+ File location = getLocation(serverDefinition);
+ if (location == null || !location.isDirectory()) {
+ return false;
+ }
+ String path = location.getAbsolutePath();
+ if (path == null) {
+ return false;
+ }
+ IServer[] servers = ServerCore.getServers();
+ for (int i = 0; i < servers.length; i++) {
+ IRuntime runtime = servers[i].getRuntime();
+ if (runtime == null || runtime.getLocation() == null) {
+ continue;
+ }
+ if(path.equals(runtime.getLocation().toOSString())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void computeIncludedServerDefinition(
+ ServerDefinition serverDefinition) {
+ if (serverDefinition == null) {
+ return;
+ }
+ String type = serverDefinition.getType();
+ if (AS.equals(type)) {
+ return;
+ }
+ calculateIncludedServerDefinition(serverDefinition, new NullProgressMonitor());
+ }
+
+
+}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -73,7 +73,7 @@
}
- private void searchDirectory(File directory, List<ServerDefinition> serverDefinitions,
+ public void searchDirectory(File directory, List<ServerDefinition> serverDefinitions,
int depth, IProgressMonitor monitor) {
if (depth == 0 || monitor.isCanceled() || directory == null || !directory.isDirectory()) {
return;
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -56,6 +56,8 @@
private static final String PRIORITY = "priority";
+ private static Set<IRuntimeDetector> declaredRuntimeDetectors;
+
private static Set<IRuntimeDetector> runtimeDetectors;
// The shared instance
@@ -97,8 +99,8 @@
}
public static Set<IRuntimeDetector> getDeclaredRuntimeDetectors() {
- if (runtimeDetectors == null) {
- runtimeDetectors = new TreeSet<IRuntimeDetector>();
+ if (declaredRuntimeDetectors == null) {
+ declaredRuntimeDetectors = new TreeSet<IRuntimeDetector>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry
.getExtensionPoint(RUNTIME_DETECTOR_EXTENSION_ID);
@@ -138,11 +140,11 @@
priority = Integer.MAX_VALUE;
}
detector.setPriority(priority);
- runtimeDetectors.add(detector);
+ declaredRuntimeDetectors.add(detector);
}
}
}
- return runtimeDetectors;
+ return declaredRuntimeDetectors;
}
public static void log(Throwable e) {
@@ -157,24 +159,28 @@
}
public static Set<IRuntimeDetector> getRuntimeDetectors() {
- Set<IRuntimeDetector> detectors = getDeclaredRuntimeDetectors();
- String enabledDetectors = getPreferences().get(ENABLED_DETECTORS, null);
- if (enabledDetectors == null) {
- saveEnabledDetectors(detectors);
- } else {
- StringTokenizer tokenizer = new StringTokenizer(enabledDetectors, ",");
- List<String> enabled = new ArrayList<String>();
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- if (token != null && !token.isEmpty()) {
- enabled.add(token);
+ if (runtimeDetectors == null) {
+ runtimeDetectors = getDeclaredRuntimeDetectors();
+ String enabledDetectors = getPreferences().get(ENABLED_DETECTORS,
+ null);
+ if (enabledDetectors == null) {
+ saveEnabledDetectors(runtimeDetectors);
+ } else {
+ StringTokenizer tokenizer = new StringTokenizer(
+ enabledDetectors, ",");
+ List<String> enabled = new ArrayList<String>();
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ if (token != null && !token.isEmpty()) {
+ enabled.add(token);
+ }
}
+ for (IRuntimeDetector detector : runtimeDetectors) {
+ detector.setEnabled(enabled.contains(detector.getId()));
+ }
}
- for (IRuntimeDetector detector:detectors) {
- detector.setEnabled(enabled.contains(detector.getId()));
- }
}
- return detectors;
+ return runtimeDetectors;
}
public static void saveEnabledDetectors(Set<IRuntimeDetector> detectors) {
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -46,11 +46,6 @@
public void setPreferenceId(String preferenceId) {
this.preferenceId = preferenceId;
}
-
- @Override
- public String includedRuntimes(ServerDefinition serverDefinition) {
- return "";
- }
public String getImplementationVersion(File dir, String file) {
File jarFile = new File(dir, file);
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -40,8 +40,6 @@
ServerDefinition getServerDefinition(File root, IProgressMonitor monitor);
- String includedRuntimes(ServerDefinition serverDefinition);
-
boolean exists(ServerDefinition serverDefinition);
int getPriority();
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.classpath
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.classpath (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.classpath 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.project
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.project (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.drools.detector</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/.settings/org.eclipse.jdt.core.prefs 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,8 @@
+#Mon May 30 13:52:12 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/META-INF/MANIFEST.MF (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.drools.detector;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.drools.detector.RuntimeDroolsActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.runtime.core,
+ org.drools.eclipse
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.runtime.drools.detector,
+ org.jboss.tools.runtime.handlers
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.html
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.html (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime Drools Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.ini
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.ini (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.ini 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.mappings
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.mappings (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.mappings 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/about.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime Drools Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/build.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/build.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime Drools Detector
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/plugin.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.DroolsHandler"
+ name="Drools"
+ class="org.jboss.tools.runtime.handlers.DroolsHandler"
+ preferenceId="org.drools.eclipse.preferences.DroolsRuntimesPreferencePage"
+ priority="300"/>
+ </extension>
+
+</plugin>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/pom.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/pom.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>plugins</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.plugins</groupId>
+ <artifactId>org.jboss.tools.runtime.drools.detector</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/detector/RuntimeDroolsActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/detector/RuntimeDroolsActivator.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/drools/detector/RuntimeDroolsActivator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.runtime.drools.detector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeDroolsActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.runtime.drools.detector"; //$NON-NLS-1$
+
+ // The shared instance
+ private static RuntimeDroolsActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public RuntimeDroolsActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RuntimeDroolsActivator getDefault() {
+ return plugin;
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ getDefault().getLog().log(status);
+ }
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/handlers/DroolsHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/handlers/DroolsHandler.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/src/org/jboss/tools/runtime/handlers/DroolsHandler.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.runtime.handlers;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.drools.eclipse.util.DroolsRuntime;
+import org.drools.eclipse.util.DroolsRuntimeManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.ServerDefinition;
+
+public class DroolsHandler extends AbstractRuntimeDetector {
+
+ private static final String DROOLS = "DROOLS"; // NON-NLS-1$
+ private static final String SOA_P = "SOA-P"; //$NON-NLS-1$
+
+ @Override
+ public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+ DroolsRuntime[] existingRuntimes = DroolsRuntimeManager
+ .getDroolsRuntimes();
+ List<DroolsRuntime> droolsRuntimes = new ArrayList<DroolsRuntime>();
+ if (existingRuntimes != null) {
+ for (DroolsRuntime runtime : existingRuntimes) {
+ droolsRuntimes.add(runtime);
+ }
+ }
+ initializeInternal(serverDefinitions, droolsRuntimes);
+ if (droolsRuntimes.size() > 0) {
+ DroolsRuntime[] dra = droolsRuntimes.toArray(new DroolsRuntime[0]);
+ DroolsRuntimeManager.setDroolsRuntimes(dra);
+ }
+
+ }
+
+ private void initializeInternal(List<ServerDefinition> serverDefinitions,
+ List<DroolsRuntime> droolsRuntimes) {
+ for (ServerDefinition serverDefinition : serverDefinitions) {
+ String type = serverDefinition.getType();
+ if (serverDefinition.isEnabled() && !droolsExists(serverDefinition)) {
+ if (DROOLS.equals(type)) {
+ File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
+ if (droolsRoot.isDirectory()) {
+ DroolsRuntime runtime = new DroolsRuntime();
+ runtime.setName("Drools " + serverDefinition.getVersion() + " - " + serverDefinition.getName()); //$NON-NLS-1$
+ runtime.setPath(droolsRoot.getAbsolutePath());
+ DroolsRuntimeManager.recognizeJars(runtime);
+ runtime.setDefault(true);
+ droolsRuntimes.add(runtime);
+ }
+ }
+ }
+ initializeInternal(serverDefinition.getIncludedServerDefinitions(),
+ droolsRuntimes);
+ }
+ }
+
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private static boolean droolsExists(ServerDefinition serverDefinition) {
+ DroolsRuntime[] droolsRuntimes = DroolsRuntimeManager
+ .getDroolsRuntimes();
+ for (DroolsRuntime dr : droolsRuntimes) {
+ String location = dr.getPath();
+ if (location != null
+ && location.equals(serverDefinition.getLocation()
+ .getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public ServerDefinition getServerDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null) {
+ return null;
+ }
+ String[] files = root.list(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("drools-api") && name.endsWith(".jar")) {
+ return true;
+ }
+ return false;
+ }
+ });
+ if (files != null && files.length > 0) {
+ String version = getImplementationVersion(root, files[0]);
+ if (version != null) {
+ version = version.substring(0, 3);
+ return new ServerDefinition(root.getName(), version, DROOLS,
+ root.getAbsoluteFile());
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean exists(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return false;
+ }
+ return droolsExists(serverDefinition);
+ }
+
+ public static void calculateIncludedServerDefinition(
+ ServerDefinition serverDefinition) {
+ if (serverDefinition == null
+ || !SOA_P.equals(serverDefinition.getType())) {
+ return;
+ }
+ File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
+ if (droolsRoot.isDirectory()) {
+ String name = "Drools - " + serverDefinition.getName(); //$NON-NLS-1$
+ ServerDefinition sd = new ServerDefinition(name,
+ serverDefinition.getVersion(), DROOLS, droolsRoot);
+ sd.setParent(serverDefinition);
+ serverDefinition.getIncludedServerDefinitions().add(sd);
+ }
+ }
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.classpath
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.classpath (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.classpath 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.project
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.project (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.jbpm.detector</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/.settings/org.eclipse.jdt.core.prefs 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,8 @@
+#Mon May 30 14:19:53 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/META-INF/MANIFEST.MF (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.jboss.tools.runtime.jbpm.detector;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.jbpm.detector.RuntimeJbpmActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.runtime.core,
+ org.jboss.tools.jbpm.common
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Name: %BundleName
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.html
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.html (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime jBPM Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.ini
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.ini (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.ini 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.mappings
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.mappings (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.mappings 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/about.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime jBPM Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime jBPM Detector
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/plugin.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.JbpmHandler"
+ name="jBPM"
+ class="org.jboss.tools.runtime.handlers.JbpmHandler"
+ preferenceId="org.jboss.tools.jbpm.locations"
+ priority="400"/>
+ </extension>
+
+</plugin>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/pom.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/pom.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>plugins</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.plugins</groupId>
+ <artifactId>org.jboss.tools.runtime.jbpm.detector</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/handlers/JbpmHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/handlers/JbpmHandler.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/handlers/JbpmHandler.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,144 @@
+/*************************************************************************************
+ * Copyright (c) 2010 JBoss by Red Hat 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.runtime.handlers;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jbpm.preferences.JbpmInstallation;
+import org.jboss.tools.jbpm.preferences.PreferencesManager;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.ServerDefinition;
+
+public class JbpmHandler extends AbstractRuntimeDetector {
+
+ private static final String JBPM3 = "jBPM3"; //$NON-NLS-1$
+ private static final String JBPM4 = "jBPM4"; //$NON-NLS-1$
+ private static final String JBPM = "JBPM"; //$NON-NLS-1$
+ private static final String SOA_P = "SOA-P"; //$NON-NLS-1$
+ private static final String SOA_P_STD = "SOA-P-STD"; //$NON-NLS-1$
+
+ public static File getJbpmRoot(ServerDefinition serverDefinition) {
+ String type = serverDefinition.getType();
+ if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
+ return new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
+ }
+ if (JBPM.equals(type)) {
+ return serverDefinition.getLocation();
+ }
+ return null;
+ }
+
+ @Override
+ public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+ for (ServerDefinition serverDefinition : serverDefinitions) {
+ if (serverDefinition.isEnabled() && !jbpmExists(serverDefinition)) {
+ File jbpmRoot = getJbpmRoot(serverDefinition);
+ if (jbpmRoot == null || !jbpmRoot.isDirectory()) {
+ continue;
+ }
+ String type = serverDefinition.getType();
+ if (JBPM.equals(type)) {
+ PreferencesManager.getInstance().addJbpmInstallation(serverDefinition.getName(), jbpmRoot.getAbsolutePath(), serverDefinition.getVersion());
+ }
+ }
+ initializeRuntimes(serverDefinition.getIncludedServerDefinitions());
+ }
+
+ }
+
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ public static boolean jbpmExists(ServerDefinition serverDefinition) {
+ File jbpmRoot = getJbpmRoot(serverDefinition);
+ if (jbpmRoot == null || !jbpmRoot.isDirectory()) {
+ return false;
+ }
+ Map<String, JbpmInstallation> jbpmMap = PreferencesManager.getInstance().getJbpmInstallationMap();
+ Collection<JbpmInstallation> jbpmInstalations = jbpmMap.values();
+ for (JbpmInstallation jbpm:jbpmInstalations) {
+ String location = jbpm.location;
+ if (location != null && location.equals(jbpmRoot.getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public ServerDefinition getServerDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null) {
+ return null;
+ }
+ boolean isJBPM = isValidJbpmInstallation(root.getAbsolutePath());
+ if (isJBPM) {
+ String version = "unknown";
+ if (isJbpm3(root.getAbsolutePath())) {
+ version = JBPM3;
+ } else if (isJbpm4(root.getAbsolutePath())) {
+ version = JBPM4;
+ }
+ String name = root.getName();
+ int index = 1;
+ boolean nameExists = PreferencesManager.getInstance().getJbpmInstallation(name) != null;
+ while (nameExists) {
+ name = root.getName() + " " + index++;
+ nameExists = PreferencesManager.getInstance().getJbpmInstallation(name) != null;
+ }
+ return new ServerDefinition(name, version, JBPM, root.getAbsoluteFile());
+ }
+ return null;
+ }
+
+ private static boolean isJbpm3(String location) {
+ return new Path(location).append("/src/resources/gpd/version.info.xml").toFile().exists();
+ }
+
+ private static boolean isJbpm4(String location) {
+ return new Path(location).append("/jbpm.jar").toFile().exists();
+ }
+
+ private boolean isValidJbpmInstallation(String location) {
+ return isJbpm3(location) || isJbpm4(location);
+ }
+
+ @Override
+ public boolean exists(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return false;
+ }
+ return jbpmExists(serverDefinition);
+ }
+
+ public static void calculateIncludedServerDefinition(
+ ServerDefinition serverDefinition) {
+ if (serverDefinition == null || !SOA_P.equals(serverDefinition.getType())) {
+ return;
+ }
+ File jbpmRoot = new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
+ if (jbpmRoot.isDirectory()) {
+ String version = JBPM3;
+ if (isJbpm4(serverDefinition.getLocation().getAbsolutePath())) {
+ version = JBPM4;
+ }
+ ServerDefinition sd = new ServerDefinition(serverDefinition.getName(), version, JBPM, jbpmRoot);
+ sd.setParent(serverDefinition);
+ serverDefinition.getIncludedServerDefinitions().add(sd);
+ }
+ }
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/detector/RuntimeJbpmActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/detector/RuntimeJbpmActivator.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/src/org/jboss/tools/runtime/jbpm/detector/RuntimeJbpmActivator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,50 @@
+package org.jboss.tools.runtime.jbpm.detector;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeJbpmActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.runtime.jbpm.detector"; //$NON-NLS-1$
+
+ // The shared instance
+ private static RuntimeJbpmActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public RuntimeJbpmActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RuntimeJbpmActivator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.project
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.project (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.project 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.seam.detector</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,8 @@
+#Mon May 30 13:29:40 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.seam.detector;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.seam.detector.RuntimeSeamActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.0",
+ org.jboss.tools.seam.core,
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.eclipse.ui.workbench;bundle-version="3.7.0",
+ org.jboss.tools.common,
+ org.jboss.tools.runtime.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Localization: plugin
+Bundle-Vendor: %BundleVendor
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime Seam Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime Seam Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime Seam Detector
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.SeamHandler"
+ name="Seam"
+ class="org.jboss.tools.runtime.handlers.SeamHandler"
+ preferenceId="org.jboss.tools.common.model.ui.seam"
+ priority="200"/>
+ </extension>
+</plugin>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>plugins</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.plugins</groupId>
+ <artifactId>org.jboss.tools.runtime.seam.detector</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,180 @@
+/*************************************************************************************
+ * Copyright (c) 2010 JBoss by Red Hat 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.runtime.handlers;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.ServerDefinition;
+import org.jboss.tools.seam.core.SeamUtil;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+
+public class SeamHandler extends AbstractRuntimeDetector {
+
+ private final static String seamJarName = "jboss-seam.jar";
+ private final static String seamVersionAttributeName = "Seam-Version";
+ private static final String SEAM = "SEAM"; // NON-NLS-1$
+
+ private static File getSeamRoot(ServerDefinition serverDefinition) {
+ String type = serverDefinition.getType();
+ if (SEAM.equals(type)) {
+ return serverDefinition.getLocation();
+ }
+ return null;
+ }
+
+ @Override
+ public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+
+ Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
+
+ for(ServerDefinition serverDefinition:serverDefinitions) {
+ if (!serverDefinition.isEnabled()) {
+ continue;
+ }
+ String type = serverDefinition.getType();
+ if (SEAM.equals(type)) {
+ addSeam(map, serverDefinition, serverDefinition.getLocation());
+ }
+ initializeRuntimes(serverDefinition.getIncludedServerDefinitions());
+ }
+ SeamRuntimeManager.getInstance().save();
+ }
+
+ private static void addSeam(Map<String, SeamRuntime> map,
+ ServerDefinition serverDefinition, File seamFile) {
+ if (seamFile.exists() && seamFile.canRead() && seamFile.isDirectory()) {
+ SeamVersion seamVersion = getSeamVersion(seamFile.getAbsolutePath());
+ if (seamVersion != null) {
+ String name = "Seam " + serverDefinition.getName() + " " + seamVersion; //$NON-NLS-1$ //$NON-NLS-2$
+ addSeam(map, seamFile.getAbsolutePath(), seamVersion, name);
+ }
+ }
+ }
+
+ private static void addSeam(Map<String, SeamRuntime> map, String seamPath,SeamVersion seamVersion, String name) {
+ if (!seamExists(seamPath)) {
+ File seamFolder = new File(seamPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamPath);
+ rt.setName(name);
+ rt.setDefault(true);
+ rt.setVersion(seamVersion);
+ SeamRuntimeManager.getInstance().addRuntime(rt);
+ }
+ }
+ }
+
+ private static SeamVersion getSeamVersion(String seamGenBuildPath) {
+ if (seamGenBuildPath == null || seamGenBuildPath.trim().length() <= 0) {
+ return null;
+ }
+ String fullVersion = SeamUtil.getSeamVersionFromManifest(seamGenBuildPath);
+ if (fullVersion == null) {
+ return null;
+ }
+ String version = fullVersion.substring(0,3);
+ SeamVersion seamVersion = null;
+ if (version != null) {
+ seamVersion = SeamVersion.findByString(version);
+ }
+ return seamVersion;
+ }
+
+ /**
+ * @param seamPath
+ * @return
+ */
+ private static boolean seamExists(String seamPath) {
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ for (SeamRuntime sr:seamRuntimes) {
+ if (seamPath != null && seamPath.equals(sr.getHomeDir())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public ServerDefinition getServerDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null) {
+ return null;
+ }
+ String seamVersion = getSeamVersionFromManifest(root.getAbsolutePath());
+ if (seamVersion != null) {
+ return new ServerDefinition(root.getName(), seamVersion, SEAM, root.getAbsoluteFile());
+ }
+ return null;
+ }
+
+ private static String getSeamVersionFromManifest(String seamHome) {
+ File seamHomeFolder = new File(seamHome);
+ if (seamHomeFolder == null || !seamHomeFolder.isDirectory()) {
+ return null;
+ }
+ String[] seamFiles = seamHomeFolder.list(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ if ("seam-gen".equals(name)) {
+ return true;
+ }
+ if ("lib".equals(name)) {
+ return true;
+ }
+ return false;
+ }
+ });
+ if (seamFiles == null || seamFiles.length != 2) {
+ return null;
+ }
+ File jarFile = new File(seamHome, "lib/" + seamJarName);
+ if(!jarFile.isFile()) {
+ jarFile = new File(seamHome, seamJarName);
+ if(!jarFile.isFile()) {
+ return null;
+ }
+ }
+ try {
+ JarFile jar = new JarFile(jarFile);
+ Attributes attributes = jar.getManifest().getMainAttributes();
+ String version = attributes.getValue(seamVersionAttributeName);
+ return version;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean exists(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return false;
+ }
+ File seamRoot = getSeamRoot(serverDefinition);
+ if (seamRoot == null || !seamRoot.isDirectory()) {
+ return false;
+ }
+ String path = seamRoot.getAbsolutePath();
+ return seamExists(path);
+ }
+
+}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.runtime.seam.detector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeSeamActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.runtime.seam.detector"; //$NON-NLS-1$
+
+ // The shared instance
+ private static RuntimeSeamActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public RuntimeSeamActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RuntimeSeamActivator getDefault() {
+ return plugin;
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ getDefault().getLog().log(status);
+ }
+}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF 2011-06-02 20:00:22 UTC (rev 31787)
@@ -32,7 +32,11 @@
org.jboss.tools.seam.ui.pages,
org.jboss.tools.seam.xml,
org.jboss.tools.seam.xml.ui,
- org.jboss.tools.seam.text.ext
+ org.jboss.tools.seam.text.ext,
+ org.jboss.tools.runtime.as.detector,
+ org.jboss.tools.runtime.drools.detector,
+ org.jboss.tools.runtime.jbpm.detector,
+ org.jboss.tools.runtime.seam.detector
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %BundleVendor
Modified: trunk/runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java 2011-06-02 19:51:52 UTC (rev 31786)
+++ trunk/runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java 2011-06-02 20:00:22 UTC (rev 31787)
@@ -38,7 +38,7 @@
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.tools.runtime.IJBossRuntimePluginConstants;
+import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.IRuntimeDetector;
13 years, 6 months
JBoss Tools SVN: r31786 - trunk/runtime/features/org.jboss.tools.runtime.core.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 15:51:52 -0400 (Thu, 02 Jun 2011)
New Revision: 31786
Modified:
trunk/runtime/features/org.jboss.tools.runtime.core.feature/feature.properties
Log:
JBIDE-9026 Separate specific runtime detection plugins from base core
Modified: trunk/runtime/features/org.jboss.tools.runtime.core.feature/feature.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.core.feature/feature.properties 2011-06-02 19:49:47 UTC (rev 31785)
+++ trunk/runtime/features/org.jboss.tools.runtime.core.feature/feature.properties 2011-06-02 19:51:52 UTC (rev 31786)
@@ -25,7 +25,7 @@
JBossToolsUpdatesSiteName=JBoss Tools Updates
# "description" property - description of the feature
-description=Project Examples
+description=JBoss Runtime Detection Core
# "copyright" property - text of the "Feature Update Copyright"
copyright=Copyright (c) 2008-2010 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
13 years, 6 months
JBoss Tools SVN: r31785 - trunk/runtime/features.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 15:49:47 -0400 (Thu, 02 Jun 2011)
New Revision: 31785
Added:
trunk/runtime/features/org.jboss.tools.runtime.seam.detector.feature/
Log:
Initial import.
13 years, 6 months
JBoss Tools SVN: r31784 - trunk/runtime/plugins.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 15:48:32 -0400 (Thu, 02 Jun 2011)
New Revision: 31784
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/
Log:
Initial import.
13 years, 6 months
JBoss Tools SVN: r31783 - trunk/runtime/features.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-02 15:47:28 -0400 (Thu, 02 Jun 2011)
New Revision: 31783
Added:
trunk/runtime/features/org.jboss.tools.runtime.jbpm.detector.feature/
Log:
Initial import.
13 years, 6 months