Configuration: Make UI improvements
Use JTextField for output file prefix/postfix. Use TextFieldWithBrowseButton for output directory Improve layout
This commit is contained in:
@@ -224,8 +224,8 @@ kotlin.compiler.jvm.option.panel.title=Kotlin to JVM
|
|||||||
# Kotlin to JavaScript
|
# Kotlin to JavaScript
|
||||||
kotlin.compiler.js.option.panel.title=Kotlin to JavaScript
|
kotlin.compiler.js.option.panel.title=Kotlin to JavaScript
|
||||||
kotlin.compiler.js.option.generate.sourcemaps=Generate &source maps
|
kotlin.compiler.js.option.generate.sourcemaps=Generate &source maps
|
||||||
kotlin.compiler.js.option.output.prefix=Output file &prefix:
|
kotlin.compiler.js.option.output.prefix=File to &prepend to generated code:
|
||||||
kotlin.compiler.js.option.output.postfix=Output file p&ostfix:
|
kotlin.compiler.js.option.output.postfix=File to append to generated c&ode:
|
||||||
kotlin.compiler.js.option.output.prefix.browse.title=Choose output file prefix
|
kotlin.compiler.js.option.output.prefix.browse.title=Choose output file prefix
|
||||||
kotlin.compiler.js.option.output.postfix.browse.title=Choose output file postfix
|
kotlin.compiler.js.option.output.postfix.browse.title=Choose output file postfix
|
||||||
kotlin.compiler.js.option.output.copy.files=&Copy library runtime files
|
kotlin.compiler.js.option.output.copy.files=&Copy library runtime files
|
||||||
|
|||||||
+3
-3
@@ -215,7 +215,7 @@
|
|||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.prefix"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.prefix"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="2d5b" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPrefixFile">
|
<component id="dd0c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPrefixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.postfix"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.postfix"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="1292b" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPostfixFile">
|
<component id="1bdb7" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPostfixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.copy.dir"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.copy.dir"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="f1f6b" class="javax.swing.JTextField" binding="outputDirectory">
|
<component id="7c11a" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputDirectory">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
|
|||||||
+26
-12
@@ -88,10 +88,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
private ThreeStateCheckBox generateSourceMapsCheckBox;
|
private ThreeStateCheckBox generateSourceMapsCheckBox;
|
||||||
private TextFieldWithBrowseButton outputPrefixFile;
|
private TextFieldWithBrowseButton outputPrefixFile;
|
||||||
private TextFieldWithBrowseButton outputPostfixFile;
|
private TextFieldWithBrowseButton outputPostfixFile;
|
||||||
private JLabel labelForOutputPrefixFile;
|
|
||||||
private JLabel labelForOutputPostfixFile;
|
|
||||||
private JLabel labelForOutputDirectory;
|
private JLabel labelForOutputDirectory;
|
||||||
private JTextField outputDirectory;
|
private TextFieldWithBrowseButton outputDirectory;
|
||||||
private ThreeStateCheckBox copyRuntimeFilesCheckBox;
|
private ThreeStateCheckBox copyRuntimeFilesCheckBox;
|
||||||
private ThreeStateCheckBox keepAliveCheckBox;
|
private ThreeStateCheckBox keepAliveCheckBox;
|
||||||
private JCheckBox enablePreciseIncrementalCheckBox;
|
private JCheckBox enablePreciseIncrementalCheckBox;
|
||||||
@@ -109,6 +107,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
private JPanel apiVersionPanel;
|
private JPanel apiVersionPanel;
|
||||||
private JComboBox apiVersionComboBox;
|
private JComboBox apiVersionComboBox;
|
||||||
private JPanel scriptPanel;
|
private JPanel scriptPanel;
|
||||||
|
private JLabel labelForOutputPrefixFile;
|
||||||
|
private JLabel labelForOutputPostfixFile;
|
||||||
|
|
||||||
private boolean isEnabled = true;
|
private boolean isEnabled = true;
|
||||||
|
|
||||||
@@ -141,11 +141,24 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
additionalArgsOptionsField.attachLabel(additionalArgsLabel);
|
additionalArgsOptionsField.attachLabel(additionalArgsLabel);
|
||||||
|
|
||||||
setupFileChooser(labelForOutputPrefixFile, outputPrefixFile,
|
setupFileChooser(labelForOutputPrefixFile, outputPrefixFile,
|
||||||
KotlinBundle.message("kotlin.compiler.js.option.output.prefix.browse.title"));
|
KotlinBundle.message("kotlin.compiler.js.option.output.prefix.browse.title"),
|
||||||
|
true);
|
||||||
setupFileChooser(labelForOutputPostfixFile, outputPostfixFile,
|
setupFileChooser(labelForOutputPostfixFile, outputPostfixFile,
|
||||||
KotlinBundle.message("kotlin.compiler.js.option.output.postfix.browse.title"));
|
KotlinBundle.message("kotlin.compiler.js.option.output.postfix.browse.title"),
|
||||||
|
true);
|
||||||
|
setupFileChooser(labelForOutputDirectory, outputDirectory,
|
||||||
|
"Choose Output Directory",
|
||||||
|
false);
|
||||||
|
|
||||||
|
outputDirectory.addBrowseFolderListener(
|
||||||
|
"Choose Output Directory",
|
||||||
|
null,
|
||||||
|
project,
|
||||||
|
new FileChooserDescriptor(false, true, false, false, false, false),
|
||||||
|
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
labelForOutputDirectory.setLabelFor(outputDirectory);
|
|
||||||
copyRuntimeFilesCheckBox.addChangeListener(new ChangeListener() {
|
copyRuntimeFilesCheckBox.addChangeListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void stateChanged(@NotNull ChangeEvent e) {
|
public void stateChanged(@NotNull ChangeEvent e) {
|
||||||
@@ -210,12 +223,13 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
private static void setupFileChooser(
|
private static void setupFileChooser(
|
||||||
@NotNull JLabel label,
|
@NotNull JLabel label,
|
||||||
@NotNull TextFieldWithBrowseButton fileChooser,
|
@NotNull TextFieldWithBrowseButton fileChooser,
|
||||||
@NotNull String title
|
@NotNull String title,
|
||||||
|
boolean forFiles
|
||||||
) {
|
) {
|
||||||
label.setLabelFor(fileChooser);
|
label.setLabelFor(fileChooser);
|
||||||
|
|
||||||
fileChooser.addBrowseFolderListener(title, null, null,
|
fileChooser.addBrowseFolderListener(title, null, null,
|
||||||
new FileChooserDescriptor(true, false, false, false, false, false),
|
new FileChooserDescriptor(forFiles, !forFiles, false, false, false, false),
|
||||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
|
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,15 +330,15 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
ComparingUtils.isModified(scriptTemplatesField, compilerSettings.scriptTemplates) ||
|
ComparingUtils.isModified(scriptTemplatesField, compilerSettings.scriptTemplates) ||
|
||||||
ComparingUtils.isModified(scriptTemplatesClasspathField, compilerSettings.scriptTemplatesClasspath) ||
|
ComparingUtils.isModified(scriptTemplatesClasspathField, compilerSettings.scriptTemplatesClasspath) ||
|
||||||
ComparingUtils.isModified(copyRuntimeFilesCheckBox, compilerSettings.copyJsLibraryFiles) ||
|
ComparingUtils.isModified(copyRuntimeFilesCheckBox, compilerSettings.copyJsLibraryFiles) ||
|
||||||
ComparingUtils.isModified(outputDirectory, compilerSettings.outputDirectoryForJsLibraryFiles) ||
|
isModified(outputDirectory, compilerSettings.outputDirectoryForJsLibraryFiles) ||
|
||||||
|
|
||||||
(compilerWorkspaceSettings != null &&
|
(compilerWorkspaceSettings != null &&
|
||||||
(ComparingUtils.isModified(enablePreciseIncrementalCheckBox, compilerWorkspaceSettings.getPreciseIncrementalEnabled()) ||
|
(ComparingUtils.isModified(enablePreciseIncrementalCheckBox, compilerWorkspaceSettings.getPreciseIncrementalEnabled()) ||
|
||||||
ComparingUtils.isModified(keepAliveCheckBox, compilerWorkspaceSettings.getEnableDaemon()))) ||
|
ComparingUtils.isModified(keepAliveCheckBox, compilerWorkspaceSettings.getEnableDaemon()))) ||
|
||||||
|
|
||||||
ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourceMap) ||
|
ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourceMap) ||
|
||||||
isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) ||
|
ComparingUtils.isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) ||
|
||||||
isModified(outputPostfixFile, k2jsCompilerArguments.outputPostfix) ||
|
ComparingUtils.isModified(outputPostfixFile, k2jsCompilerArguments.outputPostfix) ||
|
||||||
!getSelectedModuleKind().equals(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind)) ||
|
!getSelectedModuleKind().equals(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind)) ||
|
||||||
|
|
||||||
!getSelectedJvmVersion().equals(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
!getSelectedJvmVersion().equals(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
||||||
@@ -479,7 +493,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
return outputPostfixFile;
|
return outputPostfixFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JTextField getOutputDirectory() {
|
public TextFieldWithBrowseButton getOutputDirectory() {
|
||||||
return outputDirectory;
|
return outputDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,13 +104,17 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
val contentPanel = FormBuilder
|
val contentPanel = FormBuilder
|
||||||
.createFormBuilder()
|
.createFormBuilder()
|
||||||
.addComponent(JPanel(BorderLayout()).apply {
|
.addComponent(JPanel(BorderLayout()).apply {
|
||||||
border = EmptyBorder(0, 0, UIUtil.DEFAULT_VGAP, UIUtil.DEFAULT_VGAP)
|
|
||||||
add(useProjectSettingsCheckBox, BorderLayout.WEST)
|
add(useProjectSettingsCheckBox, BorderLayout.WEST)
|
||||||
add(projectSettingsLink, BorderLayout.EAST)
|
add(projectSettingsLink, BorderLayout.EAST)
|
||||||
})
|
})
|
||||||
.addLabeledComponent("&Target platform: ", targetPlatformComboBox)
|
.addLabeledComponent("&Target platform: ", targetPlatformComboBox)
|
||||||
.addComponent(compilerConfigurable.createComponent()!!)
|
.addComponent(compilerConfigurable.createComponent()!!.apply {
|
||||||
|
border = null
|
||||||
|
})
|
||||||
.panel
|
.panel
|
||||||
|
.apply {
|
||||||
|
border = EmptyBorder(10, 10, 10, 10)
|
||||||
|
}
|
||||||
add(contentPanel, BorderLayout.NORTH)
|
add(contentPanel, BorderLayout.NORTH)
|
||||||
|
|
||||||
useProjectSettingsCheckBox.addActionListener {
|
useProjectSettingsCheckBox.addActionListener {
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ class MultipleKotlinFacetEditor(
|
|||||||
helper.bind(generateNoWarningsCheckBox, editors) { it.compilerConfigurable.generateNoWarningsCheckBox }
|
helper.bind(generateNoWarningsCheckBox, editors) { it.compilerConfigurable.generateNoWarningsCheckBox }
|
||||||
helper.bind(additionalArgsOptionsField.textField, editors) { it.compilerConfigurable.additionalArgsOptionsField.textField }
|
helper.bind(additionalArgsOptionsField.textField, editors) { it.compilerConfigurable.additionalArgsOptionsField.textField }
|
||||||
helper.bind(generateSourceMapsCheckBox, editors) { it.compilerConfigurable.generateSourceMapsCheckBox}
|
helper.bind(generateSourceMapsCheckBox, editors) { it.compilerConfigurable.generateSourceMapsCheckBox}
|
||||||
helper.bind(outputPrefixFile.textField, editors) { it.compilerConfigurable.outputPrefixFile.textField}
|
helper.bind(outputPrefixFile.textField, editors) { it.compilerConfigurable.outputPrefixFile.textField }
|
||||||
helper.bind(outputPostfixFile.textField, editors) { it.compilerConfigurable.outputPostfixFile.textField}
|
helper.bind(outputPostfixFile.textField, editors) { it.compilerConfigurable.outputPostfixFile.textField }
|
||||||
helper.bind(outputDirectory, editors) { it.compilerConfigurable.outputDirectory}
|
helper.bind(outputDirectory.textField, editors) { it.compilerConfigurable.outputDirectory.textField }
|
||||||
helper.bind(copyRuntimeFilesCheckBox, editors) { it.compilerConfigurable.copyRuntimeFilesCheckBox}
|
helper.bind(copyRuntimeFilesCheckBox, editors) { it.compilerConfigurable.copyRuntimeFilesCheckBox}
|
||||||
helper.bind(keepAliveCheckBox, editors) { it.compilerConfigurable.keepAliveCheckBox}
|
helper.bind(keepAliveCheckBox, editors) { it.compilerConfigurable.keepAliveCheckBox}
|
||||||
helper.bind(moduleKindComboBox, editors) { it.compilerConfigurable.moduleKindComboBox}
|
helper.bind(moduleKindComboBox, editors) { it.compilerConfigurable.moduleKindComboBox}
|
||||||
|
|||||||
Reference in New Issue
Block a user