Skip to content

Commit d518564

Browse files
committed
feat: Remove exist ui class and change to CodeXPDashboard form
1 parent 09fc62c commit d518564

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package com.github.ilovegamecoding.intellijcodexp.toolWindow
22

3-
import com.github.ilovegamecoding.intellijcodexp.services.CodeXPService
4-
import com.intellij.openapi.components.service
3+
import com.github.ilovegamecoding.intellijcodexp.form.CodeXPDashboard
54
import com.intellij.openapi.diagnostic.thisLogger
65
import com.intellij.openapi.project.Project
76
import com.intellij.openapi.wm.ToolWindow
87
import com.intellij.openapi.wm.ToolWindowFactory
9-
import com.intellij.ui.components.JBPanel
108
import com.intellij.ui.content.ContentFactory
119

1210

1311
class CodeXPToolWindowFactory : ToolWindowFactory {
12+
private var codeXPDashboard = CodeXPDashboard()
1413

1514
init {
1615
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 {
1918
private val contentFactory = ContentFactory.SERVICE.getInstance()
2019

2120
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)
2422
toolWindow.contentManager.addContent(content)
2523
}
2624

2725
override fun shouldBeAvailable(project: Project) = true
2826

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"
3929
}
4030
}

0 commit comments

Comments
 (0)