Skip to content

Commit d28f42c

Browse files
committed
Merge branch 'endgame-s186' into develop.next
2 parents 501ac8a + ed3381a commit d28f42c

File tree

196 files changed

+5154
-3471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+5154
-3471
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in this file.
44

55
- [Change Log](#change-log)
6+
- [3.52.0](#3520)
67
- [3.51.0](#3510)
78
- [3.50.0](#3500)
89
- [3.49.0](#3490)
@@ -66,6 +67,18 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
6667
- [3.0.7](#307)
6768
- [3.0.6](#306)
6869

70+
## 3.52.0
71+
### Added
72+
- Support OAuth for authentication
73+
- Add support for management/client sdk in Azure SDK reference book
74+
75+
### Changed
76+
- Improve UI for azure service connector
77+
78+
### Fixed
79+
- [#5121](https://github.com/microsoft/azure-tools-for-java/issues/5121) Fix project disposed exception for workspace tagging
80+
- [PR #5163](https://github.com/microsoft/azure-tools-for-java/pull/5163) Fix enable local access may not work for Azure MySQL
81+
6982
## 3.51.0
7083
### Added
7184
- Add support for IntelliJ 2021.1 EAP

PluginsAndFeatures/AddLibrary/AzureLibraries/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>com.microsoft.azuretools</groupId>
3030
<artifactId>utils</artifactId>
31-
<version>3.51.0</version>
31+
<version>3.52.0</version>
3232
</parent>
3333
<groupId>com.microsoft.azuretools</groupId>
3434
<artifactId>com.microsoft.azuretools.sdk.lib</artifactId>
@@ -38,7 +38,7 @@
3838
<organization><name>Microsoft Corp.</name></organization>
3939

4040
<properties>
41-
<azuretool.version>3.51.0</azuretool.version>
41+
<azuretool.version>3.52.0</azuretool.version>
4242
<azuretool.sdk.version>3.25.0.qualifier</azuretool.sdk.version>
4343
</properties>
4444
<dependencies>

PluginsAndFeatures/azure-toolkit-for-intellij/.idea/codeStyles/codeStyleConfig.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1 @@
1-
plugins {
2-
id 'java'
3-
id "org.jetbrains.intellij"
4-
}
5-
6-
group 'com.microsoft.azuretools'
7-
8-
intellij {
9-
version = intellij_version
10-
downloadSources = Boolean.valueOf(true)
11-
}
12-
13-
repositories {
14-
mavenLocal()
15-
mavenCentral()
16-
}
17-
18-
dependencies {
19-
// https://mvnrepository.com/artifact/org.projectlombok/lombok
20-
compileOnly 'org.projectlombok:lombok:1.18.8'
21-
annotationProcessor 'org.projectlombok:lombok:1.18.8'
22-
23-
implementation "com.microsoft.azure:azure-toolkit-common-lib:0.5.0"
24-
}
1+
intellij{}

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/AzureComboBox.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureComboBox.java

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@
1212
import com.intellij.ui.SimpleListCellRenderer;
1313
import com.intellij.ui.components.fields.ExtendableTextComponent;
1414
import com.intellij.ui.components.fields.ExtendableTextField;
15-
import com.microsoft.azure.toolkit.lib.appservice.Draft;
1615
import com.microsoft.azure.toolkit.lib.common.exception.AzureExceptionHandler;
1716
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
17+
import com.microsoft.azure.toolkit.lib.common.task.AzureTask;
18+
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
1819
import com.microsoft.azure.toolkit.lib.common.utils.TailingDebouncer;
19-
import com.microsoft.azuretools.azurecommons.helpers.NotNull;
20-
import com.microsoft.azuretools.azurecommons.helpers.Nullable;
21-
import com.microsoft.azuretools.core.mvp.ui.base.SchedulerProvider;
22-
import com.microsoft.azuretools.core.mvp.ui.base.SchedulerProviderFactory;
23-
import com.microsoft.tooling.msservices.components.DefaultLoader;
2420
import lombok.Getter;
2521
import lombok.Setter;
2622
import org.apache.commons.collections.CollectionUtils;
2723
import org.apache.commons.lang.StringUtils;
2824
import org.apache.commons.lang3.exception.ExceptionUtils;
2925
import rx.Observable;
26+
import rx.schedulers.Schedulers;
3027

3128
import javax.annotation.Nonnull;
29+
import javax.annotation.Nullable;
3230
import javax.swing.*;
3331
import javax.swing.event.DocumentEvent;
3432
import javax.swing.event.PopupMenuEvent;
@@ -45,8 +43,6 @@
4543
import java.util.function.Function;
4644
import java.util.function.Predicate;
4745

48-
import static com.microsoft.intellij.ui.messages.AzureBundle.message;
49-
5046
public abstract class AzureComboBox<T> extends ComboBox<T> implements AzureFormInputComponent<T> {
5147
public static final String EMPTY_ITEM = StringUtils.EMPTY;
5248
private static final int DEBOUNCE_DELAY = 500;
@@ -58,8 +54,7 @@ public abstract class AzureComboBox<T> extends ComboBox<T> implements AzureFormI
5854
private boolean required;
5955
private Object value;
6056
private boolean valueNotSet = true;
61-
@Setter
62-
private boolean forceDisable;
57+
private boolean valueFixed;
6358
private String label;
6459

6560
public AzureComboBox() {
@@ -71,7 +66,7 @@ public AzureComboBox(boolean refresh) {
7166
this.init();
7267
this.refresher = new TailingDebouncer(this::doRefreshItems, DEBOUNCE_DELAY);
7368
if (refresh) {
74-
DefaultLoader.getIdeHelper().invokeLater(this::refreshItems);
69+
AzureTaskManager.getInstance().runLater(this::refreshItems, AzureTask.Modality.ANY);
7570
}
7671
}
7772

@@ -87,7 +82,7 @@ protected void init() {
8782
this.setEditor(this.inputEditor);
8883
this.setRenderer(new SimpleListCellRenderer<T>() {
8984
@Override
90-
public void customize(@NotNull final JList<? extends T> l, final T t, final int i, final boolean b,
85+
public void customize(@Nonnull final JList<? extends T> l, final T t, final int i, final boolean b,
9186
final boolean b1) {
9287
setText(getItemText(t));
9388
setIcon(getItemIcon(t));
@@ -110,12 +105,24 @@ public T getValue() {
110105

111106
@Override
112107
public void setValue(final T val) {
108+
this.setValue(val, false);
109+
}
110+
111+
public void setValue(final T val, final boolean fixed) {
112+
this.valueFixed = fixed;
113+
this.setEditable(!this.valueFixed);
113114
this.valueNotSet = false;
114115
this.value = val;
115116
this.refreshValue();
116117
}
117118

118119
public void setValue(final ItemReference<T> val) {
120+
this.setValue(val, false);
121+
}
122+
123+
public void setValue(final ItemReference<T> val, final boolean fixed) {
124+
this.valueFixed = fixed;
125+
this.setEditable(!this.valueFixed);
119126
this.valueNotSet = false;
120127
this.value = val;
121128
this.refreshValue();
@@ -161,7 +168,7 @@ private void doRefreshItems() {
161168
this.setLoading(true);
162169
final List<? extends T> items = this.loadItems();
163170
this.setLoading(false);
164-
DefaultLoader.getIdeHelper().invokeLater(() -> this.setItems(items));
171+
AzureTaskManager.getInstance().runLater(() -> this.setItems(items), AzureTask.Modality.ANY);
165172
} catch (final Exception e) {
166173
final Throwable rootCause = ExceptionUtils.getRootCause(e);
167174
if (rootCause instanceof InterruptedIOException || rootCause instanceof InterruptedException) {
@@ -191,15 +198,15 @@ public void clear() {
191198
}
192199

193200
protected void setLoading(final boolean loading) {
194-
DefaultLoader.getIdeHelper().invokeLater(() -> {
201+
AzureTaskManager.getInstance().runLater(() -> {
195202
if (loading) {
196203
this.setEnabled(false);
197204
this.setEditor(this.loadingSpinner);
198205
} else {
199-
this.setEnabled(forceDisable ? false : true);
206+
this.setEnabled(!valueFixed);
200207
this.setEditor(this.inputEditor);
201208
}
202-
});
209+
}, AzureTask.Modality.ANY);
203210
}
204211

205212
protected String getItemText(Object item) {
@@ -220,21 +227,17 @@ protected ExtendableTextComponent.Extension getExtension() {
220227
}
221228

222229
protected Observable<? extends List<? extends T>> loadItemsAsync() {
223-
return Observable.fromCallable(this::loadItems).subscribeOn(getSchedulerProvider().io());
230+
return Observable.fromCallable(this::loadItems).subscribeOn(Schedulers.io());
224231
}
225232

226-
@NotNull
233+
@Nonnull
227234
protected abstract List<? extends T> loadItems() throws Exception;
228235

229236
@Nullable
230237
protected T getDefaultValue() {
231238
return null;
232239
}
233240

234-
protected SchedulerProvider getSchedulerProvider() {
235-
return SchedulerProviderFactory.getInstance().getSchedulerProvider();
236-
}
237-
238241
protected void handleLoadingError(Throwable e) {
239242
AzureExceptionHandler.onRxException(e);
240243
}
@@ -272,6 +275,7 @@ protected JTextField createEditorComponent() {
272275
return textField;
273276
}
274277

278+
@Nullable
275279
protected ExtendableTextComponent.Extension getExtension() {
276280
final ExtendableTextComponent.Extension extension = AzureComboBox.this.getExtension();
277281
return extension == null ? null : ExtendableTextComponent.Extension.create(
@@ -289,7 +293,7 @@ public void setItem(Object item) {
289293
// do nothing: item can not be set on loading
290294
super.setItem(item);
291295
if (item == null) {
292-
this.editor.setText(message("common.refreshing"));
296+
this.editor.setText("Refreshing...");
293297
}
294298
}
295299

@@ -347,16 +351,16 @@ public ComboFilterListener(List<? extends T> list, BiPredicate<? super T, ? supe
347351
}
348352

349353
@Override
350-
protected void textChanged(@NotNull final DocumentEvent documentEvent) {
351-
DefaultLoader.getIdeHelper().invokeLater(() -> {
354+
protected void textChanged(@Nonnull final DocumentEvent documentEvent) {
355+
AzureTaskManager.getInstance().runLater(() -> {
352356
try {
353357
final String text = documentEvent.getDocument().getText(0, documentEvent.getDocument().getLength());
354-
list.stream().filter(item -> filter.test(item, text) && !getItems().contains(item)).forEach(item -> addItem(item));
355-
getItems().stream().filter(item -> !filter.test(item, text)).forEach(item -> removeItem(item));
358+
list.stream().filter(item -> filter.test(item, text) && !getItems().contains(item)).forEach(AzureComboBox.this::addItem);
359+
getItems().stream().filter(item -> !filter.test(item, text)).forEach(AzureComboBox.this::removeItem);
356360
} catch (BadLocationException e) {
357361
// swallow exception and show all items
358362
}
359-
});
363+
}, AzureTask.Modality.ANY);
360364
}
361365
}
362366

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*/
5+
6+
package com.microsoft.azure.toolkit.intellij.common;
7+
8+
import lombok.RequiredArgsConstructor;
9+
import lombok.Setter;
10+
11+
import javax.annotation.Nonnull;
12+
import java.util.Collections;
13+
import java.util.List;
14+
import java.util.Objects;
15+
import java.util.function.Supplier;
16+
17+
@RequiredArgsConstructor
18+
@Setter
19+
public class AzureComboBoxSimple<T> extends AzureComboBox<T> {
20+
21+
private final Supplier<? extends List<? extends T>> supplier;
22+
private Validator validator;
23+
24+
@Nonnull
25+
protected List<? extends T> loadItems() throws Exception {
26+
if (Objects.nonNull(this.supplier)) {
27+
return this.supplier.get();
28+
}
29+
return Collections.emptyList();
30+
}
31+
}

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/AzureDialog.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureDialog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
package com.microsoft.azure.toolkit.intellij.common;
66

77
import com.intellij.openapi.project.Project;
8+
import com.intellij.openapi.ui.DialogWrapper;
89
import com.intellij.openapi.ui.ValidationInfo;
910
import com.microsoft.azure.toolkit.lib.common.form.AzureForm;
1011
import com.microsoft.azure.toolkit.lib.common.form.AzureFormInput;
1112
import com.microsoft.azure.toolkit.lib.common.form.AzureValidationInfo;
12-
import com.microsoft.intellij.ui.components.AzureDialogWrapper;
1313
import lombok.extern.java.Log;
1414

1515
import javax.swing.*;
@@ -18,7 +18,7 @@
1818
import java.util.stream.Collectors;
1919

2020
@Log
21-
public abstract class AzureDialog<T> extends AzureDialogWrapper {
21+
public abstract class AzureDialog<T> extends DialogWrapper {
2222
protected OkActionListener<T> okActionListener;
2323

2424
public AzureDialog(Project project) {
@@ -52,12 +52,12 @@ protected List<ValidationInfo> doValidateAll() {
5252
final List<AzureValidationInfo> infos = this.getForm().validateData();
5353
this.setOKActionEnabled(infos.stream().noneMatch(
5454
i -> i == AzureValidationInfo.PENDING || i.getType() == AzureValidationInfo.Type.ERROR || AzureValidationInfo.UNINITIALIZED.equals(i)));
55-
List<ValidationInfo> resultList = infos.stream()
55+
final List<ValidationInfo> resultList = infos.stream()
5656
.filter(i -> i != AzureValidationInfo.PENDING && i != AzureValidationInfo.OK && !AzureValidationInfo.UNINITIALIZED.equals(i))
5757
.map(AzureDialog::toIntellijValidationInfo)
5858
.collect(Collectors.toList());
5959
// this is in order to let ok action disable if only there is any uninitialized filed.
60-
if (infos.stream().filter(e -> AzureValidationInfo.UNINITIALIZED.equals(e)).count() > 0L) {
60+
if (infos.stream().anyMatch(AzureValidationInfo.UNINITIALIZED::equals)) {
6161
setErrorInfoAll(resultList);
6262
}
6363
return resultList;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.microsoft.azure.toolkit.intellij.common;
2+
3+
import javax.swing.*;
4+
5+
public interface AzureFormJPanel<T> extends AzureFormPanel<T> {
6+
JPanel getContentPanel();
7+
}

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/AzureTextInput.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureTextInput.java

File renamed without changes.

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/lib/appservice/Draft.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/Draft.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*/
55

6-
package com.microsoft.azure.toolkit.lib.appservice;
6+
package com.microsoft.azure.toolkit.intellij.common;
77

88
public interface Draft {
99
// marker interface

0 commit comments

Comments
 (0)