mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 19:04:38 +00:00
Ctrl + G shortcut for tag list view
This commit is contained in:
@@ -591,7 +591,40 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
|
||||
if (items.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((e.getKeyCode() == 'G') && (e.isControlDown())) {
|
||||
Openable openable = items.get(0).getOpenable();
|
||||
SWF swf = null;
|
||||
if (openable instanceof SWF) {
|
||||
swf = (SWF) openable;
|
||||
}
|
||||
if (swf != null) {
|
||||
String val = "";
|
||||
boolean valid;
|
||||
int characterId = -1;
|
||||
do {
|
||||
val = ViewMessages.showInputDialog(MainPanel.this, translate("message.input.gotoCharacter"), translate("message.input.gotoCharacter.title"), val);
|
||||
if (val == null) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
characterId = Integer.parseInt(val);
|
||||
} catch (NumberFormatException nfe) {
|
||||
characterId = -1;
|
||||
}
|
||||
} while (characterId <= 0);
|
||||
|
||||
if (characterId > 0) {
|
||||
CharacterTag tag = swf.getCharacter(characterId);
|
||||
if (tag == null) {
|
||||
ViewMessages.showMessageDialog(MainPanel.this, translate("message.character.notfound").replace("%characterid%", "" + characterId), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
} else {
|
||||
setTagTreeSelectedNode(getCurrentTree(), tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((e.getKeyCode() == 'F') && (e.isControlDown())) {
|
||||
AbstractTagTree tree = getCurrentTree();
|
||||
@@ -1175,38 +1208,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
handleKeyPressed(e);
|
||||
if ((e.getKeyCode() == 'G') && (e.isControlDown())) {
|
||||
SWF swf = getCurrentSwf();
|
||||
if (swf != null) {
|
||||
String val = "";
|
||||
boolean valid;
|
||||
int characterId = -1;
|
||||
do {
|
||||
val = ViewMessages.showInputDialog(MainPanel.this, translate("message.input.gotoCharacter"), translate("message.input.gotoCharacter.title"), val);
|
||||
if (val == null) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
characterId = Integer.parseInt(val);
|
||||
} catch (NumberFormatException nfe) {
|
||||
characterId = -1;
|
||||
}
|
||||
} while (characterId <= 0);
|
||||
|
||||
if (characterId > 0) {
|
||||
CharacterTag tag = swf.getCharacter(characterId);
|
||||
if (tag == null) {
|
||||
ViewMessages.showMessageDialog(MainPanel.this, translate("message.character.notfound").replace("%characterid%", "" + characterId), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
} else {
|
||||
TreePath path = tagTree.getFullModel().getTreePath(tag);
|
||||
if (path != null) {
|
||||
tagTree.setSelectionPath(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
handleKeyPressed(e);
|
||||
}
|
||||
});
|
||||
tagListTree.addKeyListener(new KeyAdapter() {
|
||||
|
||||
Reference in New Issue
Block a user