Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
AddImageErrorsDialog.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.casemodule;
20 
21 import java.awt.Frame;
22 import javax.swing.JDialog;
23 
27 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
28 public class AddImageErrorsDialog extends JDialog {
29 
36  public AddImageErrorsDialog(Frame parent, boolean modal) {
37  super(parent, modal);
38  initComponents();
39  }
40 
46  @SuppressWarnings("unchecked")
47  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
48  private void initComponents() {
49 
50  jScrollPane1 = new javax.swing.JScrollPane();
51  errorsText = new javax.swing.JTextArea();
52  copyButton = new javax.swing.JButton();
53  closeButton = new javax.swing.JButton();
54 
55  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
56  setTitle(org.openide.util.NbBundle.getMessage(AddImageErrorsDialog.class, "AddImageErrorsDialog.title")); // NOI18N
57  setIconImage(null);
58  setIconImages(null);
59 
60  errorsText.setBackground(new java.awt.Color(240, 240, 240));
61  errorsText.setColumns(20);
62  errorsText.setEditable(false);
63  errorsText.setRows(5);
64  jScrollPane1.setViewportView(errorsText);
65 
66  org.openide.awt.Mnemonics.setLocalizedText(copyButton, org.openide.util.NbBundle.getMessage(AddImageErrorsDialog.class, "AddImageErrorsDialog.copyButton.text")); // NOI18N
67  copyButton.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageErrorsDialog.class, "AddImageErrorsDialog.copyButton.toolTipText")); // NOI18N
68  copyButton.addActionListener(new java.awt.event.ActionListener() {
69  public void actionPerformed(java.awt.event.ActionEvent evt) {
70  copyButtonActionPerformed(evt);
71  }
72  });
73 
74  org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(AddImageErrorsDialog.class, "AddImageErrorsDialog.closeButton.text")); // NOI18N
75  closeButton.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageErrorsDialog.class, "AddImageErrorsDialog.closeButton.toolTipText")); // NOI18N
76  closeButton.addActionListener(new java.awt.event.ActionListener() {
77  public void actionPerformed(java.awt.event.ActionEvent evt) {
78  closeButtonActionPerformed(evt);
79  }
80  });
81 
82  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
83  getContentPane().setLayout(layout);
84  layout.setHorizontalGroup(
85  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
86  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)
87  .addGroup(layout.createSequentialGroup()
88  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
89  .addComponent(copyButton)
90  .addGap(18, 18, 18)
91  .addComponent(closeButton))
92  );
93  layout.setVerticalGroup(
94  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95  .addGroup(layout.createSequentialGroup()
96  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
97  .addGap(0, 0, 0)
98  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
99  .addComponent(closeButton)
100  .addComponent(copyButton)))
101  );
102 
103  pack();
104  }// </editor-fold>//GEN-END:initComponents
105 
106  private void copyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyButtonActionPerformed
107  errorsText.selectAll();
108  errorsText.copy();
109  }//GEN-LAST:event_copyButtonActionPerformed
110 
111  private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
112  setVisible(false);
113  }//GEN-LAST:event_closeButtonActionPerformed
114 
115  public void appendErrors(String errors) {
116  errorsText.append(errors + "\n");
117  }
118  // Variables declaration - do not modify//GEN-BEGIN:variables
119  private javax.swing.JButton closeButton;
120  private javax.swing.JButton copyButton;
121  private javax.swing.JTextArea errorsText;
122  private javax.swing.JScrollPane jScrollPane1;
123  // End of variables declaration//GEN-END:variables
124 }
void copyButtonActionPerformed(java.awt.event.ActionEvent evt)
void closeButtonActionPerformed(java.awt.event.ActionEvent evt)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.