Skip to content

Instantly share code, notes, and snippets.

@itsakt
Last active February 4, 2017 14:06
Show Gist options
  • Save itsakt/86ada76e8cb40551ad2d6c221757a531 to your computer and use it in GitHub Desktop.
Save itsakt/86ada76e8cb40551ad2d6c221757a531 to your computer and use it in GitHub Desktop.
package com.akt.awesomeplugin;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
public class ToolWindowHandler implements ToolWindowFactory {
private JPanel toolWindowContent;
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(toolWindowContent, "", false);
toolWindow.getContentManager().addContent(content);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment