Skip to content

Commit 88d3a9d

Browse files
apps are not cleared if selected cluster is empty.
1 parent 73b574e commit 88d3a9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-springcloud/src/main/java/com/microsoft/azure/toolkit/intellij/springcloud/creation/AbstractSpringCloudAppInfoPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ protected void init() {
7676

7777
private void onSubscriptionChanged(final ItemEvent e) {
7878
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
79-
final Subscription subscription = (Subscription) e.getItem();
79+
final Subscription subscription = this.getSelectorSubscription().getValue();
8080
this.getSelectorCluster().setSubscription(subscription);
8181
}
8282
}
8383

8484
private void onClusterChanged(final ItemEvent e) {
8585
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
86-
final SpringCloudCluster c = (SpringCloudCluster) e.getItem();
86+
final SpringCloudCluster c = this.getSelectorCluster().getValue();
8787
final String appName = StringUtils.firstNonBlank(this.getTextName().getName(), this.defaultAppName);
8888
if (Objects.nonNull(c)) {
8989
final SpringCloudApp app = c.app(new SpringCloudAppEntity(appName, c.entity()));

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-springcloud/src/main/java/com/microsoft/azure/toolkit/intellij/springcloud/deplolyment/SpringCloudDeploymentConfigurationPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ private void onArtifactChanged(final ItemEvent e) {
8888

8989
private void onSubscriptionChanged(final ItemEvent e) {
9090
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
91-
final Subscription subscription = (Subscription) e.getItem();
91+
final Subscription subscription = this.selectorSubscription.getValue();
9292
this.selectorCluster.setSubscription(subscription);
9393
}
9494
}
9595

9696
private void onClusterChanger(final ItemEvent e) {
9797
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
98-
final SpringCloudCluster cluster = (SpringCloudCluster) e.getItem();
98+
final SpringCloudCluster cluster = this.selectorCluster.getValue();
9999
this.selectorApp.setCluster(cluster);
100100
}
101101
}

0 commit comments

Comments
 (0)