Inline checkbox in BytecodeToolWindow
This commit is contained in:
@@ -32,8 +32,6 @@ public class InlineUtil {
|
|||||||
|
|
||||||
public static boolean DEFAULT_INLINE_FLAG_FOR_TEST = true;
|
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 DEFAULT_INLINE_FLAG_FOR_STUB = false; /*always false*/
|
||||||
|
|
||||||
public static boolean hasNoinlineAnnotation(@NotNull CallableDescriptor valueParameterDescriptor) {
|
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(),
|
state = new GenerationState(jetFile.getProject(), ClassBuilderFactories.TEST, Progress.DEAF, exhaust.getBindingContext(),
|
||||||
Collections.singletonList(jetFile), true, true,
|
Collections.singletonList(jetFile), true, true,
|
||||||
GenerationState.GenerateClassFilter.GENERATE_ALL,
|
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);
|
KotlinCodegenFacade.compileCorrectFiles(state, CompilationErrorHandler.THROW_EXCEPTION);
|
||||||
}
|
}
|
||||||
catch (ProcessCanceledException e) {
|
catch (ProcessCanceledException e) {
|
||||||
@@ -176,6 +176,7 @@ public class BytecodeToolWindow extends JPanel implements Disposable {
|
|||||||
private final Editor myEditor;
|
private final Editor myEditor;
|
||||||
private final Project myProject;
|
private final Project myProject;
|
||||||
private final ToolWindow toolWindow;
|
private final ToolWindow toolWindow;
|
||||||
|
private final JCheckBox enableInline;
|
||||||
|
|
||||||
public BytecodeToolWindow(Project project, ToolWindow toolWindow) {
|
public BytecodeToolWindow(Project project, ToolWindow toolWindow) {
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
@@ -186,6 +187,13 @@ public class BytecodeToolWindow 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());
|
||||||
|
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>() {
|
new InfinitePeriodicalTask(UPDATE_DELAY, Alarm.ThreadToUse.SWING_THREAD, this, new Computable<LongRunningReadTask>() {
|
||||||
@Override
|
@Override
|
||||||
public LongRunningReadTask compute() {
|
public LongRunningReadTask compute() {
|
||||||
|
|||||||
Reference in New Issue
Block a user