Skip to content

Commit befca2c

Browse files
authored
[CQ] API: migrate FlutterGeneratorPeer from slated-for-removal addBrowseFolderListener (#8070)
Migrate from a flavor of `addBrowseFolderListener` that's slated for removal. ![image](https://github.com/user-attachments/assets/ad2cb246-f17d-4b0f-87c4-7d274f4ffa03) See: #7718 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent cf33869 commit befca2c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

flutter-idea/src/io/flutter/module/FlutterGeneratorPeer.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.flutter.module.settings.SettingsHelpForm;
2424
import io.flutter.sdk.FlutterSdk;
2525
import io.flutter.sdk.FlutterSdkUtil;
26+
2627
import javax.swing.ComboBoxEditor;
2728
import javax.swing.JComponent;
2829
import javax.swing.JLabel;
@@ -31,6 +32,7 @@
3132
import javax.swing.JTextPane;
3233
import javax.swing.event.DocumentEvent;
3334
import javax.swing.text.JTextComponent;
35+
3436
import org.jetbrains.annotations.NotNull;
3537
import org.jetbrains.annotations.Nullable;
3638

@@ -64,9 +66,8 @@ private void init() {
6466
mySdkPathComboWithBrowse.getComboBox().setEditable(true);
6567
FlutterSdkUtil.addKnownSDKPathsToCombo(mySdkPathComboWithBrowse.getComboBox());
6668

67-
mySdkPathComboWithBrowse.addBrowseFolderListener(FlutterBundle.message("flutter.sdk.browse.path.label"), null, null,
68-
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
69-
TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
69+
mySdkPathComboWithBrowse.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
70+
.withTitle(FlutterBundle.message("flutter.sdk.browse.path.label")), TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
7071
mySdkPathComboWithBrowse.getComboBox().addActionListener(e -> fillSdkCache());
7172
fillSdkCache();
7273

0 commit comments

Comments
 (0)