TableMapper Fixes (again)

thobaben_diagram
Harald Wolff 2016-12-07 09:01:55 +01:00
parent 0cfca19953
commit 6258fe062d
2 changed files with 16 additions and 7 deletions

View File

@ -0,0 +1,9 @@
package org.hwo.models.TableMapper;
public enum ColumnResizePolicy {
FILL_LINEAR, // totalwidth < viewport : w = w * (totalwidth / viewport.width)
FILL_LAST_COLUMN, // totalwidth < viewport : last volumns width is expanded
}

View File

@ -396,11 +396,14 @@ public class TableMapper extends AbstractTableModel
}
};
jTable.addMouseListener(mouseAdapter);
if (InteractiveObjectHelper.isInteractiveObject(editorObjectClass))
setEditorEnabled(true);
if (ObjectEditorUIHelper.isEditable(editorObjectClass))
setEditorEnabled(true);
initializeJTable();
}
private void initializeMapper()
@ -437,7 +440,6 @@ public class TableMapper extends AbstractTableModel
this.jTable.setRowSorter(new TableRowSorter<TableMapper>(this));
} else {
this.jTable.setRowSorter(null);
}
}
@ -543,7 +545,10 @@ public class TableMapper extends AbstractTableModel
public void openEditor()
{
System.err.println("TableMapper.openEditor()");
if (!isEditorEnabled())
return;
log(DEBUG,"TableMapper.openEditor()");
for (TableMapperListener listener: this.tableMapperListeners){
if (listener.editorRequest(this, getSelectedRow())){
fireTableRowsUpdated(jTable.getSelectedRow(), jTable.getSelectedRow());
@ -772,11 +777,6 @@ public class TableMapper extends AbstractTableModel
int ind = this.p_rows.indexOf(before);
this.p_rows.add(ind, row);
if (TableMapperValue.class.isInstance(row)){
TableMapperValue tmv = (TableMapperValue)row;
tmv.unassignTableMapper(this);
}
fireTableRowsInserted(ind, ind);
} else {
this.p_rows.add(row);