|
32 | 32 | import com.microsoft.aad.adal4j.DeviceCode; |
33 | 33 | import com.microsoft.intellij.ui.components.AzureDialogWrapper; |
34 | 34 | import org.apache.log4j.Level; |
35 | | -import org.apache.log4j.LogManager; |
36 | 35 | import org.apache.log4j.Logger; |
37 | 36 | import org.jetbrains.annotations.Nullable; |
38 | 37 |
|
| 38 | +import javax.swing.JComponent; |
| 39 | +import javax.swing.JEditorPane; |
| 40 | +import javax.swing.JPanel; |
| 41 | +import javax.swing.UIManager; |
| 42 | +import javax.swing.event.HyperlinkEvent; |
| 43 | +import javax.swing.text.html.HTMLDocument; |
| 44 | +import java.awt.Color; |
39 | 45 | import java.awt.Desktop; |
| 46 | +import java.awt.Font; |
40 | 47 | import java.awt.Toolkit; |
41 | 48 | import java.awt.Window; |
42 | 49 | import java.awt.datatransfer.Clipboard; |
|
47 | 54 | import java.net.URISyntaxException; |
48 | 55 | import java.util.concurrent.ExecutionException; |
49 | 56 | import java.util.concurrent.Future; |
50 | | -import javax.swing.JComponent; |
51 | | -import javax.swing.JEditorPane; |
52 | | -import javax.swing.JPanel; |
53 | | -import javax.swing.event.HyperlinkEvent; |
54 | 57 |
|
55 | 58 | public class DeviceLoginWindow extends AzureDialogWrapper { |
56 | 59 | private static final String TITLE = "Azure Device Login"; |
@@ -82,6 +85,15 @@ public DeviceLoginWindow(final AuthenticationContext ctx, final DeviceCode devic |
82 | 85 | } |
83 | 86 | } |
84 | 87 | }); |
| 88 | + // Apply JLabel's font and color to JEditorPane |
| 89 | + final Font font = UIManager.getFont("Label.font"); |
| 90 | + final Color foregroundColor = UIManager.getColor("Label.foreground"); |
| 91 | + editorPanel.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); |
| 92 | + if (font != null && foregroundColor != null) { |
| 93 | + editorPanel.setFont(font); |
| 94 | + editorPanel.setForeground(foregroundColor); |
| 95 | + } |
| 96 | + |
85 | 97 | authExecutor = ApplicationManager.getApplication() |
86 | 98 | .executeOnPooledThread(() -> pullAuthenticationResult(ctx, deviceCode, callBack)); |
87 | 99 | init(); |
|
0 commit comments