* You use setColumnList to produce the column descriptors for outline fields for code generation; you cannot use it to dynamically change the outline column descriptors for a ListView field displaying data.
* @param columns
*/
public void setColumnList(Array_Of_OutlineColumnDesc<OutlineColumnDesc> columns){
// === Column model setup ===
ArrayColumnModel cm = new ArrayColumnModel();
int colNum = 0;
// TF:14 Jul 2009:Placing a check if columns are null
if (columns == null) {
return;
}
String[] propNames = new String[columns.size()];
boolean isDraggable = false;
for (OutlineColumnDesc col : (List<OutlineColumnDesc>)columns){
int alignment = JLabel.LEFT;
switch (col.getAlignment()){
case Constants.TA_LEFT:
alignment = JLabel.LEFT;
break;
case Constants.TA_RIGHT:
alignment = JLabel.RIGHT;
break;
case Constants.TA_CENTER:
alignment = JLabel.CENTER;
break;
}
int colWidth = 0;
if (col.getArrayColumn() != null) {
colWidth = col.getArrayColumn().getMinWidth();
}
else if (col.getActualWidth() >= 0) {
colWidth = col.getActualWidth();
}
else {
// TF:19/3/08: Added in a factor to make the columns approximately as wide as they are in Forte.
colWidth = (int)(UIutils.colsToPixels(col.getMaxCharacters(), this) * UIutils.FORTE_COLUMNS_SCALING_FACTOR);
}
AlignedCellRenderer renderer = new AlignedCellRenderer(alignment, col.getName().toString());
renderer.setInsets(0, 2, 0, 2);
ArrayColumn ac = new ArrayColumn(col.getName().toString(),
colNum,
colWidth,
renderer,
false,
new Integer(col.getTitleMsgNum()));
// CraigM:18/07/2008 - We need to set the size policy as it is used in ArrayFieldModel.resizeColumnIfNecessary()
ac.setSizePolicy(col.getSizePolicy());
// TF:19/06/2008:In Forte, the user could always adjust the widths of the columns in a list view. If we use
// setMinWidth (as the ArrayColumn constructor does) then the user cannot reduce the columns smaller than
// their initial size. Hence we use setMinWidth(0) and setPreferredWith. This is done here rather than in
// the array column constructor as this rule applies only for list views, not array fields.
ac.setMinWidth(0);
ac.setPreferredWidth(colWidth);
col.setArrayColumn(ac);
cm.addColumn(ac, col.getTitle().toString(), col.getState() != Constants.FS_INVISIBLE);
propNames[colNum] = col.getName().toString();
colNum++;
if (col.getState() == Constants.FS_DRAG) {