mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 13:20:45 +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:
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.usages.MultinameUsage;
|
||||
import com.jpexs.decompiler.flash.abc.usages.TraitMultinameUsage;
|
||||
import com.jpexs.decompiler.flash.gui.AppFrame;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import static com.jpexs.decompiler.flash.gui.abc.NewTraitDialog.ACTION_OK;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
@@ -41,6 +42,9 @@ import javax.swing.*;
|
||||
*/
|
||||
public class UsageFrame extends AppFrame implements ActionListener, MouseListener {
|
||||
|
||||
static final String ACTION_GOTO = "GOTO";
|
||||
static final String ACTION_CANCEL = "CANCEL";
|
||||
|
||||
private JButton gotoButton = new JButton(translate("button.goto"));
|
||||
private JButton cancelButton = new JButton(translate("button.cancel"));
|
||||
private JList usageList;
|
||||
@@ -59,9 +63,9 @@ public class UsageFrame extends AppFrame implements ActionListener, MouseListene
|
||||
}
|
||||
usageList = new JList(usageListModel);
|
||||
usageList.setBackground(Color.white);
|
||||
gotoButton.setActionCommand("GOTO");
|
||||
gotoButton.setActionCommand(ACTION_GOTO);
|
||||
gotoButton.addActionListener(this);
|
||||
cancelButton.setActionCommand("CANCEL");
|
||||
cancelButton.setActionCommand(ACTION_CANCEL);
|
||||
cancelButton.addActionListener(this);
|
||||
JPanel buttonsPanel = new JPanel();
|
||||
buttonsPanel.setLayout(new FlowLayout());
|
||||
@@ -114,12 +118,14 @@ public class UsageFrame extends AppFrame implements ActionListener, MouseListene
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getActionCommand().equals("GOTO")) {
|
||||
gotoUsage();
|
||||
setVisible(false);
|
||||
}
|
||||
if (e.getActionCommand().equals("CANCEL")) {
|
||||
setVisible(false);
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_GOTO:
|
||||
gotoUsage();
|
||||
setVisible(false);
|
||||
break;
|
||||
case ACTION_CANCEL:
|
||||
setVisible(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user