diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/GuiController.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/GuiController.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java index cc645d8..e466f63 100644 --- a/src/main/java/cuchaz/enigma/gui/GuiController.java +++ b/src/main/java/cuchaz/enigma/gui/GuiController.java | |||
| @@ -12,24 +12,21 @@ package cuchaz.enigma.gui; | |||
| 12 | 12 | ||
| 13 | import com.google.common.collect.Lists; | 13 | import com.google.common.collect.Lists; |
| 14 | import com.google.common.collect.Queues; | 14 | import com.google.common.collect.Queues; |
| 15 | |||
| 16 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; | 15 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; |
| 16 | import cuchaz.enigma.Deobfuscator; | ||
| 17 | import cuchaz.enigma.analysis.*; | ||
| 18 | import cuchaz.enigma.gui.dialog.ProgressDialog; | ||
| 19 | import cuchaz.enigma.mapping.*; | ||
| 20 | import cuchaz.enigma.throwables.MappingParseException; | ||
| 21 | import cuchaz.enigma.utils.ReadableToken; | ||
| 17 | 22 | ||
| 18 | import java.io.File; | 23 | import java.io.File; |
| 19 | import java.io.FileWriter; | ||
| 20 | import java.io.IOException; | 24 | import java.io.IOException; |
| 21 | import java.util.Collection; | 25 | import java.util.Collection; |
| 22 | import java.util.Deque; | 26 | import java.util.Deque; |
| 23 | import java.util.List; | 27 | import java.util.List; |
| 24 | import java.util.jar.JarFile; | 28 | import java.util.jar.JarFile; |
| 25 | 29 | ||
| 26 | import cuchaz.enigma.Deobfuscator; | ||
| 27 | import cuchaz.enigma.analysis.*; | ||
| 28 | import cuchaz.enigma.gui.dialog.ProgressDialog; | ||
| 29 | import cuchaz.enigma.mapping.*; | ||
| 30 | import cuchaz.enigma.throwables.MappingParseException; | ||
| 31 | import cuchaz.enigma.utils.ReadableToken; | ||
| 32 | |||
| 33 | public class GuiController { | 30 | public class GuiController { |
| 34 | 31 | ||
| 35 | private Deobfuscator deobfuscator; | 32 | private Deobfuscator deobfuscator; |
| @@ -192,18 +189,26 @@ public class GuiController { | |||
| 192 | } | 189 | } |
| 193 | 190 | ||
| 194 | public void rename(EntryReference<Entry, Entry> deobfReference, String newName) { | 191 | public void rename(EntryReference<Entry, Entry> deobfReference, String newName) { |
| 192 | rename(deobfReference, newName, true); | ||
| 193 | } | ||
| 194 | |||
| 195 | public void rename(EntryReference<Entry, Entry> deobfReference, String newName, boolean refreshClassTree) | ||
| 196 | { | ||
| 195 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); | 197 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); |
| 196 | this.deobfuscator.rename(obfReference.getNameableEntry(), newName); | 198 | this.deobfuscator.rename(obfReference.getNameableEntry(), newName); |
| 197 | this.isDirty = true; | 199 | this.isDirty = true; |
| 198 | refreshClasses(); | 200 | |
| 201 | if (refreshClassTree) | ||
| 202 | this.gui.moveClassTree(deobfReference, newName); | ||
| 199 | refreshCurrentClass(obfReference); | 203 | refreshCurrentClass(obfReference); |
| 204 | |||
| 200 | } | 205 | } |
| 201 | 206 | ||
| 202 | public void removeMapping(EntryReference<Entry, Entry> deobfReference) { | 207 | public void removeMapping(EntryReference<Entry, Entry> deobfReference) { |
| 203 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); | 208 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); |
| 204 | this.deobfuscator.removeMapping(obfReference.getNameableEntry()); | 209 | this.deobfuscator.removeMapping(obfReference.getNameableEntry()); |
| 205 | this.isDirty = true; | 210 | this.isDirty = true; |
| 206 | refreshClasses(); | 211 | this.gui.moveClassTree(deobfReference, obfReference.entry.getName(), false, true); |
| 207 | refreshCurrentClass(obfReference); | 212 | refreshCurrentClass(obfReference); |
| 208 | } | 213 | } |
| 209 | 214 | ||
| @@ -211,7 +216,6 @@ public class GuiController { | |||
| 211 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); | 216 | EntryReference<Entry, Entry> obfReference = this.deobfuscator.obfuscateReference(deobfReference); |
| 212 | this.deobfuscator.markAsDeobfuscated(obfReference.getNameableEntry()); | 217 | this.deobfuscator.markAsDeobfuscated(obfReference.getNameableEntry()); |
| 213 | this.isDirty = true; | 218 | this.isDirty = true; |
| 214 | refreshClasses(); | ||
| 215 | refreshCurrentClass(obfReference); | 219 | refreshCurrentClass(obfReference); |
| 216 | } | 220 | } |
| 217 | 221 | ||