[java-decompiler] fix deprecation warnings and minor style lints

GitOrigin-RevId: 3dacc55169d075ec2ab70cd3345bc4316f13fa75
This commit is contained in:
Bartek Pacia
2025-09-30 12:51:11 +00:00
committed by intellij-monorepo-bot
parent a5bc16da2f
commit 3757083de8
2 changed files with 9 additions and 8 deletions
@@ -14,6 +14,7 @@ import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.openapi.editor.impl.EditorInspectionsActionToolbar
import com.intellij.openapi.editor.impl.EditorMarkupModelImpl
import com.intellij.openapi.editor.impl.EditorToolbarButtonLook
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.components.panels.NonOpaquePanel
import com.intellij.util.ui.JBInsets
@@ -26,9 +27,9 @@ import kotlin.math.max
private class DecompilerInEditorListener : EditorFactoryListener {
override fun editorCreated(event: EditorFactoryEvent) {
val editor = event.editor as? EditorImpl ?: return
val file = editor.virtualFile ?: return
if (file.fileType != JavaClassFileType.INSTANCE) return
if (file.name == "module-info.class") return
val virtualFile = FileDocumentManager.getInstance().getFile(editor.document) ?: return
if (virtualFile.fileType != JavaClassFileType.INSTANCE) return
if (virtualFile.name == "module-info.class") return
setupModeToggles(editor)
}
@@ -77,17 +78,17 @@ private class DecompilerInEditorListener : EditorFactoryListener {
val toolbar = statusToolbar.component
toolbar.layout = EditorMarkupModelImpl.StatusComponentLayout()
toolbar.setBorder(JBUI.Borders.empty(2))
toolbar.border = JBUI.Borders.empty(2)
val statusPanel = NonOpaquePanel()
statusPanel.isVisible = true
statusPanel.setLayout(BoxLayout(statusPanel, BoxLayout.X_AXIS))
statusPanel.layout = BoxLayout(statusPanel, BoxLayout.X_AXIS)
statusPanel.add(toolbar)
val scrollPane = (editor.scrollPane as? JBScrollPane) ?: return
val scrollPane = editor.scrollPane as? JBScrollPane ?: return
scrollPane.statusComponent = statusPanel
val scrollPaneLayout = (scrollPane.layout as? JBScrollPane.Layout) ?: return
val scrollPaneLayout = scrollPane.layout as? JBScrollPane.Layout ?: return
scrollPaneLayout.syncWithScrollPane(scrollPane)
}
}
@@ -17,7 +17,7 @@ import com.intellij.psi.util.PsiUtilBase
class ShowDecompiledClassAction : AnAction(IdeaDecompilerBundle.message("action.show.decompiled.name")) {
override fun getActionUpdateThread() = ActionUpdateThread.BGT
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
override fun update(e: AnActionEvent) {
val psiElement = getPsiElement(e)