Skip to content

Commit 08353c9

Browse files
committed
refactor(planner): move PlannerView interface outside class
将 PlannerView 接口和枚举从 AutoDevPlannerToolWindow 类中移出,提升代码组织性。
1 parent e582a50 commit 08353c9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/planner/AutoDevPlannerToolWindow.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
2929
var planLangSketch: PlanLangSketch =
3030
PlanLangSketch(project, content, MarkdownPlanParser.parse(content).toMutableList(), true)
3131

32-
private var markdownEditor: MarkdownLanguageField? = null
3332
private val contentPanel = JBUI.Panels.simplePanel()
3433

3534
private var currentView: PlannerView? = null
@@ -116,16 +115,7 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
116115
}
117116

118117
override fun dispose() {
119-
markdownEditor = null
120-
}
121-
122-
interface PlannerView {
123-
val viewType: PlannerViewType
124-
fun initialize(window: AutoDevPlannerToolWindow)
125-
}
126118

127-
enum class PlannerViewType {
128-
PLAN, EDITOR, ISSUE_INPUT, LOADING
129119
}
130120

131121
inner class PlanSketchView : PlannerView {
@@ -237,3 +227,12 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
237227
}
238228
}
239229
}
230+
231+
interface PlannerView {
232+
val viewType: PlannerViewType
233+
fun initialize(window: AutoDevPlannerToolWindow)
234+
}
235+
236+
enum class PlannerViewType {
237+
PLAN, EDITOR, ISSUE_INPUT, LOADING
238+
}

0 commit comments

Comments
 (0)