Autopsy  4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportHTMLConfigurationPanel.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;
20 
22 
26 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
27 final class ReportHTMLConfigurationPanel extends javax.swing.JPanel {
28 
32  ReportHTMLConfigurationPanel() {
33  initComponents();
34 
35  // Load settings
36  String header = ModuleSettings.getConfigSetting("HTMLReport", "header"); //NON-NLS
37  String footer = ModuleSettings.getConfigSetting("HTMLReport", "footer"); //NON-NLS
38 
39  headerTextField.setText(header != null ? header : "");
40  footerTextField.setText(footer != null ? footer : "");
41  }
42 
48  String getHeader() {
49  return headerTextField.getText();
50  }
51 
57  String getFooter() {
58  return footerTextField.getText();
59  }
60 
66  @SuppressWarnings("unchecked")
67  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
68  private void initComponents() {
69 
70  headerLabel = new javax.swing.JLabel();
71  footerLabel = new javax.swing.JLabel();
72  headerTextField = new javax.swing.JTextField();
73  footerTextField = new javax.swing.JTextField();
74 
75  setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
76 
77  org.openide.awt.Mnemonics.setLocalizedText(headerLabel, org.openide.util.NbBundle.getMessage(ReportHTMLConfigurationPanel.class, "ReportHTMLConfigurationPanel.headerLabel.text")); // NOI18N
78 
79  org.openide.awt.Mnemonics.setLocalizedText(footerLabel, org.openide.util.NbBundle.getMessage(ReportHTMLConfigurationPanel.class, "ReportHTMLConfigurationPanel.footerLabel.text")); // NOI18N
80 
81  headerTextField.setText(org.openide.util.NbBundle.getMessage(ReportHTMLConfigurationPanel.class, "ReportHTMLConfigurationPanel.headerTextField.text")); // NOI18N
82 
83  footerTextField.setText(org.openide.util.NbBundle.getMessage(ReportHTMLConfigurationPanel.class, "ReportHTMLConfigurationPanel.footerTextField.text")); // NOI18N
84 
85  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
86  this.setLayout(layout);
87  layout.setHorizontalGroup(
88  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
89  .addGroup(layout.createSequentialGroup()
90  .addContainerGap()
91  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
92  .addComponent(headerLabel)
93  .addComponent(footerLabel))
94  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
95  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96  .addComponent(headerTextField)
97  .addComponent(footerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
98  .addContainerGap())
99  );
100  layout.setVerticalGroup(
101  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
102  .addGroup(layout.createSequentialGroup()
103  .addContainerGap()
104  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
105  .addComponent(headerLabel)
106  .addComponent(headerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
107  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
108  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
109  .addComponent(footerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
110  .addComponent(footerLabel))
111  .addContainerGap(188, Short.MAX_VALUE))
112  );
113  }// </editor-fold>//GEN-END:initComponents
114  // Variables declaration - do not modify//GEN-BEGIN:variables
115  private javax.swing.JLabel footerLabel;
116  private javax.swing.JTextField footerTextField;
117  private javax.swing.JLabel headerLabel;
118  private javax.swing.JTextField headerTextField;
119  // End of variables declaration//GEN-END:variables
120 }

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.