Author: scabanovich
Date: 2012-10-10 18:00:39 -0400 (Wed, 10 Oct 2012)
New Revision: 44417
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/NewWebProjectWizard.java
Log:
JBIDE-12823
https://issues.jboss.org/browse/JBIDE-12823
Runtime is set to data model. Operation of project creation is run with fork=true and
cancelable=false, as in New Dynamic Wep project wizard.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2012-10-10
21:44:01 UTC (rev 44416)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2012-10-10
22:00:39 UTC (rev 44417)
@@ -414,6 +414,13 @@
wcco.setDataModel(dataModel);
dataModel.setProperty(IProjectCreationPropertiesNew.PROJECT_NAME, projectName);
dataModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME,
projectName);
+ String runtimeName = getProperty(WebNatureOperation.RUNTIME_NAME);
+ if(runtimeName != null && runtimeName.length() > 0) {
+ Object o = findFacetRuntime(null);
+ if(o != null) {
+ dataModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, o);
+ }
+ }
if(!isDefaultLocation(projectLocation, true)) {
dataModel.setProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION,
Boolean.FALSE);
dataModel.setProperty(IProjectCreationPropertiesNew.USER_DEFINED_LOCATION,
projectLocation);
@@ -490,7 +497,7 @@
if(wcco != null) {
wcco.execute(monitor, null);
}
- new RuntimeJob().schedule();
+// new RuntimeJob().runInWorkspace(monitor);
} catch (ExecutionException e) {
WebUiPlugin.getPluginLog().logError(e);
}
@@ -593,11 +600,10 @@
String runtimeName = getProperty(WebNatureOperation.RUNTIME_NAME);
if(runtimeName == null) return null;
if(runtime != null) runtimeName = runtime.getName();
- Set set = RuntimeManager.getRuntimes();
- Iterator it = set.iterator();
- while(it.hasNext()) {
- org.eclipse.wst.common.project.facet.core.runtime.IRuntime r =
(org.eclipse.wst.common.project.facet.core.runtime.IRuntime)it.next();
- if(runtimeName.equals(r.getName())) return r;
+ for(org.eclipse.wst.common.project.facet.core.runtime.IRuntime r:
RuntimeManager.getRuntimes()) {
+ if(runtimeName.equals(r.getName())) {
+ return r;
+ }
}
return null;
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/NewWebProjectWizard.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/NewWebProjectWizard.java 2012-10-10
21:44:01 UTC (rev 44416)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/NewWebProjectWizard.java 2012-10-10
22:00:39 UTC (rev 44417)
@@ -63,7 +63,7 @@
IRunnableWithProgress runnable = createOperation();
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
try {
- getContainer().run(false, true, op);
+ getContainer().run(true, false, op);
BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
BasicNewResourceWizard.selectAndReveal(context.getProject(),
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
if(runnable instanceof WebNatureOperation &&
((WebNatureOperation)runnable).isCancelled()) {