Inline checkbox in BytecodeToolWindow

This commit is contained in:
Mikhael Bogdanov
2014-03-13 12:46:30 +04:00
parent 53e41e94d9
commit f475f3ba31
2 changed files with 9 additions and 3 deletions
@@ -32,8 +32,6 @@ public class InlineUtil {
public static boolean DEFAULT_INLINE_FLAG_FOR_TEST = true;
public static boolean DEFAULT_INLINE_FLAG_FOR_TOOLWINDOW = true;
public static boolean DEFAULT_INLINE_FLAG_FOR_STUB = false; /*always false*/
public static boolean hasNoinlineAnnotation(@NotNull CallableDescriptor valueParameterDescriptor) {
@@ -112,7 +112,7 @@ public class BytecodeToolWindow extends JPanel implements Disposable {
state = new GenerationState(jetFile.getProject(), ClassBuilderFactories.TEST, Progress.DEAF, exhaust.getBindingContext(),
Collections.singletonList(jetFile), true, true,
GenerationState.GenerateClassFilter.GENERATE_ALL,
InlineUtil.DEFAULT_INLINE_FLAG_FOR_TOOLWINDOW /*TODO add checkbox or extract it from option*/);
enableInline.isSelected());
KotlinCodegenFacade.compileCorrectFiles(state, CompilationErrorHandler.THROW_EXCEPTION);
}
catch (ProcessCanceledException e) {
@@ -176,6 +176,7 @@ public class BytecodeToolWindow extends JPanel implements Disposable {
private final Editor myEditor;
private final Project myProject;
private final ToolWindow toolWindow;
private final JCheckBox enableInline;
public BytecodeToolWindow(Project project, ToolWindow toolWindow) {
super(new BorderLayout());
@@ -186,6 +187,13 @@ public class BytecodeToolWindow extends JPanel implements Disposable {
EditorFactory.getInstance().createDocument(""), project, JavaFileType.INSTANCE, true);
add(myEditor.getComponent());
JPanel optionPanel = new JPanel(new BorderLayout());
add(optionPanel, BorderLayout.NORTH);
/*TODO: try to extract default parameter from compiler options*/
enableInline = new JCheckBox("Enable inline");
optionPanel.add(enableInline, BorderLayout.WEST);
new InfinitePeriodicalTask(UPDATE_DELAY, Alarm.ThreadToUse.SWING_THREAD, this, new Computable<LongRunningReadTask>() {
@Override
public LongRunningReadTask compute() {