Skip to content

Commit 34da1af

Browse files
committed
🌈 style(name): rename file
1 parent 4b5b357 commit 34da1af

File tree

9 files changed

+71
-53
lines changed

9 files changed

+71
-53
lines changed

‎src/main/kotlin/irony/pycharm/qsseditor/ApplyAction.kt‎

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package irony.pycharm.qsseditor
2+
3+
import com.intellij.openapi.actionSystem.AnAction
4+
import com.intellij.openapi.actionSystem.AnActionEvent
5+
import com.intellij.openapi.actionSystem.CommonDataKeys
6+
import com.intellij.openapi.editor.Editor
7+
import com.intellij.openapi.project.Project
8+
9+
10+
class QSSAction : AnAction(QSSBundle.message("action.apply.title", "Apply Style")) {
11+
12+
override fun update(e: AnActionEvent) {
13+
e.presentation.isEnabledAndVisible = false
14+
val project: Project = e.project ?: return
15+
val editor: Editor = e.getData(CommonDataKeys.EDITOR) ?: return
16+
}
17+
18+
override fun actionPerformed(e: AnActionEvent) {
19+
20+
}
21+
}

src/main/kotlin/irony/pycharm/qsseditor/LangBundle.kt renamed to src/main/kotlin/irony/pycharm/qsseditor/QSSBundle.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import org.jetbrains.annotations.Nullable
77
import org.jetbrains.annotations.PropertyKey
88
import java.util.function.Supplier
99

10-
object LangBundle {
11-
private const val BUNDLE: @NonNls String = "messages.LangBundle"
12-
private val INSTANCE = DynamicBundle(LangBundle::class.java, BUNDLE)
10+
object QSSBundle {
11+
private const val BUNDLE: @NonNls String = "messages.QSSBundle"
12+
private val INSTANCE = DynamicBundle(QSSBundle::class.java, BUNDLE)
1313

1414
fun message(
1515
key: @PropertyKey(resourceBundle = BUNDLE) String,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package irony.pycharm.qsseditor
2+
3+
import com.intellij.openapi.options.BoundSearchableConfigurable
4+
import com.intellij.openapi.options.Configurable.NoScroll
5+
import com.intellij.openapi.ui.DialogPanel
6+
import com.intellij.ui.dsl.builder.bindIntText
7+
import com.intellij.ui.dsl.builder.bindSelected
8+
import com.intellij.ui.dsl.builder.bindText
9+
import com.intellij.ui.dsl.builder.panel
10+
11+
class QSSConfigurable : BoundSearchableConfigurable(
12+
"QSS Editor",
13+
QSSBundle.message("setting.topic.title", "QSS Editor Configurable")
14+
), NoScroll {
15+
16+
override fun createPanel() : DialogPanel {
17+
return panel {
18+
row(QSSBundle.message("setting.host.title", "Host")) {
19+
textField().bindText(QSSService.instance::host)
20+
}
21+
row(QSSBundle.message("setting.port.title", "Port")) {
22+
textField().bindIntText(QSSService.instance::port)
23+
}
24+
row(QSSBundle.message("setting.auto.title","Auto Apply")) {
25+
checkBox("").bindSelected(QSSService.instance::auto)
26+
}
27+
}
28+
}
29+
}

src/main/kotlin/irony/pycharm/qsseditor/SettingsState.kt renamed to src/main/kotlin/irony/pycharm/qsseditor/QSSService.kt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,33 @@ import com.intellij.openapi.components.PersistentStateComponent
55
import com.intellij.openapi.components.State
66
import com.intellij.openapi.components.Storage
77
import com.intellij.util.xmlb.XmlSerializerUtil
8+
import kotlinx.coroutines.CoroutineScope
9+
import kotlinx.coroutines.launch
810

9-
@State(name = "irony.pycharm.qsseditor.SettingsState", storages = [Storage("QSSEditorSetting.xml")])
10-
internal class SettingsState : PersistentStateComponent<SettingsState> {
11+
@State(name = "irony.pycharm.qsseditor.QSSService", storages = [Storage("QSSEditorSetting.xml")])
12+
internal class QSSService(private val cs: CoroutineScope) : PersistentStateComponent<QSSService> {
13+
private var inited: Boolean = false;
1114
var auto: Boolean = true
1215
var host: String = "localhost"
1316
var port: Int = 61052
1417

15-
override fun getState(): SettingsState {
18+
override fun getState(): QSSService {
1619
return this
1720
}
1821

19-
override fun loadState(state: SettingsState) {
22+
override fun loadState(state: QSSService) {
2023
XmlSerializerUtil.copyBean(state, this)
2124
}
2225

2326
companion object {
24-
val instance: SettingsState
27+
val instance: QSSService
2528
get() = ApplicationManager.getApplication().getService(
26-
SettingsState::class.java
29+
QSSService::class.java
2730
)
2831
}
32+
33+
fun initialize() {
34+
if (!inited) {
35+
}
36+
}
2937
}

‎src/main/kotlin/irony/pycharm/qsseditor/SettingsConfigurable.kt‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎src/main/resources/META-INF/plugin.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-extension-points.html -->
2727
<extensions defaultExtensionNs="com.intellij">
2828
<applicationService
29-
serviceImplementation="irony.pycharm.qsseditor.SettingsState"/>
29+
serviceImplementation="irony.pycharm.qsseditor.QSSService"/>
3030
<applicationConfigurable
3131
parentId="language"
3232
groupWeight="-500"
33-
instance="irony.pycharm.qsseditor.SettingsConfigurable"
34-
id="irony.pycharm.qsseditor.SettingsConfigurable"
33+
instance="irony.pycharm.qsseditor.QSSConfigurable"
34+
id="irony.pycharm.qsseditor.QSSConfigurable"
3535
displayName="QSS"/>
3636
</extensions>
3737
<actions>
38-
<action id="ApplyAction" class="irony.pycharm.qsseditor.ApplyAction">
38+
<action id="ApplyAction" class="irony.pycharm.qsseditor.QSSAction">
3939
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
4040
</action>
4141
</actions>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)