From b212f6db3b876c39e61b5889d2d9d65dfd4686ee Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Tue, 10 Apr 2018 09:11:29 -0600 Subject: [PATCH] cleanup --- .../commonfilesearch/CommonFilesPanel.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index 864fcaf993..140a3411fe 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -184,6 +184,17 @@ public final class CommonFilesPanel extends javax.swing.JPanel { new SwingWorker, Void>() { private String tabTitle; + + private void setTitleForAllDataSources() { + this.tabTitle = Bundle.CommonFilesPanel_search_results_titleAll(); + } + + private void setTitleForSingleSource(Long dataSourceId) { + final String CommonFilesPanel_search_results_titleSingle = Bundle.CommonFilesPanel_search_results_titleSingle(); + final Object[] dataSourceName = new Object[]{dataSourceMap.get(dataSourceId)}; + + this.tabTitle = String.format(CommonFilesPanel_search_results_titleSingle, dataSourceName); + } private Long determineDataSourceId() { Long selectedObjId = CommonFilesPanel.NO_DATA_SOURCE_SELECTED; @@ -208,14 +219,11 @@ public final class CommonFilesPanel extends javax.swing.JPanel { if (dataSourceId == CommonFilesPanel.NO_DATA_SOURCE_SELECTED) { builder = new AllDataSources(dataSourceMap); - this.tabTitle = Bundle.CommonFilesPanel_search_results_titleAll(); + setTitleForAllDataSources(); } else { builder = new SingleDataSource(dataSourceId, dataSourceMap); - final String CommonFilesPanel_search_results_titleSingle = Bundle.CommonFilesPanel_search_results_titleSingle(); - final Object[] dataSourceName = new Object[]{dataSourceMap.get(dataSourceId)}; - - this.tabTitle = String.format(CommonFilesPanel_search_results_titleSingle, dataSourceName); + setTitleForSingleSource(dataSourceId); } return builder.collateFiles();