* Fixed some UI bugs related to the recently added collapsed grid feature.

This commit is contained in:
Heng Sin Low 2007-10-10 19:25:05 +00:00
parent da3979ec51
commit 549ef12574
3 changed files with 43 additions and 36 deletions

View File

@ -684,13 +684,13 @@ public final class APanel extends CPanel
gc.initGrid(gTab, false, m_curWindowNo, this, mWindow, false); // will set color on Tab level gc.initGrid(gTab, false, m_curWindowNo, this, mWindow, false); // will set color on Tab level
included = parent.includeTab(gc,this); included = parent.includeTab(gc,this);
TabSwitcher ts = new TabSwitcher(parent, this); TabSwitcher ts = new TabSwitcher(parent, this);
Component[] comp = parent.getvPanel().getComponents(); Component[] comp = parent.getvPanel().getComponentsRecursive();
for (int i = 0; i < comp.length; i++) for (int i = 0; i < comp.length; i++)
{ {
ts.addTabSwitchingSupport((JComponent)comp[i]); ts.addTabSwitchingSupport((JComponent)comp[i]);
} }
ts = new TabSwitcher(gc, this); ts = new TabSwitcher(gc, this);
comp = gc.getvPanel().getComponents(); comp = gc.getvPanel().getComponentsRecursive();
for (int i = 0; i < comp.length; i++) for (int i = 0; i < comp.length; i++)
{ {
ts.addTabSwitchingSupport((JComponent)comp[i]); ts.addTabSwitchingSupport((JComponent)comp[i]);

View File

@ -226,7 +226,7 @@ public class GridController extends CPanel
m_mTab.removePropertyChangeListener(vTable); m_mTab.removePropertyChangeListener(vTable);
// editors // editors
Component[] comp = vPanel.getComponents(); Component[] comp = vPanel.getComponentsRecursive();
for (int i = 0; i < comp.length; i++) for (int i = 0; i < comp.length; i++)
{ {
if (comp[i] instanceof VEditor) if (comp[i] instanceof VEditor)
@ -881,7 +881,7 @@ public class GridController extends CPanel
// No Dependents and no Callout - Set just Background // No Dependents and no Callout - Set just Background
if (dependants.size() == 0 && changedField.getCallout().length() > 0) if (dependants.size() == 0 && changedField.getCallout().length() > 0)
{ {
Component[] comp = vPanel.getComponents(); Component[] comp = vPanel.getComponentsRecursive();
for (int i = 0; i < comp.length; i++) for (int i = 0; i < comp.length; i++)
{ {
if (columnName.equals(comp[i].getName ()) && comp[i] instanceof VEditor) if (columnName.equals(comp[i].getName ()) && comp[i] instanceof VEditor)
@ -904,7 +904,7 @@ public class GridController extends CPanel
boolean noData = m_mTab.getRowCount() == 0; boolean noData = m_mTab.getRowCount() == 0;
log.config(m_mTab.toString() + " - Rows=" + m_mTab.getRowCount()); log.config(m_mTab.toString() + " - Rows=" + m_mTab.getRowCount());
// All Components in vPanel (Single Row) // All Components in vPanel (Single Row)
Component[] comps = vPanel.getComponents(); Component[] comps = vPanel.getComponentsRecursive();
for (int i = 0; i < comps.length; i++) for (int i = 0; i < comps.length; i++)
{ {
Component comp = comps[i]; Component comp = comps[i];

View File

@ -22,6 +22,7 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
import java.util.*; import java.util.*;
import java.util.List;
// //
import org.adempiere.plaf.AdempierePLAF; import org.adempiere.plaf.AdempierePLAF;
import org.compiere.grid.ed.*; import org.compiere.grid.ed.*;
@ -635,8 +636,42 @@ public final class VPanel extends CTabbedPane
return (org.jdesktop.swingx.JXTaskPane)m_tabincludelist.get(AD_Tab_ID); return (org.jdesktop.swingx.JXTaskPane)m_tabincludelist.get(AD_Tab_ID);
} }
private void findChildComponents(CPanel container, List list)
{
Component[] comp = container.getComponents();
for (int c = 0; c < comp.length; c++)
{
list.add(comp[c]);
if ( comp [c] instanceof org.jdesktop.swingx.JXTaskPaneContainer)
{
org.jdesktop.swingx.JXTaskPaneContainer panetaskcontainer = (org.jdesktop.swingx.JXTaskPaneContainer)comp [c];
Component[] comppanetask = panetaskcontainer.getComponents();
for (int y = 0; y < comppanetask.length; y++)
{
if ( comppanetask [y] instanceof org.jdesktop.swingx.JXTaskPane)
{
org.jdesktop.swingx.JXTaskPane tabtask = (org.jdesktop.swingx.JXTaskPane)comppanetask[y];
Component[] comptabtask = tabtask.getContentPane().getComponents();
for (int x = 0; x < comptabtask.length; x++)
{
list.add(comptabtask[x]);
}
}
}
} else if (comp[c] instanceof CPanel)
{
findChildComponents((CPanel)comp[c], list);
}
}
}
//[ 1757088 ] //[ 1757088 ]
public Component[] getComponents() public Component[] getComponentsRecursive()
{ {
java.util.ArrayList list = new java.util.ArrayList(); java.util.ArrayList list = new java.util.ArrayList();
@ -645,36 +680,8 @@ public final class VPanel extends CTabbedPane
list.add(this.getComponentAt(i)); list.add(this.getComponentAt(i));
if (this.getComponentAt(i) instanceof CPanel) if (this.getComponentAt(i) instanceof CPanel)
{ {
CPanel tab = (CPanel)this.getComponentAt(i); CPanel panel = (CPanel)this.getComponentAt(i);
Component[] comp = tab.getComponents(); findChildComponents(panel, list);
for (int c = 0; c < comp.length; c++)
{
if ( comp [c] instanceof org.jdesktop.swingx.JXTaskPaneContainer)
{
org.jdesktop.swingx.JXTaskPaneContainer panetaskcontainer = (org.jdesktop.swingx.JXTaskPaneContainer)comp [c];
Component[] comppanetask = panetaskcontainer.getComponents();
for (int y = 0; y < comppanetask.length; y++)
{
if ( comppanetask [y] instanceof org.jdesktop.swingx.JXTaskPane)
{
org.jdesktop.swingx.JXTaskPane tabtask = (org.jdesktop.swingx.JXTaskPane)comppanetask[y];
Component[] comptabtask = tabtask.getContentPane().getComponents();
for (int x = 0; x < comptabtask.length; x++)
{
list.add(comptabtask[x]);
}
}
}
}
list.add(comp[c]);
}
} }
} }