diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties index 689533fdfe..94b497d2ff 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties @@ -41,3 +41,4 @@ RecentFilesPanel.downloadLabel.text=Recent Downloads RecentFilesPanel.attachmentLabel.text=Recent Attachments PastCasesPanel.notableFileLabel.text=Cases with Common Items That Were Tagged as Notable PastCasesPanel.sameIdLabel.text=Past Cases with the Same Device IDs +DataSourceSummaryTabbedPane.noDataSourceLabel.text=No data source has been selected. diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED index 9a48089e5d..f03f55df38 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED @@ -94,6 +94,7 @@ RecentFilesPanel.downloadLabel.text=Recent Downloads RecentFilesPanel.attachmentLabel.text=Recent Attachments PastCasesPanel.notableFileLabel.text=Cases with Common Items That Were Tagged as Notable PastCasesPanel.sameIdLabel.text=Past Cases with the Same Device IDs +DataSourceSummaryTabbedPane.noDataSourceLabel.text=No data source has been selected. UserActivityPanel_noDataExists=No communication data exists UserActivityPanel_tab_title=User Activity UserActivityPanel_TopAccountTableModel_accountType_header=Account Type diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.form b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.form index d4edf4b0ee..56b4314181 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.form @@ -67,7 +67,7 @@ - + @@ -79,7 +79,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.java index 8d2fb8c846..5269bdff67 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryDialog.java @@ -121,7 +121,7 @@ final class DataSourceSummaryDialog extends javax.swing.JDialog implements Obser closeButton = new javax.swing.JButton(); dataSourceSummarySplitPane = new javax.swing.JSplitPane(); - javax.swing.JTabbedPane dataSourceTabbedPane = dataSourceSummaryTabbedPane; + javax.swing.JPanel dataSourceTabbedPane = dataSourceSummaryTabbedPane; org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(DataSourceSummaryDialog.class, "DataSourceSummaryDialog.closeButton.text")); // NOI18N closeButton.addActionListener(new java.awt.event.ActionListener() { diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.form b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.form new file mode 100644 index 0000000000..7c01388a52 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.form @@ -0,0 +1,61 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.java index cee151b68a..55320f7dbb 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/DataSourceSummaryTabbedPane.java @@ -18,11 +18,11 @@ */ package org.sleuthkit.autopsy.datasourcesummary.ui; +import java.awt.CardLayout; import java.awt.Component; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; -import javax.swing.JTabbedPane; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel; import org.sleuthkit.datamodel.DataSource; @@ -40,7 +40,7 @@ import org.sleuthkit.datamodel.DataSource; "DataSourceSummaryTabbedPane_pastCasesTab_title=Past Cases", "DataSourceSummaryTabbedPane_analysisTab_title=Analysis" }) -public class DataSourceSummaryTabbedPane extends JTabbedPane { +public class DataSourceSummaryTabbedPane extends javax.swing.JPanel { /** * Records of tab information (i.e. title, component, function to call on @@ -111,6 +111,9 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane { } private static final long serialVersionUID = 1L; + // needs to match value provided for card layout in designed + private static final String TABBED_PANE = "tabbedPane"; + private static final String NO_DATASOURCE_PANE = "noDataSourcePane"; private final IngestJobInfoPanel ingestHistoryPanel = new IngestJobInfoPanel(); @@ -127,18 +130,30 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane { ); private DataSource dataSource = null; + private CardLayout cardLayout; /** - * Constructs a tabbed pane showing the summary of a data source. + * Creates new form TabPane */ public DataSourceSummaryTabbedPane() { - initComponent(); + initComponents(); + postInit(); } - private void initComponent() { + /** + * Method called right after initComponents during initialization. + */ + private void postInit() { + // get the card layout + cardLayout = (CardLayout) this.getLayout(); + + // set up the tabs for (DataSourceTab tab : tabs) { - addTab(tab.getTabTitle(), tab.getComponent()); + tabbedPane.addTab(tab.getTabTitle(), tab.getComponent()); } + + // set this to no datasource initially + cardLayout.show(this, NO_DATASOURCE_PANE); } /** @@ -157,9 +172,13 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane { */ public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - - for (DataSourceTab tab : tabs) { - tab.getOnDataSource().accept(dataSource); + if (this.dataSource == null) { + cardLayout.show(this, NO_DATASOURCE_PANE); + } else { + for (DataSourceTab tab : tabs) { + tab.getOnDataSource().accept(dataSource); + } + cardLayout.show(this, TABBED_PANE); } } @@ -171,4 +190,34 @@ public class DataSourceSummaryTabbedPane extends JTabbedPane { tab.getOnClose().run(); } } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + tabbedPane = new javax.swing.JTabbedPane(); + javax.swing.JPanel noDataSourcePane = new javax.swing.JPanel(); + javax.swing.JLabel noDataSourceLabel = new javax.swing.JLabel(); + + setLayout(new java.awt.CardLayout()); + add(tabbedPane, "tabbedPane"); + + noDataSourcePane.setLayout(new java.awt.BorderLayout()); + + noDataSourceLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + org.openide.awt.Mnemonics.setLocalizedText(noDataSourceLabel, org.openide.util.NbBundle.getMessage(DataSourceSummaryTabbedPane.class, "DataSourceSummaryTabbedPane.noDataSourceLabel.text")); // NOI18N + noDataSourcePane.add(noDataSourceLabel, java.awt.BorderLayout.CENTER); + + add(noDataSourcePane, "noDataSourcePane"); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTabbedPane tabbedPane; + // End of variables declaration//GEN-END:variables }