summaryrefslogtreecommitdiff
path: root/enigma-swing
diff options
context:
space:
mode:
authorGravatar modmuss502021-09-16 14:35:13 +0100
committerGravatar GitHub2021-09-16 14:35:13 +0100
commit2eb7d2b83a397d4d276c882107fc50ddd7ce866a (patch)
tree5ab3b1d476c1fbe251f51d711e5e3a9421a06846 /enigma-swing
parentRefactor and clean up Gui class (diff)
downloadenigma-2eb7d2b83a397d4d276c882107fc50ddd7ce866a.tar.gz
enigma-2eb7d2b83a397d4d276c882107fc50ddd7ce866a.tar.xz
enigma-2eb7d2b83a397d4d276c882107fc50ddd7ce866a.zip
Improve record class detection (#428)
Also generate a method mapping for the record entry, does not support the case of the method having a diffrent name from the field. If there is a component this is remapped via the field mapping.
Diffstat (limited to 'enigma-swing')
-rw-r--r--enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java
index 28b4043e..3b8ecbc5 100644
--- a/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java
+++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java
@@ -20,6 +20,7 @@ import javax.swing.tree.TreePath;
20import com.formdev.flatlaf.extras.FlatSVGIcon; 20import com.formdev.flatlaf.extras.FlatSVGIcon;
21import com.google.common.collect.Lists; 21import com.google.common.collect.Lists;
22 22
23import cuchaz.enigma.analysis.index.EntryIndex;
23import cuchaz.enigma.gui.Gui; 24import cuchaz.enigma.gui.Gui;
24import cuchaz.enigma.translation.representation.AccessFlags; 25import cuchaz.enigma.translation.representation.AccessFlags;
25import cuchaz.enigma.translation.representation.entry.ClassEntry; 26import cuchaz.enigma.translation.representation.entry.ClassEntry;
@@ -119,7 +120,8 @@ public class GuiUtil {
119 } 120 }
120 121
121 public static Icon getClassIcon(Gui gui, ClassEntry entry) { 122 public static Icon getClassIcon(Gui gui, ClassEntry entry) {
122 AccessFlags access = gui.getController().project.getJarIndex().getEntryIndex().getClassAccess(entry); 123 EntryIndex entryIndex = gui.getController().project.getJarIndex().getEntryIndex();
124 AccessFlags access = entryIndex.getClassAccess(entry);
123 125
124 if (access != null) { 126 if (access != null) {
125 if (access.isAnnotation()) { 127 if (access.isAnnotation()) {
@@ -128,7 +130,7 @@ public class GuiUtil {
128 return INTERFACE_ICON; 130 return INTERFACE_ICON;
129 } else if (access.isEnum()) { 131 } else if (access.isEnum()) {
130 return ENUM_ICON; 132 return ENUM_ICON;
131 } else if (access.isRecord()) { 133 } else if (entryIndex.getDefinition(entry).isRecord()) {
132 return RECORD_ICON; 134 return RECORD_ICON;
133 } 135 }
134 } 136 }