-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from mdddj/3.3.2.as
3.3.2.as
- Loading branch information
Showing
39 changed files
with
697 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"configurations": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"backend.maxHeapSizeMb": 1500 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 41 additions & 41 deletions
82
src/main/kotlin/shop/itbug/fluttercheckversionx/actions/DartAiSwitchAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package shop.itbug.fluttercheckversionx.actions | ||
|
||
import com.intellij.openapi.actionSystem.ActionManager | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.fileEditor.FileEditorManager | ||
import com.intellij.util.indexing.FileBasedIndex | ||
import shop.itbug.fluttercheckversionx.common.MyToggleAction | ||
import shop.itbug.fluttercheckversionx.inlay.DartAISetting | ||
|
||
/** | ||
* dart 文件的ai设定 | ||
*/ | ||
class DartAiSwitchAction : MyToggleAction({ "Display AI operations" }) { | ||
|
||
val setting = DartAISetting.getInstance() | ||
|
||
override fun isSelected(e: AnActionEvent): Boolean { | ||
return setting.state.showInEditor | ||
} | ||
|
||
override fun setSelected(e: AnActionEvent, state: Boolean) { | ||
println("进来了...") | ||
setting.loadState(setting.state.copy(showInEditor = state)) | ||
|
||
val file = FileEditorManager.getInstance(e.project!!).selectedEditor?.file!! | ||
|
||
FileBasedIndex.getInstance().requestReindex(file) | ||
} | ||
|
||
|
||
override fun update(e: AnActionEvent) { | ||
val file = FileEditorManager.getInstance(e.project!!).selectedEditor?.file | ||
e.presentation.isEnabled = e.project!=null && file != null | ||
super.update(e) | ||
} | ||
|
||
companion object { | ||
fun getInstance(): AnAction = ActionManager.getInstance().getAction("DartAiSwitchAction")!! | ||
} | ||
} | ||
//package shop.itbug.fluttercheckversionx.actions | ||
// | ||
//import com.intellij.openapi.actionSystem.ActionManager | ||
//import com.intellij.openapi.actionSystem.AnAction | ||
//import com.intellij.openapi.actionSystem.AnActionEvent | ||
//import com.intellij.openapi.fileEditor.FileEditorManager | ||
//import com.intellij.util.indexing.FileBasedIndex | ||
//import shop.itbug.fluttercheckversionx.common.MyToggleAction | ||
//import shop.itbug.fluttercheckversionx.inlay.DartAISetting | ||
// | ||
///** | ||
// * dart 文件的ai设定 | ||
// */ | ||
//class DartAiSwitchAction : MyToggleAction({ "Display AI operations" }) { | ||
// | ||
// val setting = DartAISetting.getInstance() | ||
// | ||
// override fun isSelected(e: AnActionEvent): Boolean { | ||
// return setting.state.showInEditor | ||
// } | ||
// | ||
// override fun setSelected(e: AnActionEvent, state: Boolean) { | ||
// println("进来了...") | ||
// setting.loadState(setting.state.copy(showInEditor = state)) | ||
// | ||
// val file = FileEditorManager.getInstance(e.project!!).selectedEditor?.file!! | ||
// | ||
// FileBasedIndex.getInstance().requestReindex(file) | ||
// } | ||
// | ||
// | ||
// override fun update(e: AnActionEvent) { | ||
// val file = FileEditorManager.getInstance(e.project!!).selectedEditor?.file | ||
// e.presentation.isEnabled = e.project!=null && file != null | ||
// super.update(e) | ||
// } | ||
// | ||
// companion object { | ||
// fun getInstance(): AnAction = ActionManager.getInstance().getAction("DartAiSwitchAction")!! | ||
// } | ||
//} |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/shop/itbug/fluttercheckversionx/actions/DioWindowAnActionEx.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/kotlin/shop/itbug/fluttercheckversionx/common/MySelecter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package shop.itbug.fluttercheckversionx.common | ||
|
||
import com.intellij.openapi.actionSystem.DataContext | ||
import com.intellij.openapi.actionSystem.DefaultActionGroup | ||
import com.intellij.ui.components.JBList | ||
import retrofit2.Call | ||
import retrofit2.Callback | ||
import retrofit2.Response | ||
import shop.itbug.fluttercheckversionx.services.JSONResult | ||
import javax.swing.DefaultListModel | ||
import javax.swing.JComponent | ||
import javax.swing.ListCellRenderer | ||
|
||
|
||
|
||
|
||
abstract class MySelecterAction : MyComboBoxAction() { | ||
override fun createPopupActionGroup(button: JComponent, dataContext: DataContext): DefaultActionGroup { | ||
|
||
return super.createPopupActionGroup(button, dataContext) | ||
} | ||
} | ||
|
||
///我的选择器 | ||
abstract class MySelecter<T> : JBList<T>() { | ||
|
||
|
||
val listModel = DefaultListModel<T>() | ||
private val listRender = ListCellRenderer { _, value, index, isSelected, _ -> getCompeont(value, index,isSelected) } | ||
abstract fun getData(): Call<JSONResult<List<T>>> | ||
|
||
|
||
init { | ||
model = listModel | ||
cellRenderer = listRender | ||
this.getData().enqueue(object : Callback<JSONResult<List<T>>> { | ||
override fun onResponse(call: Call<JSONResult<List<T>>>, response: Response<JSONResult<List<T>>>) { | ||
response.body()?.data?.apply { | ||
listModel.addAll(this) | ||
} | ||
} | ||
|
||
override fun onFailure(call: Call<JSONResult<List<T>>>, throwable: Throwable) { | ||
println("加载失败") | ||
} | ||
|
||
}) | ||
} | ||
|
||
|
||
abstract fun getCompeont(value: T, index: Int, isSelected : Boolean) : JComponent | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.