Multi-Column client window - ID: 2086368

http://sourceforge.net/tracker/?func=detail&atid=879335&aid=2086368&group_id=176962
This commit is contained in:
phib 2009-12-09 23:58:51 +00:00
parent 016b85744a
commit 02678a408d
2 changed files with 30 additions and 3 deletions

View File

@ -424,12 +424,13 @@ public class GridController extends CPanel
// VEditor => this - New Editor value to be updated here (MTable) // VEditor => this - New Editor value to be updated here (MTable)
vEditor.addVetoableChangeListener(this); vEditor.addVetoableChangeListener(this);
// Add to VPanel // Add to VPanel
vPanel.addField(vEditor, mField); vPanel.addFieldBuffered(vEditor, mField);
// APanel Listen to buttons // APanel Listen to buttons
if (mField.getDisplayType() == DisplayType.Button && m_aPanel != null) if (mField.getDisplayType() == DisplayType.Button && m_aPanel != null)
((JButton)vEditor).addActionListener (m_aPanel); ((JButton)vEditor).addActionListener (m_aPanel);
} }
} // for all fields } // for all fields
vPanel.addFieldBuffered(null, null); // flush the last one through
// No Included Grid Controller // No Included Grid Controller
/* /*

View File

@ -173,6 +173,10 @@ public final class VPanel extends CTabbedPane
} }
}; };
private VEditor prevEditor = null;
private GridField prevField = null;
private boolean wrap = false;
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger (VPanel.class); private static CLogger log = CLogger.getCLogger (VPanel.class);
@ -205,10 +209,25 @@ public final class VPanel extends CTabbedPane
} // setMnemonic } // setMnemonic
/** /**
* Add Field and Label to Panel * Add Field and Label to buffer and push buffered field to Panel
* @param editor editor * @param editor editor
* @param mField field model * @param mField field model
*/ */
public void addFieldBuffered (VEditor editor, GridField mField)
{
wrap = mField != null ? !mField.isSameLine() : false;
if ( prevEditor != null && prevField != null)
addField(prevEditor, prevField);
prevEditor = editor;
prevField = mField;
}
/**
* Add the previous Field and Label to Panel
* @param editor editor
* @param mField field model
* @param wrap move to next line after this field
*/
public void addField (VEditor editor, GridField mField) public void addField (VEditor editor, GridField mField)
{ {
//[ 1757088 ] //[ 1757088 ]
@ -266,7 +285,10 @@ public final class VPanel extends CTabbedPane
// *** The Label *** // *** The Label ***
if ( label == null) if ( label == null)
{
label = new CLabel(""); label = new CLabel("");
label.setName(mField.getColumnName());
}
// //
if (mField.isCreateMnemonic()) if (mField.isCreateMnemonic())
setMnemonic(label, mField.getMnemonic()); setMnemonic(label, mField.getMnemonic());
@ -300,6 +322,10 @@ public final class VPanel extends CTabbedPane
{ {
constraints += mField.isLongField() ? ",spanx" : ""; constraints += mField.isLongField() ? ",spanx" : "";
} }
if ( wrap )
{
constraints += ", wrap";
}
// Add Field // Add Field
//[ 1757088 ] //[ 1757088 ]