Skip to content

Commit c90d127

Browse files
committed
Models and new comment UI
1 parent 6f00316 commit c90d127

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/helpers/MvpUIHelperImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
package com.microsoft.intellij.helpers;
77

8+
import com.microsoft.azuretools.azurecommons.helpers.NotNull;
89
import com.microsoft.azuretools.core.mvp.ui.base.MvpUIHelper;
10+
import com.microsoft.intellij.secure.IdeaSecureStore;
911
import com.microsoft.tooling.msservices.components.DefaultLoader;
1012

1113
import javax.swing.*;
@@ -21,4 +23,10 @@ public void showError(String msg) {
2123
public void showException(String msg, Exception e) {
2224
DefaultLoader.getUIHelper().showError(e.getMessage(), msg);
2325
}
26+
27+
@Deprecated
28+
@Override
29+
public String loadPasswordFromSecureStore(@NotNull String serviceName, @NotNull String userName) {
30+
return IdeaSecureStore.getInstance().loadPassword(serviceName, userName);
31+
}
2432
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.intellij.ui;
7+
8+
import com.intellij.openapi.util.SystemInfo;
9+
import com.intellij.ui.components.JBLabel;
10+
import com.intellij.ui.scale.JBUIScale;
11+
import com.intellij.util.ui.UIUtil;
12+
import org.jetbrains.annotations.NotNull;
13+
14+
import javax.swing.plaf.FontUIResource;
15+
import javax.swing.plaf.LabelUI;
16+
import java.awt.*;
17+
18+
public class AzureCommentLabel extends JBLabel {
19+
public AzureCommentLabel(@NotNull String text) {
20+
super(text);
21+
setForeground(UIUtil.getContextHelpForeground());
22+
}
23+
24+
@Override
25+
public void setUI(LabelUI ui) {
26+
super.setUI(ui);
27+
28+
if (SystemInfo.isMac) {
29+
Font font = getFont();
30+
float size = font.getSize2D();
31+
font = new FontUIResource(font.deriveFont(size - JBUIScale.scale(2))); // Allow to reset the font by UI
32+
setFont(font);
33+
}
34+
}
35+
}

Utils/azuretools-core/src/com/microsoft/azuretools/authmanage/models/AuthMethodDetails.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ public class AuthMethodDetails {
3333
@Getter
3434
private String clientId;
3535

36+
@Deprecated
3637
@JsonProperty
3738
@Setter
3839
@Getter
3940
private String credFilePath;
4041

42+
@JsonProperty
43+
@Setter
44+
@Getter
45+
private String certificate;
46+
4147
@JsonProperty
4248
@Setter
4349
@Getter

Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/ui/base/MvpUIHelper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55

66
package com.microsoft.azuretools.core.mvp.ui.base;
77

8+
import com.microsoft.azuretools.azurecommons.helpers.NotNull;
9+
810
public interface MvpUIHelper {
911

1012
void showError(String message);
1113

1214
void showException(String message, Exception e);
1315

16+
@Deprecated
17+
default String loadPasswordFromSecureStore(@NotNull String serviceName, @NotNull String userName) {
18+
return null;
19+
}
1420
}

0 commit comments

Comments
 (0)