[ 1855851 ] Propose New Look for Collapseable Field Group

- fix layout issue.
This commit is contained in:
Heng Sin Low 2007-12-25 10:29:16 +00:00
parent b7c53ab760
commit 1b0d73c825
1 changed files with 34 additions and 2 deletions

View File

@ -326,8 +326,8 @@ public final class VPanel extends CTabbedPane
{
CollapsiblePanel collapsibleSection = new CollapsiblePanel(fieldGroup);
JXCollapsiblePane m_tab = collapsibleSection.getCollapsiblePane();
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
m_tab.getContentPane().setLayout(new GridBagLayout());
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
setupCollapsiblePaneLayout(m_tab);
m_tab.setName(fieldGroup);
m_gbc.anchor = GridBagConstraints.NORTHWEST;
//m_gbc.gridy = 0; // line
@ -359,6 +359,38 @@ public final class VPanel extends CTabbedPane
return true;
} // addGroup
private void setupCollapsiblePaneLayout(JXCollapsiblePane m_tab) {
m_tab.getContentPane().setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridy = 0; // line
gbc.gridx = 0;
gbc.gridheight = 1;
gbc.gridwidth = 1;
gbc.insets = m_labelInset;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0;
gbc.weighty = 0;
gbc.ipadx = 0;
gbc.ipady = 0;
m_tab.getContentPane().add(Box.createHorizontalGlue() , gbc);
gbc.weightx = 1;
gbc.gridx = 1;
gbc.insets = m_fieldInset;
m_tab.getContentPane().add(Box.createHorizontalGlue() , gbc);
gbc.weightx = 0;
gbc.gridx = 2;
gbc.insets = m_labelInset;
m_tab.getContentPane().add(Box.createHorizontalGlue() , gbc);
gbc.weightx = 1;
gbc.gridx = 3;
gbc.insets = m_fieldInset;
m_tab.getContentPane().add(Box.createHorizontalGlue() , gbc);
}
/**
* Add Top (10) and right (12) gap
*/