|
12 | 12 | import com.intellij.ui.jcef.JCEFHtmlPanel; |
13 | 13 | import com.intellij.util.ui.JBUI; |
14 | 14 | import com.intellij.util.ui.components.BorderLayoutPanel; |
| 15 | +import com.shuzijun.leetcode.plugin.editor.LCVPanel; |
15 | 16 | import com.shuzijun.leetcode.plugin.model.PluginConstant; |
16 | 17 | import com.shuzijun.leetcode.plugin.utils.*; |
17 | 18 | import org.apache.commons.lang.StringUtils; |
@@ -53,7 +54,11 @@ public LoginPanel(@Nullable Project project) { |
53 | 54 | if (HttpLogin.isEnabledJcef()) { |
54 | 55 | okAction = new OkAction() { |
55 | 56 | }; |
56 | | - jcefPanel = new JcefPanel(project, okAction); |
| 57 | + try { |
| 58 | + jcefPanel = new JcefPanel(project, okAction); |
| 59 | + } catch (IllegalArgumentException e) { |
| 60 | + jcefPanel = new JcefPanel(project, okAction,true); |
| 61 | + } |
57 | 62 | jcefPanel.getComponent().setMinimumSize(new Dimension(1000, 500)); |
58 | 63 | jcefPanel.getComponent().setPreferredSize(new Dimension(1000, 500)); |
59 | 64 | panel.addToCenter(new JBScrollPane(jcefPanel.getComponent(), JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER)); |
@@ -145,10 +150,21 @@ private static class JcefPanel extends JCEFHtmlPanel { |
145 | 150 |
|
146 | 151 | private Action okAction; |
147 | 152 |
|
| 153 | + public JcefPanel(Project project, Action okAction, boolean old) { |
| 154 | + super( null); |
| 155 | + this.project = project; |
| 156 | + this.okAction = okAction; |
| 157 | + init(); |
| 158 | + } |
| 159 | + |
148 | 160 | public JcefPanel(Project project, Action okAction) { |
149 | 161 | super(null, null); |
150 | 162 | this.project = project; |
151 | 163 | this.okAction = okAction; |
| 164 | + init(); |
| 165 | + } |
| 166 | + |
| 167 | + private void init(){ |
152 | 168 | getJBCefClient().addLoadHandler(cefLoadHandler = new CefLoadHandlerAdapter() { |
153 | 169 |
|
154 | 170 | boolean successDispose = false; |
|
0 commit comments