From e840fa0a0ee787964d48d058caa00a42896aea97 Mon Sep 17 00:00:00 2001 From: Tim McIver Date: Fri, 11 Jan 2013 12:35:02 -0500 Subject: [PATCH] These changes in support of AUT-740 concerning KeywordSearch 'Advanced Keyword Search Configuration' dialog box. Renamed 'Save As' button to 'Copy List'. Added cancel button. Altered logic so that when a copy list operation is aborted, a dialog no longer pops up saying that the list was saved. --- .../AdvancedConfigurationDialog.form | 24 +++++++++++--- .../AdvancedConfigurationDialog.java | 32 ++++++++++++++----- .../autopsy/corecomponents/Bundle.properties | 1 + .../autopsy/keywordsearch/Bundle.properties | 2 +- .../KeywordSearchConfigurationPanel1.java | 5 +-- .../KeywordSearchEditListPanel.java | 1 - 6 files changed, 48 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form b/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form index 554b08dbe3..c43b3f6718 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form @@ -59,18 +59,22 @@ - - + + + + - - - + + + + + @@ -83,6 +87,16 @@ + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java index 3758ee7760..e2a787a37a 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java @@ -85,6 +85,7 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4)); jPanel1 = new javax.swing.JPanel(); applyButton = new javax.swing.JButton(); + cancelButton = new javax.swing.JButton(); filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4)); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); @@ -98,21 +99,31 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { applyButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.applyButton.text")); // NOI18N + cancelButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.cancelButton.text")); // NOI18N + cancelButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cancelButtonActionPerformed(evt); + } + }); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(343, Short.MAX_VALUE) - .addComponent(applyButton) - .addContainerGap()) + .addContainerGap(242, Short.MAX_VALUE) + .addComponent(applyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(12, 12, 12)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(2, 2, 2) - .addComponent(applyButton) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(applyButton) + .addComponent(cancelButton)) + .addGap(0, 4, Short.MAX_VALUE)) ); getContentPane().add(jPanel1); @@ -121,8 +132,13 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { pack(); }// //GEN-END:initComponents + private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed + close(); + }//GEN-LAST:event_cancelButtonActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton applyButton; + private javax.swing.JButton cancelButton; private javax.swing.Box.Filler filler1; private javax.swing.Box.Filler filler2; private javax.swing.JPanel jPanel1; @@ -132,8 +148,8 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { public void addApplyButtonListener(ActionListener l) { this.applyButton.addActionListener(l); } - + public void close() { - this.dispose(); + dispose(); } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties index de17cfba58..2296419cd9 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties @@ -103,3 +103,4 @@ GeneralPanel.useBestViewerRB.text=Change to the most specific file viewer GeneralPanel.keepCurrentViewerRB.text=Stay on the same file viewer GeneralPanel.useBestViewerRB.toolTipText=For example, change from Hex to Media when a JPEG is selected. GeneralPanel.keepCurrentViewerRB.toolTipText=For example, stay in Hex view when a JPEG is selected. +AdvancedConfigurationDialog.cancelButton.text=Cancel diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties index 48a458800a..7151abdaf1 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties @@ -18,7 +18,7 @@ ExtractedContentPanel.hitPreviousButton.text= ExtractedContentPanel.hitNextButton.text= ExtractedContentPanel.copyMenuItem.text=Copy ExtractedContentPanel.selectAllMenuItem.text=Select All -KeywordSearchEditListPanel.saveListButton.text=Save As +KeywordSearchEditListPanel.saveListButton.text=Copy List KeywordSearchEditListPanel.addWordField.text= KeywordSearchEditListPanel.addWordButton.text=Add KeywordSearchEditListPanel.chRegex.text=Regular Expression diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java index a511a47e55..d22390f0a9 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java @@ -118,10 +118,11 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel impleme if (shouldAdd) { writer.addList(listName, keywords); + KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List <" + listName + "> saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); } - currentKeywordList = writer.getList(listName); - KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List <" + listName + "> saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); + //currentKeywordList = writer.getList(listName); + listsManagementPanel.resync(); } }); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java index 1a91b8cecd..70889cd3fc 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java @@ -37,7 +37,6 @@ import javax.swing.DefaultListSelectionModel; import javax.swing.JCheckBox; import javax.swing.JFileChooser; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent;