Code Style Update / Cleanup / Repackaging
This commit is contained in:
parent
515495e378
commit
f59823b185
|
@ -29,8 +29,8 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents;
|
|||
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
|
||||
import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJButton;
|
||||
import the.bytecode.club.bytecodeviewer.translation.components.TranslatedVisibleComponent;
|
||||
import the.bytecode.club.uikit.tabpopup.closer.JTabbedPanePopupMenuTabsCloser;
|
||||
import the.bytecode.club.uikit.tabpopup.closer.PopupMenuTabsCloseConfiguration;
|
||||
import the.bytecode.club.bytecodeviewer.gui.tabpopup.closer.JTabbedPanePopupMenuTabsCloser;
|
||||
import the.bytecode.club.bytecodeviewer.gui.tabpopup.closer.PopupMenuTabsCloseConfiguration;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
|
||||
|
||||
import javax.swing.*;
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
|
||||
|
||||
import javax.swing.*;
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -68,16 +68,16 @@ public class JTabbedPanePopupEventHandler
|
|||
if (e.isPopupTrigger())
|
||||
{
|
||||
int index = tabbedPane.indexAtLocation(e.getX(), e.getY());
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
Component popupOnTab = tabbedPane.getComponentAt(index);
|
||||
|
||||
if (this.tabPopupEventListener != null)
|
||||
{
|
||||
this.tabPopupEventListener.onTabPopupEvent(tabbedPane, index, new TabPopupEvent(e, popupOnTab));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public JTabbedPane getTabbedPane()
|
||||
{
|
|
@ -16,16 +16,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class TabPopupEvent extends MouseEvent
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2510164400674753411L;
|
||||
|
||||
private final Component popupOnTab;
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup.closer;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
|
||||
|
||||
import the.bytecode.club.uikit.tabpopup.ITabZeroComponentEventListener;
|
||||
import the.bytecode.club.bytecodeviewer.gui.tabpopup.ITabZeroComponentEventListener;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -61,18 +61,16 @@ public class JTabbedPaneCloser
|
|||
protected void removeOtherComponents(Component component, boolean equalStop)
|
||||
{
|
||||
int i = this.tabbedPane.getTabCount();
|
||||
|
||||
while (i-- > 0)
|
||||
{
|
||||
Component c = this.tabbedPane.getComponentAt(i);
|
||||
|
||||
if (c != component)
|
||||
{
|
||||
this.tabbedPane.remove(i);
|
||||
}
|
||||
else if (equalStop)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tryTriggerTabZeroComponentEvent();
|
||||
}
|
||||
|
@ -82,6 +80,7 @@ public class JTabbedPaneCloser
|
|||
int count = this.tabbedPane.getTabCount();
|
||||
int i = 0;
|
||||
List<Component> removeTabs = new ArrayList<>();
|
||||
|
||||
do
|
||||
{
|
||||
Component c = this.tabbedPane.getComponentAt(i);
|
||||
|
@ -117,8 +116,6 @@ public class JTabbedPaneCloser
|
|||
private void tryTriggerTabZeroComponentEvent()
|
||||
{
|
||||
if (this.tabbedPane.getTabCount() == 0 && tabZeroComponentEventListener != null)
|
||||
{
|
||||
tabZeroComponentEventListener.onTabZeroComponent(this.tabbedPane);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup.closer;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
|
||||
|
||||
import the.bytecode.club.uikit.tabpopup.AbstractJTabbedPanePopupMenuHandler;
|
||||
import the.bytecode.club.bytecodeviewer.gui.tabpopup.AbstractJTabbedPanePopupMenuHandler;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -79,8 +79,7 @@ public class JTabbedPanePopupMenuTabsCloser extends AbstractJTabbedPanePopupMenu
|
|||
|
||||
protected void addItemCloseOtherTabs(JPopupMenu popUpMenu, Component popupOnTab)
|
||||
{
|
||||
addMenuItem(popUpMenu, "Close Others", e ->
|
||||
{tabbedPaneCloser.removeOtherComponents(popupOnTab);});
|
||||
addMenuItem(popUpMenu, "Close Others", e -> tabbedPaneCloser.removeOtherComponents(popupOnTab));
|
||||
}
|
||||
|
||||
protected void addItemCloseAllTabs(JPopupMenu popUpMenu)
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
package the.bytecode.club.uikit.tabpopup.closer;
|
||||
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
|
||||
|
||||
/**
|
||||
* PopupMenu items configuration of close tabs
|
Loading…
Reference in New Issue
Block a user