mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
load deployment source configuration in read action (EA-72202)
This commit is contained in:
+9
-3
@@ -22,6 +22,8 @@ import com.intellij.execution.configurations.RunConfigurationBase;
|
||||
import com.intellij.execution.configurations.RunProfileState;
|
||||
import com.intellij.execution.configurations.RuntimeConfigurationException;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.components.ComponentSerializationUtil;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
@@ -164,12 +166,16 @@ public class DeployToServerRunConfiguration<S extends ServerConfiguration, D ext
|
||||
myDeploymentSource = null;
|
||||
if (state != null) {
|
||||
myServerName = state.myServerName;
|
||||
Element deploymentTag = state.myDeploymentTag;
|
||||
final Element deploymentTag = state.myDeploymentTag;
|
||||
if (deploymentTag != null) {
|
||||
String typeId = deploymentTag.getAttributeValue(DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE);
|
||||
DeploymentSourceType<?> type = findDeploymentSourceType(typeId);
|
||||
final DeploymentSourceType<?> type = findDeploymentSourceType(typeId);
|
||||
if (type != null) {
|
||||
myDeploymentSource = type.load(deploymentTag, getProject());
|
||||
myDeploymentSource = new ReadAction<DeploymentSource>() {
|
||||
protected void run(final @NotNull Result<DeploymentSource> result) {
|
||||
result.setResult(type.load(deploymentTag, getProject()));
|
||||
}
|
||||
}.execute().getResultObject();
|
||||
myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource);
|
||||
ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), deploymentTag.getChild(SETTINGS_ELEMENT));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user