Merge remote-tracking branch 'upstream/develop' into 1252-FilterPanel-bug-fix

This commit is contained in:
Kelly Kelly 2019-05-24 11:12:51 -04:00
commit 202f593a68
14 changed files with 160 additions and 100 deletions

View File

@ -171,7 +171,8 @@ public class IngestEventsListener {
}
/**
* Configure the listener to flag previously seen devices or not.
* Configure the listener to flag devices previously seen in other cases or
* not.
*
* @param value True to flag seen devices; otherwise false.
*/
@ -318,7 +319,7 @@ public class IngestEventsListener {
LOGGER.log(Level.SEVERE, "Failed to connect to Central Repository database.", ex);
return;
}
switch (IngestManager.IngestJobEvent.valueOf(evt.getPropertyName())) {
case DATA_SOURCE_ANALYSIS_COMPLETED: {
jobProcessingExecutor.submit(new AnalysisCompleteTask(dbManager, evt));
@ -332,10 +333,10 @@ public class IngestEventsListener {
}
private final class AnalysisCompleteTask implements Runnable {
private final EamDb dbManager;
private final PropertyChangeEvent event;
private AnalysisCompleteTask(EamDb db, PropertyChangeEvent evt) {
dbManager = db;
event = evt;
@ -361,15 +362,15 @@ public class IngestEventsListener {
long dataSourceObjectId = -1;
try {
dataSource = ((DataSourceAnalysisCompletedEvent) event).getDataSource();
/*
* We only care about Images for the purpose of
* updating hash values.
* We only care about Images for the purpose of updating hash
* values.
*/
if (!(dataSource instanceof Image)) {
return;
}
dataSourceName = dataSource.getName();
dataSourceObjectId = dataSource.getId();
@ -397,7 +398,7 @@ public class IngestEventsListener {
if (StringUtils.equals(imageMd5Hash, crMd5Hash) == false) {
correlationDataSource.setMd5(imageMd5Hash);
}
String imageSha1Hash = image.getSha1();
if (imageSha1Hash == null) {
imageSha1Hash = "";
@ -406,7 +407,7 @@ public class IngestEventsListener {
if (StringUtils.equals(imageSha1Hash, crSha1Hash) == false) {
correlationDataSource.setSha1(imageSha1Hash);
}
String imageSha256Hash = image.getSha256();
if (imageSha256Hash == null) {
imageSha256Hash = "";
@ -489,9 +490,13 @@ public class IngestEventsListener {
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.IMSI_TYPE_ID
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.MAC_TYPE_ID)) {
try {
Long countPreviousOccurences = dbManager.getCountArtifactInstancesByTypeValue(eamArtifact.getCorrelationType(), eamArtifact.getCorrelationValue());
if (countPreviousOccurences > 0) {
postCorrelatedPreviousArtifactToBlackboard(bbArtifact);
//only alert to previous instances when they were in another case
List<CorrelationAttributeInstance> previousOccurences = dbManager.getArtifactInstancesByTypeValue(eamArtifact.getCorrelationType(), eamArtifact.getCorrelationValue());
for (CorrelationAttributeInstance instance : previousOccurences) {
if (!instance.getCorrelationCase().getCaseUUID().equals(eamArtifact.getCorrelationCase().getCaseUUID())) {
postCorrelatedPreviousArtifactToBlackboard(bbArtifact);
break;
}
}
} catch (CorrelationAttributeNormalizationException ex) {
LOGGER.log(Level.INFO, String.format("Unable to flag notable item: %s.", eamArtifact.toString()), ex);

View File

@ -1,4 +1,4 @@
IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings
IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag previously seen devices
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag devices previously seen in other cases
IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository

View File

@ -12,5 +12,5 @@ CentralRepoIngestModuleFactory.ingestmodule.desc=Saves properties to the central
CentralRepoIngestModuleFactory.ingestmodule.name=Correlation Engine
IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings
IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag previously seen devices
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag devices previously seen in other cases
IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository

View File

@ -70,7 +70,7 @@ final class IngestSettings implements IngestModuleIngestJobSettings {
}
/**
* Are previously seen devices to be flagged?
* Are devices previously seen in other cases to be flagged?
*
* @return True if flagging; otherwise false.
*/

View File

@ -72,7 +72,7 @@ final class AccountDeviceInstanceNode extends AbstractNode {
}
@Override
@NbBundle.Messages(value = {"AccountNode.device=Device", "AccountNode.accountName=Account", "AccountNode.accountType=Type", "AccountNode.messageCount=Msgs"})
@NbBundle.Messages(value = {"AccountNode.device=Device", "AccountNode.accountName=Account", "AccountNode.accountType=Type", "AccountNode.messageCount=Messages"})
protected Sheet createSheet() {
Sheet sheet = super.createSheet();
Sheet.Set properties = sheet.get(Sheet.PROPERTIES);

View File

@ -1,7 +1,7 @@
AccountNode.accountName=Account
AccountNode.accountType=Type
AccountNode.device=Device
AccountNode.messageCount=Msgs
AccountNode.messageCount=Messages
applyText=Apply
CTL_OpenCVTAction=Communications
CVTTopComponent.name=\ Communications Visualization

View File

@ -3,8 +3,6 @@ SummaryViewer.countsPanel.border.title=Counts
SummaryViewer.emailLabel.text=Emails:
SummaryViewer.contactsLabel.text=Contacts:
SummaryViewer.attachmentsLabel.text=Attachments:
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
OutlineViewPanel.messageLabel.text=<Control Disabled>
SummaryViewer.messagesDataLabel.text=messages
SummaryViewer.callLogsDataLabel.text=callLogs
@ -13,3 +11,5 @@ SummaryViewer.emailDataLabel.text=emails
SummaryViewer.attachmentsDataLabel.text=attachments
SummaryViewer.messagesLabel.text=Messages:
SummaryViewer.callLogsLabel.text=Call Logs:
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case

View File

@ -9,6 +9,7 @@ ContactNode_URL=URL
ContactsViewer_columnHeader_Email=Email
ContactsViewer_columnHeader_Name=Name
ContactsViewer_columnHeader_Phone=Phone
ContactsViewer_noContacts_message=<No contacts found for selected account>
ContactsViewer_tabTitle=Contacts
MediaViewer_Name=Media
MessageNode_Node_Property_Attms=Attachments
@ -22,13 +23,12 @@ MessageViewer_columnHeader_Date=Date
MessageViewer_columnHeader_From=From
MessageViewer_columnHeader_Subject=Subject
MessageViewer_columnHeader_To=To
MessageViewer_no_messages=<No messages found for selected account>
MessageViewer_tabTitle=Messages
SummaryViewer.countsPanel.border.title=Counts
SummaryViewer.emailLabel.text=Emails:
SummaryViewer.contactsLabel.text=Contacts:
SummaryViewer.attachmentsLabel.text=Attachments:
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
OutlineViewPanel.messageLabel.text=<Control Disabled>
SummaryViewer.messagesDataLabel.text=messages
SummaryViewer.callLogsDataLabel.text=callLogs
@ -37,8 +37,10 @@ SummaryViewer.emailDataLabel.text=emails
SummaryViewer.attachmentsDataLabel.text=attachments
SummaryViewer.messagesLabel.text=Messages:
SummaryViewer.callLogsLabel.text=Call Logs:
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer_CaseRefNameColumn_Title=Case Name
SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Case References>
SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Other Occurrences>
SummaryViewer_Creation_Date_Title=Creation Date
SummaryViewer_FileRefNameColumn_Title=Path
SummaryViewer_TabTitle=Summary

View File

@ -16,27 +16,24 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="outlineView" max="32767" attributes="0"/>
<Component id="contactPane" alignment="0" max="32767" attributes="0"/>
<Component id="contactPane" max="32767" attributes="0"/>
<Component id="outlineViewPanel" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="outlineView" pref="350" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Component id="contactPane" pref="400" max="32767" attributes="0"/>
<Component id="outlineViewPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="contactPane" pref="332" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="org.openide.explorer.view.OutlineView" name="outlineView">
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.openide.explorer.view.OutlineView()"/>
</AuxValues>
</Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane" name="contactPane">
</Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel" name="outlineViewPanel">
</Component>
</SubComponents>
</Form>

View File

@ -23,7 +23,7 @@ import java.awt.KeyboardFocusManager;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import static javax.swing.SwingUtilities.isDescendingFrom;
import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline;
@ -32,6 +32,8 @@ import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.nodes.NodeAdapter;
import org.openide.nodes.NodeMemberEvent;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider;
@ -45,9 +47,9 @@ import org.sleuthkit.datamodel.BlackboardAttribute;
*
*/
@ServiceProvider(service = RelationshipsViewer.class)
public final class ContactsViewer extends JPanel implements RelationshipsViewer, ExplorerManager.Provider, Lookup.Provider {
public final class ContactsViewer extends JPanel implements RelationshipsViewer{
private final ExplorerManager tableEM;
// private final ExplorerManager tableEM;
private final Outline outline;
private final ModifiableProxyLookup proxyLookup;
private final PropertyChangeListener focusPropertyListener;
@ -57,14 +59,19 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
"ContactsViewer_tabTitle=Contacts",
"ContactsViewer_columnHeader_Name=Name",
"ContactsViewer_columnHeader_Phone=Phone",
"ContactsViewer_columnHeader_Email=Email",})
"ContactsViewer_columnHeader_Email=Email",
"ContactsViewer_noContacts_message=<No contacts found for selected account>"
})
/**
* Visualization for contact nodes.
*/
public ContactsViewer() {
tableEM = new ExplorerManager();
proxyLookup = new ModifiableProxyLookup(createLookup(tableEM, getActionMap()));
initComponents();
outlineViewPanel.hideOutlineView(Bundle.ContactsViewer_noContacts_message());
proxyLookup = new ModifiableProxyLookup(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
nodeFactory = new ContactsChildNodeFactory(null);
// See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed
@ -81,30 +88,44 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
proxyLookup.setNewLookups(createLookup(contactPane.getExplorerManager(), getActionMap()));
} else if (isDescendingFrom(newFocusOwner, ContactsViewer.this)) {
//... or if it is within the Results table.
proxyLookup.setNewLookups(createLookup(tableEM, getActionMap()));
proxyLookup.setNewLookups(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
}
}
};
initComponents();
outline = outlineView.getOutline();
outlineView.setPropertyColumns(
outline = outlineViewPanel.getOutlineView().getOutline();
outlineViewPanel.getOutlineView().setPropertyColumns(
"TSK_EMAIL", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getDisplayName(),
"TSK_PHONE_NUMBER", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getDisplayName()
);
outline.setRootVisible(false);
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.ContactsViewer_columnHeader_Name());
outlineViewPanel.hideOutlineView("<No contacts for selected account>");
tableEM.addPropertyChangeListener((PropertyChangeEvent evt) -> {
outlineViewPanel.getExplorerManager().addPropertyChangeListener((PropertyChangeEvent evt) -> {
if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
final Node[] nodes = tableEM.getSelectedNodes();
final Node[] nodes = outlineViewPanel.getExplorerManager().getSelectedNodes();
contactPane.setNode(nodes);
}
});
tableEM.setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), getExplorerManager()), true));
outlineViewPanel.getExplorerManager().setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), outlineViewPanel.getExplorerManager()), true));
// When a new set of nodes are added to the OutlineView the childrenAdded
// seems to be fired before the childrenRemoved.
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter(){
@Override
public void childrenAdded(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
});
}
@Override
@ -124,12 +145,7 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
nodeFactory.refresh(info);
}
@Override
public ExplorerManager getExplorerManager() {
return tableEM;
}
@Override
public Lookup getLookup() {
return proxyLookup;
@ -140,14 +156,23 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
super.addNotify();
//add listener that maintains correct selection in the Global Actions Context
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.addPropertyChangeListener("focusOwner", focusPropertyListener);
.addPropertyChangeListener("focusOwner", focusPropertyListener); //NON-NLS
}
@Override
public void removeNotify() {
super.removeNotify();
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.removePropertyChangeListener("focusOwner", focusPropertyListener);
.removePropertyChangeListener("focusOwner", focusPropertyListener); //NON-NLS
}
private void updateOutlineViewPanel() {
int nodeCount = outlineViewPanel.getExplorerManager().getRootContext().getChildren().getNodesCount();
if(nodeCount == 0) {
outlineViewPanel.hideOutlineView(Bundle.ContactsViewer_noContacts_message());
} else {
outlineViewPanel.showOutlineView();
}
}
/**
@ -159,28 +184,28 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
outlineView = new org.openide.explorer.view.OutlineView();
contactPane = new org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane();
outlineViewPanel = new org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outlineViewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
.addGap(1, 1, 1)
.addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
.addComponent(outlineViewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane contactPane;
private org.openide.explorer.view.OutlineView outlineView;
private org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel outlineViewPanel;
// End of variables declaration//GEN-END:variables
}

View File

@ -16,27 +16,27 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="outlineView" alignment="0" max="32767" attributes="0"/>
<Component id="contentViewer" alignment="1" max="32767" attributes="0"/>
<Component id="contentViewer" max="32767" attributes="0"/>
<Component id="outlineViewPanel" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="outlineView" pref="300" max="32767" attributes="0"/>
<Component id="outlineViewPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="contentViewer" pref="500" max="32767" attributes="0"/>
<Component id="contentViewer" pref="390" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="org.openide.explorer.view.OutlineView" name="outlineView">
</Component>
<Component class="org.sleuthkit.autopsy.contentviewers.MessageContentViewer" name="contentViewer">
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MessageDataContent()"/>
</AuxValues>
</Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel" name="outlineViewPanel">
</Component>
</SubComponents>
</Form>

View File

@ -23,7 +23,7 @@ import java.awt.KeyboardFocusManager;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import static javax.swing.SwingUtilities.isDescendingFrom;
import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline;
@ -32,6 +32,8 @@ import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.nodes.NodeAdapter;
import org.openide.nodes.NodeMemberEvent;
import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider;
@ -43,9 +45,8 @@ import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
* Visualation for the messages of the currently selected accounts.
*/
@ServiceProvider(service = RelationshipsViewer.class)
public final class MessagesViewer extends JPanel implements RelationshipsViewer, ExplorerManager.Provider, Lookup.Provider {
public final class MessagesViewer extends JPanel implements RelationshipsViewer {
private final ExplorerManager tableEM;
private final Outline outline;
private final ModifiableProxyLookup proxyLookup;
private final PropertyChangeListener focusPropertyListener;
@ -57,15 +58,19 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
"MessageViewer_columnHeader_To=To",
"MessageViewer_columnHeader_Date=Date",
"MessageViewer_columnHeader_Subject=Subject",
"MessageViewer_columnHeader_Attms=Attachments"
"MessageViewer_columnHeader_Attms=Attachments",
"MessageViewer_no_messages=<No messages found for selected account>"
})
/**
* Visualation for the messages of the currently selected accounts.
*/
public MessagesViewer() {
tableEM = new ExplorerManager();
proxyLookup = new ModifiableProxyLookup(createLookup(tableEM, getActionMap()));
initComponents();
outlineViewPanel.hideOutlineView(Bundle.MessageViewer_no_messages());
proxyLookup = new ModifiableProxyLookup(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
nodeFactory = new MessagesChildNodeFactory(null);
// See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed
@ -82,29 +87,26 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
proxyLookup.setNewLookups(createLookup(((MessageDataContent) contentViewer).getExplorerManager(), getActionMap()));
} else if (isDescendingFrom(newFocusOwner, MessagesViewer.this)) {
//... or if it is within the Results table.
proxyLookup.setNewLookups(createLookup(tableEM, getActionMap()));
proxyLookup.setNewLookups(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
}
}
};
initComponents();
outline = outlineView.getOutline();
outlineView.setPropertyColumns(
outline = outlineViewPanel.getOutlineView().getOutline();
outlineViewPanel.getOutlineView().setPropertyColumns(
"From", Bundle.MessageViewer_columnHeader_From(),
"To", Bundle.MessageViewer_columnHeader_To(),
"Date", Bundle.MessageViewer_columnHeader_Date(),
"Subject", Bundle.MessageViewer_columnHeader_Subject(),
"Attms", Bundle.MessageViewer_columnHeader_Attms(),
"Type", "Type"
"Attms", Bundle.MessageViewer_columnHeader_Attms()
);
outline.setRootVisible(false);
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Type");
tableEM.addPropertyChangeListener((PropertyChangeEvent evt) -> {
outlineViewPanel.getExplorerManager().addPropertyChangeListener((PropertyChangeEvent evt) -> {
if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
final Node[] nodes = tableEM.getSelectedNodes();
final Node[] nodes = outlineViewPanel.getExplorerManager().getSelectedNodes();
if (nodes != null && nodes.length == 1) {
contentViewer.setNode(nodes[0]);
@ -115,7 +117,27 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
}
});
tableEM.setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), getExplorerManager()), true));
outlineViewPanel.getExplorerManager().setRootContext(
new TableFilterNode(
new DataResultFilterNode(
new AbstractNode(
Children.create(nodeFactory, true)),
outlineViewPanel.getExplorerManager()),
true));
// When a new set of nodes are added to the OutlineView the childrenAdded
// seems to be fired before the childrenRemoved.
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter() {
@Override
public void childrenAdded(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
});
}
@Override
@ -133,11 +155,6 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
nodeFactory.refresh(info);
}
@Override
public ExplorerManager getExplorerManager() {
return tableEM;
}
@Override
public Lookup getLookup() {
return proxyLookup;
@ -157,6 +174,15 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.removePropertyChangeListener("focusOwner", focusPropertyListener);
}
private void updateOutlineViewPanel() {
int nodeCount = outlineViewPanel.getExplorerManager().getRootContext().getChildren().getNodesCount();
if(nodeCount == 0) {
outlineViewPanel.hideOutlineView(Bundle.MessageViewer_no_messages());
} else {
outlineViewPanel.showOutlineView();
}
}
/**
* This method is called from within the constructor to initialize the form.
@ -167,28 +193,28 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
outlineView = new org.openide.explorer.view.OutlineView();
contentViewer = new MessageDataContent();
outlineViewPanel = new org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(contentViewer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outlineViewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addComponent(outlineViewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE))
.addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.sleuthkit.autopsy.contentviewers.MessageContentViewer contentViewer;
private org.openide.explorer.view.OutlineView outlineView;
private org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel outlineViewPanel;
// End of variables declaration//GEN-END:variables
}

View File

@ -19,6 +19,7 @@
package org.sleuthkit.autopsy.communications.relationships;
import java.awt.CardLayout;
import javax.swing.SwingUtilities;
import org.openide.explorer.ExplorerManager;
import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.explorer.view.OutlineView;
@ -62,17 +63,21 @@ public class OutlineViewPanel extends javax.swing.JPanel implements ExplorerMana
* @param message String message to show on the panel.
*/
public void hideOutlineView(String message) {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "messageCard"); //NON-NLS
messageLabel.setText(message);
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "messageCard"); //NON-NLS
messageLabel.setText(message);
});
}
/**
* Hides the message panel and shows the OutlineView.
*/
public void showOutlineView() {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "outlineCard"); //NON-NLS
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "outlineCard"); //NON-NLS
});
}
/**

View File

@ -45,7 +45,7 @@ public class SummaryViewer extends javax.swing.JPanel implements RelationshipsVi
"SummaryViewer_TabTitle=Summary",
"SummaryViewer_FileRefNameColumn_Title=Path",
"SummaryViewer_CaseRefNameColumn_Title=Case Name",
"SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Case References>",
"SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Other Occurrences>",
"SummaryViewer_Creation_Date_Title=Creation Date"
})