An option to enable assertions in the Bytecode toolwindow

This commit is contained in:
Andrey Breslav
2014-10-09 19:45:00 +04:00
parent 1214bef3e8
commit 21d31a1a4f
@@ -113,7 +113,7 @@ public class KotlinBytecodeToolWindow extends JPanel implements Disposable {
} }
state = new GenerationState(jetFile.getProject(), ClassBuilderFactories.TEST, Progress.DEAF, state = new GenerationState(jetFile.getProject(), ClassBuilderFactories.TEST, Progress.DEAF,
exhaust.getModuleDescriptor(), exhaust.getBindingContext(), exhaust.getModuleDescriptor(), exhaust.getBindingContext(),
Collections.singletonList(jetFile), true, true, Collections.singletonList(jetFile), !enableAssertions.isSelected(), !enableAssertions.isSelected(),
GenerationState.GenerateClassFilter.GENERATE_ALL, GenerationState.GenerateClassFilter.GENERATE_ALL,
!enableInline.isSelected(), !enableOptimization.isSelected(), null, null, !enableInline.isSelected(), !enableOptimization.isSelected(), null, null,
DiagnosticSink.DO_NOTHING, null); DiagnosticSink.DO_NOTHING, null);
@@ -182,6 +182,7 @@ public class KotlinBytecodeToolWindow extends JPanel implements Disposable {
private final ToolWindow toolWindow; private final ToolWindow toolWindow;
private final JCheckBox enableInline; private final JCheckBox enableInline;
private final JCheckBox enableOptimization; private final JCheckBox enableOptimization;
private final JCheckBox enableAssertions;
public KotlinBytecodeToolWindow(Project project, ToolWindow toolWindow) { public KotlinBytecodeToolWindow(Project project, ToolWindow toolWindow) {
super(new BorderLayout()); super(new BorderLayout());
@@ -192,14 +193,16 @@ public class KotlinBytecodeToolWindow extends JPanel implements Disposable {
EditorFactory.getInstance().createDocument(""), project, JavaFileType.INSTANCE, true); EditorFactory.getInstance().createDocument(""), project, JavaFileType.INSTANCE, true);
add(myEditor.getComponent()); add(myEditor.getComponent());
JPanel optionPanel = new JPanel(new BorderLayout()); JPanel optionPanel = new JPanel(new FlowLayout());
add(optionPanel, BorderLayout.NORTH); add(optionPanel, BorderLayout.NORTH);
/*TODO: try to extract default parameter from compiler options*/ /*TODO: try to extract default parameter from compiler options*/
enableInline = new JCheckBox("Enable inline", false); enableInline = new JCheckBox("Enable inline", false);
enableOptimization = new JCheckBox("Enable optimization", true); enableOptimization = new JCheckBox("Enable optimization", true);
optionPanel.add(enableInline, BorderLayout.WEST); enableAssertions = new JCheckBox("Enable assertions", true);
optionPanel.add(enableOptimization, BorderLayout.CENTER); optionPanel.add(enableInline);
optionPanel.add(enableOptimization);
optionPanel.add(enableAssertions);
new InfinitePeriodicalTask(UPDATE_DELAY, Alarm.ThreadToUse.SWING_THREAD, this, new Computable<LongRunningReadTask>() { new InfinitePeriodicalTask(UPDATE_DELAY, Alarm.ThreadToUse.SWING_THREAD, this, new Computable<LongRunningReadTask>() {
@Override @Override