diff options
| author | 2021-09-16 14:35:13 +0100 | |
|---|---|---|
| committer | 2021-09-16 14:35:13 +0100 | |
| commit | 2eb7d2b83a397d4d276c882107fc50ddd7ce866a (patch) | |
| tree | 5ab3b1d476c1fbe251f51d711e5e3a9421a06846 /enigma-swing | |
| parent | Refactor and clean up Gui class (diff) | |
| download | enigma-fork-2eb7d2b83a397d4d276c882107fc50ddd7ce866a.tar.gz enigma-fork-2eb7d2b83a397d4d276c882107fc50ddd7ce866a.tar.xz enigma-fork-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.java | 6 |
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 28b4043..3b8ecbc 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; | |||
| 20 | import com.formdev.flatlaf.extras.FlatSVGIcon; | 20 | import com.formdev.flatlaf.extras.FlatSVGIcon; |
| 21 | import com.google.common.collect.Lists; | 21 | import com.google.common.collect.Lists; |
| 22 | 22 | ||
| 23 | import cuchaz.enigma.analysis.index.EntryIndex; | ||
| 23 | import cuchaz.enigma.gui.Gui; | 24 | import cuchaz.enigma.gui.Gui; |
| 24 | import cuchaz.enigma.translation.representation.AccessFlags; | 25 | import cuchaz.enigma.translation.representation.AccessFlags; |
| 25 | import cuchaz.enigma.translation.representation.entry.ClassEntry; | 26 | import 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 | } |