Merge branch 'develop' of github.com:sleuthkit/autopsy into develop

This commit is contained in:
Brian Carrier 2014-03-14 16:43:06 -04:00
commit eb723200f6
3 changed files with 31 additions and 14 deletions

View File

@ -60,7 +60,7 @@
<Component class="javax.swing.JButton" name="listsButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/dropdown-icon.png"/>
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="ListBundleName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
@ -69,10 +69,10 @@
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="rolloverIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/dropdown-icon-rollover.png"/>
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-rollover.png"/>
</Property>
<Property name="rolloverSelectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/dropdown-icon-pressed.png"/>
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-pressed.png"/>
</Property>
</Properties>
<Events>

View File

@ -143,13 +143,13 @@ class KeywordSearchPanel extends javax.swing.JPanel {
setOpaque(false);
listsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/dropdown-icon.png"))); // NOI18N
listsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon.png"))); // NOI18N
listsButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "ListBundleName")); // NOI18N
listsButton.setBorderPainted(false);
listsButton.setContentAreaFilled(false);
listsButton.setEnabled(false);
listsButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/dropdown-icon-rollover.png"))); // NOI18N
listsButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/dropdown-icon-pressed.png"))); // NOI18N
listsButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-rollover.png"))); // NOI18N
listsButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-pressed.png"))); // NOI18N
listsButton.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
listsButtonMousePressed(evt);

View File

@ -260,21 +260,38 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
final boolean literal_query = tcq.isLiteral();
int resID = 0;
for(ContentHit chit : tcqRes.get(tcq.getQueryString())) {
AbstractFile f = chit.getContent();
final Map<AbstractFile, Integer> hitContents = ContentHit.flattenResults(tcqRes);
for (final AbstractFile f : hitContents.keySet()) {
final int previewChunk = hitContents.get(f);
//get unique match result files
Map<String, Object> resMap = new LinkedHashMap<>();
if (chit.hasSnippet()) {
//to generate the preview snippet
//just pick any term that hit that file (since we are compressing result view)
String hit = null;
//find the first hit for this file
for (String hitKey : tcqRes.keySet()) {
List<ContentHit> chits = tcqRes.get(hitKey);
for (ContentHit chit : chits) {
if (chit.getContent().equals(f)) {
hit = hitKey;
if (chit.hasSnippet() && (KeywordSearchUtil.escapeLuceneQuery(hit) != null)) {
setCommonProperty(resMap, CommonPropertyTypes.CONTEXT, chit.getSnippet());
}
break;
}
}
if (hit != null) {
break;
}
}
if (f.getType() == TSK_DB_FILES_TYPE_ENUM.FS) {
AbstractFsContentNode.fillPropertyMap(resMap, (FsContent) f);
}
final String highlightQueryEscaped = getHighlightQuery(tcq, literal_query, tcqRes, f);
tempList.add(new KeyValueQueryContent(f.getName(), resMap, ++resID, f, highlightQueryEscaped, tcq, chit.getChunkId(), tcqRes));
tempList.add(new KeyValueQueryContent(f.getName(), resMap, ++resID, f, highlightQueryEscaped, tcq, previewChunk, tcqRes));
}
// Add all the nodes to toPopulate at once. Minimizes node creation