From 3fc02c46fa6a15221a42b6fe069e40d55d248fe1 Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 21 Jul 2021 06:25:59 -0700 Subject: [PATCH] Better Tab Fallback Names If the active resource cannot be found (Plugin Console created outside of execution function) - Name the tabs in numerical order of the resources processed --- .../bytecodeviewer/gui/components/JFrameConsoleTabbed.java | 5 +++++ .../bytecode/club/bytecodeviewer/plugin/PluginManager.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java index 3aa9188a..8e19cdcb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java @@ -48,4 +48,9 @@ public class JFrameConsoleTabbed extends JFrame { tabbedPane.add(console, containerName); } + + public JTabbedPane getTabbedPane() + { + return tabbedPane; + } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java index fce2d428..b68b03f0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java @@ -133,7 +133,7 @@ public final class PluginManager console.setConsoleID(id); final String name = (activePlugin == null || activePlugin.activeContainer == null) - ? console.getTitle() : activePlugin.activeContainer.name; + ? ("#" + (activeTabbedConsole.getTabbedPane().getTabCount() + 1)) : activePlugin.activeContainer.name; activeTabbedConsole.addConsole(console.getComponent(0), name); }