Skip to content

Instantly share code, notes, and snippets.

@rahul-lohra
Created July 18, 2020 13:58
Show Gist options
  • Save rahul-lohra/1ebf759f26202a86e72481746a349836 to your computer and use it in GitHub Desktop.
Save rahul-lohra/1ebf759f26202a86e72481746a349836 to your computer and use it in GitHub Desktop.
MyToolWindow code
package com.rahul.gqlformat
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.content.ContentFactory
class MyToolWindow : ToolWindowFactory {
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val view = GqlView(project)
val contentFactory = ContentFactory.SERVICE.getInstance()
val content = contentFactory.createContent(view.panel, "", false)
toolWindow.contentManager.addContent(content)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment