From 1e33c701324568c1766a6ffd1dacbaccbd66477e Mon Sep 17 00:00:00 2001 From: millmanorama Date: Thu, 15 Mar 2018 14:06:44 +0100 Subject: [PATCH 1/2] fix opening AccountsBrowser in the Netbeans Design View --- .../sleuthkit/autopsy/communications/AccountsBrowser.form | 5 +++++ .../sleuthkit/autopsy/communications/AccountsBrowser.java | 1 + 2 files changed, 6 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form index 8642d90664..1c1bc033f5 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form @@ -17,6 +17,9 @@ + + + @@ -31,6 +34,8 @@ + + diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java index 9827b4bec3..dbe2c51bdd 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java @@ -141,6 +141,7 @@ public final class AccountsBrowser extends JPanel implements ExplorerManager.Pro setLayout(new java.awt.BorderLayout()); + jSplitPane1.setDividerLocation(500); jSplitPane1.setLeftComponent(outlineView); add(jSplitPane1, java.awt.BorderLayout.CENTER); From ead7d952b073debd7f3e6b7eb104923a792488ac Mon Sep 17 00:00:00 2001 From: millmanorama Date: Thu, 15 Mar 2018 14:08:37 +0100 Subject: [PATCH 2/2] replace deprecated Case.getCurrentCase() with Case.getOpenCase() --- .../sleuthkit/autopsy/communications/AccountsBrowser.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java index dbe2c51bdd..534da9d557 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java @@ -34,6 +34,7 @@ import org.openide.nodes.Children; import org.openide.util.Lookup; import org.openide.util.lookup.ProxyLookup; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.CommunicationsManager; import org.sleuthkit.datamodel.TskCoreException; @@ -89,7 +90,7 @@ public final class AccountsBrowser extends JPanel implements ExplorerManager.Pro jSplitPane1.setRightComponent(messageBrowser); proxyLookup = new ProxyLookup( - messageBrowser.getLookup(), + messageBrowser.getLookup(), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); } @@ -120,10 +121,12 @@ public final class AccountsBrowser extends JPanel implements ExplorerManager.Pro @Subscribe public void handleFilterEvent(CVTEvents.FilterChangeEvent filterChangeEvent) { try { - final CommunicationsManager commsManager = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager(); + final CommunicationsManager commsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager(); accountsTableEM.setRootContext(new AbstractNode(Children.create(new AccountDeviceInstanceNodeFactory(commsManager, filterChangeEvent.getNewFilter()), true))); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "There was an error getting the CommunicationsManager for the current case.", ex); + } catch (NoCurrentCaseException ex) { //NOPMD empty catch clause + //Case is closed, do nothig. } }