Skip to content

Commit

Permalink
Rename some generated code and delete not needed code
Browse files Browse the repository at this point in the history
  • Loading branch information
fmueller committed Apr 27, 2024
1 parent 51c6c84 commit 59d7343
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
package com.github.fmueller.jarvis.toolWindow

import com.github.fmueller.jarvis.MyBundle
import com.github.fmueller.jarvis.services.MyProjectService
import com.github.fmueller.jarvis.services.OllamaService
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.components.JBLabel
import com.intellij.ui.components.JBPanel
import com.intellij.ui.content.ContentFactory
import com.github.fmueller.jarvis.MyBundle
import com.github.fmueller.jarvis.services.MyProjectService
import com.github.fmueller.jarvis.services.OllamaService
import javax.swing.JButton

class MyToolWindowFactory : ToolWindowFactory {

init {
thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
}
class ConversationWindowFactory : ToolWindowFactory {

override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val myToolWindow = MyToolWindow(toolWindow)
val content = ContentFactory.getInstance().createContent(myToolWindow.getContent(), null, false)
val conversationWindow = ConversationWindow(toolWindow)
val content = ContentFactory.getInstance().createContent(conversationWindow.getContent(), null, false)
toolWindow.contentManager.addContent(content)
}

override fun shouldBeAvailable(project: Project) = true

class MyToolWindow(toolWindow: ToolWindow) {
class ConversationWindow(toolWindow: ToolWindow) {

private val ollama = toolWindow.project.service<OllamaService>()
private val service = toolWindow.project.service<MyProjectService>()
Expand Down
10 changes: 3 additions & 7 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<!-- Plugin Configuration File. Read more: https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html -->
<idea-plugin>
<id>com.github.fmueller.jarvis</id>
<name>jarvis</name>
<vendor>fmueller</vendor>
<name>Jarvis</name>
<vendor>Felix Müller</vendor>

<depends>com.intellij.modules.platform</depends>

<resource-bundle>messages.MyBundle</resource-bundle>

<extensions defaultExtensionNs="com.intellij">
<toolWindow factoryClass="com.github.fmueller.jarvis.toolWindow.MyToolWindowFactory" id="MyToolWindow"/>
<toolWindow factoryClass="com.github.fmueller.jarvis.toolWindow.ConversationWindowFactory" id="JarvisConversationWindow"/>
</extensions>

<applicationListeners>
<listener class="com.github.fmueller.jarvis.listeners.MyApplicationActivationListener" topic="com.intellij.openapi.application.ApplicationActivationListener"/>
</applicationListeners>
</idea-plugin>

0 comments on commit 59d7343

Please sign in to comment.