Move option for auto-reloading script dependencies to 'Kotlin Scripting' page
This commit is contained in:
+5
-13
@@ -150,7 +150,7 @@
|
|||||||
</component>
|
</component>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
<grid id="483d4" binding="scriptPanel" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="483d4" binding="scriptPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="true"/>
|
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="true"/>
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="71c3f" class="javax.swing.JTextField" binding="scriptTemplatesField">
|
<component id="71c3f" class="javax.swing.JTextField" binding="scriptTemplatesField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" 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="0" 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"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="56390" class="javax.swing.JLabel" binding="scriptTemplatesClasspathLabel">
|
<component id="56390" class="javax.swing.JLabel" binding="scriptTemplatesClasspathLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<labelFor value="644d9"/>
|
<labelFor value="644d9"/>
|
||||||
@@ -182,23 +182,15 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="644d9" class="javax.swing.JTextField" binding="scriptTemplatesClasspathField">
|
<component id="644d9" class="javax.swing.JTextField" binding="scriptTemplatesClasspathField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" 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="1" 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"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</component>
|
||||||
<component id="9b5f1" class="javax.swing.JCheckBox" binding="scriptDependenciesAutoReload">
|
|
||||||
<constraints>
|
|
||||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<text value="Reload script dependencies on file change"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="ae60b" class="javax.swing.JLabel" binding="scriptTemplatesLabel">
|
<component id="ae60b" class="javax.swing.JLabel" binding="scriptTemplatesLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<enabled value="true"/>
|
<enabled value="true"/>
|
||||||
|
|||||||
-11
@@ -37,7 +37,6 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants;
|
|||||||
import org.jetbrains.kotlin.config.*;
|
import org.jetbrains.kotlin.config.*;
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundle;
|
import org.jetbrains.kotlin.idea.KotlinBundle;
|
||||||
import org.jetbrains.kotlin.idea.PluginStartupComponent;
|
import org.jetbrains.kotlin.idea.PluginStartupComponent;
|
||||||
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings;
|
|
||||||
import org.jetbrains.kotlin.idea.facet.DescriptionListCellRenderer;
|
import org.jetbrains.kotlin.idea.facet.DescriptionListCellRenderer;
|
||||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet;
|
import org.jetbrains.kotlin.idea.facet.KotlinFacet;
|
||||||
import org.jetbrains.kotlin.idea.roots.RootUtilsKt;
|
import org.jetbrains.kotlin.idea.roots.RootUtilsKt;
|
||||||
@@ -95,7 +94,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
private JCheckBox enableIncrementalCompilationForJvmCheckBox;
|
private JCheckBox enableIncrementalCompilationForJvmCheckBox;
|
||||||
private JCheckBox enableIncrementalCompilationForJsCheckBox;
|
private JCheckBox enableIncrementalCompilationForJsCheckBox;
|
||||||
private JComboBox moduleKindComboBox;
|
private JComboBox moduleKindComboBox;
|
||||||
private JCheckBox scriptDependenciesAutoReload;
|
|
||||||
private JTextField scriptTemplatesField;
|
private JTextField scriptTemplatesField;
|
||||||
private JTextField scriptTemplatesClasspathField;
|
private JTextField scriptTemplatesClasspathField;
|
||||||
private JLabel scriptTemplatesLabel;
|
private JLabel scriptTemplatesLabel;
|
||||||
@@ -443,7 +441,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
!getSelectedAPIVersionView().equals(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments)) ||
|
!getSelectedAPIVersionView().equals(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments)) ||
|
||||||
!getSelectedCoroutineState().equals(commonCompilerArguments.getCoroutinesState()) ||
|
!getSelectedCoroutineState().equals(commonCompilerArguments.getCoroutinesState()) ||
|
||||||
!additionalArgsOptionsField.getText().equals(compilerSettings.getAdditionalArguments()) ||
|
!additionalArgsOptionsField.getText().equals(compilerSettings.getAdditionalArguments()) ||
|
||||||
isModified(scriptDependenciesAutoReload, getScriptingSettings().isAutoReloadEnabled()) ||
|
|
||||||
isModified(scriptTemplatesField, compilerSettings.getScriptTemplates()) ||
|
isModified(scriptTemplatesField, compilerSettings.getScriptTemplates()) ||
|
||||||
isModified(scriptTemplatesClasspathField, compilerSettings.getScriptTemplatesClasspath()) ||
|
isModified(scriptTemplatesClasspathField, compilerSettings.getScriptTemplatesClasspath()) ||
|
||||||
isModified(copyRuntimeFilesCheckBox, compilerSettings.getCopyJsLibraryFiles()) ||
|
isModified(copyRuntimeFilesCheckBox, compilerSettings.getCopyJsLibraryFiles()) ||
|
||||||
@@ -544,8 +541,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
compilerSettings.setCopyJsLibraryFiles(copyRuntimeFilesCheckBox.isSelected());
|
compilerSettings.setCopyJsLibraryFiles(copyRuntimeFilesCheckBox.isSelected());
|
||||||
compilerSettings.setOutputDirectoryForJsLibraryFiles(outputDirectory.getText());
|
compilerSettings.setOutputDirectoryForJsLibraryFiles(outputDirectory.getText());
|
||||||
|
|
||||||
getScriptingSettings().setAutoReloadEnabled(scriptDependenciesAutoReload.isSelected());
|
|
||||||
|
|
||||||
if (compilerWorkspaceSettings != null) {
|
if (compilerWorkspaceSettings != null) {
|
||||||
compilerWorkspaceSettings.setPreciseIncrementalEnabled(enableIncrementalCompilationForJvmCheckBox.isSelected());
|
compilerWorkspaceSettings.setPreciseIncrementalEnabled(enableIncrementalCompilationForJvmCheckBox.isSelected());
|
||||||
compilerWorkspaceSettings.setIncrementalCompilationForJsEnabled(enableIncrementalCompilationForJsCheckBox.isSelected());
|
compilerWorkspaceSettings.setIncrementalCompilationForJsEnabled(enableIncrementalCompilationForJsCheckBox.isSelected());
|
||||||
@@ -592,7 +587,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
apiVersionComboBox.setSelectedItem(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments));
|
apiVersionComboBox.setSelectedItem(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments));
|
||||||
coroutineSupportComboBox.setSelectedItem(CoroutineSupport.byCompilerArguments(commonCompilerArguments));
|
coroutineSupportComboBox.setSelectedItem(CoroutineSupport.byCompilerArguments(commonCompilerArguments));
|
||||||
additionalArgsOptionsField.setText(compilerSettings.getAdditionalArguments());
|
additionalArgsOptionsField.setText(compilerSettings.getAdditionalArguments());
|
||||||
scriptDependenciesAutoReload.setSelected(getScriptingSettings().isAutoReloadEnabled());
|
|
||||||
scriptTemplatesField.setText(compilerSettings.getScriptTemplates());
|
scriptTemplatesField.setText(compilerSettings.getScriptTemplates());
|
||||||
scriptTemplatesClasspathField.setText(compilerSettings.getScriptTemplatesClasspath());
|
scriptTemplatesClasspathField.setText(compilerSettings.getScriptTemplatesClasspath());
|
||||||
copyRuntimeFilesCheckBox.setSelected(compilerSettings.getCopyJsLibraryFiles());
|
copyRuntimeFilesCheckBox.setSelected(compilerSettings.getCopyJsLibraryFiles());
|
||||||
@@ -729,11 +723,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
this.compilerSettings = compilerSettings;
|
this.compilerSettings = compilerSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private KotlinScriptingSettings getScriptingSettings() {
|
|
||||||
return KotlinScriptingSettings.Companion.getInstance(project);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createUIComponents() {
|
private void createUIComponents() {
|
||||||
// Workaround: ThreeStateCheckBox doesn't send suitable notification on state change
|
// Workaround: ThreeStateCheckBox doesn't send suitable notification on state change
|
||||||
// TODO: replace with PropertyChangerListener after fix is available in IDEA
|
// TODO: replace with PropertyChangerListener after fix is available in IDEA
|
||||||
|
|||||||
+21
-17
@@ -8,7 +8,7 @@
|
|||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<grid id="6126a" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="6126a" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
@@ -18,41 +18,45 @@
|
|||||||
<children>
|
<children>
|
||||||
<vspacer id="7a19">
|
<vspacer id="7a19">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<grid id="b9ce9" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="b9ce9" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<clientProperties>
|
<clientProperties>
|
||||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
|
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
|
||||||
</clientProperties>
|
</clientProperties>
|
||||||
<border type="etched" title="Script definitions" noi18n="true"/>
|
<border type="etched" title="Manage script definitions" noi18n="true"/>
|
||||||
<children>
|
<children>
|
||||||
<grid id="5ec35" binding="panelScriptDefinitionsChooser" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="5ec35" binding="panelScriptDefinitionsChooser" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children/>
|
<children>
|
||||||
|
<vspacer id="a58a1">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
<component id="9988" class="com.intellij.ui.components.JBLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<componentStyle value="SMALL"/>
|
|
||||||
<fontColor value="BRIGHTER"/>
|
|
||||||
<text value="Manage script definitions" noi18n="true"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
|
<component id="cc285" class="javax.swing.JCheckBox" binding="scriptDependenciesAutoReload">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Reload script dependencies on file change"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
+11
-2
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.Nls;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager;
|
import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager;
|
||||||
|
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -21,13 +22,16 @@ import java.awt.*;
|
|||||||
public class KotlinScriptingSettingsConfigurable implements SearchableConfigurable, Configurable.NoScroll {
|
public class KotlinScriptingSettingsConfigurable implements SearchableConfigurable, Configurable.NoScroll {
|
||||||
private JPanel root;
|
private JPanel root;
|
||||||
private JPanel panelScriptDefinitionsChooser;
|
private JPanel panelScriptDefinitionsChooser;
|
||||||
|
private JCheckBox scriptDependenciesAutoReload;
|
||||||
|
|
||||||
private KotlinScriptDefinitionsModel model;
|
private KotlinScriptDefinitionsModel model;
|
||||||
|
|
||||||
private final ScriptDefinitionsManager manager;
|
private final ScriptDefinitionsManager manager;
|
||||||
|
private final KotlinScriptingSettings settings;
|
||||||
|
|
||||||
public KotlinScriptingSettingsConfigurable(Project project) {
|
public KotlinScriptingSettingsConfigurable(Project project) {
|
||||||
manager = ScriptDefinitionsManager.Companion.getInstance(project);
|
manager = ScriptDefinitionsManager.Companion.getInstance(project);
|
||||||
|
settings = KotlinScriptingSettings.Companion.getInstance(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -48,20 +52,25 @@ public class KotlinScriptingSettingsConfigurable implements SearchableConfigurab
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isModified() {
|
public boolean isModified() {
|
||||||
return !model.getItems().equals(manager.getAllDefinitions());
|
return isModified(scriptDependenciesAutoReload, settings.isAutoReloadEnabled())
|
||||||
|
|| !model.getItems().equals(manager.getAllDefinitions());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
|
settings.setAutoReloadEnabled(scriptDependenciesAutoReload.isSelected());
|
||||||
|
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
scriptDependenciesAutoReload.setSelected(settings.isAutoReloadEnabled());
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nls
|
@Nls
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
|
|||||||
Reference in New Issue
Block a user