Skip to content

Commit 9f30fd8

Browse files
committed
Add JCEF option
1 parent fe38c1f commit 9f30fd8

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

flutter-idea/src/io/flutter/FlutterBundle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ settings.allow.tests.tooltip=The directory must be marked as a sources root, suc
213213
settings.font.packages=Font Packages
214214
settings.show.all.configs=Show all possible run configurations for apps or tests, even if a created configuration already exists
215215
settings.show.all.configs.tooltip=If there is a defined run configuration to watch a specific test and one to just run it, show both.
216+
settings.jcef.browser=Use JCEF browser to show embedded DevTools.
217+
settings.jcef.browser.tooltip=JCEF is a browser included in IntelliJ that is an alternative to using JxBrowser for showing embedded DevTools.
216218
settings.enable.androi.gradle.sync.tooltip=Provides advanced editing capabilities for Java and Kotlin code. Uses Gradle to find Android libraries then links them into the Flutter project.
217219
settings.experiments=Experiments
218220
settings.editor=Editor

flutter-idea/src/io/flutter/sdk/FlutterSettingsConfigurable.form

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
</grid>
245245
</children>
246246
</grid>
247-
<grid id="23e52" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
247+
<grid id="23e52" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
248248
<margin top="0" left="0" bottom="0" right="0"/>
249249
<constraints>
250250
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -287,6 +287,15 @@
287287
<toolTipText resource-bundle="io/flutter/FlutterBundle" key="settings.show.all.configs.tooltip"/>
288288
</properties>
289289
</component>
290+
<component id="909bb" class="javax.swing.JCheckBox" binding="myEnableJcefBrowserCheckBox">
291+
<constraints>
292+
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
293+
</constraints>
294+
<properties>
295+
<text resource-bundle="io/flutter/FlutterBundle" key="settings.jcef.browser"/>
296+
<toolTipText resource-bundle="io/flutter/FlutterBundle" key="settings.jcef.browser.tooltip"/>
297+
</properties>
298+
</component>
290299
</children>
291300
</grid>
292301
<grid id="3bf2f" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

flutter-idea/src/io/flutter/sdk/FlutterSettingsConfigurable.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public class FlutterSettingsConfigurable implements SearchableConfigurable {
7878

7979
private JCheckBox myShowAllRunConfigurationsInContextCheckBox;
8080

81+
private JCheckBox myEnableJcefBrowserCheckBox;
82+
8183
private JCheckBox myShowBuildMethodGuides;
8284
private JCheckBox myShowClosingLabels;
8385
private FixedSizeButton myCopyButton;
@@ -265,6 +267,10 @@ public boolean isModified() {
265267
return true;
266268
}
267269

270+
if (settings.isEnableJcefBrowser() != myEnableJcefBrowserCheckBox.isSelected()) {
271+
return true;
272+
}
273+
268274
return false;
269275
}
270276

@@ -323,6 +329,7 @@ public void apply() throws ConfigurationException {
323329
settings.setAllowTestsInSourcesRoot(myAllowTestsInSourcesRoot.isSelected());
324330
settings.setShowAllRunConfigurationsInContext(myShowAllRunConfigurationsInContextCheckBox.isSelected());
325331
settings.setFontPackages(myFontPackagesTextArea.getText());
332+
settings.setEnableJcefBrowser(myEnableJcefBrowserCheckBox.isSelected());
326333

327334
reset(); // because we rely on remembering initial state
328335
checkFontPackages(settings.getFontPackages(), oldFontPackages);
@@ -394,6 +401,7 @@ public void reset() {
394401
myIncludeAllStackTraces.setEnabled(myShowStructuredErrors.isSelected());
395402

396403
myShowAllRunConfigurationsInContextCheckBox.setSelected(settings.showAllRunConfigurationsInContext());
404+
myEnableJcefBrowserCheckBox.setSelected(settings.isEnableJcefBrowser());
397405
myFontPackagesTextArea.setText(settings.getFontPackages());
398406
}
399407

flutter-idea/src/io/flutter/settings/FlutterSettings.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class FlutterSettings {
3131
private static final String enableEmbeddedBrowsersKey = "io.flutter.editor.enableEmbeddedBrowsers";
3232
private static final String enableBazelHotRestartKey = "io.flutter.editor.enableBazelHotRestart";
3333
private static final String showBazelHotRestartWarningKey = "io.flutter.showBazelHotRestartWarning";
34+
private static final String enableJcefBrowserKey = "io.flutter.enableJcefBrowser";
3435
private static final String fontPackagesKey = "io.flutter.fontPackages";
3536
private static final String allowTestsInSourcesRootKey = "io.flutter.allowTestsInSources";
3637
private static final String showBazelIosRunNotificationKey = "io.flutter.hideBazelIosRunNotification";
@@ -269,6 +270,16 @@ public void setShowAllRunConfigurationsInContext(boolean value) {
269270
fireEvent();
270271
}
271272

273+
public boolean isEnableJcefBrowser() {
274+
return getPropertiesComponent().getBoolean(enableJcefBrowserKey, false);
275+
}
276+
277+
public void setEnableJcefBrowser(boolean value) {
278+
getPropertiesComponent().setValue(enableJcefBrowserKey, value, false);
279+
280+
fireEvent();
281+
}
282+
272283
public boolean isVerboseLogging() {
273284
return getPropertiesComponent().getBoolean(verboseLoggingKey, false);
274285
}

0 commit comments

Comments
 (0)