-
Notifications
You must be signed in to change notification settings - Fork 330
issue #1047 - Add additional settings to the project creation. #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue #1047 - Add additional settings to the project creation. #1232
Conversation
| flutter.module.create.settings.radios.android.kotlin=Kotlin | ||
| flutter.module.create.settings.radios.android.tip=Select an Android language. | ||
| flutter.module.create.settings.radios.ios.label=iOS language: | ||
| flutter.module.create.settings.radios.ios.object_c=Object C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing
58a7981 to
e603fa7
Compare
5959f07 to
e5e7329
Compare
|
Wow, @branflake2267 , this is fantastic! Adding @pq as the reviewer since he's worked on the wizards most recently. A couple of drive by thoughts:
|
|
lol, oops on the Android language choice. Spaced on that. Good catch. :) Thanks.
|
| flutter.module.create.settings.description.tip=Enter a project description which shows up in the pubsec.yaml. | ||
| flutter.module.create.settings.description.default_text=A new Flutter project. | ||
| flutter.module.create.settings.radios.android.label=Android language: | ||
| flutter.module.create.settings.radios.android.ios=iOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ios/java/
e5e7329 to
b454d30
Compare
| settingsStep.addSettingsField(FlutterBundle.message("flutter.module.create.settings.help.project_name.label"), | ||
| new JLabel(FlutterBundle.message("flutter.module.create.settings.help.project_name.description"))); | ||
| settingsStep.addSettingsField(FlutterBundle.message("flutter.module.create.settings.help.org.label"), | ||
| new JLabel(FlutterBundle.message("flutter.module.create.settings.help.org.description"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add help for project type, to help distinguish application vs plugin?
Project type: Select 'application' to build a mobile application for end users.
_____________ Choose a 'plugin' if you're building native device feature hooks for a developer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this. I wonder if we could do something to set this help apart a bit more. Maybe putting it in it's own group (sorry, that's an eclipse/SWT-ism... not sure what that's called in Swing). Or having a dividing line or styled text? Maybe we could add a hyperlink to get more info as well? (Oops: I guess that assumes there's a good page with flutter create docs but I don't see one. cc @LarkAscending in case I'm missing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
This is great @branflake2267 ! I think we need to split this over two pages in the wizard:
The reason is that not all project types have the same properties. For example, a package does not contain any platform code, and thus is does not make sense to ask for android and ios languages for that one. |
|
Thanks. Ah, I didn't see Another option I like to use for dimensional properties, on selection is to disable those that don't apply. If the package options were minor, the properties that don't apply could be changed or disabled. Would this be of interest? Would you be the consensus for adding a wizard to my patch? |
|
WebStorm only has one step and IDEA has two steps in the project create wizards. It looks possible to add wizard steps to Webstorm, so I would suggest keeping the wizards consistent with IDEA. Then this would mean the flutter SDK selection would have to be extracted into it's own wizard. What are your thoughts on keeping Webstorms and IDEAs steps similar? |
|
@branflake2267, we're not optimizing for the webstorm experience - having it be slightly different than IDEA is fine. In terms of keeping this one page, perhaps a combo box for project type? That way we can default to |
pq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of nits but substantially awesome! 🎉
| } | ||
|
|
||
| @Nullable | ||
| @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make final?
| private JTextField descriptionField; | ||
| private RadiosForm androidLanguageRadios; | ||
| private RadiosForm iosLanguageRadios; | ||
| private JCheckBox includeDriverTextField; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these all be made final?
| } | ||
|
|
||
| public FlutterCreateAdditionalSettings getAddtionalSettings() { | ||
| return settingsFields.getAddtionalSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing buildUI is sure to have been called before this is accessed and settingsFields is certain not to be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving the instantiation to the ctor.
|
|
||
| radio2.setText(label2); | ||
|
|
||
| ButtonGroup radioGroup = new ButtonGroup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make final?
| } | ||
|
|
||
| public List<String> getArgs() { | ||
| List<String> args = new ArrayList<String>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: final?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think you can simplify to:
new ArrayList<>();
src/io/flutter/sdk/FlutterSdk.java
Outdated
| // keep as the last argument | ||
| args.add(appDir.getName()); | ||
|
|
||
| String[] vargs = args.stream().toArray(String[]::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And final here too...
|
|
||
| List<String> args1 = addtionalSettings1.getArgs(); | ||
| List<String> args2 = addtionalSettings2.getArgs(); | ||
| List<String> args3 = addtionalSettings3.getArgs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More opportunities to go final...
| List<String> args2 = addtionalSettings2.getArgs(); | ||
| List<String> args3 = addtionalSettings3.getArgs(); | ||
|
|
||
| assertTrue(args1.size() == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal but failure would read a little better if this were:
assertEquals(1, args1.size());
| assertEquals("--plugin", args1.get(0)); | ||
|
|
||
| assertTrue(args2.size() == 0); | ||
| assertTrue(args3.size() == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly preferring assertEquals here?
| } | ||
|
|
||
| @Test | ||
| public void descriptionPropertyTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments in generatePluginPropertyTest apply here to and below. 👍
|
I like the current config I've proposed in this patch the best with radio selection. My solution to the selection complexity would be to add notes to the help section and probably a link to get started if that were possible. And I like disabling vs adding wizards. Although a combo has the exact same effect I'd go after except, I might want to add some verbiage to a combo's list to explain the option in more detail. I just want more options, so I'll build however you like it. |
|
I've appended a commit with the latest nit fixes and added help section. Todos:
|
abdf591 to
e2d6f2e
Compare
|
Latest rendition. @pq @devoncarew What do you think so far? Let me know if you want to try out the combos for project selection. I imagine some more tuning will need to be done on the helps. How do you want to proceed? |
|
@branflake2267, the UI looks great! We may follow up with some tweaks and iterations after it lands (like trying out a combo for project selection to see how it feels). I'll let @pq speak to the code in terms of a lgtm. We're more or less in feature freeze for M16 (releasing this week), so we'll likely wait to land for a day or two until after we push M16. |
And - I would like to see how this looks - but it's not something we need to do for this PR. Happy to iterate a bit in follow-ups if that's your preference. |
|
Cool! As @devoncarew said, let's wait until M16 goes out (#1153) and then land this and iterate. 🎉 |
| <properties/> | ||
| <border type="none"/> | ||
| <children> | ||
| <component id="26e7" class="javax.swing.JTextPane" binding="gettingStartedUrl"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@devoncarew @pq Sounds good on iteration. I think a combo might be nice, I'll wait and see what you do. @pq I didn't use a LinkLabel, that looks like a better choice. I used a JTextPane with html. I'll change that over tonight. Thanks. |
|
Great! No worries about the LinkLabel. If you don't get to it we can pick that up on another pass. The important bits are here and thanks a million for that! |
e2d6f2e to
c3d2fa9
Compare
…nal create settings.
c3d2fa9 to
5f793ef
Compare
|
I rebased onto the head. That'll be it until Monday for me. I'll be out of pocket until then, just in case. |
|
Super, thanks! M16 should be out by then too. 🎉 |
|
As per the plan, I'll land this now and we can iterate/fiddle. Thanks! |
|
Sounds nifty :) |










This works for IDEA. I'm looking at Webstorm next.
The default view for IDEA:

Todos: