ToolWindow not showing up

I am trying to build a very simple plugin that has a tool window, but it never shows up in the UI, and there are no errors in the log.  Any help would be appreciated.
My plugin.xml:

<idea-plugin version="2">
  <id>com.yourcompany.unique.plugin.id</id>
  <name>Plugin display name here</name>
  <version>1.0</version>
  <vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>
  <description><![CDATA[
      Enter short description for your plugin here.<br>
      <em>most HTML tags may be used</em>
    ]]></description>
  <change-notes><![CDATA[
      Add change notes here.<br>
      <em>most HTML tags may be used</em>
    ]]>
  </change-notes>
  <idea-version since-build="131"/>
  <depends>com.intellij.modules.lang</depends>
  <extensions defaultExtensionNs="com.intellij">
    <toolWindow id="Sample" anchor="bottom" factoryClass="MyToolWindowFactory" icon="/general/add.png"/>
  </extensions>
  <application-components>
  </application-components>
  <project-components>
  </project-components>
  <actions>
  </actions>
</idea-plugin>
 
 
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.content.ContentFactory
import org.jetbrains.annotations.NotNull
class
MyToolWindowFactory implements ToolWindowFactory {

    MyToolWindowFactory() {
        println "here"
    
}

    @Override
    void
createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        println 'create'
        def
panel = new ToolPanel()
        toolWindow.contentManager.addContent(ContentFactory.SERVICE.getInstance().createContent(panel, "a", false))
    }
}
 
 
/**
* Created by astortz on 2/5/15.
*/
import com.intellij.openapi.ui.SimpleToolWindowPanel

import javax.swing.JTextArea

class ToolPanel extends SimpleToolWindowPanel {
    ToolPanel() {
        super(true, true)
        def information = new JTextArea();
        information.setText("hello world")
        setContent(information)
    }
}
3 comments
Comment actions Permalink

How exactly do you run your plugin? Do you see it in the list of installed plugins in Settings | Plugins?

0
Comment actions Permalink

I was using the Run/Debug menu.  When I went to see if it was listed in the installed plugins, I noticed a menu that I had removed from the plugin was still present.  This lead me to believe that the plugin.xml was not being evaluated on each run.  So I uninstalled the plugin and re-ran/debugged the plugin and my menu disappeared and my tool window showed up!

So, thanks for pointing me in a direction that helped me spot the issue.

Is there another way to reload/reevaluate the plugin.xml when it has changed?

1
Comment actions Permalink

The plugin is reevaluated on each run. Possibly the problem was that you ended up with multiple installations of your plugin with the same ID in different directories. Uninstalling the plugin removed the outdated extra copy.

0

Please sign in to leave a comment.