JBoss Tools SVN: r43637 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-09-13 05:15:17 -0400 (Thu, 13 Sep 2012)
New Revision: 43637
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java
Log:
JBIDE-12470 : Backport the fixes to properly handle remote archetype repos from m2e 1.2
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java 2012-09-13 07:56:37 UTC (rev 43636)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java 2012-09-13 09:15:17 UTC (rev 43637)
@@ -12,6 +12,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -26,10 +27,13 @@
import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
import org.apache.maven.archetype.metadata.RequiredProperty;
import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ICellModifier;
@@ -40,6 +44,8 @@
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
+import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.internal.archetype.ArchetypeManager;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.components.TextComboBoxCellEditor;
@@ -384,54 +390,72 @@
}
void loadArchetypeDescriptor() {
- final String groupId = archetype.getGroupId();
- final String artifactId = archetype.getArtifactId();
- final String version = archetype.getVersion();
- final String archetypeName = groupId + ":" + artifactId + ":" + version; //$NON-NLS-1$ //$NON-NLS-2$
+
+ try {
+ RequiredPropertiesLoader propertiesLoader = new RequiredPropertiesLoader(archetype);
+ getContainer().run(true, true, propertiesLoader);
+
+ List<?> properties = propertiesLoader.getProperties();
+ if(properties != null) {
+ for(Object o : properties) {
+ if(o instanceof RequiredProperty) {
+ RequiredProperty rp = (RequiredProperty) o;
+ requiredProperties.add(rp.getKey());
+ addTableItem(rp.getKey(), rp.getDefaultValue());
+ }
+ }
+ }
- try {
- getContainer().run(false, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- monitor.beginTask(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_task, archetypeName), IProgressMonitor.UNKNOWN);
- try {
- IMaven maven = MavenPlugin.getMaven();
+ } catch(InterruptedException ex) {
+ // ignore
+ } catch(InvocationTargetException ex) {
+ String msg = NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_error_download, getName(archetype));
+ MavenProjectExamplesActivator.log(ex, msg);
+ setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ }
- ArtifactRepository localRepository = maven.getLocalRepository();
-
- List<ArtifactRepository> repositories = maven.getArtifactRepositories();
-
- ArchetypeArtifactManager aaMgr = MavenPluginActivator.getDefault().getArchetypeArtifactManager();
- if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories)) {
- ArchetypeDescriptor descriptor = aaMgr.getFileSetArchetypeDescriptor(groupId, artifactId, version, null,
- localRepository, repositories);
- List<?> properties = descriptor.getRequiredProperties();
- if(properties != null) {
- for(Object o : properties) {
- if(o instanceof RequiredProperty) {
- RequiredProperty rp = (RequiredProperty) o;
- requiredProperties.add(rp.getKey());
- addTableItem(rp.getKey(), rp.getDefaultValue());
- }
- }
- }
- }
- } catch(UnknownArchetype e) {
- MavenProjectExamplesActivator.log(e, NLS.bind("Error downloading archetype {0}",archetypeName));
- } catch(CoreException ex) {
- MavenProjectExamplesActivator.log(ex, ex.getMessage());
- } finally {
- monitor.done();
- }
- }
- });
- } catch(InterruptedException ex) {
- // ignore
- } catch(InvocationTargetException ex) {
- String msg = NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_error_download, archetypeName);
- setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
- }
- }
-
+ static String getName(Archetype archetype) {
+ final String groupId = archetype.getGroupId();
+ final String artifactId = archetype.getArtifactId();
+ final String version = archetype.getVersion();
+ return groupId + ":" + artifactId + ":" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private static class RequiredPropertiesLoader implements IRunnableWithProgress {
+
+ private Archetype archetype;
+
+ private List<?> properties;
+
+ RequiredPropertiesLoader(Archetype archetype) {
+ this.archetype = archetype;
+ }
+
+ List<?> getProperties() {
+ return properties;
+ }
+
+ public void run(IProgressMonitor monitor) {
+ String archetypeName = getName(archetype);
+ monitor.beginTask(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_task, archetypeName ), IProgressMonitor.UNKNOWN);
+
+ try {
+
+ ArtifactRepository remoteArchetypeRepository = getArchetypeRepository(archetype);
+
+ properties = getRequiredProperties(archetype, remoteArchetypeRepository, monitor);
+
+ } catch(UnknownArchetype e) {
+ String msg = NLS.bind("Error downloading archetype {0}",archetypeName);
+ MavenProjectExamplesActivator.log(e, msg); //$NON-NLS-1$
+ } catch(CoreException ex) {
+ MavenProjectExamplesActivator.log(ex, ex.getMessage()); //$NON-NLS-1$
+ } finally {
+ monitor.done();
+ }
+ }
+ }
/**
* @param key
* @param value
@@ -585,4 +609,91 @@
public static String getDefaultJavaPackage(String groupId, String artifactId) {
return org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage.getDefaultJavaPackage(groupId, artifactId);
}
+
+ /**
+ * Gets the remote {@link ArtifactRepository} of the given {@link Archetype}, or null if none is found.
+ * The repository url is extracted from {@link Archetype#getRepository()}, or, if it has none, the remote catalog the archetype is found in.
+ * The {@link ArtifactRepository} id is set to <strong>archetypeId+"-repo"</strong>, to enable authentication on that repository.
+ *
+ * @see <a href="http://maven.apache.org/archetype/maven-archetype-plugin/faq.html">http://maven.apache.org/archetype/maven-archetype-plugin/faq.html</a>
+ * @param archetype
+ * @return the remote {@link ArtifactRepository} of the given {@link Archetype}, or null if none is found.
+ * @throws CoreException
+ */
+ public static ArtifactRepository getArchetypeRepository(Archetype archetype) throws CoreException {
+ String repoUrl = archetype.getRepository();
+ if (repoUrl == null) {
+ RemoteCatalogFactory catalogFactory = MavenPluginActivator.getDefault().getArchetypeManager().findParentCatalogFactory(archetype, RemoteCatalogFactory.class);
+ if (catalogFactory != null ) {
+ repoUrl = catalogFactory.getRepositoryUrl();
+ }
+ }
+ return repoUrl == null?null:MavenPlugin.getMaven().createArtifactRepository(archetype.getArtifactId()+"-repo", repoUrl); //$NON-NLS-1$
+ }
+
+
+ /**
+ * Gets the required properties of an {@link Archetype}.
+ *
+ * @param archetype the archetype possibly declaring required properties
+ * @param remoteArchetypeRepository the remote archetype repository, can be null.
+ * @param monitor the progress monitor, can be null.
+ * @return the required properties of the archetypes, null if none is found.
+ * @throws UnknownArchetype thrown if no archetype is can be resolved
+ * @throws CoreException
+ */
+ public static List<?> getRequiredProperties(Archetype archetype, ArtifactRepository remoteArchetypeRepository, IProgressMonitor monitor) throws UnknownArchetype, CoreException {
+ Assert.isNotNull(archetype, "Archetype can not be null");
+
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ final String groupId = archetype.getGroupId();
+ final String artifactId = archetype.getArtifactId();
+ final String version = archetype.getVersion();
+
+ IMaven maven = MavenPlugin.getMaven();
+
+ ArtifactRepository localRepository = maven.getLocalRepository();
+
+ List<ArtifactRepository> repositories;
+
+ if (remoteArchetypeRepository == null) {
+ repositories = maven.getArtifactRepositories();
+ } else {
+ repositories = Collections.singletonList(remoteArchetypeRepository);
+ }
+
+ MavenSession session = maven.createSession(maven.createExecutionRequest(monitor), null);
+
+ MavenSession oldSession = MavenPluginActivator.getDefault().setSession(session);
+
+ ArchetypeArtifactManager aaMgr = MavenPluginActivator.getDefault().getArchetypeArtifactManager();
+
+ List<?> properties = null;
+
+ try {
+ if(aaMgr.isFileSetArchetype(groupId,
+ artifactId,
+ version,
+ null,
+ localRepository,
+ repositories)) {
+ ArchetypeDescriptor descriptor = aaMgr.getFileSetArchetypeDescriptor(groupId,
+ artifactId,
+ version,
+ null,
+ localRepository,
+ repositories);
+
+ properties = descriptor.getRequiredProperties();
+ }
+ } finally {
+ MavenPluginActivator.getDefault().setSession(oldSession);
+ }
+
+ return properties;
+ }
+
}
13 years, 3 months
JBoss Tools SVN: r43636 - in trunk/common/plugins: org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-09-13 03:56:37 -0400 (Thu, 13 Sep 2012)
New Revision: 43636
Modified:
trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/zip/UnzipOperation.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
Log:
Fix resource leaks
Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/zip/UnzipOperation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/zip/UnzipOperation.java 2012-09-13 07:52:48 UTC (rev 43635)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/zip/UnzipOperation.java 2012-09-13 07:56:37 UTC (rev 43636)
@@ -90,14 +90,25 @@
File outputFile = new File(destination,file.getName());
outputFile.getParentFile().mkdirs();
outputFile.createNewFile();
- BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile),BUFFER_SIZE);
- BufferedInputStream in = new BufferedInputStream(zipFile.getInputStream(file));
- byte[] buff = new byte[BUFFER_SIZE];
- int n = -1;
- while((n = in.read(buff,0,buff.length))>-1) {
- out.write(buff, 0, n);
+ BufferedOutputStream out = null;
+ BufferedInputStream in =null;
+ try {
+ out = new BufferedOutputStream(new FileOutputStream(outputFile),BUFFER_SIZE);
+ in= new BufferedInputStream(zipFile.getInputStream(file));
+ byte[] buff = new byte[BUFFER_SIZE];
+ int n = -1;
+ while((n = in.read(buff,0,buff.length))>-1) {
+ out.write(buff, 0, n);
+ }
+ out.flush();
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.close();
+ }
}
- out.flush();
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2012-09-13 07:52:48 UTC (rev 43635)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2012-09-13 07:56:37 UTC (rev 43636)
@@ -38,7 +38,6 @@
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -62,7 +61,6 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.about.ISystemSummarySection;
@@ -85,7 +83,6 @@
import org.jboss.tools.common.model.ui.widgets.TextAndReferenceComponent;
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-import org.jboss.tools.common.model.ui.wizards.query.IQueryDialog;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
public class ReportProblemWizard extends AbstractQueryWizard {
@@ -251,13 +248,14 @@
* @return
*/
private byte[] getEclipseLogContent() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
String location = Platform.getLogFileLocation().toOSString();
File f = new File(location);
if(!f.isFile()) return sb.toString().getBytes();
+ InputStreamReader in = null;
try {
- InputStreamReader in = new FileReader(location);
+ in = new FileReader(location);
char[] tempBuffer = new char[512];
int len = 0;
@@ -268,6 +266,15 @@
} catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
+ finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (Exception ignore) {
+ //Ignore
+ }
+ }
+ }
return getLogByCurentDate(sb.toString()).getBytes();
};
13 years, 3 months
JBoss Tools SVN: r43635 - in trunk/as: features/org.jboss.ide.eclipse.as.feature and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-13 03:52:48 -0400 (Thu, 13 Sep 2012)
New Revision: 43635
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DownloadRuntimeToWTPRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DriverUtility.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/IJBossRuntimePluginConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/JBossASHandler.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossASDownloadRuntimeFilter.java
Removed:
trunk/as/features/org.jboss.tools.runtime.as.detector.feature/
trunk/as/plugins/org.jboss.tools.runtime.as.detector/
Modified:
trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
trunk/as/features/pom.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/pom.xml
trunk/as/site/category.xml
Log:
JBIDE-12583
Modified: trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
===================================================================
--- trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2012-09-13 07:52:48 UTC (rev 43635)
@@ -39,10 +39,6 @@
<includes
id="org.jboss.ide.eclipse.as.serverAdapter.wtp.feature"
version="0.0.0"/>
- <includes
- id="org.jboss.tools.runtime.as.detector.feature"
- version="0.0.0"/>
-
<requires>
<import plugin="org.eclipse.ui" version="3.7.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.7.0" match="greaterOrEqual"/>
Modified: trunk/as/features/pom.xml
===================================================================
--- trunk/as/features/pom.xml 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/features/pom.xml 2012-09-13 07:52:48 UTC (rev 43635)
@@ -19,7 +19,6 @@
<module>org.jboss.ide.eclipse.as.feature</module>
<module>org.jboss.ide.eclipse.as.test.feature</module>
- <module>org.jboss.tools.runtime.as.detector.feature</module>
</modules>
</project>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2012-09-13 07:52:48 UTC (rev 43635)
@@ -1,54 +1,59 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.jboss.ide.eclipse.as.core;singleton:=true
-Bundle-Version: 2.4.0.qualifier
-Bundle-Activator: org.jboss.ide.eclipse.as.core.JBossServerCorePlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.debug.core;bundle-version="3.7.0",
- org.eclipse.jdt.launching;bundle-version="3.6.0",
- org.eclipse.jdt.core;bundle-version="3.7.0",
- org.eclipse.jst.server.core;bundle-version="1.2.101",
- org.eclipse.wst.server.core;bundle-version="1.1.302",
- org.eclipse.jst.j2ee;bundle-version="1.1.500",
- org.eclipse.wst.xml.core;bundle-version="1.1.600",
- org.apache.ant;bundle-version="1.7.1",
- org.eclipse.core.variables;bundle-version="3.2.500",
- org.eclipse.jem.util;bundle-version="2.1.2",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
- org.jboss.ide.eclipse.as.wtp.core,
- org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
- org.eclipse.wst.common.frameworks;bundle-version="1.2.0",
- org.eclipse.jst.jee;bundle-version="1.0.401",
- org.eclipse.core.commands;bundle-version="3.6.0",
- org.eclipse.pde.core;bundle-version="3.7.0",
- org.eclipse.jst.j2ee.web;bundle-version="1.1.500",
- org.jboss.ide.eclipse.as.management.core,
- org.eclipse.equinox.security;bundle-version="1.1.1",
- org.jboss.ide.eclipse.as.dmr;bundle-version="2.3.0"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.jboss.ide.eclipse.as.core,
- org.jboss.ide.eclipse.as.core.extensions.descriptors,
- org.jboss.ide.eclipse.as.core.extensions.events,
- org.jboss.ide.eclipse.as.core.extensions.polling,
- org.jboss.ide.eclipse.as.core.modules,
- org.jboss.ide.eclipse.as.core.publishers,
- org.jboss.ide.eclipse.as.core.publishers.patterns,
- org.jboss.ide.eclipse.as.core.resolvers,
- org.jboss.ide.eclipse.as.core.server,
- org.jboss.ide.eclipse.as.core.server.bean,
- org.jboss.ide.eclipse.as.core.server.internal,
- org.jboss.ide.eclipse.as.core.server.internal.extendedproperties,
- org.jboss.ide.eclipse.as.core.server.internal.launch,
- org.jboss.ide.eclipse.as.core.server.internal.launch.configuration,
- org.jboss.ide.eclipse.as.core.server.internal.v7,
- org.jboss.ide.eclipse.as.core.server.v7.management,
- org.jboss.ide.eclipse.as.core.server.xpl,
- org.jboss.ide.eclipse.as.core.util
-Bundle-ClassPath: dom4j-1.6.1.jar,
- jaxen-1.1-beta-6.jar,
- getopt.jar,
- .
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.core;singleton:=true
+Bundle-Version: 2.4.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.core.JBossServerCorePlugin
+Bundle-Localization: plugin
+Require-Bundle: org.apache.ant;bundle-version="1.7.1",
+ org.eclipse.equinox.security;bundle-version="1.1.1",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.variables;bundle-version="3.2.500",
+ org.eclipse.core.commands;bundle-version="3.6.0",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.jem.util;bundle-version="2.1.2",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jst.jee;bundle-version="1.0.401",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.jst.j2ee.web;bundle-version="1.1.500",
+ org.eclipse.jst.server.core;bundle-version="1.2.101",
+ org.eclipse.wst.server.core;bundle-version="1.1.302",
+ org.eclipse.wst.xml.core;bundle-version="1.1.600",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
+ org.eclipse.wst.common.frameworks;bundle-version="1.2.0",
+ org.eclipse.pde.core;bundle-version="3.7.0",
+ org.eclipse.datatools.connectivity;bundle-version="1.2.2";resolution:=optional,
+ org.eclipse.datatools.connectivity.db.generic;bundle-version="1.0.1";resolution:=optional,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.jboss.ide.eclipse.as.management.core,
+ org.jboss.ide.eclipse.as.dmr;bundle-version="2.3.0",
+ org.jboss.tools.runtime.core;bundle-version="2.0.0",
+ org.jboss.tools.runtime.ui;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.core.extensions.descriptors,
+ org.jboss.ide.eclipse.as.core.extensions.events,
+ org.jboss.ide.eclipse.as.core.extensions.polling,
+ org.jboss.ide.eclipse.as.core.modules,
+ org.jboss.ide.eclipse.as.core.publishers,
+ org.jboss.ide.eclipse.as.core.publishers.patterns,
+ org.jboss.ide.eclipse.as.core.resolvers,
+ org.jboss.ide.eclipse.as.core.runtime,
+ org.jboss.ide.eclipse.as.core.server,
+ org.jboss.ide.eclipse.as.core.server.bean,
+ org.jboss.ide.eclipse.as.core.server.internal,
+ org.jboss.ide.eclipse.as.core.server.internal.extendedproperties,
+ org.jboss.ide.eclipse.as.core.server.internal.launch,
+ org.jboss.ide.eclipse.as.core.server.internal.launch.configuration,
+ org.jboss.ide.eclipse.as.core.server.internal.v7,
+ org.jboss.ide.eclipse.as.core.server.v7.management,
+ org.jboss.ide.eclipse.as.core.server.xpl,
+ org.jboss.ide.eclipse.as.core.util
+Bundle-ClassPath: dom4j-1.6.1.jar,
+ jaxen-1.1-beta-6.jar,
+ getopt.jar,
+ .
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -108,6 +108,28 @@
public static String UpdateDeploymentScannerJobName;
+
+ /* From runtime detection */
+ public static String JBossRuntimeStartup_JBoss_Application_Server_6_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_7_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_7_1;
+ 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_Cannot_create_new_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_JBoss_EAP_Server_6_0;
+ // NEW_SERVER_ADAPTER add logic for new adapter here
+ public static String JBossRuntimeStartup_Runtime;
+ public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+ public static String JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database;
+
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2012-09-13 07:52:48 UTC (rev 43635)
@@ -85,4 +85,24 @@
RuntimeFolderDoesNotExist=The server's runtime folder does not exist: {0}
JBossConfigurationFolderDoesNotExist=The server's configuration folder does not exist: {0}
JBossAS7ConfigurationFileDoesNotExist=The server's configuration file does not exist: {0}
-UpdateDeploymentScannerJobName=Updating Deployment Scanners for Server: {0}
\ No newline at end of file
+UpdateDeploymentScannerJobName=Updating Deployment Scanners for Server: {0}
+
+#From runtime detection
+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_Cannot_create_new_DB_Driver=Can''t create new 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_Application_Server_7_1=JBoss Application Server 7.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_JBoss_EAP_Server_5_0=JBoss EAP Server 5.0
+JBossRuntimeStartup_JBoss_EAP_Server_6_0=JBoss EAP Server 6.0
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database=The JBoss AS H2 embedded database
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DownloadRuntimeToWTPRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DownloadRuntimeToWTPRuntime.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DownloadRuntimeToWTPRuntime.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -0,0 +1,67 @@
+package org.jboss.ide.eclipse.as.core.runtime;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+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.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.DownloadRuntime;
+
+public class DownloadRuntimeToWTPRuntime implements IJBossToolingConstants {
+ private static HashMap<String, String[]> map;
+ static {
+ map = new HashMap<String, String[]>();
+ map.put(AS_32, new String[]{DOWNLOAD_RT_328});
+ map.put(AS_40, new String[]{DOWNLOAD_RT_405});
+ map.put(AS_42, new String[]{DOWNLOAD_RT_423});
+ map.put(AS_50, new String[]{DOWNLOAD_RT_501});
+ map.put(AS_51, new String[]{DOWNLOAD_RT_510});
+ map.put(AS_60, new String[]{DOWNLOAD_RT_610});
+ map.put(AS_70, new String[]{DOWNLOAD_RT_701, DOWNLOAD_RT_702});
+ map.put(AS_71, new String[]{DOWNLOAD_RT_710, DOWNLOAD_RT_711});
+ // NEW_SERVER_ADAPTER
+ }
+
+
+ public static IRuntimeType getWTPRuntime(DownloadRuntime rt) {
+ Iterator<String> keyIt = map.keySet().iterator();
+ while(keyIt.hasNext()) {
+ String k = keyIt.next();
+ String[] val = map.get(k);
+ if( Arrays.asList(val).contains(rt.getId())) {
+ return ServerCore.findRuntimeType(k);
+ }
+ }
+ return null;
+ }
+
+ public static DownloadRuntime[] getDownloadRuntimes(IRuntimeType type) {
+ Map<String, DownloadRuntime> dlRuntimes = RuntimeCoreActivator.getDefault().getDownloadRuntimes();
+ return getDownloadRuntimes(type, dlRuntimes);
+ }
+
+ public static DownloadRuntime[] getDownloadRuntimes(IRuntimeType type, DownloadRuntime[] dlRuntimes) {
+ HashMap<String, DownloadRuntime> map = new HashMap<String, DownloadRuntime>();
+ for( int i = 0; i < dlRuntimes.length; i++ ) {
+ map.put(dlRuntimes[i].getId(), dlRuntimes[i]);
+ }
+ return getDownloadRuntimes(type, map);
+ }
+
+ public static DownloadRuntime[] getDownloadRuntimes(IRuntimeType type, Map<String, DownloadRuntime> dlRuntimes) {
+ String[] all = map.get(type.getId());
+ ArrayList<DownloadRuntime> ret = new ArrayList<DownloadRuntime>();
+ for( int i = 0; i < all.length;i++ ) {
+ DownloadRuntime r = dlRuntimes.get(all[i]);
+ if( r != null )
+ ret.add(r);
+ }
+ return (DownloadRuntime[]) ret.toArray(new DownloadRuntime[ret.size()]);
+
+ }
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DriverUtility.java (from rev 43615, trunk/as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DriverUtility.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/DriverUtility.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.runtime;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+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.IServerType;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+
+public class DriverUtility implements IJBossRuntimePluginConstants {
+ public static final HashMap<String,String> SERVER_DRIVER_LOCATION = new HashMap<String, String>();
+ static {
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_32, HSQLDB_DRIVER_3X_4X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_40, HSQLDB_DRIVER_3X_4X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_42, HSQLDB_DRIVER_3X_4X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_50, HSQLDB_DRIVER_5X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_51, HSQLDB_DRIVER_5X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_60, HSQLDB_DRIVER_5X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_43, HSQLDB_DRIVER_3X_4X_LOCATION);
+ SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_50, HSQLDB_DRIVER_5X_LOCATION);
+ }
+
+ /**
+ * Creates HSQL DB Driver
+ * @param jbossASLocation location of JBoss AS
+ * @param index
+ * @throws ConnectionProfileException
+ * @return driver instance
+ */
+ public void createDriver(String jbossASLocation, IServerType serverType) throws ConnectionProfileException {
+ if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
+ // Don't create the driver a few times
+ return;
+ }
+ String driverPath;
+ try {
+ driverPath = getDriverPath(jbossASLocation, serverType);
+ } catch (IOException e) {
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
+ JBossServerCorePlugin.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver, e));
+ return;
+ }
+ if (driverPath == null) {
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
+ JBossServerCorePlugin.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_DB_Driver));
+ }
+
+ DriverInstance driver = getDriver(serverType);
+ if (driver == null) {
+ TemplateDescriptor descr = getDriverTemplateDescriptor(serverType);
+ IPropertySet instance = new PropertySetImpl(getDriverName(serverType), getDriverDefinitionId(serverType));
+ instance.setName(getDriverName(serverType));
+ instance.setID(getDriverDefinitionId(serverType));
+ 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, getDriverUrl(serverType));
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+ if( isAS7StyleServer(serverType)) {
+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, "org.h2.Driver");//$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, "H2 driver");//$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, "jdbc:h2:mem");//$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, "sa");//$NON-NLS-1$
+ }
+
+ instance.setBaseProperties(props);
+ DriverManager.getInstance().removeDriverInstance(instance.getID());
+ System.gc();
+ DriverManager.getInstance().addDriverInstance(instance);
+ }
+
+ driver = DriverManager.getInstance().getDriverInstanceByName(getDriverName(serverType));
+ if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) {
+ // create profile
+ Properties props = new Properties();
+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
+ getDriverDefinitionId(serverType));
+ 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));
+
+ if( isAS7StyleServer(serverType)) {
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database, H2_PROFILE_ID, props, "", false); //$NON-NLS-1$
+ } else {
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ protected static String getDriverUrl(IServerType serverType) {
+ if( isAS7StyleServer(serverType)) {
+ return "jdbc:h2:mem";//$NON-NLS-1$
+ } else {
+ return "jdbc:hsqldb:.";//$NON-NLS-1$
+ }
+ }
+
+ private static String getDriverDefinitionId(IServerType serverType) {
+ if( isAS7StyleServer(serverType)) {
+ return H2_DRIVER_DEFINITION_ID;
+ } else {
+ return HSQL_DRIVER_DEFINITION_ID;
+ }
+ }
+
+ private static String getDriverName(IServerType serverType) {
+ if( isAS7StyleServer(serverType)) {
+ return H2_DRIVER_NAME;
+ } else {
+ return HSQL_DRIVER_NAME;
+ }
+ }
+
+ protected static TemplateDescriptor getDriverTemplateDescriptor(IServerType serverType) {
+ if( isAS7StyleServer(serverType)) {
+ return TemplateDescriptor.getDriverTemplateDescriptor(H2_DRIVER_TEMPLATE_ID);
+ } else {
+ return TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ }
+ }
+
+ protected static DriverInstance getDriver(IServerType serverType) {
+ if( isAS7StyleServer(serverType)) {
+ return DriverManager.getInstance().getDriverInstanceByName(H2_DRIVER_NAME);
+ }
+ return DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ }
+
+ private static String getDriverPath(String jbossASLocation, IServerType serverType)
+ throws IOException {
+ String driverPath;
+ if (isAS7StyleServer(serverType)) {
+ File file = new File(jbossASLocation + "/modules/com/h2database/h2/main").getCanonicalFile();//$NON-NLS-1$
+ File[] fileList = file.listFiles(new FilenameFilter() {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("h2") && name.endsWith(".jar")) {//$NON-NLS-1$ //$NON-NLS-2$
+ return true;
+ }
+ return false;
+ }
+ });
+ if (fileList != null && fileList.length > 0) {
+ return fileList[0].getCanonicalPath();
+ }
+ return null;
+ } else {
+ String loc = SERVER_DRIVER_LOCATION.get(serverType.getId());
+ driverPath = new File(jbossASLocation + loc).getCanonicalPath();
+ }
+ return driverPath;
+ }
+
+ private static boolean isAS7StyleServer(IServerType type) {
+ if( type != null ) {
+ String id = type.getId();
+ return IJBossToolingConstants.SERVER_AS_70.equals(id) ||
+ IJBossToolingConstants.SERVER_AS_71.equals(id) ||
+ IJBossToolingConstants.SERVER_EAP_60.equals(id);
+ }
+ return false;
+ }
+
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/IJBossRuntimePluginConstants.java (from rev 43615, trunk/as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/IJBossRuntimePluginConstants.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/IJBossRuntimePluginConstants.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.core.runtime;
+
+import org.jboss.ide.eclipse.as.core.Messages;
+
+
+public interface IJBossRuntimePluginConstants {
+ public static final String DEFAULT_DS = "DefaultDS";//$NON-NLS-1$
+ 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 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$
+
+ public static final String HSQL_DRIVER_DEFINITION_ID
+ = "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String H2_DRIVER_DEFINITION_ID
+ = "DriverDefn.H2 DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String H2_DRIVER_NAME = "H2 Database"; //$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 H2_DRIVER_TEMPLATE_ID
+ = "org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"; //$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";//$NON-NLS-1$
+
+ public static final String H2_PROFILE_ID = "org.eclipse.datatools.connectivity.db.generic.connectionProfile";//$NON-NLS-1$
+
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/JBossASHandler.java (from rev 43615, trunk/as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/JBossASHandler.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/JBossASHandler.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -0,0 +1,395 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.core.runtime;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+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.datatools.connectivity.ConnectionProfileException;
+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.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+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.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetectorDelegate;
+import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+import org.osgi.framework.Bundle;
+
+public class JBossASHandler extends AbstractRuntimeDetectorDelegate implements IJBossRuntimePluginConstants {
+
+ private static String[] hasIncludedRuntimes = new String[] {SOA_P, EAP, EPP, EWP, SOA_P_STD};
+ private static final String DROOLS = "DROOLS"; //$NON-NLS-1$
+ private static final String ESB = "ESB"; //$NON-NLS-1$
+
+ // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+ public static final String RUNTIME_TYPES[] = IJBossToolingConstants.ALL_JBOSS_RUNTIMES;
+ public static final String SERVER_TYPES[] = IJBossToolingConstants.ALL_JBOSS_SERVERS;
+
+ public static final HashMap<String,String> SERVER_DEFAULT_NAME = new HashMap<String, String>();
+ static {
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_32, Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_40, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_42, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_50, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_51, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_60, Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_43, Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_50, Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_70, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_71, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_1);
+ SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_60, Messages.JBossRuntimeStartup_JBoss_EAP_Server_6_0);
+ }
+
+ public void initializeRuntimes(List<RuntimeDefinition> runtimeDefinitions) {
+ createJBossServerFromDefinitions(runtimeDefinitions);
+ }
+
+ private static File getLocation(RuntimeDefinition runtimeDefinitions) {
+ String type = runtimeDefinitions.getType();
+ String version = runtimeDefinitions.getVersion();
+ if (EAP.equals(type) && version != null && version.startsWith("6") ) {//$NON-NLS-1$
+ return runtimeDefinitions.getLocation();
+ }
+ if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)) {
+ return new File(runtimeDefinitions.getLocation(), "jboss-as");//$NON-NLS-1$
+ }
+ if (SOA_P_STD.equals(type)) {
+ return new File(runtimeDefinitions.getLocation(),"jboss-esb"); //$NON-NLS-1$
+ }
+ if(EWP.equals(type)) {
+ return new File(runtimeDefinitions.getLocation(),"jboss-as-web"); //$NON-NLS-1$
+ }
+ if (AS.equals(type) || EAP_STD.equals(type)) {
+ return runtimeDefinitions.getLocation();
+ }
+ return null;
+ }
+
+ public static void createJBossServerFromDefinitions(List<RuntimeDefinition> runtimeDefinitions) {
+ for (RuntimeDefinition runtimeDefinition:runtimeDefinitions) {
+ if (runtimeDefinition.isEnabled()) {
+ File asLocation = getLocation(runtimeDefinition);
+ if (asLocation == null || !asLocation.isDirectory()) {
+ continue;
+ }
+ String type = runtimeDefinition.getType();
+ if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)
+ || SOA_P_STD.equals(type) || EWP.equals(type)
+ || EAP_STD.equals(type) || AS.equals(type)) {
+ String typeId = new ServerBeanLoader(asLocation).getServerAdapterId();
+ String name = runtimeDefinition.getName();
+ String runtimeName = name + " " + RUNTIME; //$NON-NLS-1$
+ createJBossServer(asLocation, typeId, name, runtimeName);
+ }
+ }
+ createJBossServerFromDefinitions(runtimeDefinition.getIncludedRuntimeDefinitions());
+ }
+ }
+
+ private static boolean serverExistsForPath(IPath locPath) {
+ 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(locPath)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static IRuntime findRuntimeForPath(IPath locPath) {
+ 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(locPath)) {
+ return runtimes[i];
+ }
+ }
+ return null;
+ }
+
+ private static void createJBossServer(File asLocation, String serverTypeId, String name, String runtimeName) {
+ if (asLocation == null || !asLocation.isDirectory() || serverTypeId == null)
+ return;
+ IServerType serverType = ServerCore.findServerType(serverTypeId);
+ if( serverType == null )
+ return;
+ IRuntimeType rtType = serverType.getRuntimeType();
+ if( rtType == null )
+ return;
+
+ IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
+ if( serverExistsForPath(jbossAsLocationPath))
+ return;
+
+ IRuntime runtime = findRuntimeForPath(jbossAsLocationPath);
+ IProgressMonitor progressMonitor = new NullProgressMonitor();
+ try {
+ if (runtime == null) {
+ runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor, rtType);
+ }
+ if (runtime != null) {
+ createServer(progressMonitor, runtime, serverType, name);
+ }
+
+ new DriverUtility().createDriver(asLocation.getAbsolutePath(), serverType);
+ } catch (CoreException e) {
+ JBossServerCorePlugin.log(IStatus.ERROR, Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server,e);
+ } catch (ConnectionProfileException e) {
+ JBossServerCorePlugin.log(IStatus.ERROR, Messages.JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile,e);
+ }
+ }
+
+ /**
+ * 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, IRuntimeType rtType) throws CoreException {
+ IRuntimeWorkingCopy runtime = null;
+ IPath jbossAsLocationPath = new Path(jbossASLocation);
+ runtime = rtType.createRuntime(null, progressMonitor);
+ runtime.setLocation(jbossAsLocationPath);
+ if(runtimeName!=null) {
+ runtime.setName(runtimeName);
+ }
+ return runtime.save(false, progressMonitor);
+ }
+
+ /**
+ * Creates new JBoss Server
+ * @param progressMonitor
+ * @param runtime parent JBoss AS Runtime
+ * @return server working copy
+ * @throws CoreException
+ */
+ private static void createServer(IProgressMonitor progressMonitor, IRuntime runtime,
+ IServerType serverType, String name) throws CoreException {
+ if (name == null)
+ name = SERVER_DEFAULT_NAME.get(serverType.getId());
+ if( !serverWithNameExists(name)) {
+ IServerWorkingCopy serverWC = serverType.createServer(null, null,
+ new NullProgressMonitor());
+ serverWC.setRuntime(runtime);
+ serverWC.setName(name);
+ serverWC.setServerConfiguration(null);
+ serverWC.setAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ serverWC.save(true, new NullProgressMonitor());
+ }
+ }
+
+ private static boolean serverWithNameExists(String name) {
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server:servers) {
+ if (name.equals(server.getName()) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public RuntimeDefinition getRuntimeDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null || !isEnabled()) {
+ return null;
+ }
+ ServerBeanLoader loader = new ServerBeanLoader(root);
+ ServerBean serverBean = loader.getServerBean();
+
+ if (!JBossServerType.UNKNOWN.equals(serverBean.getType())) {
+ RuntimeDefinition runtimeDefinition = new RuntimeDefinition(serverBean.getName(),
+ serverBean.getVersion(), serverBean.getType().getId(), new File(serverBean.getLocation()));
+ calculateIncludedRuntimeDefinition(runtimeDefinition, monitor);
+ return runtimeDefinition;
+ }
+ return null;
+ }
+
+ private void calculateIncludedRuntimeDefinition(
+ RuntimeDefinition runtimeDefinition, IProgressMonitor monitor) {
+ if (runtimeDefinition == null || runtimeDefinition.getType() == null) {
+ return;
+ }
+ String type = runtimeDefinition.getType();
+ if (!hasIncludedRuntimes(type)) {
+ return;
+ }
+ runtimeDefinition.getIncludedRuntimeDefinitions().clear();
+ List<RuntimeDefinition> runtimeDefinitions = runtimeDefinition
+ .getIncludedRuntimeDefinitions();
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ final File location = getLocation(runtimeDefinition);
+ File[] directories = runtimeDefinition.getLocation().listFiles(
+ new FileFilter() {
+ 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<RuntimeDefinition> definitions = new ArrayList<RuntimeDefinition>();
+ locator.searchDirectory(directory, definitions, 1, monitor);
+ for (RuntimeDefinition definition:definitions) {
+ definition.setParent(runtimeDefinition);
+ }
+ runtimeDefinitions.addAll(definitions);
+ }
+ if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
+ addDrools(runtimeDefinition);
+ addEsb(runtimeDefinition);
+ }
+ } finally {
+ setEnabled(saved);
+ }
+ }
+
+ private void addDrools(RuntimeDefinition runtimeDefinition) {
+ if (runtimeDefinition == null) {
+ return;
+ }
+ Bundle drools = Platform.getBundle("org.drools.eclipse"); //$NON-NLS-1$
+ Bundle droolsDetector = Platform
+ .getBundle("org.jboss.tools.runtime.drools.detector");//$NON-NLS-1$
+ if (drools != null && droolsDetector != null) {
+ File droolsRoot = runtimeDefinition.getLocation();
+ if (droolsRoot.isDirectory()) {
+ String name = "Drools - " + runtimeDefinition.getName();//$NON-NLS-1$
+ RuntimeDefinition droolsDefinition = new RuntimeDefinition(
+ name, runtimeDefinition.getVersion(), DROOLS,
+ droolsRoot);
+ droolsDefinition.setParent(runtimeDefinition);
+ runtimeDefinition.getIncludedRuntimeDefinitions().add(
+ droolsDefinition);
+ }
+ }
+ }
+
+ private void addEsb(RuntimeDefinition runtimeDefinition) {
+ if (runtimeDefinition == null) {
+ return;
+ }
+ Bundle esb = Platform.getBundle("org.jboss.tools.esb.project.core");//$NON-NLS-1$
+ Bundle esbDetectorPlugin = Platform
+ .getBundle("org.jboss.tools.runtime.esb.detector");//$NON-NLS-1$
+ if (esb != null && esbDetectorPlugin != null) {
+ String type = runtimeDefinition.getType();
+ File esbRoot;
+ if (SOA_P.equals(type)) {
+ esbRoot = runtimeDefinition.getLocation();
+ } else {
+ esbRoot = new File(runtimeDefinition.getLocation(), "jboss-esb"); //$NON-NLS-1$
+ }
+ if (esbRoot.isDirectory()) {
+ String name = "ESB - " + runtimeDefinition.getName();//$NON-NLS-1$
+ String version="";//$NON-NLS-1$
+ RuntimeDefinition esbDefinition = new RuntimeDefinition(
+ name, version, ESB,
+ esbRoot);
+ IRuntimeDetector esbDetector = RuntimeCoreActivator.getDefault().getEsbDetector();
+ if (esbDetector != null) {
+ version = esbDetector.getVersion(esbDefinition);
+ esbDefinition.setVersion(version);
+ }
+
+ esbDefinition.setParent(runtimeDefinition);
+ runtimeDefinition.getIncludedRuntimeDefinitions().add(
+ esbDefinition);
+ }
+ }
+ }
+
+ private boolean hasIncludedRuntimes(String type) {
+ for (String t:hasIncludedRuntimes) {
+ if (t.equals(type)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean exists(RuntimeDefinition 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 computeIncludedRuntimeDefinition(
+ RuntimeDefinition runtimeDefinition) {
+ if (runtimeDefinition == null) {
+ return;
+ }
+ String type = runtimeDefinition.getType();
+ if (AS.equals(type)) {
+ return;
+ }
+ calculateIncludedRuntimeDefinition(runtimeDefinition, new NullProgressMonitor());
+ }
+
+ @Override
+ public String getVersion(RuntimeDefinition runtimeDefinition) {
+ return runtimeDefinition.getVersion();
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -72,6 +72,21 @@
public static final String V7_1 = "7.1"; //$NON-NLS-1$
// NEW_SERVER_ADAPTER Add the new version string above this line
+
+
+ /* String constants for download runtime extensions */
+ public static final String DOWNLOAD_RT_328 = "org.jboss.tools.runtime.core.as.328"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_405 = "org.jboss.tools.runtime.core.as.405"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_423 = "org.jboss.tools.runtime.core.as.423"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_501 = "org.jboss.tools.runtime.core.as.501"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_510 = "org.jboss.tools.runtime.core.as.510"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_610 = "org.jboss.tools.runtime.core.as.610"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_701 = "org.jboss.tools.runtime.core.as.701"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_702 = "org.jboss.tools.runtime.core.as.702"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_710 = "org.jboss.tools.runtime.core.as.710"; //$NON-NLS-1$
+ public static final String DOWNLOAD_RT_711 = "org.jboss.tools.runtime.core.as.711"; //$NON-NLS-1$
+
+
/* Files or folders inside the TOOLING */
public static final String LOG = "log"; //$NON-NLS-1$
public static final String TEMP_DEPLOY = "tempDeploy"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-09-13 07:52:48 UTC (rev 43635)
@@ -500,13 +500,6 @@
sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
sourcePathComputerId="org.eclipse.jst.server.generic.core.sourcePathComputer"/>
<launchConfigurationType
- delegate="org.jboss.ide.eclipse.as.core.server.internal.launch.TwiddleLaunchConfiguration"
- id="org.jboss.ide.eclipse.as.core.server.twiddleConfiguration"
- modes="run"
- name="Twiddle"
- public="false">
- </launchConfigurationType>
- <launchConfigurationType
delegate="org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration"
id="org.jboss.ide.eclipse.as.core.server.stopLaunchConfiguration"
modes="run"
@@ -1218,4 +1211,110 @@
</factory>
</extension>
+
+
+
+
+
+
+ <!-- From as-handler for runtime detection -->
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.JBossASHandler"
+ name="JBoss AS"
+ class="org.jboss.ide.eclipse.as.core.runtime.JBossASHandler"
+ preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
+ priority="100"/>
+ </extension>
+
+
+ <extension
+ point="org.jboss.tools.runtime.core.downloadruntimes">
+ <runtime
+ id="org.jboss.tools.runtime.core.as.328"
+ name="JBoss AS 3.2.8"
+ version="3.2.8"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://repository.jboss.org/sourceforge/jboss-3.2.8.SP1.zip"
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.405"
+ name="JBoss AS 4.0.5"
+ version="4.0.5"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://repository.jboss.org/sourceforge/jboss-4.0.5.GA.zip"
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.423"
+ name="JBoss AS 4.2.3"
+ version="4.2.3"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4...."
+ disclaimer="true"/>
+
+ <runtime
+ id="org.jboss.tools.runtime.core.as.501"
+ name="JBoss AS 5.0.1"
+ version="5.0.1"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://repository.jboss.org/sourceforge/jboss-5.0.1.GA.zip"
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.510"
+ name="JBoss AS 5.1.0"
+ version="5.1.0"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://repository.jboss.org/sourceforge/jboss-5.1.0.GA.zip"
+ disclaimer="true"/>
+
+ <runtime
+ id="org.jboss.tools.runtime.core.as.610"
+ name="JBoss AS 6.1.0"
+ version="6.1.0.Final"
+ size="183MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1.0.Final.z..."
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.701"
+ name="JBoss AS 7.0.1 Everything (NOT Java EE6 Certified)"
+ version="7.0.1.Final"
+ size="74MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.1.Final/jboss-as-7.0.1..."
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.702"
+ name="JBoss AS 7.0.2 Everything (NOT Java EE6 Certified)"
+ version="7.0.2.Final"
+ size="75MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.2.Final/jboss-as-7.0.2..."
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.711"
+ name="JBoss AS 7.1.1 Certified Java EE 6 Full Profile"
+ version="7.1.1.Final"
+ size="127MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1..."
+ disclaimer="true"/>
+ <runtime
+ id="org.jboss.tools.runtime.core.as.710"
+ name="JBoss AS 7.1.0 Certified Java EE 6 Full Profile"
+ version="7.1.0.Final"
+ size="100MB"
+ licenseUrl="http://www.gnu.org/licenses/lgpl-2.1.txt"
+ url="http://download.jboss.org/jbossas/7.1/jboss-as-7.1.0.Final/jboss-as-7.1.0..."
+ disclaimer="true"/>
+ <!-- NEW_SERVER_ADAPTER add new downloadable runtimes here.
+ Also, if adding new, make sure to update DownloadRuntimeToWTPRuntime -->
+ </extension>
</plugin>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2012-09-13 07:52:48 UTC (rev 43635)
@@ -1,77 +1,79 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.jboss.ide.eclipse.as.ui;singleton:=true
-Bundle-Version: 2.4.0.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui.ide;bundle-version="3.7.0",
- org.eclipse.jface.text;bundle-version="3.7.0",
- org.eclipse.ui.workbench.texteditor;bundle-version="3.7.0",
- org.eclipse.ui.editors;bundle-version="3.7.0",
- org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.core.filebuffers;bundle-version="3.5.200",
- org.eclipse.core.variables;bundle-version="3.2.500",
- org.eclipse.core.expressions;bundle-version="3.4.200",
- org.eclipse.jdt.core;bundle-version="3.7.0",
- org.eclipse.debug.ui;bundle-version="3.7.0",
- org.eclipse.jdt.debug;bundle-version="3.7.0",
- org.eclipse.jdt.launching;bundle-version="3.6.0",
- org.eclipse.jdt.ui;bundle-version="3.7.0",
- org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
- org.eclipse.ui.console;bundle-version="3.5.100",
- org.eclipse.jdt.core.manipulation;bundle-version="1.3.0",
- org.eclipse.search;bundle-version="3.6.100",
- org.eclipse.ui.forms;bundle-version="3.5.100",
- org.eclipse.core.resources;bundle-version="3.7.100",
- org.eclipse.jface;bundle-version="3.7.0",
- com.ibm.icu;bundle-version="4.2.1",
- org.eclipse.jst.server.ui;bundle-version="1.1.201",
- org.eclipse.wst.server.core;bundle-version="1.1.302",
- org.eclipse.wst.server.ui;bundle-version="1.1.305",
- org.eclipse.wst.server.ui.doc.user;bundle-version="1.1.300",
- org.eclipse.jdt.debug.ui;bundle-version="3.6.0",
- org.eclipse.text;bundle-version="3.5.100",
- org.eclipse.debug.core;bundle-version="3.7.0",
- org.eclipse.ui.views;bundle-version="3.6.0",
- org.eclipse.wst.xml.ui;bundle-version="1.1.200",
- org.eclipse.wst.sse.ui;bundle-version="1.3.0",
- org.eclipse.wst.sse.core;bundle-version="1.1.600",
- org.eclipse.wst.xml.core;bundle-version="1.1.600",
- org.eclipse.core.filesystem;bundle-version="1.3.100",
- org.eclipse.jst.server.core;bundle-version="1.2.101",
- org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
- org.eclipse.jst.servlet.ui;bundle-version="1.1.500",
- org.eclipse.jst.j2ee;bundle-version="1.1.500",
- org.eclipse.jst.j2ee.ui;bundle-version="1.1.500",
- org.eclipse.wst.web.ui;bundle-version="1.1.400",
- org.eclipse.wst.common.frameworks.ui;bundle-version="1.2.0",
- org.eclipse.jem.util;bundle-version="2.1.2",
- org.apache.ant;bundle-version="1.7.1",
- org.jboss.ide.eclipse.as.core,
- org.eclipse.ui.navigator;bundle-version="3.5.0",
- org.eclipse.ui.views.log;bundle-version="1.0.200",
- org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
- org.eclipse.wst.common.project.facet.ui;bundle-version="1.4.200",
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="2.3.0",
- org.eclipse.jst.common.project.facet.core;bundle-version="1.4.200",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
- org.jboss.ide.eclipse.as.management.core;bundle-version="1.0.0",
- org.jboss.ide.eclipse.as.dmr;bundle-version="2.3.0",
- org.eclipse.ui.browser;bundle-version="3.3.101"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.jboss.ide.eclipse.as.ui,
- org.jboss.ide.eclipse.as.ui.actions,
- org.jboss.ide.eclipse.as.ui.console,
- org.jboss.ide.eclipse.as.ui.dialogs,
- org.jboss.ide.eclipse.as.ui.editor,
- org.jboss.ide.eclipse.as.ui.launch,
- org.jboss.ide.eclipse.as.ui.preferences,
- org.jboss.ide.eclipse.as.ui.views,
- org.jboss.ide.eclipse.as.ui.views.as7.management.content,
- org.jboss.ide.eclipse.as.ui.views.server.extensions,
- org.jboss.ide.eclipse.as.ui.wizards,
- org.jboss.tools.as.wst.server.ui.xpl
-Bundle-Activator: org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.ui;singleton:=true
+Bundle-Version: 2.4.0.qualifier
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui.ide;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
+ org.eclipse.ui.workbench.texteditor;bundle-version="3.7.0",
+ org.eclipse.ui.editors;bundle-version="3.7.0",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.filebuffers;bundle-version="3.5.200",
+ org.eclipse.core.variables;bundle-version="3.2.500",
+ org.eclipse.core.expressions;bundle-version="3.4.200",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.debug.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.debug;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
+ org.eclipse.ui.console;bundle-version="3.5.100",
+ org.eclipse.jdt.core.manipulation;bundle-version="1.3.0",
+ org.eclipse.search;bundle-version="3.6.100",
+ org.eclipse.ui.forms;bundle-version="3.5.100",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.jface;bundle-version="3.7.0",
+ com.ibm.icu;bundle-version="4.2.1",
+ org.eclipse.jst.server.ui;bundle-version="1.1.201",
+ org.eclipse.wst.server.core;bundle-version="1.1.302",
+ org.eclipse.wst.server.ui;bundle-version="1.1.305",
+ org.eclipse.wst.server.ui.doc.user;bundle-version="1.1.300",
+ org.eclipse.jdt.debug.ui;bundle-version="3.6.0",
+ org.eclipse.text;bundle-version="3.5.100",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.ui.views;bundle-version="3.6.0",
+ org.eclipse.wst.xml.ui;bundle-version="1.1.200",
+ org.eclipse.wst.sse.ui;bundle-version="1.3.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.600",
+ org.eclipse.wst.xml.core;bundle-version="1.1.600",
+ org.eclipse.core.filesystem;bundle-version="1.3.100",
+ org.eclipse.jst.server.core;bundle-version="1.2.101",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
+ org.eclipse.jst.servlet.ui;bundle-version="1.1.500",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.jst.j2ee.ui;bundle-version="1.1.500",
+ org.eclipse.wst.web.ui;bundle-version="1.1.400",
+ org.eclipse.wst.common.frameworks.ui;bundle-version="1.2.0",
+ org.eclipse.jem.util;bundle-version="2.1.2",
+ org.apache.ant;bundle-version="1.7.1",
+ org.jboss.ide.eclipse.as.core,
+ org.eclipse.ui.navigator;bundle-version="3.5.0",
+ org.eclipse.ui.views.log;bundle-version="1.0.200",
+ org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
+ org.eclipse.wst.common.project.facet.ui;bundle-version="1.4.200",
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="2.3.0",
+ org.eclipse.jst.common.project.facet.core;bundle-version="1.4.200",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.jboss.ide.eclipse.as.management.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.dmr;bundle-version="2.3.0",
+ org.eclipse.ui.browser;bundle-version="3.3.101",
+ org.jboss.tools.runtime.core;bundle-version="2.0.0",
+ org.jboss.tools.runtime.ui;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.jboss.ide.eclipse.as.ui,
+ org.jboss.ide.eclipse.as.ui.actions,
+ org.jboss.ide.eclipse.as.ui.console,
+ org.jboss.ide.eclipse.as.ui.dialogs,
+ org.jboss.ide.eclipse.as.ui.editor,
+ org.jboss.ide.eclipse.as.ui.launch,
+ org.jboss.ide.eclipse.as.ui.preferences,
+ org.jboss.ide.eclipse.as.ui.views,
+ org.jboss.ide.eclipse.as.ui.views.as7.management.content,
+ org.jboss.ide.eclipse.as.ui.views.server.extensions,
+ org.jboss.ide.eclipse.as.ui.wizards,
+ org.jboss.tools.as.wst.server.ui.xpl
+Bundle-Activator: org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossASDownloadRuntimeFilter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossASDownloadRuntimeFilter.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossASDownloadRuntimeFilter.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -0,0 +1,23 @@
+package org.jboss.ide.eclipse.as.ui.wizards;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.jboss.ide.eclipse.as.core.runtime.DownloadRuntimeToWTPRuntime;
+import org.jboss.tools.runtime.core.model.DownloadRuntime;
+import org.jboss.tools.runtime.core.model.IDownloadRuntimeFilter;
+
+public class JBossASDownloadRuntimeFilter implements IDownloadRuntimeFilter {
+ private IRuntimeType runtimeType;
+ public JBossASDownloadRuntimeFilter(IRuntimeType rtType) {
+ this.runtimeType = rtType;
+ }
+ public boolean accepts(DownloadRuntime runtime) {
+ DownloadRuntime[] all = DownloadRuntimeToWTPRuntime.getDownloadRuntimes(runtimeType);
+ return Arrays.asList(all).contains(runtime);
+ }
+ public DownloadRuntime[] filter(DownloadRuntime[] runtimes) {
+ return DownloadRuntimeToWTPRuntime.getDownloadRuntimes(runtimeType, runtimes);
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-09-13 07:52:48 UTC (rev 43635)
@@ -12,19 +12,15 @@
import java.io.File;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
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.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jdt.launching.IVMInstall;
@@ -42,8 +38,6 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@@ -63,7 +57,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -76,8 +69,6 @@
import org.eclipse.wst.server.core.TaskModel;
import org.eclipse.wst.server.core.internal.IInstallableRuntime;
import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.LicenseWizardFragment;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
@@ -92,6 +83,9 @@
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.IDownloadRuntimes;
+import org.jboss.tools.runtime.ui.download.DownloadRuntimes;
import org.osgi.service.prefs.BackingStoreException;
/**
@@ -348,8 +342,7 @@
downloadAndInstallButton = new Button(homeDirComposite, SWT.NONE);
downloadAndInstallButton.setText(Messages.rwf_DownloadRuntime);
downloadAndInstallButton.addSelectionListener(new DownloadAndInstallListener());
- final IInstallableRuntime ir = ServerPlugin.findInstallableRuntime(getRuntimeType().getId());
- downloadAndInstallButton.setEnabled(ir != null);
+ downloadAndInstallButton.setEnabled(true);
// Add listeners
homeDirText.addModifyListener(new ModifyListener() {
@@ -379,70 +372,14 @@
protected class DownloadAndInstallListener extends SelectionAdapter {
public void widgetSelected(SelectionEvent se) {
- downloadAndInstallButton.setEnabled(false);
- String license = null;
- final IInstallableRuntime ir = ServerPlugin.findInstallableRuntime(getRuntimeType().getId());
-
- try {
- license = ir.getLicense(new NullProgressMonitor());
- } catch (CoreException e) {
+ IDownloadRuntimes downloader = RuntimeCoreActivator.getDefault().getDownloader();
+ if( downloader != null ) {
+ HashMap<String, Object> data = new HashMap<String, Object>();
+ data.put(DownloadRuntimes.SHELL, downloadAndInstallButton.getShell() );
+ IRuntimeType type = getRuntimeType();
+ data.put(IDownloadRuntimes.RUNTIME_FILTER, new JBossASDownloadRuntimeFilter(type));
+ downloader.execute(data);
}
- TaskModel taskModel = new TaskModel();
- taskModel.putObject(LicenseWizardFragment.LICENSE, license);
- TaskWizard wizard2 = new TaskWizard(Messages.rwf_DownloadAndInstallRuntimeWizard, new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new LicenseWizardFragment());
- }
- }, taskModel);
-
- WizardDialog dialog2 = new WizardDialog(downloadAndInstallButton.getShell(), wizard2);
- if (dialog2.open() == Window.CANCEL) {
- downloadAndInstallButton.setEnabled(true);
- return;
- }
- DirectoryDialog dialog = new DirectoryDialog(downloadAndInstallButton.getShell());
- dialog.setMessage(Messages.rwf_DownloadServerFileChooser);
- dialog.setFilterPath(homeDirText.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
-// ir.install(new Path(selectedDirectory));
- final IPath installPath = new Path(selectedDirectory);
- final Job installRuntimeJob = new Job(
- NLS.bind(Messages.rwf_InstallingRuntimeJob, getRuntimeType().getName())) {
- public boolean belongsTo(Object family) {
- return ServerPlugin.PLUGIN_ID.equals(family);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- try {
- ir.install(installPath, monitor);
- } catch (CoreException ce) {
- return ce.getStatus();
- }
-
- return Status.OK_STATUS;
- }
- };
-
- homeDirText.setText(selectedDirectory);
- JobChangeAdapter jobListener = new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- installRuntimeJob.removeJobChangeListener(this);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if( !downloadAndInstallButton.isDisposed())
- downloadAndInstallButton.setEnabled(true);
- }
- });
- }
- };
- installRuntimeJob.addJobChangeListener(jobListener);
- installRuntimeJob.schedule();
- handle.setMessage(Messages.rwf_DownloadingMayTakeLongTime, IMessageProvider.WARNING);
- MessageDialog.openWarning(downloadAndInstallButton.getShell(), Messages.rwf_InstallingASTitle,
- NLS.bind(Messages.rwf_DownloadingMayTakeLongTime, selectedDirectory));
- ((TitleAreaDialog)((IWizardPage)handle).getWizard().getContainer()).close();
- }
}
}
Modified: trunk/as/plugins/pom.xml
===================================================================
--- trunk/as/plugins/pom.xml 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/plugins/pom.xml 2012-09-13 07:52:48 UTC (rev 43635)
@@ -26,7 +26,6 @@
<module>org.jboss.ide.eclipse.as.jmx.integration</module>
<module>org.jboss.ide.eclipse.as.management.core</module>
<module>org.jboss.ide.eclipse.as.management.as71</module>
- <module>org.jboss.tools.runtime.as.detector</module>
</modules>
</project>
Modified: trunk/as/site/category.xml
===================================================================
--- trunk/as/site/category.xml 2012-09-13 05:32:15 UTC (rev 43634)
+++ trunk/as/site/category.xml 2012-09-13 07:52:48 UTC (rev 43635)
@@ -12,13 +12,6 @@
<category name="JBoss Tools as 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 as Nightly Build Update Site" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
- <category name="JBoss Tools as Nightly Build Update Site" />
- </feature>
-
<feature url="features/org.jboss.ide.eclipse.as.test.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.test.feature" version="0.0.0">
<category name="JBoss Tools as Nightly Build Update Site" />
</feature>
13 years, 3 months
JBoss Tools SVN: r43634 - in trunk/runtime/plugins: org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-13 01:32:15 -0400 (Thu, 13 Sep 2012)
New Revision: 43634
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimeFilter.java
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimes.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimes.java
Log:
JBIDE-12602 to trunk
Added: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimeFilter.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimeFilter.java (rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimeFilter.java 2012-09-13 05:32:15 UTC (rev 43634)
@@ -0,0 +1,6 @@
+package org.jboss.tools.runtime.core.model;
+
+public interface IDownloadRuntimeFilter {
+ public boolean accepts(DownloadRuntime runtime);
+ public DownloadRuntime[] filter(DownloadRuntime[] runtime);
+}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimes.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimes.java 2012-09-13 01:20:47 UTC (rev 43633)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IDownloadRuntimes.java 2012-09-13 05:32:15 UTC (rev 43634)
@@ -3,6 +3,16 @@
import java.util.HashMap;
public interface IDownloadRuntimes {
+ /**
+ * Should be a ui Shell object
+ */
+ public static final String SHELL = "download.runtimes.shell";
+
+ /**
+ * May be used to limit the number of items showing up in the
+ * download runtime dialog.
+ */
+ public static final String RUNTIME_FILTER = "download.runtimes.filter";
void execute(HashMap<String, Object> data);
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2012-09-13 01:20:47 UTC (rev 43633)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2012-09-13 05:32:15 UTC (rev 43634)
@@ -190,22 +190,32 @@
return prefs;
}
+ public RuntimeSharedImages getSharedImages() {
+ return RuntimeSharedImages.getDefault();
+ }
+
+ /* These are all deprecated and shouldn't be used */
+ @Deprecated
public List<RuntimeDefinition> getServerDefinitions() {
return RuntimeModelUtil.getRuntimeDefinitions(getModel().getRuntimePaths());
}
+ @Deprecated
public Set<IRuntimeDetector> getRuntimeDetectors() {
return RuntimeCoreActivator.getDefault().getRuntimeDetectors();
}
+ @Deprecated
public static void setTimestamp(RuntimePath[] runtimePaths2) {
RuntimeModelUtil.updateTimestamps(runtimePaths2);
}
+ @Deprecated
public static boolean runtimeCreated(RuntimeDefinition runtimeDefinition) {
return RuntimeModelUtil.verifyRuntimeDefinitionCreated(runtimeDefinition);
}
+ @Deprecated
public static RuntimePath[] getRuntimePaths() {
return getDefault().getModel().getRuntimePaths();
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java 2012-09-13 01:20:47 UTC (rev 43633)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java 2012-09-13 05:32:15 UTC (rev 43634)
@@ -12,6 +12,8 @@
import java.util.Arrays;
import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -46,6 +48,7 @@
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.DownloadRuntime;
+import org.jboss.tools.runtime.core.model.IDownloadRuntimeFilter;
import org.jboss.tools.runtime.ui.dialogs.AutoResizeTableLayout;
/**
@@ -58,12 +61,31 @@
private Map<String, DownloadRuntime> downloadRuntimes;
public DownloadRuntimeViewerDialog(Shell parentShell) {
+ this(parentShell, null);
+ }
+
+ public DownloadRuntimeViewerDialog(Shell parentShell, IDownloadRuntimeFilter filter) {
super(parentShell);
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER
| SWT.RESIZE | getDefaultOrientation());
- downloadRuntimes = RuntimeCoreActivator.getDefault().getDownloadRuntimes();
+ Map<String, DownloadRuntime> allDownloads = RuntimeCoreActivator.getDefault().getDownloadRuntimes();
+ if( filter == null )
+ downloadRuntimes = RuntimeCoreActivator.getDefault().getDownloadRuntimes();
+ else {
+ Map<String, DownloadRuntime> filtered = new HashMap<String, DownloadRuntime>();
+ Iterator<String> it = allDownloads.keySet().iterator();
+ while(it.hasNext()) {
+ String k = it.next();
+ DownloadRuntime rt = allDownloads.get(k);
+ if( filter.accepts(rt)) {
+ filtered.put(k, rt);
+ }
+ }
+ downloadRuntimes = filtered;
+ }
}
+
@Override
protected Control createDialogArea(Composite parent) {
getShell().setText("Runtimes");
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimes.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimes.java 2012-09-13 01:20:47 UTC (rev 43633)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimes.java 2012-09-13 05:32:15 UTC (rev 43634)
@@ -4,10 +4,11 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.runtime.core.model.IDownloadRuntimeFilter;
import org.jboss.tools.runtime.core.model.IDownloadRuntimes;
public class DownloadRuntimes implements IDownloadRuntimes {
- public static final String SHELL = "download.runtimes.shell";
+ public static final String SHELL = IDownloadRuntimes.SHELL;
public DownloadRuntimes() {
@@ -15,12 +16,13 @@
public void execute(HashMap<String, Object> map) {
Object shell = map.get(SHELL);
Shell shell2 = shell == null ? Display.getDefault().getActiveShell() : ((Shell)shell);
+ Object filter = map.get(IDownloadRuntimes.RUNTIME_FILTER);
// If this has not been accessed before, this may freeze the UI during
// a fetch to the remote path. The call to get the downloadable runtimes
// also fetches from a remote repository location.
// THis should also be done via a display.asynchexec
- DownloadRuntimeViewerDialog dialog = new DownloadRuntimeViewerDialog(shell2);
+ DownloadRuntimeViewerDialog dialog = new DownloadRuntimeViewerDialog(shell2, (IDownloadRuntimeFilter)filter);
dialog.open();
}
13 years, 3 months
JBoss Tools SVN: r43633 - in trunk/documentation/whatsnew/jst: images and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-12 21:20:47 -0400 (Wed, 12 Sep 2012)
New Revision: 43633
Added:
trunk/documentation/whatsnew/jst/images/4.0.0.Alpha1/
trunk/documentation/whatsnew/jst/images/4.0.0.Alpha1/param.png
Modified:
trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html
Log:
N&N for JSF Tools 4.0.0.Alpha1
Added: trunk/documentation/whatsnew/jst/images/4.0.0.Alpha1/param.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/4.0.0.Alpha1/param.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html
===================================================================
--- trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html 2012-09-13 00:57:24 UTC (rev 43632)
+++ trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html 2012-09-13 01:20:47 UTC (rev 43633)
@@ -24,7 +24,7 @@
<h1>JST/JSF 4.0.0.Alpha1 What's New</h1>
<p align="right"><a href="../index.html">< Main
- Index</a> <a href="../vpe/vpe-news-3.3.0.Beta1.html">VPE Tools ></a></p>
+ Index</a> </p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
@@ -37,15 +37,15 @@
</tr>
<tr>
<td valign="top" align="left">
- <p><b>XYZ</b></p>
+ <p><b>As-you-type validation</b></p>
</td>
<td align="top">
<p>
- XYZ
+ You don't have to save the file to validate EL expressions. The file is being validated as you are typing.
</p>
<p>
<small>
- <a href="https://issues.jboss.org/browse/JBIDE-12199">Related Jira</a>
+ <a href="https://issues.jboss.org/browse/JBIDE-10738">Related Jira</a>
</small><br/>
</p>
</td>
@@ -57,15 +57,16 @@
</tr>
<tr>
<td valign="top" align="left">
- <p><b>XYZ</b></p>
+ <p><b><ui:param/> validation and navigation</b></p>
</td>
<td align="top">
<p>
- XYZ
+ When you set some parameters using <ui:param/> these parameters are now available for validation and navigation (Ctrl+Click) in EL expressions which use them.
</p>
+ <p><img src="images/4.0.0.Alpha1/param.png" /></p>
<p>
<small>
- <a href="https://issues.jboss.org/browse/JBIDE-10611">Related Jira</a>
+ <a href="https://issues.jboss.org/browse/JBIDE-3526">Related Jira</a>
</small><br/>
</p>
</td>
13 years, 3 months
JBoss Tools SVN: r43632 - in trunk/documentation/whatsnew: jst and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-12 20:57:24 -0400 (Wed, 12 Sep 2012)
New Revision: 43632
Added:
trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html
Modified:
trunk/documentation/whatsnew/index.html
Log:
N&N for JSF Tools 4.0.0.Alpha1
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2012-09-13 00:53:19 UTC (rev 43631)
+++ trunk/documentation/whatsnew/index.html 2012-09-13 00:57:24 UTC (rev 43632)
@@ -54,6 +54,7 @@
<td valign="top">
<p><a href="cdi/cdi-news-4.0.0.Alpha1.html">CDI Tools</a></p>
+ <p><a href="jst/jst-news-4.0.0.Alpha1.html">JST/JSF</a></p>
</td>
</tr>
Added: trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html
===================================================================
--- trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html (rev 0)
+++ trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html 2012-09-13 00:57:24 UTC (rev 43632)
@@ -0,0 +1,83 @@
+<?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-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>JST/JSF 3.3.0.Beta1 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>JST/JSF 4.0.0.Alpha1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main
+ Index</a> <a href="../vpe/vpe-news-3.3.0.Beta1.html">VPE Tools ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Validation</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>XYZ</b></p>
+ </td>
+ <td align="top">
+ <p>
+ XYZ
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-12199">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>XYZ</b></p>
+ </td>
+ <td align="top">
+ <p>
+ XYZ
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10611">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/documentation/whatsnew/jst/jst-news-4.0.0.Alpha1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 3 months
JBoss Tools SVN: r43631 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-12 20:53:19 -0400 (Wed, 12 Sep 2012)
New Revision: 43631
Modified:
trunk/documentation/whatsnew/index.html
Log:
N&N for CDI Tools 4.0.0.Alpha1
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2012-09-13 00:49:50 UTC (rev 43630)
+++ trunk/documentation/whatsnew/index.html 2012-09-13 00:53:19 UTC (rev 43631)
@@ -53,7 +53,7 @@
<p align="right"><b>4.0.0.Alpha1</b>
<td valign="top">
- <p><a href="cd/cd-news-4.0.0.Alpha1.html">CDI Tools</a></p>
+ <p><a href="cdi/cdi-news-4.0.0.Alpha1.html">CDI Tools</a></p>
</td>
</tr>
13 years, 3 months
JBoss Tools SVN: r43630 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-12 20:49:50 -0400 (Wed, 12 Sep 2012)
New Revision: 43630
Modified:
trunk/documentation/whatsnew/index.html
Log:
N&N for CDI Tools 4.0.0.Alpha1
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2012-09-13 00:46:40 UTC (rev 43629)
+++ trunk/documentation/whatsnew/index.html 2012-09-13 00:49:50 UTC (rev 43630)
@@ -43,6 +43,24 @@
<tr>
<td colspan="2">
<hr>
+ <h3>JBoss Tools 4.0 individual new and noteworthy</h3>
+ <hr>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>4.0.0.Alpha1</b>
+ <td valign="top">
+
+ <p><a href="cd/cd-news-4.0.0.Alpha1.html">CDI Tools</a></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr>
<h3>JBoss Tools 3.3 individual new and noteworthy</h3>
<hr>
</td>
13 years, 3 months
JBoss Tools SVN: r43629 - trunk/documentation/whatsnew/cdi.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-12 20:46:40 -0400 (Wed, 12 Sep 2012)
New Revision: 43629
Added:
trunk/documentation/whatsnew/cdi/cdi-news-4.0.0.Alpha1.html
Log:
N&N for CDI Tools 4.0.0.Alpha1
Added: trunk/documentation/whatsnew/cdi/cdi-news-4.0.0.Alpha1.html
===================================================================
--- trunk/documentation/whatsnew/cdi/cdi-news-4.0.0.Alpha1.html (rev 0)
+++ trunk/documentation/whatsnew/cdi/cdi-news-4.0.0.Alpha1.html 2012-09-13 00:46:40 UTC (rev 43629)
@@ -0,0 +1,86 @@
+<?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-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>CDI tools 4.0.0.Alpha1 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>CDI tools 3.3.0.CR1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../maven/maven-news-4.0.0.Alpha1.html">Maven Tools News ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Validation</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Unproxyable bean type</b></p>
+ </td>
+ <td align="top">
+ <p>
+ CDI tools now reports problems with bean types of normal scoped beans that cannot be proxied by the container (JSR-299 5.4.1)
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-12199">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>As-you-type validation</b></p>
+ </td>
+ <td align="top">
+ <p>
+ You don't have to save the file to run CDI validator anymore. The file is being validated as you are typing.
+ </p>
+ <p>
+ <iframe src="http://player.vimeo.com/video/47965113" width="500" height="369" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10611">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/documentation/whatsnew/cdi/cdi-news-4.0.0.Alpha1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 3 months
JBoss Tools SVN: r43628 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-09-12 20:09:33 -0400 (Wed, 12 Sep 2012)
New Revision: 43628
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-12587
https://issues.jboss.org/browse/JBIDE-12587
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 2012-09-13 00:08:42 UTC (rev 43627)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-09-13 00:09:33 UTC (rev 43628)
@@ -505,6 +505,9 @@
init(rootProject, validationHelper, projectContext, validatorManager, reporter);
setAsYouTypeValidation(true);
this.document = validationContext.getDocument();
+ if(rootCdiProject == null) {
+ return;
+ }
rootCdiProject = new CDIProjectAsYouType(rootCdiProject, file);
validateResource(file);
if(reporter instanceof ITypedReporter) {
13 years, 3 months