mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 09:51:27 +00:00
prepare for Issue #350 (Allow to open multiple SWF files into the same ffdec instance), some action commands moved to constants
This commit is contained in:
@@ -36,6 +36,9 @@ import javax.swing.JRadioButton;
|
||||
*/
|
||||
public class RenameDialog extends AppDialog implements ActionListener {
|
||||
|
||||
static final String ACTION_OK = "OK";
|
||||
static final String ACTION_CANCEL = "CANCEL";
|
||||
|
||||
private JRadioButton typeNumberRadioButton = new JRadioButton(translate("rename.type.typenumber"));
|
||||
private JRadioButton randomWordRadioButton = new JRadioButton(translate("rename.type.randomword"));
|
||||
private JButton okButton = new JButton(translate("button.ok"));
|
||||
@@ -70,10 +73,10 @@ public class RenameDialog extends AppDialog implements ActionListener {
|
||||
add(pan, BorderLayout.CENTER);
|
||||
JPanel panButtons = new JPanel(new FlowLayout());
|
||||
panButtons.add(okButton);
|
||||
okButton.setActionCommand("OK");
|
||||
okButton.setActionCommand(ACTION_OK);
|
||||
okButton.addActionListener(this);
|
||||
panButtons.add(cancelButton);
|
||||
cancelButton.setActionCommand("CANCEL");
|
||||
cancelButton.setActionCommand(ACTION_CANCEL);
|
||||
cancelButton.addActionListener(this);
|
||||
add(panButtons, BorderLayout.SOUTH);
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
@@ -95,12 +98,12 @@ public class RenameDialog extends AppDialog implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (e.getActionCommand()) {
|
||||
case "OK":
|
||||
case ACTION_OK:
|
||||
confirmed = true;
|
||||
Configuration.lastRenameType.set((Integer) (getRenameType() == RenameType.TYPENUMBER ? 1 : 2));
|
||||
setVisible(false);
|
||||
break;
|
||||
case "CANCEL":
|
||||
case ACTION_CANCEL:
|
||||
confirmed = false;
|
||||
setVisible(false);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user