Autopsy  4.13.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
HTMLReportConfigurationPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 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.report.modules.html;
20 
24 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
25 final class HTMLReportConfigurationPanel extends javax.swing.JPanel {
26 
30  HTMLReportConfigurationPanel() {
31  initComponents();
32  headerTextField.setText("");
33  footerTextField.setText("");
34  }
35 
36  void setConfiguration(HTMLReportModuleSettings settings) {
37  headerTextField.setText(settings.getHeader());
38  footerTextField.setText(settings.getFooter());
39  }
40 
41  HTMLReportModuleSettings getConfiguration() {
42  return new HTMLReportModuleSettings(headerTextField.getText(), footerTextField.getText());
43  }
44 
50  String getHeader() {
51  return headerTextField.getText();
52  }
53 
59  String getFooter() {
60  return footerTextField.getText();
61  }
62 
68  @SuppressWarnings("unchecked")
69  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
70  private void initComponents() {
71 
72  headerLabel = new javax.swing.JLabel();
73  footerLabel = new javax.swing.JLabel();
74  headerTextField = new javax.swing.JTextField();
75  footerTextField = new javax.swing.JTextField();
76 
77  setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
78 
79  org.openide.awt.Mnemonics.setLocalizedText(headerLabel, org.openide.util.NbBundle.getMessage(HTMLReportConfigurationPanel.class, "HTMLReportConfigurationPanel.headerLabel.text")); // NOI18N
80 
81  org.openide.awt.Mnemonics.setLocalizedText(footerLabel, org.openide.util.NbBundle.getMessage(HTMLReportConfigurationPanel.class, "HTMLReportConfigurationPanel.footerLabel.text")); // NOI18N
82 
83  headerTextField.setText(org.openide.util.NbBundle.getMessage(HTMLReportConfigurationPanel.class, "HTMLReportConfigurationPanel.headerTextField.text")); // NOI18N
84 
85  footerTextField.setText(org.openide.util.NbBundle.getMessage(HTMLReportConfigurationPanel.class, "HTMLReportConfigurationPanel.footerTextField.text")); // NOI18N
86 
87  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
88  this.setLayout(layout);
89  layout.setHorizontalGroup(
90  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
91  .addGroup(layout.createSequentialGroup()
92  .addContainerGap()
93  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
94  .addComponent(headerLabel)
95  .addComponent(footerLabel))
96  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
97  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98  .addComponent(headerTextField)
99  .addComponent(footerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
100  .addContainerGap())
101  );
102  layout.setVerticalGroup(
103  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
104  .addGroup(layout.createSequentialGroup()
105  .addContainerGap()
106  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
107  .addComponent(headerLabel)
108  .addComponent(headerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
109  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
110  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
111  .addComponent(footerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
112  .addComponent(footerLabel))
113  .addContainerGap(188, Short.MAX_VALUE))
114  );
115  }// </editor-fold>//GEN-END:initComponents
116  // Variables declaration - do not modify//GEN-BEGIN:variables
117  private javax.swing.JLabel footerLabel;
118  private javax.swing.JTextField footerTextField;
119  private javax.swing.JLabel headerLabel;
120  private javax.swing.JTextField headerTextField;
121  // End of variables declaration//GEN-END:variables
122 }

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.