mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-253343: Run Targets - the newly created run target is not selected in the Run Configuration dialog
GitOrigin-RevId: 06088a6e56d1e843a269f45130b5504ce93d0532
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b2063f8016
commit
8fe4d29680
+3
-5
@@ -7,10 +7,7 @@ import com.intellij.execution.RunOnTargetComboBox;
|
||||
import com.intellij.execution.RunnerAndConfigurationSettings;
|
||||
import com.intellij.execution.configurations.*;
|
||||
import com.intellij.execution.runners.ProgramRunner;
|
||||
import com.intellij.execution.target.LanguageRuntimeType;
|
||||
import com.intellij.execution.target.TargetEnvironmentAwareRunProfile;
|
||||
import com.intellij.execution.target.TargetEnvironmentsConfigurable;
|
||||
import com.intellij.execution.target.TargetEnvironmentsManager;
|
||||
import com.intellij.execution.target.*;
|
||||
import com.intellij.execution.ui.RunnerAndConfigurationSettingsEditor;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.DataManager;
|
||||
@@ -521,7 +518,8 @@ public final class SingleConfigurationConfigurable<Config extends RunConfigurati
|
||||
LanguageRuntimeType<?> languageRuntime = ((RunOnTargetComboBox)myRunOnComboBox).getDefaultLanguageRuntimeType();
|
||||
TargetEnvironmentsConfigurable configurable = new TargetEnvironmentsConfigurable(myProject, selectedName, languageRuntime);
|
||||
if (ShowSettingsUtil.getInstance().editConfigurable(myWholePanel, configurable)) {
|
||||
resetRunOnComboBox(selectedName);
|
||||
TargetEnvironmentConfiguration lastEdited = configurable.getSelectedTargetConfig();
|
||||
resetRunOnComboBox(lastEdited != null ? lastEdited.getDisplayName() : selectedName);
|
||||
}
|
||||
});
|
||||
myJBScrollPane = wrapWithScrollPane(null);
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ internal class TargetEnvironmentDetailsConfigurable(
|
||||
|
||||
override fun getBannerSlogan(): String = config.displayName
|
||||
|
||||
override fun getIcon(expanded: Boolean): Icon? = config.getTargetType().icon
|
||||
override fun getIcon(expanded: Boolean): Icon = config.getTargetType().icon
|
||||
|
||||
override fun isModified(): Boolean = allConfigurables().any { it.isModified }
|
||||
|
||||
|
||||
+3
-1
@@ -34,7 +34,7 @@ class TargetEnvironmentsConfigurable(project: Project,
|
||||
|
||||
override fun createComponent(): JComponent = editor.createComponent()
|
||||
|
||||
override fun getHelpTopic(): String? = "reference.remote.targets"
|
||||
override fun getHelpTopic(): String = "reference.remote.targets"
|
||||
|
||||
override fun apply() {
|
||||
editor.apply()
|
||||
@@ -48,4 +48,6 @@ class TargetEnvironmentsConfigurable(project: Project,
|
||||
editor.disposeUIResources()
|
||||
super.disposeUIResources()
|
||||
}
|
||||
|
||||
val selectedTargetConfig: TargetEnvironmentConfiguration? get() = editor.selectedConfig
|
||||
}
|
||||
+9
@@ -22,6 +22,10 @@ class TargetEnvironmentsMasterDetails @JvmOverloads constructor(
|
||||
private val defaultLanguageRuntime: LanguageRuntimeType<*>?
|
||||
) : MasterDetailsComponent() {
|
||||
|
||||
private var _lastSelectedConfig: TargetEnvironmentConfiguration? = null
|
||||
internal val selectedConfig: TargetEnvironmentConfiguration?
|
||||
get() = myCurrentConfigurable?.editableObject as? TargetEnvironmentConfiguration ?: _lastSelectedConfig
|
||||
|
||||
init {
|
||||
// note that `MasterDetailsComponent` does not work without `initTree()`
|
||||
initTree()
|
||||
@@ -83,6 +87,11 @@ class TargetEnvironmentsMasterDetails @JvmOverloads constructor(
|
||||
addedConfigs.forEach { TargetEnvironmentsManager.instance.addTarget(it) }
|
||||
}
|
||||
|
||||
override fun disposeUIResources() {
|
||||
_lastSelectedConfig = selectedObject as? TargetEnvironmentConfiguration
|
||||
super.disposeUIResources()
|
||||
}
|
||||
|
||||
private fun allTargets() = TargetEnvironmentsManager.instance.targets.resolvedConfigs()
|
||||
|
||||
private fun addTargetNode(config: TargetEnvironmentConfiguration): MyNode {
|
||||
|
||||
Reference in New Issue
Block a user