19 package org.sleuthkit.autopsy.modules.hashdatabase;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.regex.Pattern;
26 import javax.swing.JFrame;
27 import javax.swing.JMenuItem;
28 import javax.swing.JPopupMenu;
29 import javax.swing.SwingUtilities;
30 import org.openide.util.NbBundle;
31 import org.openide.windows.WindowManager;
42 Pattern md5Pattern = Pattern.compile(
"^[a-fA-F0-9]{32}$");
43 List<HashEntry> hashes =
new ArrayList<>();
44 List<String> invalidHashes =
new ArrayList<>();
51 super((JFrame) WindowManager.getDefault().getMainWindow(),
60 setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
70 void enableAddHashValuesToDatabaseDialog(
boolean enable) {
72 setDefaultCloseOperation(2);
74 setDefaultCloseOperation(0);
86 @SuppressWarnings(
"unchecked")
97 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
105 public void mouseClicked(java.awt.event.MouseEvent evt) {
113 public void actionPerformed(java.awt.event.ActionEvent evt) {
120 public void actionPerformed(java.awt.event.ActionEvent evt) {
126 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
127 public void actionPerformed(java.awt.event.ActionEvent evt) {
132 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
133 getContentPane().setLayout(layout);
134 layout.setHorizontalGroup(
135 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
136 .addGroup(layout.createSequentialGroup()
138 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139 .addGroup(layout.createSequentialGroup()
141 .addGap(0, 0, Short.MAX_VALUE))
144 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
146 .addComponent(
cancelButton, javax.swing.GroupLayout.Alignment.TRAILING)
150 layout.setVerticalGroup(
151 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
152 .addGroup(layout.createSequentialGroup()
155 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
156 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
157 .addGroup(layout.createSequentialGroup()
159 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
161 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
163 .addComponent(
jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE))
181 if (SwingUtilities.isRightMouseButton(evt)) {
182 JPopupMenu popup =
new JPopupMenu();
184 JMenuItem cutMenu =
new JMenuItem(
"Cut");
185 cutMenu.addActionListener(
new ActionListener() {
187 public void actionPerformed(ActionEvent e) {
192 JMenuItem copyMenu =
new JMenuItem(
"Copy");
193 copyMenu.addActionListener(
new ActionListener() {
195 public void actionPerformed(ActionEvent e) {
200 JMenuItem pasteMenu =
new JMenuItem(
"Paste");
201 pasteMenu.addActionListener(
new ActionListener() {
203 public void actionPerformed(ActionEvent e) {
211 popup.add(pasteMenu);
218 progressDialog.addHashValuesToDatabase();
void cancelButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton pasteFromClipboardButton
void hashValuesTextAreaMouseClicked(java.awt.event.MouseEvent evt)
void pasteFromClipboardButtonActionPerformed(java.awt.event.ActionEvent evt)
void AddValuesToHashDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JTextArea hashValuesTextArea
javax.swing.JButton AddValuesToHashDatabaseButton
javax.swing.JLabel instructionLabel
javax.swing.JScrollPane jScrollPane1
javax.swing.JButton cancelButton