diff options
Diffstat (limited to 'src/cuchaz/enigma/gui/Gui.java')
| -rw-r--r-- | src/cuchaz/enigma/gui/Gui.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java index 3b67a32..9ed6dd8 100644 --- a/src/cuchaz/enigma/gui/Gui.java +++ b/src/cuchaz/enigma/gui/Gui.java | |||
| @@ -78,6 +78,7 @@ import cuchaz.enigma.mapping.Entry; | |||
| 78 | import cuchaz.enigma.mapping.EntryPair; | 78 | import cuchaz.enigma.mapping.EntryPair; |
| 79 | import cuchaz.enigma.mapping.FieldEntry; | 79 | import cuchaz.enigma.mapping.FieldEntry; |
| 80 | import cuchaz.enigma.mapping.IllegalNameException; | 80 | import cuchaz.enigma.mapping.IllegalNameException; |
| 81 | import cuchaz.enigma.mapping.MappingParseException; | ||
| 81 | import cuchaz.enigma.mapping.MethodEntry; | 82 | import cuchaz.enigma.mapping.MethodEntry; |
| 82 | 83 | ||
| 83 | public class Gui | 84 | public class Gui |
| @@ -508,6 +509,10 @@ public class Gui | |||
| 508 | { | 509 | { |
| 509 | throw new Error( ex ); | 510 | throw new Error( ex ); |
| 510 | } | 511 | } |
| 512 | catch( MappingParseException ex ) | ||
| 513 | { | ||
| 514 | JOptionPane.showMessageDialog( m_frame, ex.getMessage() ); | ||
| 515 | } | ||
| 511 | } | 516 | } |
| 512 | } | 517 | } |
| 513 | } ); | 518 | } ); |
| @@ -862,9 +867,17 @@ public class Gui | |||
| 862 | 867 | ||
| 863 | private void startRename( ) | 868 | private void startRename( ) |
| 864 | { | 869 | { |
| 870 | // get the class name | ||
| 871 | String className = m_selectedEntryPair.deobf.getName(); | ||
| 872 | int pos = className.lastIndexOf( '$' ); | ||
| 873 | if( pos >= 0 ) | ||
| 874 | { | ||
| 875 | className = className.substring( pos + 1 ); | ||
| 876 | } | ||
| 877 | |||
| 865 | // init the text box | 878 | // init the text box |
| 866 | final JTextField text = new JTextField(); | 879 | final JTextField text = new JTextField(); |
| 867 | text.setText( m_selectedEntryPair.deobf.getName() ); | 880 | text.setText( className ); |
| 868 | text.setPreferredSize( new Dimension( 360, text.getPreferredSize().height ) ); | 881 | text.setPreferredSize( new Dimension( 360, text.getPreferredSize().height ) ); |
| 869 | text.addKeyListener( new KeyAdapter( ) | 882 | text.addKeyListener( new KeyAdapter( ) |
| 870 | { | 883 | { |
| @@ -905,6 +918,7 @@ public class Gui | |||
| 905 | } | 918 | } |
| 906 | catch( IllegalNameException ex ) | 919 | catch( IllegalNameException ex ) |
| 907 | { | 920 | { |
| 921 | ex.printStackTrace( System.err ); | ||
| 908 | text.setBorder( BorderFactory.createLineBorder( Color.red, 1 ) ); | 922 | text.setBorder( BorderFactory.createLineBorder( Color.red, 1 ) ); |
| 909 | } | 923 | } |
| 910 | return; | 924 | return; |