mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 22:11:39 +00:00
Added: "Show detail" context menu item for items in folder preview
This commit is contained in:
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#1418] Option to make main window Always on top
|
||||
- [#289] Support for Aero Snap on Windows
|
||||
- [#2412] Show coordinates on stage mouse move for up to 2 decimal places
|
||||
- "Show detail" context menu item for items in folder preview
|
||||
|
||||
### Fixed
|
||||
- [#2456] FLA export - NullPointer exception while exporting to CS4 or lower via commandline
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.gui;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTree;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.treeitems.Openable;
|
||||
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||
import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.Color;
|
||||
@@ -110,11 +109,7 @@ public class FolderListPanel extends JPanel {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getClickCount() > 1) {
|
||||
if (selectedIndex > -1) {
|
||||
TreeItem selectedItem = FolderListPanel.this.items.get(selectedIndex);
|
||||
TreePath subPath = parentPath.pathByAddingChild(selectedItem);
|
||||
mainPanel.getCurrentTree().setSelectionPath(subPath);
|
||||
}
|
||||
goToSelection();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +153,7 @@ public class FolderListPanel extends JPanel {
|
||||
}
|
||||
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted());
|
||||
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted(), true);
|
||||
mainPanel.getContextPopupMenu().show(FolderListPanel.this, e.getX(), e.getY());
|
||||
}
|
||||
repaint();
|
||||
@@ -166,6 +161,14 @@ public class FolderListPanel extends JPanel {
|
||||
});
|
||||
setFocusable(true);
|
||||
}
|
||||
|
||||
public void goToSelection() {
|
||||
if (selectedIndex > -1) {
|
||||
TreeItem selectedItem = FolderListPanel.this.items.get(selectedIndex);
|
||||
TreePath subPath = parentPath.pathByAddingChild(selectedItem);
|
||||
mainPanel.getCurrentTree().setSelectionPath(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void setItems(TreePath parentPath, List<TreeItem> items) {
|
||||
this.items = items;
|
||||
|
||||
@@ -105,9 +105,7 @@ public class FolderPreviewPanel extends JPanel {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getClickCount() > 1) {
|
||||
if (selectedIndex > -1) {
|
||||
mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), FolderPreviewPanel.this.items.get(selectedIndex));
|
||||
}
|
||||
goToSelection();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +149,7 @@ public class FolderPreviewPanel extends JPanel {
|
||||
}
|
||||
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted());
|
||||
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted(), true);
|
||||
mainPanel.getContextPopupMenu().show(FolderPreviewPanel.this, e.getX(), e.getY());
|
||||
}
|
||||
repaint();
|
||||
@@ -159,6 +157,12 @@ public class FolderPreviewPanel extends JPanel {
|
||||
});
|
||||
setFocusable(true);
|
||||
}
|
||||
|
||||
public void goToSelection() {
|
||||
if (selectedIndex > -1) {
|
||||
mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), FolderPreviewPanel.this.items.get(selectedIndex));
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void setItems(List<TreeItem> items) {
|
||||
this.items = items;
|
||||
|
||||
@@ -636,7 +636,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
if ((e.getKeyCode() == KeyEvent.VK_DELETE) && !e.isControlDown() && !e.isAltDown()) {
|
||||
if (contextPopupMenu.canRemove(items)) {
|
||||
contextPopupMenu.update(items);
|
||||
contextPopupMenu.update(items, false);
|
||||
contextPopupMenu.removeItemActionPerformed(null, e.isShiftDown());
|
||||
}
|
||||
}
|
||||
@@ -682,10 +682,10 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
if (e.getKeyCode() == 'X' && allWritable) {
|
||||
if (!frameItems.isEmpty()) {
|
||||
contextPopupMenu.update(frameItems);
|
||||
contextPopupMenu.update(frameItems, false);
|
||||
contextPopupMenu.cutTagOrFrameToClipboardActionPerformed(null);
|
||||
} else {
|
||||
contextPopupMenu.update(tagItems);
|
||||
contextPopupMenu.update(tagItems, false);
|
||||
if (e.isShiftDown()) {
|
||||
contextPopupMenu.cutTagToClipboardWithDependenciesActionPerformed(null);
|
||||
} else {
|
||||
@@ -712,7 +712,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
return;
|
||||
}
|
||||
}
|
||||
contextPopupMenu.update(items);
|
||||
contextPopupMenu.update(items, false);
|
||||
if (e.isShiftDown()) {
|
||||
contextPopupMenu.pasteAfterActionPerformed(null);
|
||||
} else {
|
||||
|
||||
@@ -129,7 +129,7 @@ public class PinButton extends JPanel {
|
||||
}
|
||||
List<TreeItem> itemList = new ArrayList<>();
|
||||
itemList.add(item);
|
||||
mainPanel.getContextPopupMenu().update(itemList);
|
||||
mainPanel.getContextPopupMenu().update(itemList, false);
|
||||
mainPanel.getContextPopupMenu().show(PinButton.this, 0, PinButton.this.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 487 B |
Binary file not shown.
|
After Width: | Height: | Size: 738 B |
@@ -1055,4 +1055,6 @@ contextmenu.showInEasy = Show in Simple editor
|
||||
#after 23.0.1
|
||||
work.debugging.start = Starting Flash content debugger
|
||||
|
||||
menu.file.view.alwaysOnTop = Always on top
|
||||
menu.file.view.alwaysOnTop = Always on top
|
||||
|
||||
contextmenu.showDetail = Show detail
|
||||
@@ -1054,4 +1054,6 @@ contextmenu.showInEasy = Zobrazit v Jednoduch\u00e9m editoru
|
||||
|
||||
#after 23.0.1
|
||||
work.debugging.start = Spou\u0161t\u00ed se Flash content debugger
|
||||
menu.file.view.alwaysOnTop = V\u017edy navrchu
|
||||
menu.file.view.alwaysOnTop = V\u017edy navrchu
|
||||
|
||||
contextmenu.showDetail = Zobrazit detail
|
||||
@@ -310,6 +310,8 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
private JMenuItem textSearchMenuItem;
|
||||
|
||||
private JMenuItem moveTagMenuItem;
|
||||
|
||||
private JMenuItem showDetailMenuItem;
|
||||
|
||||
private JMenuItem showInResourcesViewTagMenuItem;
|
||||
|
||||
@@ -373,6 +375,12 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
public TagTreeContextMenu(final List<AbstractTagTree> trees, MainPanel mainPanel) {
|
||||
this.mainPanel = mainPanel;
|
||||
|
||||
showDetailMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showDetail"));
|
||||
showDetailMenuItem.addActionListener(this::showDetailActionPerformed);
|
||||
showDetailMenuItem.setIcon(View.getIcon("detail16"));
|
||||
add(showDetailMenuItem);
|
||||
addSeparator();
|
||||
|
||||
expandRecursiveMenuItem = new JMenuItem(mainPanel.translate("contextmenu.expandAll"));
|
||||
expandRecursiveMenuItem.addActionListener(this::expandRecursiveActionPerformed);
|
||||
expandRecursiveMenuItem.setIcon(View.getIcon("expand16"));
|
||||
@@ -407,17 +415,17 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
configurePathResolvingMenuItem.setIcon(View.getIcon("settings16"));
|
||||
add(configurePathResolvingMenuItem);
|
||||
|
||||
addSeparator();
|
||||
addSeparator();
|
||||
jumpToCharacterMenuItem = new JMenuItem(mainPanel.translate("contextmenu.jumpToCharacter"));
|
||||
jumpToCharacterMenuItem.addActionListener(this::jumpToCharacterActionPerformed);
|
||||
jumpToCharacterMenuItem.setIcon(View.getIcon("jumpto16"));
|
||||
add(jumpToCharacterMenuItem);
|
||||
|
||||
add(jumpToCharacterMenuItem);
|
||||
|
||||
showInFramesFolderMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showInFramesFolder"));
|
||||
showInFramesFolderMenuItem.addActionListener(this::showInFramesFolderActionPerformed);
|
||||
showInFramesFolderMenuItem.setIcon(View.getIcon("frame16"));
|
||||
add(showInFramesFolderMenuItem);
|
||||
|
||||
|
||||
showInResourcesViewTagMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showInResources"));
|
||||
showInResourcesViewTagMenuItem.addActionListener(this::showInResourcesViewActionPerformed);
|
||||
showInResourcesViewTagMenuItem.setIcon(View.getIcon("folder16"));
|
||||
@@ -905,7 +913,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
li.add(item);
|
||||
}
|
||||
|
||||
update(li);
|
||||
update(li, false);
|
||||
show(e.getComponent(), e.getX(), e.getY());
|
||||
}
|
||||
}
|
||||
@@ -1002,7 +1010,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void update(final List<TreeItem> items) {
|
||||
public void update(final List<TreeItem> items, boolean inFolder) {
|
||||
|
||||
if (items.isEmpty()) {
|
||||
return;
|
||||
@@ -1321,6 +1329,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
addAs3ClassMenuItem.setVisible(false);
|
||||
textSearchMenuItem.setVisible(hasScripts || hasTexts);
|
||||
moveTagMenuItem.setVisible(items.size() == 1 && (items.get(0) instanceof Tag));
|
||||
showDetailMenuItem.setVisible(false);
|
||||
showInResourcesViewTagMenuItem.setVisible(false);
|
||||
showInTagListViewTagMenuItem.setVisible(false);
|
||||
showInHexDumpViewTagMenuItem.setVisible(false);
|
||||
@@ -1531,9 +1540,11 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
}
|
||||
|
||||
if (tree.getModel().getChildCount(firstItem) > 0) {
|
||||
expandRecursiveMenuItem.setVisible(true);
|
||||
collapseRecursiveMenuItem.setVisible(true);
|
||||
if (!inFolder) {
|
||||
if (tree.getModel().getChildCount(firstItem) > 0) {
|
||||
expandRecursiveMenuItem.setVisible(true);
|
||||
collapseRecursiveMenuItem.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (firstItem instanceof SWF) {
|
||||
@@ -1604,6 +1615,10 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
addFramesBeforeMenuItem.setVisible(true);
|
||||
addFramesAfterMenuItem.setVisible(true);
|
||||
}
|
||||
|
||||
if (inFolder) {
|
||||
showDetailMenuItem.setVisible(true);
|
||||
}
|
||||
|
||||
if (mainPanel.getCurrentView() == MainPanel.VIEW_TAGLIST
|
||||
&& !(firstItem instanceof ShowFrameTag)
|
||||
@@ -4391,6 +4406,12 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
mainPanel.updateMenu();
|
||||
}
|
||||
|
||||
private void showDetailActionPerformed(ActionEvent evt) {
|
||||
//Go to one of the panels. The other is always empty, so call both.
|
||||
mainPanel.folderPreviewPanel.goToSelection();
|
||||
mainPanel.folderListPanel.goToSelection();
|
||||
}
|
||||
|
||||
private void showInResourcesViewActionPerformed(ActionEvent evt) {
|
||||
TreeItem item = getCurrentItem();
|
||||
mainPanel.showView(MainPanel.VIEW_RESOURCES);
|
||||
|
||||
Reference in New Issue
Block a user