<commit_before>package com.android.tools.idea.diagnostics

import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.components.JBPanel
import com.intellij.ui.components.JBTextField
import java.awt.Dimension
import javax.swing.BoxLayout

// TODO: Reconcile the fact that DiagnosticsController is application-level, whereas tool windows are project-level.

// Things to improve:
// - Reconsider whether this needs to be a tool window. It could instead be an internal action, for example.
// - Add a tool window icon.

class DiagnosticsWindowFactory : ToolWindowFactory, DumbAware {
    override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
        val contentManager = toolWindow.contentManager
        contentManager.removeAllContents(true)
        val panel = DiagnosticsWindow()
        val content = contentManager.factory.createContent(panel, null, false)
        contentManager.addContent(content)
    }
}

class DiagnosticsWindow : JBPanel<DiagnosticsWindow>() {
    private val controller = DiagnosticsController(this)
    val listView = CallTableView(CallTableModel())

    init {
        layout = BoxLayout(this, BoxLayout.Y_AXIS)

        // Command line.
        val commandLine = JBTextField().apply {
            maximumSize = Dimension(Integer.MAX_VALUE, minimumSize.height)
            addActionListener { e ->
                text = ""
                controller.handleRawCommandFromEdt(e.actionCommand)
            }
        }
        add(commandLine)

        // Call list.
        add(listView)
    }
}<commit_msg>Add method list view to scroll pane<commit_after>package com.android.tools.idea.diagnostics

import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.components.JBPanel
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.components.JBTextField
import java.awt.Dimension
import javax.swing.BoxLayout

// TODO: Reconcile the fact that DiagnosticsController is application-level, whereas tool windows are project-level.

// Things to improve:
// - Reconsider whether this needs to be a tool window. It could instead be an internal action, for example.
// - Add a tool window icon.

class DiagnosticsWindowFactory : ToolWindowFactory, DumbAware {
    override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
        val contentManager = toolWindow.contentManager
        contentManager.removeAllContents(true)
        val panel = DiagnosticsWindow()
        val content = contentManager.factory.createContent(panel, null, false)
        contentManager.addContent(content)
    }
}

class DiagnosticsWindow : JBPanel<DiagnosticsWindow>() {
    private val controller = DiagnosticsController(this)
    val listView = CallTableView(CallTableModel())

    init {
        layout = BoxLayout(this, BoxLayout.Y_AXIS)

        // Command line.
        val commandLine = JBTextField().apply {
            maximumSize = Dimension(Integer.MAX_VALUE, minimumSize.height)
            addActionListener { e ->
                text = ""
                controller.handleRawCommandFromEdt(e.actionCommand)
            }
        }
        add(commandLine)

        // Call list.
        add(JBScrollPane(listView))
    }
}
{'fraction_non_alphanumeric': 0.08125894134477825, 'fraction_numerical': 0.0, 'mean_word_length': 3.2582216808769795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4154958', 'n_tokens_mistral': 953, 'n_tokens_neox': 942, 'n_words': 228}