Minor: reformat
This commit is contained in:
+18
-18
@@ -75,34 +75,34 @@ object ScratchToolWindow {
|
|||||||
if (ApplicationManager.getApplication().isUnitTestMode) return
|
if (ApplicationManager.getApplication().isUnitTestMode) return
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
ApplicationManager.getApplication().invokeLater {
|
||||||
val toolWindow = getToolWindow(project) ?: createToolWindow(project)
|
val toolWindow = getToolWindow(project) ?: createToolWindow(project)
|
||||||
val contents = toolWindow.contentManager.contents
|
val contents = toolWindow.contentManager.contents
|
||||||
for (content in contents) {
|
for (content in contents) {
|
||||||
val component = content.component
|
val component = content.component
|
||||||
if (component is ConsoleViewImpl) {
|
if (component is ConsoleViewImpl) {
|
||||||
component.print("$message\n", type)
|
component.print("$message\n", type)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
toolWindow.setAvailable(true, null)
|
|
||||||
toolWindow.show(null)
|
|
||||||
}
|
}
|
||||||
|
toolWindow.setAvailable(true, null)
|
||||||
|
toolWindow.show(null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearToolWindow(project: Project) {
|
fun clearToolWindow(project: Project) {
|
||||||
if (ApplicationManager.getApplication().isUnitTestMode) return
|
if (ApplicationManager.getApplication().isUnitTestMode) return
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
ApplicationManager.getApplication().invokeLater {
|
||||||
val toolWindow = getToolWindow(project) ?: return@invokeLater
|
val toolWindow = getToolWindow(project) ?: return@invokeLater
|
||||||
val contents = toolWindow.contentManager.contents
|
val contents = toolWindow.contentManager.contents
|
||||||
for (content in contents) {
|
for (content in contents) {
|
||||||
val component = content.component
|
val component = content.component
|
||||||
if (component is ConsoleViewImpl) {
|
if (component is ConsoleViewImpl) {
|
||||||
component.clear()
|
component.clear()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
toolWindow.setAvailable(false, null)
|
|
||||||
toolWindow.hide(null)
|
|
||||||
}
|
}
|
||||||
|
toolWindow.setAvailable(false, null)
|
||||||
|
toolWindow.hide(null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getToolWindow(project: Project): ToolWindow? {
|
private fun getToolWindow(project: Project): ToolWindow? {
|
||||||
|
|||||||
Reference in New Issue
Block a user