Skip to content

Commit

Permalink
uitools updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Jan 20, 2025
1 parent ebac67d commit 3feb9fb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/org/magic/services/tools/UITools.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ public static JXTable createNewTable(TableModel mod, boolean enableFilter)
var table = new JXTable();
if(mod!=null)
table.setModel(mod);


if(mod instanceof GenericTableModel gtm)
table.setName(gtm.getId());



table.setDefaultRenderer(Boolean.class, new BooleanCellEditorRenderer());
table.setDefaultRenderer(Double.class, new DoubleCellEditorRenderer());
Expand Down Expand Up @@ -299,6 +295,8 @@ public static JXTable createNewTable(TableModel mod, boolean enableFilter)
table.setRowHeight(MTGConstants.TABLE_ROW_HEIGHT);
table.setPreferredScrollableViewportSize(new java.awt.Dimension(800,600));



try {
table.packAll();
}
Expand All @@ -310,6 +308,14 @@ public static JXTable createNewTable(TableModel mod, boolean enableFilter)
if(enableFilter)
initTableFilter(table);



if(mod instanceof GenericTableModel gtm)
{
table.setName(gtm.getId());
}


//TODO dev for columns state records
table.getColumnModel().addColumnModelListener(new TableColumnModelExtListenerAdapter() {
@Override
Expand Down

0 comments on commit 3feb9fb

Please sign in to comment.