JBoss Tools SVN: r35371 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 10:03:03 -0400 (Wed, 05 Oct 2011)
New Revision: 35371
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java
Log:
[JBIDE-9845] commented non-compiling method
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java 2011-10-05 13:40:12 UTC (rev 35370)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java 2011-10-05 14:03:03 UTC (rev 35371)
@@ -1,24 +1,20 @@
package org.jboss.ide.eclipse.as.egit.core;
-import java.util.concurrent.ExecutionException;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public class EgitPublishMethod implements IJBossServerPublishMethod {
- @Override
- public IJBossServerPublishMethodType getPublishMethodType() {
- return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
- }
+// @Override
+// public IJBossServerPublishMethodType getPublishMethodType() {
+// return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
+// }
public String getPublishMethodId() {
return EgitBehaviourDelegate.ID;
13 years, 3 months
JBoss Tools SVN: r35370 - trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 09:40:12 -0400 (Wed, 05 Oct 2011)
New Revision: 35370
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/UserConfiguration.java
Log:
[JBIDE-9793] corrected loading of existing express.conf
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/UserConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/UserConfiguration.java 2011-10-05 13:37:15 UTC (rev 35369)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/UserConfiguration.java 2011-10-05 13:40:12 UTC (rev 35370)
@@ -43,7 +43,7 @@
if (userHome == null) {
throw new OpenshiftException("Could not read user configuration: user home directory not found");
}
- return new File(CONFIGURATION_FILE, userHome + File.separatorChar + CONFIGURATION_FOLDER);
+ return new File(userHome + File.separatorChar + CONFIGURATION_FOLDER, CONFIGURATION_FILE);
}
protected Properties getUserProperties(File userConfigurationFile) throws FileNotFoundException, IOException {
13 years, 3 months
JBoss Tools SVN: r35369 - branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-10-05 09:37:15 -0400 (Wed, 05 Oct 2011)
New Revision: 35369
Modified:
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java
Log:
JBIDE-9802 - Wrapping potential deadlock in ESB project plugin class with Rob Stryker's patch (thanks Rob!)
Modified: branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java
===================================================================
--- branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2011-10-05 13:36:57 UTC (rev 35368)
+++ branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2011-10-05 13:37:15 UTC (rev 35369)
@@ -11,11 +11,14 @@
package org.jboss.tools.esb.core;
import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.osgi.framework.BundleContext;
@@ -44,7 +47,12 @@
super.start(context);
plugin = this;
JBossRuntimeManager.loadParsers();
- VirtualReferenceUtilities.INSTANCE.addDefaultExtension(ESBProjectConstant.ESB_PROJECT_FACET, ESBProjectConstant.ESB_EXTENSION);
+ Job job = new Job("ESB Facet Framework Initialization") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ VirtualReferenceUtilities.INSTANCE.addDefaultExtension(ESBProjectConstant.ESB_PROJECT_FACET, ESBProjectConstant.ESB_EXTENSION);
+ return Status.OK_STATUS;
+ }
+ };
PublishUtil.addModuleCoreFactory("org.jboss.tools.esb.project.core.moduleFactory");
}
13 years, 3 months
JBoss Tools SVN: r35368 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-10-05 09:36:57 -0400 (Wed, 05 Oct 2011)
New Revision: 35368
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java
Log:
JBIDE-9802 - Wrapping potential deadlock in ESB project plugin class with Rob Stryker's patch (thanks Rob!)
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2011-10-05 12:47:38 UTC (rev 35367)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2011-10-05 13:36:57 UTC (rev 35368)
@@ -11,8 +11,10 @@
package org.jboss.tools.esb.core;
import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
@@ -22,6 +24,7 @@
/**
* The activator class controls the plug-in life cycle
*/
+@SuppressWarnings("restriction")
public class ESBProjectCorePlugin extends AbstractUIPlugin {
// The plug-in ID
@@ -44,8 +47,14 @@
super.start(context);
plugin = this;
JBossRuntimeManager.loadParsers();
- VirtualReferenceUtilities.INSTANCE.addDefaultExtension(ESBProjectConstant.ESB_PROJECT_FACET, ESBProjectConstant.ESB_EXTENSION);
PublishUtil.addModuleCoreFactory("org.jboss.tools.esb.project.core.moduleFactory");
+ Job job = new Job("ESB Facet Framework Initialization") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ VirtualReferenceUtilities.INSTANCE.addDefaultExtension(ESBProjectConstant.ESB_PROJECT_FACET, ESBProjectConstant.ESB_EXTENSION);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
}
/*
13 years, 3 months
JBoss Tools SVN: r35367 - trunk/as/features/org.jboss.tools.openshift.express.feature.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 08:47:38 -0400 (Wed, 05 Oct 2011)
New Revision: 35367
Added:
trunk/as/features/org.jboss.tools.openshift.express.feature/.project
trunk/as/features/org.jboss.tools.openshift.express.feature/build.properties
trunk/as/features/org.jboss.tools.openshift.express.feature/feature.properties
trunk/as/features/org.jboss.tools.openshift.express.feature/feature.xml
trunk/as/features/org.jboss.tools.openshift.express.feature/license.html
trunk/as/features/org.jboss.tools.openshift.express.feature/pom.xml
Log:
[JBIDE-9841] added feature
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/.project
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/.project (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/.project 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.openshift.express.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/.project
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/build.properties
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/build.properties (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/build.properties 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,8 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
+src.includes = license.html,\
+ feature.xml,\
+ feature.properties,\
+ build.properties,\
+ .project
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/build.properties
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/feature.properties
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/feature.properties (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/feature.properties 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,37 @@
+###############################################################################
+# Copyright (c) 2010-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Openshift Express Tools
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+devUpdateSiteName=JBossTools Development Update Site
+
+# "description" property - description of the feature
+description=Provides Tooling to deal with Openshift Express. It will allow you to sign into your Openshift Express account, create a domain and manage applications. It will furthermore allow you to setup an Eclipse WTP server adapter that would be able to publish projects to the Openshift Express PaaS platform..
+
+copyright=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), \
+which in a particular case may include the Eclipse Public License, \
+the GNU Lesser General Public License, and/or certain other open \
+source licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/feature.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/feature.xml
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/feature.xml (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/feature.xml 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.openshift.express.feature"
+ label="%featureName"
+ version="2.3.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.openshift.express.ui">
+
+ <description url="http://www.jboss.org/tools">
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="license.html">
+ Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses),
+which in a particular case may include the Eclipse Public License,
+the GNU Lesser General Public License, and/or certain other open
+source licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.openshift.express.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.openshift.express.client"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/feature.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/license.html
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/license.html (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/license.html 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/license.html
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: trunk/as/features/org.jboss.tools.openshift.express.feature/pom.xml
===================================================================
--- trunk/as/features/org.jboss.tools.openshift.express.feature/pom.xml (rev 0)
+++ trunk/as/features/org.jboss.tools.openshift.express.feature/pom.xml 2011-10-05 12:47:38 UTC (rev 35367)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.as</groupId>
+ <artifactId>features</artifactId>
+ <version>2.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.as.features</groupId>
+ <artifactId>org.jboss.tools.openshift.express.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+</project>
Property changes on: trunk/as/features/org.jboss.tools.openshift.express.feature/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 3 months
JBoss Tools SVN: r35366 - trunk/as/features.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 08:47:23 -0400 (Wed, 05 Oct 2011)
New Revision: 35366
Added:
trunk/as/features/org.jboss.tools.openshift.express.feature/
Log:
[JBIDE-9841] added feature
13 years, 3 months
JBoss Tools SVN: r35365 - in trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-05 08:36:31 -0400 (Wed, 05 Oct 2011)
New Revision: 35365
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
JBIDE-9821 : Don't automatically delete existing projects when (re)creating an archetype-based example. Let the user change the project name instead
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-10-05 11:53:53 UTC (rev 35364)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-10-05 12:36:31 UTC (rev 35365)
@@ -39,8 +39,6 @@
private static final String JBOSS_TOOLS_MAVEN_PROJECTS = "/.JBossToolsMavenProjects"; //$NON-NLS-1$
- private boolean confirm;
-
@Override
public List<Project> importProject(final Project projectDescription, File file,
IProgressMonitor monitor) throws Exception {
@@ -54,48 +52,7 @@
}
IPath path = mavenProjectsRoot.append(projectName);
final File destination = new File(path.toOSString());
- if (destination.exists()) {
- final List<IProject> existingProjects = getExistingProjects(destination);
- if (existingProjects.size() > 0) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- String title = "Overwrite";
- String msg = getMessage(destination, existingProjects);
- confirm = MessageDialog.openQuestion(getActiveShell(),
- title, msg);
- }
- });
- if (confirm) {
- monitor.setTaskName("Deleting ...");
- for (IProject project : existingProjects) {
- monitor.setTaskName("Deleting " + project.getName());
- project.delete(false, true, monitor);
- }
- } else {
- return projects;
- }
- }
- boolean deleted = deleteDirectory(destination, monitor);
- if (monitor.isCanceled()) {
- return projects;
- }
- if (!deleted) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(getActiveShell(), "Error",
- "Cannot delete the '" + destination + "' file.");
- }
- });
- return projects;
- }
- }
- monitor.setTaskName("");
- if (monitor.isCanceled()) {
- return projects;
- }
-
Display.getDefault().syncExec(new Runnable() {
@Override
@@ -113,78 +70,4 @@
private static Shell getActiveShell() {
return Display.getDefault().getActiveShell();
}
-
- private static boolean deleteDirectory(File path, IProgressMonitor monitor) {
- if (path.exists()) {
- File[] files = path.listFiles();
- for (File file : files) {
- if (monitor.isCanceled()) {
- return false;
- }
- monitor.setTaskName("Deleting " + file);
- if (file.isDirectory()) {
- deleteDirectory(file, monitor);
- } else {
- file.delete();
- }
- }
- }
- return (path.delete());
- }
-
- private List<IProject> getExistingProjects(final File destination) {
- List<IProject> existingProjects = new ArrayList<IProject>();
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
- .getProjects();
- for (IProject project : projects) {
- if (project != null && project.exists()) {
- File projectFile = project.getLocation().toFile();
- if (projectFile.getAbsolutePath().startsWith(
- destination.getAbsolutePath())) {
- existingProjects.add(project);
- }
- }
- }
- return existingProjects;
- }
-
- private String getMessage(final File destination, List<IProject> projects) {
- if (projects.size() > 0) {
- StringBuilder builder = new StringBuilder();
- if (projects.size() == 1) {
- builder.append("\nThere is the '" + projects.get(0).getName()
- + "' project on the destination location:\n\n");
- builder.append("Would you like to overwrite it?");
- } else {
- builder.append("\nThere are the following projects on the destination location:\n\n");
- for (IProject project : projects) {
- builder.append(project.getName());
- builder.append("\n"); //$NON-NLS-1$
- }
- builder.append("\n"); //$NON-NLS-1$
- builder.append("Would you like to overwrite them?");
- }
- return builder.toString();
- }
- return null;
- }
-
- private String getWorkspaceMessage(final List<IProject> existingProjects) {
- StringBuilder builder = new StringBuilder();
- if (existingProjects.size() == 1) {
- builder.append("There is the '" + existingProjects.get(0).getName()
- + "' project in the workspace.\n\n");
- builder.append("Would you like to delete it?");
- } else {
- builder.append("There are the following projects in the workspace:\n\n");
- for (IProject project : existingProjects) {
- builder.append(project.getName());
- builder.append("\n"); //$NON-NLS-1$
- }
- builder.append("\n"); //$NON-NLS-1$
- builder.append("Would you like to delete them?");
- }
- return builder.toString();
- }
-
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-10-05 11:53:53 UTC (rev 35364)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-10-05 12:36:31 UTC (rev 35365)
@@ -22,6 +22,7 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
@@ -87,7 +88,16 @@
// It needs to be called AFTER setArchetype(archetype) !!!
archetypeChanged = false;
+ //Use archetype/example name by default
artifactIdCombo.setText(artifactId);
+
+ //Check if project already exists
+ IStatus nameStatus = getImportConfiguration().validateProjectName(getModel());
+ if(!nameStatus.isOK()) {
+ //Force the user to change the name if the project exists
+ artifactIdCombo.setText("");//$NON-NLS-1$
+ }
+
groupIdCombo.setText(groupId);
versionCombo.setText(version);
packageCombo.setText(javaPackage);
13 years, 3 months
JBoss Tools SVN: r35364 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-05 07:53:53 -0400 (Wed, 05 Oct 2011)
New Revision: 35364
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties
trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
Log:
JBIDE-9845 - unify the APIs
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -11,7 +11,6 @@
package org.jboss.ide.eclipse.as.core;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
@@ -30,21 +29,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.IPollerFailureHandler;
import org.jboss.ide.eclipse.as.core.server.IServerAlreadyStartedHandler;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
* Manages the extensions for this plugin
@@ -68,8 +57,6 @@
/** The map of pollerID -> PollerObject */
private HashMap<String, IPollerFailureHandler> pollerFailureHandlers;
- private ArrayList<PublisherWrapper> publishers;
-
/** The method used to load / instantiate the pollers */
public void loadPollers() {
pollers = new HashMap<String, ServerStatePollerType>();
@@ -169,7 +156,7 @@
return null;
}
-
+ private ArrayList<PublisherWrapper> publishers;
public IJBossServerPublisher getPublisher(IServer server, IModule[] module, String deployMethod) {
if( publishers == null )
loadPublishers();
@@ -183,21 +170,7 @@
}
return null;
}
-
- public IJBossServerPublisher[] getZippedPublishers() {
- if( publishers == null )
- loadPublishers();
- ArrayList<IJBossServerPublisher> list = new ArrayList<IJBossServerPublisher>();
- Iterator<PublisherWrapper> i = publishers.iterator();
- PublisherWrapper wrapper;
- while(i.hasNext()) {
- wrapper = i.next();
- if( wrapper.isZipDelegate )
- list.add( wrapper.getNewInstance() );
- }
- return list.toArray(new IJBossServerPublisher[list.size()]);
- }
-
+
private void loadPublishers() {
ArrayList<PublisherWrapper> publishers = new ArrayList<PublisherWrapper>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -254,44 +227,61 @@
}
}
- private ServerPublishMethodType[] publishMethodTypes;
- public ServerPublishMethodType[] getPublishMethodTypes() {
- if(publishMethodTypes == null )
- publishMethodTypes = loadPublishMethodTypes();
- return publishMethodTypes;
- }
- public ServerPublishMethodType[] loadPublishMethodTypes() {
- ArrayList<ServerPublishMethodType> types = new ArrayList<ServerPublishMethodType>();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID, "publishMethod"); //$NON-NLS-1$
- for( int i = 0; i < cf.length; i++ ) {
- types.add(new ServerPublishMethodType(cf[i]));
- }
- return types.toArray(new ServerPublishMethodType[types.size()]);
- }
-
- public IJBossServerPublishMethodType getPublishMethod(String id) {
- ServerPublishMethodType[] publishMethods = getPublishMethodTypes();
- for( int i = 0; i < publishMethods.length; i++ )
- if( publishMethods[i].getId().equals(id))
- return publishMethods[i];
- return null;
- }
- public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServerType type) {
- ArrayList<IJBossServerPublishMethodType> list = new ArrayList<IJBossServerPublishMethodType>();
- list.addAll(Arrays.asList(getPublishMethodTypes()));
- Iterator<IJBossServerPublishMethodType> i = list.iterator();
+ public IJBossServerPublisher[] getZippedPublishers() {
+ if( publishers == null )
+ loadPublishers();
+ ArrayList<IJBossServerPublisher> list = new ArrayList<IJBossServerPublisher>();
+ Iterator<PublisherWrapper> i = publishers.iterator();
+ PublisherWrapper wrapper;
while(i.hasNext()) {
- if( !i.next().accepts(type.getId()))
- i.remove();
+ wrapper = i.next();
+ if( wrapper.isZipDelegate )
+ list.add( wrapper.getNewInstance() );
}
- return list.toArray(new IJBossServerPublishMethodType[list.size()]);
+ return list.toArray(new IJBossServerPublisher[list.size()]);
}
- public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServer server) {
- return findPossiblePublishMethods(server.getServerType());
- }
+
+//
+// private ServerPublishMethodType[] publishMethodTypes;
+// public ServerPublishMethodType[] getPublishMethodTypes() {
+// if(publishMethodTypes == null )
+// publishMethodTypes = loadPublishMethodTypes();
+// return publishMethodTypes;
+// }
+//
+// public ServerPublishMethodType[] loadPublishMethodTypes() {
+// ArrayList<ServerPublishMethodType> types = new ArrayList<ServerPublishMethodType>();
+// IExtensionRegistry registry = Platform.getExtensionRegistry();
+// IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID, "publishMethod"); //$NON-NLS-1$
+// for( int i = 0; i < cf.length; i++ ) {
+// types.add(new ServerPublishMethodType(cf[i]));
+// }
+// return types.toArray(new ServerPublishMethodType[types.size()]);
+// }
+//
+// public IJBossServerPublishMethodType getPublishMethod(String id) {
+// ServerPublishMethodType[] publishMethods = getPublishMethodTypes();
+// for( int i = 0; i < publishMethods.length; i++ )
+// if( publishMethods[i].getId().equals(id))
+// return publishMethods[i];
+// return null;
+// }
+// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServerType type) {
+// ArrayList<IJBossServerPublishMethodType> list = new ArrayList<IJBossServerPublishMethodType>();
+// list.addAll(Arrays.asList(getPublishMethodTypes()));
+// Iterator<IJBossServerPublishMethodType> i = list.iterator();
+// while(i.hasNext()) {
+// if( !i.next().accepts(type.getId()))
+// i.remove();
+// }
+// return list.toArray(new IJBossServerPublishMethodType[list.size()]);
+// }
+//
+// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServer server) {
+// return findPossiblePublishMethods(server.getServerType());
+// }
// API extension
public static interface IServerJMXRunnable {
@@ -340,38 +330,38 @@
}
- /**
- * Temporary home for start launch setup participants and launch configs
- * Should eventually be replaced by an extension point of some type
- *
- * TODO Convert this into a suitable fixed API
- */
- public static HashMap<String, IStartLaunchDelegate> JBoss7launchDelegates;
- public static ArrayList<IStartLaunchSetupParticipant> JBoss7setupParticipants;
- public static HashMap<String, IStartLaunchDelegate> JBossLaunchDelegates;
- public static ArrayList<IStartLaunchSetupParticipant> JBossSetupParticipants;
- static {
- JBoss7setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- JBoss7launchDelegates = new HashMap<String, IStartLaunchDelegate>();
- JBoss7setupParticipants.add(new LocalJBoss7StartLaunchDelegate());
- JBoss7launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBoss7StartLaunchDelegate());
-
- JBossSetupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- JBossLaunchDelegates = new HashMap<String, IStartLaunchDelegate>();
- JBossSetupParticipants.add(new LocalJBossStartLaunchDelegate());
- JBossLaunchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
- }
- public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
- if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
- return JBoss7launchDelegates;
- }
- return JBossLaunchDelegates;
- }
- public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer server) {
- if( ServerUtil.isJBoss7(server)) {
- return JBoss7setupParticipants;
- }
- return JBossSetupParticipants;
- }
-
+// /**
+// * Temporary home for start launch setup participants and launch configs
+// * Should eventually be replaced by an extension point of some type
+// *
+// * TODO Convert this into a suitable fixed API
+// */
+// public static HashMap<String, IStartLaunchDelegate> JBoss7launchDelegates;
+// public static ArrayList<IStartLaunchSetupParticipant> JBoss7setupParticipants;
+// public static HashMap<String, IStartLaunchDelegate> JBossLaunchDelegates;
+// public static ArrayList<IStartLaunchSetupParticipant> JBossSetupParticipants;
+// static {
+// JBoss7setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
+// JBoss7launchDelegates = new HashMap<String, IStartLaunchDelegate>();
+// JBoss7setupParticipants.add(new LocalJBoss7StartLaunchDelegate());
+// JBoss7launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBoss7StartLaunchDelegate());
+//
+// JBossSetupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
+// JBossLaunchDelegates = new HashMap<String, IStartLaunchDelegate>();
+// JBossSetupParticipants.add(new LocalJBossStartLaunchDelegate());
+// JBossLaunchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
+// }
+// public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
+// if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
+// return JBoss7launchDelegates;
+// }
+// return JBossLaunchDelegates;
+// }
+// public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer server) {
+// if( ServerUtil.isJBoss7(server)) {
+// return JBoss7setupParticipants;
+// }
+// return JBossSetupParticipants;
+// }
+//
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -29,6 +29,7 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.ServerListener;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.osgi.framework.BundleContext;
@@ -77,12 +78,16 @@
return Status.OK_STATUS;
}
};
- job.schedule();
+ job.schedule(4000);
// register the debug options listener
final Hashtable<String, String> props = new Hashtable<String, String>(4);
props.put(DebugOptions.LISTENER_SYMBOLICNAME, PLUGIN_ID);
context.registerService(DebugOptionsListener.class.getName(), new Trace(), props);
+
+ // Temporary
+ BehaviourModel.getModel();
+
}
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -26,9 +26,12 @@
public abstract class AbstractPublishMethod implements IJBossServerPublishMethod {
public abstract String getPublishMethodId();
- public IJBossServerPublishMethodType getPublishMethodType() {
- return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
- }
+
+// @Deprecated
+// public IJBossServerPublishMethodType getPublishMethodType() {
+// return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
+// }
+
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -19,7 +19,7 @@
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public interface IJBossServerPublishMethod {
- public IJBossServerPublishMethodType getPublishMethodType();
+// public IJBossServerPublishMethodType getPublishMethodType();
public void publishStart(DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException;
public int publishFinish(DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException;
public int publishModule(DeployableServerBehavior behaviour, int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException;
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -0,0 +1,175 @@
+package org.jboss.ide.eclipse.as.core.server.internal;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+
+public class BehaviourModel {
+ private static BehaviourModel model;
+ public static BehaviourModel getModel() {
+ if( model == null )
+ model = new BehaviourModel();
+ return model;
+ }
+
+ /*
+ * Server type maps to some behaviour
+ */
+ private HashMap<String, Behaviour> map;
+ public BehaviourModel() {
+ map = new HashMap<String, Behaviour>();
+ loadModel();
+ }
+
+ public static IJBossServerPublishMethodType getPublishMethodType(IServer server) {
+ String serverType = server.getServerType().getId();
+ String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ return BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType);
+ }
+
+ /*
+ * Get all setup participants for this server type, regardless
+ * of behaviour type
+ */
+ public ArrayList<IJBossLaunchDelegate> getSetupParticipants(IServer server) {
+ Behaviour beh = map.get(server.getServerType().getId());
+ ArrayList<IJBossLaunchDelegate> list = new ArrayList<IJBossLaunchDelegate>();
+ BehaviourImpl[] impls = beh.getImplementations();
+ for( int i = 0; i < impls.length; i++ ) {
+ list.add(impls[i].getLaunchDelegate());
+ }
+ return null;
+ }
+
+ /*
+ * Get the single launch delegate designated for this server type
+ */
+ public IJBossLaunchDelegate getLaunchDelegate(IServer server, String mode) {
+ Behaviour beh = map.get(server.getServerType().getId());
+ return beh.getImpl(mode).getLaunchDelegate();
+ }
+
+ protected void loadModel() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID, "behaviourExtension"); //$NON-NLS-1$
+ for( int i = 0; i < cf.length; i++ ) {
+ String serverTypes = cf[i].getAttribute("serverTypes"); //$NON-NLS-1$
+ String[] allTypes = serverTypes.split(","); //$NON-NLS-1$
+ BehaviourImpl impl = new BehaviourImpl(cf[i]);
+ Behaviour b;
+ for( int j = 0; j < allTypes.length; j++ ) {
+ b = getOrCreateBehaviour(allTypes[j]);
+ b.addImpl(impl);
+ }
+ }
+ }
+
+ public Behaviour getBehaviour(String serverType) {
+ return map.get(serverType);
+ }
+
+ protected Behaviour getOrCreateBehaviour(String serverType) {
+ Behaviour b = map.get(serverType);
+ if( b == null )
+ map.put(serverType, new Behaviour(serverType));
+ return map.get(serverType);
+ }
+
+ public static class Behaviour {
+ private String serverType;
+ private HashMap<String, BehaviourImpl> behTypeToImpl;
+ public Behaviour(String serverType) {
+ this.serverType = serverType;
+ behTypeToImpl = new HashMap<String, BehaviourImpl>();
+ }
+ public String getServerType() {
+ return serverType;
+ }
+ // Will overwrite previous values
+ public void addImpl(BehaviourImpl impl) {
+ behTypeToImpl.put(impl.typeId, impl);
+ }
+ public BehaviourImpl getImpl(String behaviourType) {
+ return behTypeToImpl.get(behaviourType);
+ }
+ public BehaviourImpl[] getImplementations() {
+ ArrayList<BehaviourImpl> list = new ArrayList<BehaviourImpl>();
+ list.addAll(behTypeToImpl.values());
+ return list.toArray(new BehaviourImpl[list.size()]);
+ }
+
+ public String[] getSupportedBehaviours() {
+ Set<String> c = behTypeToImpl.keySet();
+ ArrayList<String> c2 = new ArrayList<String>();
+ c2.addAll(c);
+ Collections.sort(c2);
+ return c2.toArray(new String[c2.size()]);
+ }
+ }
+
+ /*
+ * This "implements" is a hack, just trying to get shit to compile!
+ */
+ public static class BehaviourImpl implements IJBossServerPublishMethodType {
+ private String name;
+ private String typeId;
+ private IConfigurationElement element;
+ private IJBossLaunchDelegate launchDelegate;
+ private String supportedServers;
+ public BehaviourImpl(IConfigurationElement element) {
+ this.element = element;
+ name = element.getAttribute("name"); //$NON-NLS-1$
+ typeId = element.getAttribute("typeId");//$NON-NLS-1$
+ supportedServers = element.getAttribute("serverTypes"); //$NON-NLS-1$
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return typeId;
+ }
+ public boolean accepts(String serverTypeId) {
+ String[] servers = supportedServers.split(","); //$NON-NLS-1$
+ for( int i = 0; i < servers.length; i++ )
+ if( servers[i].trim().equals(serverTypeId))
+ return true;
+ return false;
+ }
+
+ public IJBossServerPublishMethod createPublishMethod() {
+ try {
+ return (IJBossServerPublishMethod) element.createExecutableExtension("publishMethod"); //$NON-NLS-1$
+ } catch( CoreException ce ) {
+ JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
+ }
+ return null;
+ }
+
+ public IJBossLaunchDelegate getLaunchDelegate() {
+ if( launchDelegate != null)
+ return launchDelegate;
+
+ try {
+ launchDelegate = (IJBossLaunchDelegate) element.createExecutableExtension("launchDelegate"); //$NON-NLS-1$
+ return launchDelegate;
+ } catch( CoreException ce ) {
+ JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
+ }
+ return null;
+ }
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -48,6 +48,7 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
@@ -235,8 +236,8 @@
DeployableServerBehavior.class, new NullProgressMonitor());
if( beh == null )
return false;
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- if( type.getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
+ String type = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(getServer(), LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ if( type.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
return true;
}
return false;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -23,6 +23,19 @@
private String typeId, name;
private String[] serverTypes;
private IConfigurationElement element;
+ private String publisherClassAttribute;
+ public ServerPublishMethodType(String id, String name, String serverTypes2,
+ IConfigurationElement element, String publisherAttribute) {
+ this.typeId = id;
+ this.name = name;
+ String tmp = element.getAttribute("serverTypes"); //$NON-NLS-1$
+ serverTypes = serverTypes2.split(","); //$NON-NLS-1$
+ for( int i = 0; i < serverTypes.length; i++ )
+ serverTypes[i] = serverTypes[i].trim();
+ this.element = element;
+ this.publisherClassAttribute = publisherAttribute;
+ }
+
public ServerPublishMethodType(IConfigurationElement element) {
this.element = element;
IContributor c = element.getContributor();
@@ -33,6 +46,7 @@
// clean
for( int i = 0; i < serverTypes.length; i++ )
serverTypes[i] = serverTypes[i].trim();
+ publisherClassAttribute = "class"; //$NON-NLS-1$
}
public String getId() {
@@ -49,7 +63,7 @@
public IJBossServerPublishMethod createPublishMethod() {
try {
- return (IJBossServerPublishMethod) element.createExecutableExtension("class"); //$NON-NLS-1$
+ return (IJBossServerPublishMethod) element.createExecutableExtension(publisherClassAttribute);
} catch( CoreException ce ) {
}
return null;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -11,7 +11,6 @@
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
@@ -21,33 +20,35 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class DelegatingStartLaunchConfiguration extends AbstractJBossStartLaunchConfiguration {
- public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer server) {
- return ExtensionManager.getDefault().getSetupParticipants(server);
+ public ArrayList<IJBossLaunchDelegate> getSetupParticipants(IServer server) {
+ //return ExtensionManager.getDefault().getSetupParticipants(server);
+ return BehaviourModel.getModel().getSetupParticipants(server);
}
- public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
- return ExtensionManager.getDefault().getLaunchDelegates(server);
- }
+// public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
+// return ExtensionManager.getDefault().getLaunchDelegates(server);
+// }
// Allow all participants to set some defaults for their own details
// Participants should be careful not to change shared launch keys / values
// unless their operation mode (local / rse / etc) is in use
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- for( Iterator<IStartLaunchSetupParticipant> i = getSetupParticipants(server).iterator(); i.hasNext(); ) {
+ for( Iterator<IJBossLaunchDelegate> i = getSetupParticipants(server).iterator(); i.hasNext(); ) {
i.next().setupLaunchConfiguration(workingCopy, server);
}
}
- protected IStartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
+ protected IJBossLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
IServer server = ServerUtil.getServer(configuration);
DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- return getLaunchDelegates(server).get(type.getId());
+ String currentMode = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(beh.getServer());
+ //return getLaunchDelegates(server).get(currentMode);
+ return BehaviourModel.getModel().getLaunchDelegate(server, currentMode);
}
public void actualLaunch(ILaunchConfiguration configuration,
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -0,0 +1,26 @@
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+
+public interface IJBossLaunchDelegate {
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig, ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException;
+
+ public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException;
+
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server)
+ throws CoreException;
+
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-
-public interface IStartLaunchDelegate {
-
- public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig, ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
- throws CoreException;
-
- public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException;
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
-}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-
-public interface IStartLaunchSetupParticipant {
-
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server)
- throws CoreException;
-
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -36,7 +36,7 @@
* @author Rob Stryker
* @author André Dietisheim
*/
-public class LocalJBossStartLaunchDelegate extends AbstractJBossStartLaunchConfiguration implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+public class LocalJBossStartLaunchDelegate extends AbstractJBossStartLaunchConfiguration implements IJBossLaunchDelegate {
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -19,8 +19,7 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
@@ -28,7 +27,7 @@
* @author Rob Stryker
*/
public class LocalJBoss7StartLaunchDelegate extends LocalJBossStartLaunchDelegate
- implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+ implements IJBossLaunchDelegate {
public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws CoreException {
return new String[] {};
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -24,11 +24,10 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.Server;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
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.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
import org.jboss.ide.eclipse.as.core.util.internal.XMLMemento;
@@ -52,13 +51,17 @@
}
public static IJBossServerPublishMethodType getCurrentDeploymentMethodType(IServer server, String defaultType) {
- String type = server.getAttribute(IDeployableServer.SERVER_MODE, defaultType);
- if( type != null ) {
- return ExtensionManager.getDefault().getPublishMethod(type);
- }
- return null;
+ return BehaviourModel.getPublishMethodType(server);
}
+ public static String getCurrentDeploymentMethodTypeId(IServer server) {
+ return getCurrentDeploymentMethodTypeId(server, null);
+ }
+
+ public static String getCurrentDeploymentMethodTypeId(IServer server, String defaultType) {
+ return server.getAttribute(IDeployableServer.SERVER_MODE, defaultType);
+ }
+
public static DeploymentPreferences loadPreferencesFromFile(IServer server) {
File f = getFile(server);
InputStream is = null;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-10-05 11:53:53 UTC (rev 35364)
@@ -6,6 +6,7 @@
<extension-point id="pollerFailureHandler" name="org.jboss.ide.eclipse.as.core.runtime.server.pollerFailureHandler" schema="schema/pollerFailureHandler.exsd"/>
<extension-point id="publishers" name="org.jboss.ide.eclipse.as.core.publishers" schema="schema/publishers.exsd"/>
<extension-point id="publishMethod" name="org.jboss.ide.eclipse.as.core.publishMethod" schema="schema/publishMethod.exsd"/>
+ <extension-point id="behaviourExtension" name="org.jboss.ide.eclipse.as.core.behaviourExtension" schema="schema/behaviourExtension.exsd"/>
<extension-point id="jmxRunner" name="org.jboss.ide.eclipse.as.core.jmxRunner" schema="schema/jmxRunner.exsd"/>
<extension
@@ -1282,14 +1283,6 @@
</extension>
<extension
- point="org.jboss.ide.eclipse.as.core.publishers">
- <publisher
- class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher"
- priority="15"
- zipDelegate="false">
- </publisher>
- </extension>
- <extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.jboss.ide.eclipse.as.core.server.internal.launch.RunJarContainerWrapper$RunJarContainerInitializer"
@@ -1326,6 +1319,8 @@
supportsArgument="true">
</variable>
</extension>
+
+ <!--
<extension
point="org.jboss.ide.eclipse.as.core.publishMethod">
<publishMethod
@@ -1335,4 +1330,39 @@
serverTypes="%AllJBTServerTypes">
</publishMethod>
</extension>
+ -->
+
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
+ name="Local"
+ publishMethod="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="local">
+ </behaviour>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7BehaviorDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate"
+ name="Local"
+ publishMethod="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="local">
+ </behaviour>
+ </extension>
+
+ <!-- The default publisher declaration. -->
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher"
+ priority="15"
+ zipDelegate="false">
+ </publisher>
+ </extension>
+
</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd 2011-10-05 11:53:53 UTC (rev 35364)
@@ -0,0 +1,143 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.ide.eclipse.as.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.ide.eclipse.as.core" id="publishers" name="org.jboss.ide.eclipse.as.core.publishers"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="behaviour" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="behaviour">
+ <complexType>
+ <attribute name="typeId" type="string">
+ <annotation>
+ <documentation>
+ A "type" such as local, rse, openshiftExpress, etc
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ A user-visible string representation of the type.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="serverTypes" type="string">
+ <annotation>
+ <documentation>
+ A comma-delimited string designating which server types this behaviour element relates to.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="publishMethod" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="behaviourDelegate" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="launchDelegate" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2011-10-05 11:53:53 UTC (rev 35364)
@@ -1,7 +1,9 @@
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = JBossAS RSE Tools
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
-ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
RSEMethodName=Remote System Deployment
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2011-10-05 11:53:53 UTC (rev 35364)
@@ -1,14 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <!-- Below here is RSE stuff which can / should be moved if a new plugin is created -->
<extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- class="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
- id="rse"
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.rse.core.RSEBehaviourDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBossStartLaunchDelegate"
name="%RSEMethodName"
- serverTypes="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer">
- </publishMethod>
+ publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="rse">
+ </behaviour>
</extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBoss7BehaviourDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBoss7StartLaunchDelegate"
+ name="%RSEMethodName"
+ publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="rse">
+ </behaviour>
+ </extension>
</plugin>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -26,13 +26,12 @@
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.ThreadUtils;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public abstract class AbstractRSELaunchDelegate extends AbstractJBossStartLaunchConfiguration
- implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+ implements IJBossLaunchDelegate {
protected void executeRemoteCommand(String command, DelegatingServerBehavior behavior)
throws CoreException {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -12,9 +12,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.DelegatingJBoss7ServerBehavior;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -33,12 +30,6 @@
*/
public void start(BundleContext bundleContext) throws Exception {
RSECorePlugin.context = bundleContext;
- DelegatingServerBehavior.addDelegateMapping(RSEPublishMethod.RSE_ID, RSEBehaviourDelegate.class);
- DelegatingJBoss7ServerBehavior.addDelegateMapping(RSEPublishMethod.RSE_ID, RSEJBoss7BehaviourDelegate.class);
- ExtensionManager.JBossLaunchDelegates.put(RSEPublishMethod.RSE_ID, new RSEJBossStartLaunchDelegate());
- ExtensionManager.JBossSetupParticipants.add(new RSEJBossStartLaunchDelegate());
- ExtensionManager.JBoss7launchDelegates.put(RSEPublishMethod.RSE_ID, new RSEJBoss7StartLaunchDelegate());
- ExtensionManager.JBoss7setupParticipants.add(new RSEJBoss7StartLaunchDelegate());
}
/*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -20,12 +20,9 @@
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class ShowConsoleServerStateListener extends UnitedServerListener {
private static ShowConsoleServerStateListener instance;
@@ -44,10 +41,8 @@
if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
if( event.getServer().getServerState() == IServer.STATE_STARTING ) {
// do not launch console for remotes, for now
- DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- //IJBossServerPublishMethodType type = DeploymentPreferenceLoader.getCurrentDeploymentMethodType(jbs.getServer());
- if( !type.getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD))
+ String type = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ if( !type.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD))
return;
new Thread() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -29,11 +29,13 @@
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.util.SocketUtil;
import org.eclipse.wst.server.ui.internal.command.ServerCommand;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
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.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.Behaviour;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.BehaviourImpl;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -86,26 +88,30 @@
// fill widgets
String[] nameList = new String[deployAdditions.size()];
for( int i = 0; i < nameList.length; i++ ) {
- nameList[i] = deployAdditions.get(i).getPublishType().getName();
+ nameList[i] = deployAdditions.get(i).behaviourName;
}
deployTypeCombo.setItems(nameList);
DeployableServerBehavior ds = ServerConverter.getDeployableServerBehavior(callback.getServer().getOriginal());
String current = null;
if( ds != null ) {
- current = ds.createPublishMethod().getPublishMethodType().getName();
+ Behaviour b = BehaviourModel.getModel().getBehaviour(callback.getServer().getOriginal().getServerType().getId());
+ String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(callback.getServer().getOriginal());
+ current = b.getImpl(behaviourType).getName();
} else {
String host = callback.getServer().getHost();
- IJBossServerPublishMethodType behType = null;
+// IJBossServerPublishMethodType behType = null;
+ BehaviourImpl impl = null;
+ String serverTypeId = callback.getServer().getServerType().getId();
if( SocketUtil.isLocalhost(host)) {
- behType = ExtensionManager.getDefault().getPublishMethod(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ impl = BehaviourModel.getModel().getBehaviour(serverTypeId).getImpl(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
} else {
// socket is not localhost, hard code this for now
- behType = ExtensionManager.getDefault().getPublishMethod("rse"); //$NON-NLS-1$
+ impl = BehaviourModel.getModel().getBehaviour(serverTypeId).getImpl("rse");
}
- current = behType.getName();
+ current = impl.getName();
callback.execute(new ChangeServerPropertyCommand(
callback.getServer(), IDeployableServer.SERVER_MODE,
- behType.getId(), Messages.EditorChangeServerMode));
+ impl.getId(), Messages.EditorChangeServerMode));
}
if( current != null ) {
int index = deployTypeCombo.indexOf(current);
@@ -130,19 +136,21 @@
}
private class DeployUIAdditions {
- private IJBossServerPublishMethodType publishType;
+ private String behaviourName;
+ private String behaviourId;
+
private IDeploymentTypeUI ui;
private boolean registered = false;
- public DeployUIAdditions(IJBossServerPublishMethodType type,IDeploymentTypeUI ui) {
- this.publishType = type;
+
+ public DeployUIAdditions(String name, String id,IDeploymentTypeUI ui) {
+ this.behaviourName = name;
+ this.behaviourId = id;
this.ui = ui;
}
+
public boolean isRegistered() {
return registered;
}
- public IJBossServerPublishMethodType getPublishType() {
- return publishType;
- }
public void createComposite(Composite parent) {
// UI can be null
if( ui != null ) {
@@ -158,10 +166,12 @@
private void loadDeployTypeData() {
deployAdditions = new ArrayList<DeployUIAdditions>();
- IJBossServerPublishMethodType[] publishMethodTypes = ExtensionManager.getDefault().findPossiblePublishMethods(callback.getServer().getServerType());
- for( int i = 0; i < publishMethodTypes.length; i++) {
- IDeploymentTypeUI ui = EditorExtensionManager.getDefault().getPublishPreferenceUI(publishMethodTypes[i].getId());
- deployAdditions.add(new DeployUIAdditions(publishMethodTypes[i], ui));
+ Behaviour b = BehaviourModel.getModel().getBehaviour(callback.getServer().getServerType().getId());
+ BehaviourImpl[] supportedBehaviours = b.getImplementations();
+ for( int i = 0; i < supportedBehaviours.length; i++) {
+ IDeploymentTypeUI ui = EditorExtensionManager.getDefault().getPublishPreferenceUI(supportedBehaviours[i].getId());
+ deployAdditions.add(new DeployUIAdditions(supportedBehaviours[i].getName(),
+ supportedBehaviours[i].getId(), ui));
}
}
@@ -177,10 +187,10 @@
if( fireEvent ) {
callback.execute(new ChangeServerPropertyCommand(
callback.getServer(), IDeployableServer.SERVER_MODE,
- ui.getPublishType().getId(), "Change server mode"));
+ ui.behaviourId, "Change server mode"));
String deployType = null;
if( shouldChangeDefaultDeployType(callback.getServer())) {
- if( ui.getPublishType().getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
+ if( ui.behaviourId.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
deployType = IDeployableServer.DEPLOY_METADATA;
} else {
deployType = IDeployableServer.DEPLOY_SERVER;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties 2011-10-05 11:53:53 UTC (rev 35364)
@@ -1,3 +1,10 @@
#Properties file for org.jboss.ide.eclipse.as.test
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = AS Adapter Test Plug-in
\ No newline at end of file
+Bundle-Name.0 = AS Adapter Test Plug-in
+
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml 2011-10-05 11:53:53 UTC (rev 35364)
@@ -2,13 +2,36 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- class="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
- id="mock"
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
name="mock"
- serverTypes="org.jboss.ide.eclipse.as.systemCopyServer">
- </publishMethod>
+ publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="org.jboss.ide.eclipse.as.systemCopyServer"
+ typeId="mock">
+ </behaviour>
</extension>
-
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
+ name="mock"
+ publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="mock">
+ </behaviour>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7BehaviorDelegate"
+ launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate"
+ name="mock"
+ publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="mock">
+ </behaviour>
+ </extension>
</plugin>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-10-05 11:46:11 UTC (rev 35363)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-10-05 11:53:53 UTC (rev 35364)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.ServerPreferences;
import org.jboss.ide.eclipse.as.test.util.IOUtil;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
@@ -41,7 +42,7 @@
}
protected void theTest(boolean isAs7) throws CoreException, IOException {
-
+ ServerPreferences.getInstance().setAutoPublishing(false);
IModule mod = ServerUtil.getModule(project);
server = ServerRuntimeUtils.addModule(server, mod);
ServerRuntimeUtils.publish(server);
13 years, 3 months
JBoss Tools SVN: r35363 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: handlers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-10-05 07:46:11 -0400 (Wed, 05 Oct 2011)
New Revision: 35363
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-8995 , Tooltips names were separated from the Preference page's splitting names.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-10-05 11:41:01 UTC (rev 35362)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-10-05 11:46:11 UTC (rev 35363)
@@ -163,10 +163,10 @@
layoutIcons.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE, ICON_ORIENTATION_VISUAI_TOP);
layoutNames = new HashMap<String, String>();
- layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE, VpeUIMessages.SPLITTING_HORIZ_LEFT_SOURCE);
- layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_SOURCE_VALUE, VpeUIMessages.SPLITTING_VERT_TOP_SOURCE);
- layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_VISUAL_VALUE, VpeUIMessages.SPLITTING_HORIZ_LEFT_VISUAL);
- layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE, VpeUIMessages.SPLITTING_VERT_TOP_VISUAL);
+ layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE, VpeUIMessages.SPLITTING_HORIZ_LEFT_SOURCE_TOOLTIP);
+ layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_SOURCE_VALUE, VpeUIMessages.SPLITTING_VERT_TOP_SOURCE_TOOLTIP);
+ layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_VISUAL_VALUE, VpeUIMessages.SPLITTING_HORIZ_LEFT_VISUAL_TOOLTIP);
+ layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE, VpeUIMessages.SPLITTING_VERT_TOP_VISUAL_TOOLTIP);
layoutValues= new ArrayList<String>();
layoutValues.add(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2011-10-05 11:41:01 UTC (rev 35362)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2011-10-05 11:46:11 UTC (rev 35363)
@@ -41,7 +41,7 @@
private static List<String> layoutValues;
private static Map<String, String> layoutIcons;
- private static Map<String, String> layoutNames;
+ private static Map<String, String> layoutNamesAndTooltips;
private static final String ICON_ORIENTATION_SOURCE_LEFT = "icons/source_left.gif"; //$NON-NLS-1$
private static final String ICON_ORIENTATION_SOURCE_TOP = "icons/source_top.gif"; //$NON-NLS-1$
private static final String ICON_ORIENTATION_VISUAL_LEFT = "icons/visual_left.gif"; //$NON-NLS-1$
@@ -63,15 +63,15 @@
layoutIcons.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE,
ICON_ORIENTATION_VISUAI_TOP);
- layoutNames = new HashMap<String, String>();
- layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE,
- VpeUIMessages.SPLITTING_HORIZ_LEFT_SOURCE);
- layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_SOURCE_VALUE,
- VpeUIMessages.SPLITTING_VERT_TOP_SOURCE);
- layoutNames.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_VISUAL_VALUE,
- VpeUIMessages.SPLITTING_HORIZ_LEFT_VISUAL);
- layoutNames.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE,
- VpeUIMessages.SPLITTING_VERT_TOP_VISUAL);
+ layoutNamesAndTooltips = new HashMap<String, String>();
+ layoutNamesAndTooltips.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE,
+ VpeUIMessages.SPLITTING_HORIZ_LEFT_SOURCE_TOOLTIP);
+ layoutNamesAndTooltips.put(IVpePreferencesPage.SPLITTING_VERT_TOP_SOURCE_VALUE,
+ VpeUIMessages.SPLITTING_VERT_TOP_SOURCE_TOOLTIP);
+ layoutNamesAndTooltips.put(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_VISUAL_VALUE,
+ VpeUIMessages.SPLITTING_HORIZ_LEFT_VISUAL_TOOLTIP);
+ layoutNamesAndTooltips.put(IVpePreferencesPage.SPLITTING_VERT_TOP_VISUAL_VALUE,
+ VpeUIMessages.SPLITTING_VERT_TOP_VISUAL_TOOLTIP);
layoutValues = new ArrayList<String>();
layoutValues.add(IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE);
@@ -97,8 +97,7 @@
*/
currentOrientationIndex++;
if (currentOrientationIndex >= layoutValues.size()) {
- currentOrientationIndex = currentOrientationIndex
- % layoutValues.size();
+ currentOrientationIndex = currentOrientationIndex % layoutValues.size();
}
String newOrientation = layoutValues.get(currentOrientationIndex);
@@ -120,10 +119,9 @@
}
public void updateElement(UIElement element, Map parameters) {
- IPreferenceStore preferences = JspEditorPlugin.getDefault()
- .getPreferenceStore();
- String orientation = preferences
- .getString(IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
+ IPreferenceStore preferences = JspEditorPlugin.getDefault().getPreferenceStore();
+ String orientation = preferences.getString(
+ IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
if (orientation.isEmpty()) {
orientation = IVpePreferencesPage.SPLITTING_HORIZ_LEFT_SOURCE_VALUE;
preferences.setValue(
@@ -136,7 +134,7 @@
*/
element.setIcon(ImageDescriptor.createFromFile(this.getClass(),
layoutIcons.get(orientation)));
- String orientationName = layoutNames.get(orientation);
+ String orientationName = layoutNamesAndTooltips.get(orientation);
element.setTooltip(orientationName);
element.setText(orientationName);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2011-10-05 11:41:01 UTC (rev 35362)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2011-10-05 11:46:11 UTC (rev 35363)
@@ -141,6 +141,10 @@
public static String DEFAULT_VPE_TAB_VISUAL_SOURCE;
public static String DEFAULT_VPE_TAB_SOURCE;
public static String DEFAULT_VPE_TAB_PREVIEW;
+ public static String SPLITTING_VERT_TOP_SOURCE_TOOLTIP;
+ public static String SPLITTING_VERT_TOP_VISUAL_TOOLTIP;
+ public static String SPLITTING_HORIZ_LEFT_SOURCE_TOOLTIP;
+ public static String SPLITTING_HORIZ_LEFT_VISUAL_TOOLTIP;
public static String SPLITTING_VERT_TOP_SOURCE;
public static String SPLITTING_VERT_TOP_VISUAL;
public static String SPLITTING_HORIZ_LEFT_SOURCE;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2011-10-05 11:41:01 UTC (rev 35362)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2011-10-05 11:46:11 UTC (rev 35363)
@@ -133,10 +133,14 @@
DEFAULT_VPE_TAB_VISUAL_SOURCE=Visual/Source
DEFAULT_VPE_TAB_SOURCE=Source
DEFAULT_VPE_TAB_PREVIEW=Preview
-SPLITTING_HORIZ_LEFT_SOURCE=Switch Visual Editor to the bottom
-SPLITTING_VERT_TOP_SOURCE=Switch Visual Editor to the left
-SPLITTING_HORIZ_LEFT_VISUAL=Switch Visual Editor to the top
-SPLITTING_VERT_TOP_VISUAL=Switch Visual Editor to the right
+SPLITTING_HORIZ_LEFT_SOURCE_TOOLTIP=Switch Visual Editor to the bottom
+SPLITTING_VERT_TOP_SOURCE_TOOLTIP=Switch Visual Editor to the left
+SPLITTING_HORIZ_LEFT_VISUAL_TOOLTIP=Switch Visual Editor to the top
+SPLITTING_VERT_TOP_VISUAL_TOOLTIP=Switch Visual Editor to the right
+SPLITTING_VERT_TOP_SOURCE=Vertical splitting with Source Editor on the top
+SPLITTING_VERT_TOP_VISUAL=Vertical splitting with Visual Editor on the top
+SPLITTING_HORIZ_LEFT_SOURCE=Horizontal splitting with Source Editor to the left
+SPLITTING_HORIZ_LEFT_VISUAL=Horizontal splitting with Visual Editor to the left
# Import/Export user specified tag templates messages
IMPORT_USER_TAGS_TEMPLATES_WIZARD_PAGE=Import user specified tag templates wizard page
13 years, 3 months
JBoss Tools SVN: r35362 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-05 07:41:01 -0400 (Wed, 05 Oct 2011)
New Revision: 35362
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
JBIDE-9823 : fix to prevent Archetype properties from being displayed twice in the Archetype-based Example Wizard
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-10-05 11:24:10 UTC (rev 35361)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-10-05 11:41:01 UTC (rev 35362)
@@ -66,7 +66,6 @@
final String version = model.getVersion();
final String javaPackage = wizardPage.getJavaPackage();
final Properties properties = wizardPage.getProperties();
- final MavenPlugin plugin = MavenPlugin.getDefault();
final Archetype archetype = wizardPage.getArchetype();
final String projectName = configuration.getProjectName(model);
final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
@@ -74,7 +73,7 @@
final IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(final IProgressMonitor monitor)
throws CoreException {
- plugin.getProjectConfigurationManager().createArchetypeProject(
+ MavenPlugin.getProjectConfigurationManager().createArchetypeProject(
project, new Path(location.getAbsolutePath()), archetype,
groupId, artifactId, version, javaPackage, properties,
configuration, monitor);
@@ -104,6 +103,8 @@
return true;
}
+
+
public void addPages() {
configuration = new ProjectImportConfiguration();
wizardPage = new ArchetypeExamplesWizardPage(configuration, projectDescription);
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-10-05 11:24:10 UTC (rev 35361)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-10-05 11:41:01 UTC (rev 35362)
@@ -10,10 +10,27 @@
************************************************************************************/
package org.jboss.tools.maven.project.examples.wizard;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.common.ArchetypeArtifactManager;
+import org.apache.maven.archetype.exception.UnknownArchetype;
+import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
+import org.apache.maven.archetype.metadata.RequiredProperty;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+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.project.ProjectImportConfiguration;
import org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator;
import org.jboss.tools.project.examples.model.ArchetypeModel;
import org.jboss.tools.project.examples.model.Project;
@@ -48,10 +65,30 @@
archetype.setArtifactId(archetypeModel.getArchetypeArtifactId());
archetype.setVersion(archetypeModel.getArchetypeVersion());
archetype.setRepository(archetypeModel.getArchetypeRepository());
- archetype.setProperties(archetypeModel.getArchetypeProperties());
+
+ //Since we set archetypeChanged=false later on, we need to do the equivalent of
+ //MavenProjectWizardArchetypeParametersPage.loadArchetypeDescriptor(),
+ //as we don't have the guarantee archetypeModel holds ALL the required properties
+ //This really is an extra-safe guard, as I believe we'll probably always
+ //redefine all required properties in project-examples-maven-xxx.xml
+ Properties defaultRequiredProperties = getRequiredProperties(archetype);
+ Properties properties = new Properties(archetypeModel.getArchetypeProperties());
+ //Add remaining requiredProperties not defined by default in the example project
+ for (Object key : defaultRequiredProperties.keySet()) {
+ if (!properties.containsKey(key)) {
+ properties.put(key, defaultRequiredProperties.get(key));
+ }
+ }
+ archetype.setProperties(properties);
setArchetype(archetype);
+
+ //JBIDE-9823 : Hack to prevent the properties table to be loaded a 2nd time
+ // when setVisible() is called in MavenProjectWizardArchetypeParametersPage.
+ // It needs to be called AFTER setArchetype(archetype) !!!
+ archetypeChanged = false;
+
+ artifactIdCombo.setText(artifactId);
groupIdCombo.setText(groupId);
- artifactIdCombo.setText(artifactId);
versionCombo.setText(version);
packageCombo.setText(javaPackage);
}
@@ -59,5 +96,54 @@
public Archetype getArchetype() {
return archetype;
}
+
+ private Properties getRequiredProperties(Archetype archetype) {
+ 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$
+ final Properties requiredProperties = new Properties();
+ try {
+ getContainer().run(false, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ monitor.beginTask(NLS.bind("Downloading Archetype {0}", archetypeName), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ try {
+ IMaven maven = MavenPlugin.getMaven();
+ 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.put(rp.getKey(), rp.getDefaultValue());
+ }
+ }
+ }
+ }
+ } catch(UnknownArchetype e) {
+ MavenProjectExamplesActivator.log(e);
+ } catch(CoreException ex) {
+ MavenProjectExamplesActivator.log(ex);
+ } finally {
+ monitor.done();
+ }
+ }
+ });
+ } catch(InterruptedException ex) {
+ // ignore
+ } catch(InvocationTargetException ex) {
+ String msg = NLS.bind("Error downloading archetype {0}", archetypeName);//$NON-NLS-1$
+ MavenProjectExamplesActivator.log(ex, msg);
+ setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ return requiredProperties;
+ }
}
13 years, 3 months