diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.form b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.form index e950dbbb18..fa035c2678 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.form +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.form @@ -1,6 +1,10 @@
+ + + + @@ -21,9 +25,22 @@ - - - + + + + + + + + + + + + + + + + @@ -31,7 +48,12 @@ - + + + + + + @@ -49,5 +71,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index d5e8d2d93a..86acc34165 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -19,10 +19,16 @@ package org.sleuthkit.autopsy.commonfilesearch; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import static java.awt.event.ItemEvent.SELECTED; +import java.sql.ResultSet; import java.sql.SQLException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; +import javax.swing.AbstractListModel; +import javax.swing.ComboBoxModel; import javax.swing.SwingWorker; +import javax.swing.event.ListDataListener; import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; @@ -41,6 +47,8 @@ import org.sleuthkit.datamodel.TskCoreException; public final class CommonFilesPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; + + private final ComboBoxModel dataSourcesList; private static final Logger LOGGER = Logger.getLogger(CommonFilesPanel.class.getName()); @@ -48,6 +56,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel { * Creates new form CommonFilesPanel */ public CommonFilesPanel() { + this.dataSourcesList = new DataSourceComboBoxModel(new String[1]); initComponents(); } @@ -122,6 +131,48 @@ public final class CommonFilesPanel extends javax.swing.JPanel { } }.execute(); } + + private class DataSourceComboBoxModel extends AbstractListModel implements ComboBoxModel { + + private static final long serialVersionUID = 1L; + private final String[] dataSourceList; + String selection = null; + + DataSourceComboBoxModel(String[] theDataSoureList) { + dataSourceList = theDataSoureList; + } + @Override + public void setSelectedItem(Object anItem) { + selection = (String) anItem; + } + + @Override + public Object getSelectedItem() { + return selection; + } + + @Override + public int getSize() { + return dataSourceList.length; + } + + @Override + public String getElementAt(int index) { + return dataSourceList[index]; + } + + @Override + public void addListDataListener(ListDataListener l) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void removeListDataListener(ListDataListener l) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + + } /** * This method is called from within the constructor to initialize the form. @@ -132,7 +183,11 @@ public final class CommonFilesPanel extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { + dataSourcesButtonGroup = new javax.swing.ButtonGroup(); searchButton = new javax.swing.JButton(); + allDatasourcesRadio = new javax.swing.JRadioButton(); + withinDataSourceRadioButton = new javax.swing.JRadioButton(); + selectDataSourceComboBox = new javax.swing.JComboBox<>(); setPreferredSize(new java.awt.Dimension(300, 300)); @@ -143,19 +198,56 @@ public final class CommonFilesPanel extends javax.swing.JPanel { } }); + dataSourcesButtonGroup.add(allDatasourcesRadio); + allDatasourcesRadio.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(allDatasourcesRadio, org.openide.util.NbBundle.getMessage(CommonFilesPanel.class, "CommonFilesPanel.allDatasourcesRadio.text")); // NOI18N + allDatasourcesRadio.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + allDatasourcesRadioActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(withinDataSourceRadioButton, org.openide.util.NbBundle.getMessage(CommonFilesPanel.class, "CommonFilesPanel.withinDataSourceRadioButton.text")); // NOI18N + withinDataSourceRadioButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + withinDataSourceRadioButtonActionPerformed(evt); + } + }); + + selectDataSourceComboBox.setModel(dataSourcesList); + selectDataSourceComboBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectDataSourceComboBoxActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(325, Short.MAX_VALUE) - .addComponent(searchButton) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(searchButton)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(allDatasourcesRadio) + .addComponent(withinDataSourceRadioButton) + .addComponent(selectDataSourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(266, Short.MAX_VALUE) + .addComponent(allDatasourcesRadio) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(withinDataSourceRadioButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(selectDataSourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE) .addComponent(searchButton) .addContainerGap()) ); @@ -165,8 +257,25 @@ public final class CommonFilesPanel extends javax.swing.JPanel { search(); }//GEN-LAST:event_searchButtonActionPerformed + private void allDatasourcesRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_allDatasourcesRadioActionPerformed + selectDataSourceComboBox.setEnabled(evt.getID() != SELECTED); + + }//GEN-LAST:event_allDatasourcesRadioActionPerformed + + private void selectDataSourceComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectDataSourceComboBoxActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_selectDataSourceComboBoxActionPerformed + + private void withinDataSourceRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_withinDataSourceRadioButtonActionPerformed + selectDataSourceComboBox.setEnabled(evt.getID() == SELECTED); + }//GEN-LAST:event_withinDataSourceRadioButtonActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JRadioButton allDatasourcesRadio; + private javax.swing.ButtonGroup dataSourcesButtonGroup; private javax.swing.JButton searchButton; + private javax.swing.JComboBox selectDataSourceComboBox; + private javax.swing.JRadioButton withinDataSourceRadioButton; // End of variables declaration//GEN-END:variables } diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index ceacaae7fb..b1adb5d40b 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Fri, 09 Mar 2018 13:03:41 -0700 +#Mon, 19 Mar 2018 11:17:11 -0700 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538