mirror of
https://github.com/skylot/jadx.git
synced 2024-11-26 22:20:50 +00:00
fix(gui): correct tabs filter in "Close others" tab action (#2330)
This commit is contained in:
parent
cc6a893402
commit
61578e8793
@ -243,9 +243,10 @@ public class TabComponent extends JPanel {
|
||||
if (tabs.size() > 1) {
|
||||
JMenuItem closeOther = new JMenuItem(NLS.str("tabs.closeOthers"));
|
||||
closeOther.addActionListener(e -> {
|
||||
JNode currentNode = getNode();
|
||||
for (TabBlueprint tab : tabs) {
|
||||
if (tab != getBlueprint()) {
|
||||
tabsController.closeTab(getNode(), true);
|
||||
if (tab.getNode() != currentNode) {
|
||||
tabsController.closeTab(tab, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -310,7 +311,6 @@ public class TabComponent extends JPanel {
|
||||
if (blueprint == null) {
|
||||
throw new JadxRuntimeException("TabComponent does not have a corresponding TabBlueprint");
|
||||
}
|
||||
|
||||
return blueprint;
|
||||
}
|
||||
|
||||
|
@ -163,16 +163,16 @@ public class TabsController {
|
||||
|
||||
public void closeTab(JNode node, boolean considerPins) {
|
||||
TabBlueprint blueprint = getTabByNode(node);
|
||||
|
||||
if (blueprint == null) {
|
||||
return;
|
||||
if (blueprint != null) {
|
||||
closeTab(blueprint, considerPins);
|
||||
}
|
||||
}
|
||||
|
||||
public void closeTab(TabBlueprint blueprint, boolean considerPins) {
|
||||
if (forceClose) {
|
||||
closeTabForce(blueprint);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!considerPins || !blueprint.isPinned()) {
|
||||
if (!blueprint.isReferenced()) {
|
||||
closeTabForce(blueprint);
|
||||
@ -182,7 +182,7 @@ public class TabsController {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Removes Tab from everywhere
|
||||
*/
|
||||
private void closeTabForce(TabBlueprint blueprint) {
|
||||
@ -190,7 +190,7 @@ public class TabsController {
|
||||
tabsMap.remove(blueprint.getNode());
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Hides Tab from TabbedPane
|
||||
*/
|
||||
private void closeTabSoft(TabBlueprint blueprint) {
|
||||
|
Loading…
Reference in New Issue
Block a user