From e0d6af982057fc7db58ad7aba8a86b26fd231ee0 Mon Sep 17 00:00:00 2001 From: kthiemann Date: Fri, 16 Feb 2007 09:59:05 +0000 Subject: [PATCH] Methods to access a tab in a window programmatically see: https://sourceforge.net/forum/forum.php?thread_id=1664032&forum_id=610548 for details --- client/src/org/compiere/apps/APanel.java | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/client/src/org/compiere/apps/APanel.java b/client/src/org/compiere/apps/APanel.java index 15c18f999c..22b2d4ef2f 100644 --- a/client/src/org/compiere/apps/APanel.java +++ b/client/src/org/compiere/apps/APanel.java @@ -2100,6 +2100,33 @@ public final class APanel extends CPanel return m_curTab; } // getCurrentTab + /** + * Get the number of tabs in the panels JTabbedPane. + * @return no of tabs in the JTabbedPane of the panel + */ + public int noOfTabs() { + return m_curWinTab.getTabCount(); + } + + /** + * Get the selected tab index of the panels JTabbedPane. + * @return selected index of JTabbedPane + */ + public int getSelectedTabIndex() { + return m_curWinTab.getSelectedIndex(); + } + + /** + * Get the name of the selected tab in the panels JTabbedPane. + * @return name of selected tab + */ + public String getSelectedTabName() { + String title = m_curWinTab.getTitleAt(m_curWinTab.getSelectedIndex()); + title = title.substring(title.indexOf("")+6); + title = title.substring(0,title.indexOf("<")); + return title; + } + /** * String representation * @return String representation