Skip to content

Commit

Permalink
Merge pull request #3 from godfather1103/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
godfather1103 authored Aug 21, 2023
2 parents bd07ebb + 6df0ac7 commit 6f203e9
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 14 deletions.
2 changes: 1 addition & 1 deletion idea-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugin_name=Alibaba Java Coding Guidelines(Fix Some Bug)
gradle_jetbrains_version=1.13.3
systemProp.file.encoding=UTF-8
# \u63D2\u4EF6\u7248\u672C
plugin_version=1.1
plugin_version=1.2
# \u4F7F\u7528\u7684p3c-pmd\u7248\u672C
p3c_pmd_version=2.1.1
publishUsername=Jack Chu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,31 @@ import com.alibaba.p3c.idea.config.P3cConfig
import com.alibaba.p3c.idea.i18n.P3cBundle
import com.alibaba.smartfox.idea.common.util.BalloonNotifications
import com.alibaba.smartfox.idea.common.util.getService
import com.intellij.notification.NotificationListener
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.ide.actions.RestartIdeAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ex.ApplicationManagerEx
import com.intellij.openapi.project.DumbAware

/**
*
*
* @author caikang
* @date 2017/06/20
*/
class SwitchLanguageAction : AnAction(), DumbAware {
class SwitchLanguageAction : RestartIdeAction() {
private val p3cConfig = P3cConfig::class.java.getService()

private val textKey = "com.alibaba.p3c.action.switch_language.text"

override fun actionPerformed(e: AnActionEvent) {
p3cConfig.toggleLanguage()
BalloonNotifications.showSuccessNotification(P3cBundle.getMessage("$textKey.success"), e.project,
NotificationListener { notification, _ ->
notification.expire()
ApplicationManagerEx.getApplicationEx().restart(false)
}, sticky = true)
BalloonNotifications.showSuccessNotification(
P3cBundle.getMessage("$textKey.success"), e.project,
{ notification, _ ->
notification.expire()
ApplicationManagerEx.getApplicationEx().restart(false)
}, sticky = true
)
super.actionPerformed(e)
}

override fun update(e: AnActionEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import icons.P3cIcons
4
*/
class ToggleProjectInspectionAction : AnAction() {
val textKey = "com.alibaba.p3c.idea.action.ToggleProjectInspectionAction.text"

private val textKey = "com.alibaba.p3c.idea.action.ToggleProjectInspectionAction.text"

override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil
import java.util.Locale
import java.util.*

/**
*
*
* @author caikang
* @date 2017/06/19
*/
@State(name = "P3cConfig", storages = [Storage(file = "smartfox/p3c.xml")])
@State(name = "P3cConfig", storages = [Storage("smartfox_p3c.xml")])
class P3cConfig : PersistentStateComponent<P3cConfig> {
var astCacheTime = 1000L
var astCacheEnable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.alibaba.p3c.idea.config

import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil

/**
Expand All @@ -25,7 +26,7 @@ import com.intellij.util.xmlb.XmlSerializerUtil
* @author caikang
* @date 2017/03/01
*/
@State(name = "SmartFoxProjectConfig", storages = [com.intellij.openapi.components.Storage(file = "smartfox_info.xml")])
@State(name = "SmartFoxProjectConfig", storages = [Storage("smartfox_info.xml")])
class SmartFoxProjectConfig : PersistentStateComponent<SmartFoxProjectConfig> {
var projectInspectionClosed = false

Expand Down
5 changes: 5 additions & 0 deletions idea-plugin/p3c-idea/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ tasks {
changeNotes.set(
"""
<ul>
1.2
<li>fix(存储): 优化数据存储,修复mac无法切换中英文的bug</li>
<li>feat(切换语言): 优化切换语言的操作,增加重启的窗口</li>
</ul>
<ul>
1.1
<li>优化对于2023.2的API调度</li>
<li>优化对应分析结果信息分组</li>
Expand Down
36 changes: 36 additions & 0 deletions idea-plugin/p3c-idea/src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f203e9

Please sign in to comment.