1
1
package com.github.ilovegamecoding.intellijcodexp.toolWindow
2
2
3
- import com.github.ilovegamecoding.intellijcodexp.services.CodeXPService
4
- import com.intellij.openapi.components.service
3
+ import com.github.ilovegamecoding.intellijcodexp.form.CodeXPDashboard
5
4
import com.intellij.openapi.diagnostic.thisLogger
6
5
import com.intellij.openapi.project.Project
7
6
import com.intellij.openapi.wm.ToolWindow
8
7
import com.intellij.openapi.wm.ToolWindowFactory
9
- import com.intellij.ui.components.JBPanel
10
8
import com.intellij.ui.content.ContentFactory
11
9
12
10
13
11
class CodeXPToolWindowFactory : ToolWindowFactory {
12
+ private var codeXPDashboard = CodeXPDashboard ()
14
13
15
14
init {
16
15
thisLogger().warn(" Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`." )
@@ -19,22 +18,13 @@ class CodeXPToolWindowFactory : ToolWindowFactory {
19
18
private val contentFactory = ContentFactory .SERVICE .getInstance()
20
19
21
20
override fun createToolWindowContent (project : Project , toolWindow : ToolWindow ) {
22
- val codeXPDashboard = CodeXPDashboard ()
23
- val content = contentFactory.createContent(codeXPDashboard.getContent(), null , false )
21
+ val content = contentFactory.createContent(codeXPDashboard.pMain, null , false )
24
22
toolWindow.contentManager.addContent(content)
25
23
}
26
24
27
25
override fun shouldBeAvailable (project : Project ) = true
28
26
29
- class CodeXPDashboard () {
30
- private val service = service<CodeXPService >()
31
-
32
- init {
33
-
34
- }
35
-
36
- fun getContent () = JBPanel <JBPanel <* >>().apply {
37
- // TODO: Implement the UI for this feature
38
- }
27
+ fun setXP (xp : Int ) {
28
+ codeXPDashboard.lblLevel.text = " $xp "
39
29
}
40
30
}
0 commit comments