From 284b671ea82652ba8dcb69ca0e5b6ed252cc5df7 Mon Sep 17 00:00:00 2001 From: millmanorama Date: Thu, 15 Jun 2017 16:12:41 +0200 Subject: [PATCH] dont set NodesColumnLabel until after assigning all the properties columns --- .../corecomponents/DataResultViewerTable.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index 0cb66c9bea..5222c892ae 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -248,7 +248,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer { /** * Create Column Headers based on the Content represented by the Nodes in - * the table. Load persisted column order, sorting and visibility. + * the table. Load persisted column order, sorting and visibility. */ private void setupTable() { /* @@ -269,9 +269,10 @@ public class DataResultViewerTable extends AbstractDataResultViewer { * allow the first property column to be moved. */ List> props = loadColumnOrder(); - if (props.isEmpty() == false) { - Node.Property prop = props.remove(0); - ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(prop.getDisplayName()); + boolean propsExist = props.isEmpty() == false; + Node.Property firstProp = null; + if (propsExist) { + firstProp = props.remove(0); } /* @@ -282,6 +283,10 @@ public class DataResultViewerTable extends AbstractDataResultViewer { outline.setAutoResizeMode((props.isEmpty()) ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF); assignColumns(props); // assign columns to match the properties + if (firstProp != null) { + ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(firstProp.getDisplayName()); + } + setColumnWidths(); //Load column sorting information from preferences file and apply it to columns.