mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[bdt] BDIDE-3618 Minimap (feat): Fixed file extensions combobox render artifacts, changed loadState.
GitOrigin-RevId: ef1dd8e477a403f22c98b1a2c20b4806a3e0f8d9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0dd83b715e
commit
de6fc9b6fa
@@ -18,7 +18,6 @@ import javax.swing.DefaultListCellRenderer
|
||||
import javax.swing.JList
|
||||
import javax.swing.JPanel
|
||||
|
||||
|
||||
class MinimapConfigurable : BoundConfigurable(MiniMessagesBundle.message("settings.name")) {
|
||||
|
||||
companion object {
|
||||
@@ -59,6 +58,7 @@ class MinimapConfigurable : BoundConfigurable(MiniMessagesBundle.message("settin
|
||||
row(MiniMessagesBundle.message("settings.file.types")) {
|
||||
val textFileTypes = (FileTypeManager.getInstance() as FileTypeManagerImpl).registeredFileTypes
|
||||
.filter { !it.isBinary && it.defaultExtension.isNotBlank() }.distinctBy { it.defaultExtension }
|
||||
.sortedBy { it.defaultExtension.lowercase() }
|
||||
.sortedBy { if (fileTypes.contains(it.defaultExtension)) 0 else 1 }
|
||||
|
||||
fileTypeComboBox = comboBox(textFileTypes, FileTypeListCellRenderer())
|
||||
@@ -110,12 +110,15 @@ class MinimapConfigurable : BoundConfigurable(MiniMessagesBundle.message("settin
|
||||
}
|
||||
|
||||
private inner class FileTypeListCellRenderer : DefaultListCellRenderer() {
|
||||
private val container = JPanel(null).apply {
|
||||
layout = BoxLayout(this, BoxLayout.X_AXIS)
|
||||
}
|
||||
private val container = JPanel(null)
|
||||
private val checkBox = JBCheckBox()
|
||||
|
||||
init {
|
||||
isOpaque = false
|
||||
container.isOpaque = false
|
||||
checkBox.isOpaque = false
|
||||
|
||||
container.layout = BoxLayout(container, BoxLayout.X_AXIS)
|
||||
container.add(checkBox)
|
||||
container.add(this)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.intellij.openapi.components.PersistentStateComponent
|
||||
import com.intellij.openapi.components.State
|
||||
import com.intellij.openapi.components.Storage
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil
|
||||
|
||||
@State(name = "Minimap", storages = [Storage(value = "Minimap.xml")])
|
||||
class MinimapSettings : PersistentStateComponent<MinimapSettingsState> {
|
||||
@@ -30,11 +29,6 @@ class MinimapSettings : PersistentStateComponent<MinimapSettingsState> {
|
||||
}
|
||||
|
||||
override fun loadState(state: MinimapSettingsState) {
|
||||
try {
|
||||
XmlSerializerUtil.copyBean(state, this.state)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
//
|
||||
}
|
||||
this.state = state.copy()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user