diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index bc14db3b7d..e2036e6f25 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -64,12 +64,54 @@ public class Installer extends ModuleInstall { //Note: if shipping with a different CRT version, this will only print a warning //and try to use linker mechanism to find the correct versions of libs. //We should update this if we officially switch to a new version of CRT/compiler - System.loadLibrary("msvcr100"); //NON-NLS - System.loadLibrary("msvcp100"); //NON-NLS + System.loadLibrary("api-ms-win-core-console-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-datetime-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-debug-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-errorhandling-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-file-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-file-l1-2-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-file-l2-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-handle-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-heap-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-interlocked-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-libraryloader-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-localization-l1-2-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-memory-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-namedpipe-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-processenvironment-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-processthreads-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-processthreads-l1-1-1"); //NON-NLS + System.loadLibrary("api-ms-win-core-profile-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-rtlsupport-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-string-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-synch-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-synch-l1-2-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-sysinfo-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-timezone-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-core-util-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-conio-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-convert-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-environment-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-filesystem-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-heap-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-locale-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-math-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-multibyte-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-private-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-process-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-runtime-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-stdio-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-string-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-time-l1-1-0"); //NON-NLS + System.loadLibrary("api-ms-win-crt-utility-l1-1-0"); //NON-NLS - logger.log(Level.INFO, "MSVCR100 and MSVCP100 libraries loaded"); //NON-NLS + System.loadLibrary("ucrtbase"); //NON-NLS + System.loadLibrary("vcruntime140"); //NON-NLS + System.loadLibrary("msvcp140"); //NON-NLS + + logger.log(Level.INFO, "Visual C Runtime libraries loaded"); //NON-NLS } catch (UnsatisfiedLinkError e) { - logger.log(Level.SEVERE, "Error loading MSVCR100 and MSVCP100 libraries, ", e); //NON-NLS + logger.log(Level.SEVERE, "Error loading Visual C Runtime libraries, ", e); //NON-NLS } try { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index 64c60e542d..6f5a83c56d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -147,6 +147,14 @@ final public class Accounts implements AutopsyVisitableItem { */ private abstract class ObservingChildren extends Children.Keys { + /** + * Override of default constructor to force lazy creation of nodes, by + * concrete instances of ObservingChildren + */ + ObservingChildren() { + super(true); + } + /** * Create of keys used by this Children object to represent the child * nodes. @@ -1036,8 +1044,8 @@ final public class Accounts implements AutopsyVisitableItem { private BINNode(BinResult bin) { super(Children.LEAF); - setChildren(Children.createLazy(CreditCardNumberFactory::new)); this.bin = bin; + setChildren(Children.createLazy(CreditCardNumberFactory::new)); setName(getBinRangeString()); updateDisplayName(); this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/bank.png"); //NON-NLS @@ -1356,18 +1364,27 @@ final public class Accounts implements AutopsyVisitableItem { */ if (newStatus == BlackboardArtifact.ReviewStatus.REJECTED && showRejected == false) { List siblings = Arrays.asList(node.getParentNode().getChildren().getNodes()); - int indexOf = siblings.indexOf(node); - //there is no previous for the first node, so instead we select the next one - Node sibling = indexOf > 0 - ? siblings.get(indexOf - 1) - : siblings.get(indexOf + 1); - createPath = NodeOp.createPath(sibling, null); + if (siblings.size() > 1) { + int indexOf = siblings.indexOf(node); + //there is no previous for the first node, so instead we select the next one + Node sibling = indexOf > 0 + ? siblings.get(indexOf - 1) + : siblings.get(Integer.max(indexOf + 1, siblings.size() - 1)); + createPath = NodeOp.createPath(sibling, null); + } else { + /* if there are no other siblings to select, + * just return null, but note we need to filter + * this out of stream below */ + return null; + } } else { createPath = NodeOp.createPath(node, null); } //for the reselect to work we need to strip off the first part of the path. return Arrays.copyOfRange(createPath, 1, createPath.length); - }).collect(Collectors.toList()); + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); //change status of selected artifacts final Collection artifacts = Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleKeywordSearchPanel.form similarity index 100% rename from KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.form rename to KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleKeywordSearchPanel.form diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleKeywordSearchPanel.java similarity index 68% rename from KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java rename to KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleKeywordSearchPanel.java index 4f5ffe545b..9201bcfddf 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleKeywordSearchPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.keywordsearch; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -27,11 +26,15 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import javax.swing.JMenuItem; - import org.sleuthkit.autopsy.coreutils.Logger; /** - * A simple UI for finding text after ingest + * A dropdown panel that provides GUI components that allow a user to do three + * types of ad hoc single keyword searches. The first option is a standard + * Lucene query for one or more terms, with or without wildcards and explicit + * Boolean operators, or a phrase. The second option is a Lucene query for a + * substring of a single term. The third option is a regex query using first the + * terms component, followed by standard Lucene queries for any terms found. * * The toolbar uses a different font from the rest of the application, * Monospaced 14, due to the necessity to find a font that displays both Arabic @@ -39,48 +42,62 @@ import org.sleuthkit.autopsy.coreutils.Logger; * perform this task at the desired size, and neither could numerous other * fonts. */ -public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { +public class DropdownSingleKeywordSearchPanel extends KeywordSearchPanel { - private static final Logger logger = Logger.getLogger(DropdownSingleTermSearchPanel.class.getName()); - private static DropdownSingleTermSearchPanel instance = null; + private static final long serialVersionUID = 1L; + private static final Logger LOGGER = Logger.getLogger(DropdownSingleKeywordSearchPanel.class.getName()); + private static DropdownSingleKeywordSearchPanel defaultInstance = null; /** - * Creates new form DropdownSingleTermSearchPanel + * Gets the default instance of a dropdown panel that provides GUI + * components that allow a user to do three types of ad hoc single keyword + * searches. */ - public DropdownSingleTermSearchPanel() { + public static synchronized DropdownSingleKeywordSearchPanel getDefault() { + if (null == defaultInstance) { + defaultInstance = new DropdownSingleKeywordSearchPanel(); + } + return defaultInstance; + } + + /** + * Constructs a dropdown panel that provides GUI components that allow a + * user to do three types of ad hoc single keyword searches. + */ + public DropdownSingleKeywordSearchPanel() { initComponents(); customizeComponents(); } + /** + * Does additional initialization of the GUI components created by the + * initComponents method. + */ private void customizeComponents() { keywordTextField.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { - //do nothing } @Override public void focusLost(FocusEvent e) { if (keywordTextField.getText().equals("")) { - resetSearchBox(); + clearSearchBox(); } } }); keywordTextField.setComponentPopupMenu(rightClickMenu); - ActionListener actList = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JMenuItem jmi = (JMenuItem) e.getSource(); - if (jmi.equals(cutMenuItem)) { - keywordTextField.cut(); - } else if (jmi.equals(copyMenuItem)) { - keywordTextField.copy(); - } else if (jmi.equals(pasteMenuItem)) { - keywordTextField.paste(); - } else if (jmi.equals(selectAllMenuItem)) { - keywordTextField.selectAll(); - } + ActionListener actList = (ActionEvent e) -> { + JMenuItem jmi = (JMenuItem) e.getSource(); + if (jmi.equals(cutMenuItem)) { + keywordTextField.cut(); + } else if (jmi.equals(copyMenuItem)) { + keywordTextField.copy(); + } else if (jmi.equals(pasteMenuItem)) { + keywordTextField.paste(); + } else if (jmi.equals(selectAllMenuItem)) { + keywordTextField.selectAll(); } }; cutMenuItem.addActionListener(actList); @@ -89,36 +106,43 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { selectAllMenuItem.addActionListener(actList); } - public static synchronized DropdownSingleTermSearchPanel getDefault() { - if (instance == null) { - instance = new DropdownSingleTermSearchPanel(); - } - return instance; - } - + /** + * Add an action listener to the Search buttom component of the panel. + * + * @param actionListener The actin listener. + */ void addSearchButtonActionListener(ActionListener actionListener) { searchButton.addActionListener(actionListener); } - void resetSearchBox() { + /** + * Clears the text in the query text field, i.e., sets it to the emtpy + * string. + */ + void clearSearchBox() { keywordTextField.setText(""); } + /** + * Gets a single keyword list consisting of a single keyword encapsulating + * the input term(s)/phrase/substring/regex. + * + * @return The keyword list. + */ @Override List getKeywordLists() { List keywords = new ArrayList<>(); - keywords.add(new Keyword(keywordTextField.getText(), - !regexRadioButton.isSelected(), exactRadioButton.isSelected())); - + keywords.add(new Keyword(keywordTextField.getText(), !regexRadioButton.isSelected(), exactRadioButton.isSelected())); List keywordLists = new ArrayList<>(); keywordLists.add(new KeywordList(keywords)); - return keywordLists; } + /** + * Not implemented. + */ @Override protected void postFilesIndexedChange() { - //nothing to update } /** @@ -142,20 +166,20 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { substringRadioButton = new javax.swing.JRadioButton(); regexRadioButton = new javax.swing.JRadioButton(); - org.openide.awt.Mnemonics.setLocalizedText(cutMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.cutMenuItem.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(cutMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.cutMenuItem.text")); // NOI18N rightClickMenu.add(cutMenuItem); - org.openide.awt.Mnemonics.setLocalizedText(copyMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.copyMenuItem.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(copyMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.copyMenuItem.text")); // NOI18N rightClickMenu.add(copyMenuItem); - org.openide.awt.Mnemonics.setLocalizedText(pasteMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.pasteMenuItem.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(pasteMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.pasteMenuItem.text")); // NOI18N rightClickMenu.add(pasteMenuItem); - org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.selectAllMenuItem.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.selectAllMenuItem.text")); // NOI18N rightClickMenu.add(selectAllMenuItem); - keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N NON-NLS - keywordTextField.setText(org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.keywordTextField.text")); // NOI18N + keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N + keywordTextField.setText(org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.keywordTextField.text")); // NOI18N keywordTextField.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(192, 192, 192), 1, true)); keywordTextField.setMinimumSize(new java.awt.Dimension(2, 25)); keywordTextField.setPreferredSize(new java.awt.Dimension(2, 25)); @@ -170,8 +194,8 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { } }); - searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N NON-NLS - org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.searchButton.text")); // NOI18N + searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.searchButton.text")); // NOI18N searchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { searchButtonActionPerformed(evt); @@ -180,13 +204,13 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { queryTypeButtonGroup.add(exactRadioButton); exactRadioButton.setSelected(true); - org.openide.awt.Mnemonics.setLocalizedText(exactRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.exactRadioButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(exactRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.exactRadioButton.text")); // NOI18N queryTypeButtonGroup.add(substringRadioButton); - org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.substringRadioButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.substringRadioButton.text")); // NOI18N queryTypeButtonGroup.add(regexRadioButton); - org.openide.awt.Mnemonics.setLocalizedText(regexRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.regexRadioButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(regexRadioButton, org.openide.util.NbBundle.getMessage(DropdownSingleKeywordSearchPanel.class, "DropdownSearchPanel.regexRadioButton.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -224,18 +248,33 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { ); }// //GEN-END:initComponents + /** + * Action performed by the action listener for the search button. + * + * @param evt The action event. + */ private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed keywordTextFieldActionPerformed(evt); }//GEN-LAST:event_searchButtonActionPerformed + /** + * Action performed by the action listener for the keyword text field. + * + * @param evt The action event. + */ private void keywordTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordTextFieldActionPerformed try { search(); } catch (Exception e) { - logger.log(Level.SEVERE, "search() threw exception", e); //NON-NLS + LOGGER.log(Level.SEVERE, "Error performing ad hoc single keyword search", e); //NON-NLS } }//GEN-LAST:event_keywordTextFieldActionPerformed + /** + * Mouse event handler for the keyword text field. + * + * @param evt The mouse event. + */ private void keywordTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_keywordTextFieldMouseClicked if (evt.isPopupTrigger()) { rightClickMenu.show(evt.getComponent(), evt.getX(), evt.getY()); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownToolbar.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownToolbar.java index 7c24b99337..70219e3f3e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownToolbar.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownToolbar.java @@ -1,26 +1,21 @@ /* * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. + * + * Copyright 2003-2016 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * DropdownToolbar - * - */ package org.sleuthkit.autopsy.keywordsearch; import java.awt.event.ActionEvent; @@ -37,22 +32,26 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.RuntimeProperties; /** - * Keyword search tool bar (in upper right, by default) with drop down panels - * for ad hoc searches by list or expression. + * A panel that provides a toolbar button for the dropdown keyword list search + * panel and dropdown single keyword search panel. Displayed in the upper right + * hand corner of the application by default. */ class DropdownToolbar extends javax.swing.JPanel { - private static final Logger logger = Logger.getLogger(DropdownToolbar.class.getName()); - private KeywordPropertyChangeListener listener; - private boolean active = false; + private static final long serialVersionUID = 1L; + private static final Logger LOGGER = Logger.getLogger(DropdownToolbar.class.getName()); private static DropdownToolbar instance; - private DropdownSingleTermSearchPanel dropPanel = null; - - private DropdownToolbar() { - initComponents(); - customizeComponents(); - } + private SearchSettingsChangeListener searchSettingsChangeListener; + private boolean active = false; + private DropdownSingleKeywordSearchPanel dropPanel = null; + /** + * Gets the singleton panel that provides a toolbar button for the dropdown + * keyword list search panel and dropdown single keyword search panel. + * Displayed in the upper right hand corner of the application by default. + * + * @return The panel. + */ public synchronized static DropdownToolbar getDefault() { if (instance == null) { instance = new DropdownToolbar(); @@ -60,18 +59,30 @@ class DropdownToolbar extends javax.swing.JPanel { return instance; } + /** + * Constructs a panel that provides a toolbar button for the dropdown + * keyword list search panel and dropdown single keyword search panel. + * Displayed in the upper right hand corner of the application by default. + */ + private DropdownToolbar() { + initComponents(); + customizeComponents(); + } + + /** + * Does additional initialization of the GUI components created by the + * initComponents method. + */ private void customizeComponents() { - listener = new KeywordPropertyChangeListener(); - KeywordSearch.getServer().addServerActionListener(listener); - Case.addPropertyChangeListener(listener); + searchSettingsChangeListener = new SearchSettingsChangeListener(); + KeywordSearch.getServer().addServerActionListener(searchSettingsChangeListener); + Case.addPropertyChangeListener(searchSettingsChangeListener); DropdownListSearchPanel listsPanel = DropdownListSearchPanel.getDefault(); - listsPanel.addSearchButtonActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - listsMenu.setVisible(false); - } + listsPanel.addSearchButtonActionListener((ActionEvent e) -> { + listsMenu.setVisible(false); }); + // Adding border of six to account for menu border listsMenu.setSize(listsPanel.getPreferredSize().width + 6, listsPanel.getPreferredSize().height + 6); listsMenu.add(listsPanel); @@ -92,7 +103,7 @@ class DropdownToolbar extends javax.swing.JPanel { } }); - dropPanel = DropdownSingleTermSearchPanel.getDefault(); + dropPanel = DropdownSingleKeywordSearchPanel.getDefault(); dropPanel.addSearchButtonActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -120,6 +131,27 @@ class DropdownToolbar extends javax.swing.JPanel { } + private void maybeShowListsPopup(MouseEvent evt) { + if (!active) { + return; + } + if (evt != null && !SwingUtilities.isLeftMouseButton(evt)) { + return; + } + listsMenu.show(listsButton, listsButton.getWidth() - listsMenu.getWidth(), listsButton.getHeight() - 1); + } + + private void maybeShowSearchPopup(MouseEvent evt) { + if (!active) { + return; + } + if (evt != null && !SwingUtilities.isLeftMouseButton(evt)) { + return; + } + searchMenu.show(searchDropButton, searchDropButton.getWidth() - searchMenu.getWidth(), searchDropButton.getHeight() - 1); + } + + /** * 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 @@ -216,13 +248,13 @@ class DropdownToolbar extends javax.swing.JPanel { private javax.swing.JPopupMenu searchMenu; // End of variables declaration//GEN-END:variables - private class KeywordPropertyChangeListener implements PropertyChangeListener { + private class SearchSettingsChangeListener implements PropertyChangeListener { @Override public void propertyChange(PropertyChangeEvent evt) { String changed = evt.getPropertyName(); if (changed.equals(Case.Events.CURRENT_CASE.toString())) { - dropPanel.resetSearchBox(); + dropPanel.clearSearchBox(); setFields(null != evt.getNewValue() && RuntimeProperties.coreComponentsAreActive()); } else if (changed.equals(Server.CORE_EVT)) { final Server.CORE_EVT_STATES state = (Server.CORE_EVT_STATES) evt.getNewValue(); @@ -232,9 +264,9 @@ class DropdownToolbar extends javax.swing.JPanel { final int numIndexedFiles = KeywordSearch.getServer().queryNumIndexedFiles(); KeywordSearch.fireNumIndexedFilesChange(null, numIndexedFiles); } catch (NoOpenCoreException ex) { - logger.log(Level.SEVERE, "Error executing Solr query, {0}", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error executing Solr query, {0}", ex); //NON-NLS } catch (KeywordSearchModuleException se) { - logger.log(Level.SEVERE, "Error executing Solr query, {0}", se.getMessage()); //NON-NLS + LOGGER.log(Level.SEVERE, "Error executing Solr query, {0}", se.getMessage()); //NON-NLS } break; case STOPPED: @@ -251,23 +283,4 @@ class DropdownToolbar extends javax.swing.JPanel { } } - private void maybeShowListsPopup(MouseEvent evt) { - if (!active) { - return; - } - if (evt != null && !SwingUtilities.isLeftMouseButton(evt)) { - return; - } - listsMenu.show(listsButton, listsButton.getWidth() - listsMenu.getWidth(), listsButton.getHeight() - 1); - } - - private void maybeShowSearchPopup(MouseEvent evt) { - if (!active) { - return; - } - if (evt != null && !SwingUtilities.isLeftMouseButton(evt)) { - return; - } - searchMenu.show(searchDropButton, searchDropButton.getWidth() - searchMenu.getWidth(), searchDropButton.getHeight() - 1); - } } diff --git a/build-windows.xml b/build-windows.xml index 41a96016ab..d922476dd4 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -43,68 +43,40 @@ - - - - + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - @@ -115,57 +87,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.xml b/build.xml index b1e2fdb14a..b1c6f4149d 100755 --- a/build.xml +++ b/build.xml @@ -92,8 +92,6 @@ - - diff --git a/thirdparty/crt/update.bat b/thirdparty/crt/update.bat deleted file mode 100644 index 807264ff07..0000000000 --- a/thirdparty/crt/update.bat +++ /dev/null @@ -1,9 +0,0 @@ -REM Updates the 32-bit and 64-bit VS Runtime dlls -REM Needs to be run from a 64-bit command prompt -REM Otherwise Windows will put 32-bit dlls in system32 -copy c:\windows\system32\msvcr100.dll win64 -copy c:\windows\system32\msvcp100.dll win64 -copy c:\windows\system32\msvcr120.dll win64 -copy c:\windows\sysWoW64\msvcr100.dll win32 -copy c:\windows\sysWow64\msvcp100.dll win32 -copy c:\windows\sysWow64\msvcr120.dll win32 diff --git a/thirdparty/crt/win32/msvcp100.dll b/thirdparty/crt/win32/msvcp100.dll deleted file mode 100755 index 8502dfae5e..0000000000 Binary files a/thirdparty/crt/win32/msvcp100.dll and /dev/null differ diff --git a/thirdparty/crt/win32/msvcr100.dll b/thirdparty/crt/win32/msvcr100.dll deleted file mode 100755 index 3e82b1aeac..0000000000 Binary files a/thirdparty/crt/win32/msvcr100.dll and /dev/null differ diff --git a/thirdparty/crt/win64/msvcp100.dll b/thirdparty/crt/win64/msvcp100.dll deleted file mode 100755 index 6f0cdf160a..0000000000 Binary files a/thirdparty/crt/win64/msvcp100.dll and /dev/null differ diff --git a/thirdparty/crt/win64/msvcr100.dll b/thirdparty/crt/win64/msvcr100.dll deleted file mode 100755 index b1c3a5e77c..0000000000 Binary files a/thirdparty/crt/win64/msvcr100.dll and /dev/null differ