1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-25 17:28:51 -05:00

* performance hack when deleting cells from huge lists

This commit is contained in:
Reinhard Pointner 2014-02-04 14:34:36 +00:00
parent 8200dfc88f
commit c920efa989

View File

@ -140,6 +140,9 @@ public class RenamePanel extends JComponent {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// lock cell with once user starts deleting cells (performance hack)
setFixedCellWidth(true);
RenameList list = null; RenameList list = null;
boolean deleteCell; boolean deleteCell;
@ -446,6 +449,9 @@ public class RenamePanel extends JComponent {
} else { } else {
renameModel.clear(); renameModel.clear();
} }
// lock cell with once user starts deleting cells (performance hack)
setFixedCellWidth(false);
} }
}; };
@ -598,4 +604,10 @@ public class RenamePanel extends JComponent {
} }
} }
public void setFixedCellWidth(boolean fixed) {
for (RenameList<?> it : new RenameList[] { namesList, filesList }) {
it.getListComponent().setFixedCellWidth(fixed ? (int) it.getListComponent().getPreferredSize().getWidth() : -1);
}
}
} }