Menu ▾ ▴

#1475 Column width behaviour in Oracle plugin

SQuirreL
closed-fixed
nobody
None
medium
2021-05-24
2021-05-18
Chris B
No

Windows "Session info", "SGA trace" and "Invalid objects":

When any of those is opened, the embedded JTable is populated automatically.
After that, the column widths are adjusted to the table content, but with a maximum column width of 300.
So far this works pretty OK and the widths are appropriate, I think.
However, after reloading the content, the widths of all columns are reduced to a (too) small standard width.

The probable reason is that with each reload a new TableModel object is created.
E.g. in SGATracePanel.populateSGATrace():

:
rs = s.getResultSet();
DefaultTableModel tm = createTableModel();
while (rs.next())
:

So column settings get lost and columns are recreated with a standard width of 75.

A simple solution I could think of is to check if the JTable already has a non-empty table model and then to reset it with setRowCount(0):

:
DefaultTableModel tm;
if ((_sgaTrace.getModel().getColumnCount() > 0) && (_sgaTrace.getModel() instanceof DefaultTableModel))
{
  tm = (DefaultTableModel)_sgaTrace.getModel();
  tm.setRowCount(0);
}
else
{
  tm = createTableModel();
}
:

Discussion

  • Chris B

    Chris B - 2021-05-18

    btw: I would like to suggest to activate a basic sorting functionality in those windows.
    E.g. in SGATracePanel.createGUI():

    _sgaTrace = new AutoWidthResizeTable();
    _sgaTrace.setAutoCreateRowSorter(true);
    

    Possibly not the perfect sorting rule for each column, but a quick win and better than no sorting functionality at all, I think.

     
  • Gerd Wagner

    Gerd Wagner - 2021-05-22
    • status: open --> closed-fixed
     
  • Gerd Wagner

    Gerd Wagner - 2021-05-22

    Thanks you for the changes.
    Is fixed and will be available in future snapshots and versions.

    Excerpt from change log:
    1475 Oracle Plugin: SGA-Trace/Session Info/Invalid objects windows:

    • Column widths changed on refresh
    • Columns are now sortable
    • Windows are opened centered on SQuirreL's main window and sizes are remembered.
      Thanks to Chris B for parts of the changes.
     
  • Chris B

    Chris B - 2021-05-24

    Hi Gerd,

    thanks for taking care of this.
    But have I just seen it correctly, that you have modified the column width behaviour for "SGA-Trace" and "Session Info" only ... but not for "Invalid objects" ?

    KR, CB

     
  • Gerd Wagner

    Gerd Wagner - 2021-05-24

    ... is now fixed for "Invalid objects", too. Sorry for the inconvenience.
    Gerd

     

Log in to post a comment.