Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
EditOptionalCasePropertiesPanel.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.event.ActionListener;
22 import org.openide.util.NbBundle.Messages;
23 
27 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
28 class EditOptionalCasePropertiesPanel extends javax.swing.JPanel {
29 
30  private static final long serialVersionUID = 1L;
31 
32  private final OptionalCasePropertiesPanel propertiesPanel;
33 
37  EditOptionalCasePropertiesPanel() {
38  initComponents();
39  propertiesPanel = new OptionalCasePropertiesPanel(true);
40 
41  optionsPanel.add(propertiesPanel);
42  optionsPanel.setVisible(true);
43  propertiesPanel.setVisible(true);
44  }
45 
46  @Messages({
47  "EditOptionalCasePropertiesPanel.saveButton.text=Save",
48  "EditOptionalCasePropertiesPanel.cancelButton.text=Cancel"
49  })
55  @SuppressWarnings("unchecked")
56  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
57  private void initComponents() {
58 
59  optionsPanel = new javax.swing.JPanel();
60  cancelButton = new javax.swing.JButton();
61  saveButton = new javax.swing.JButton();
62 
63  optionsPanel.setLayout(new java.awt.BorderLayout());
64 
65  org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(EditOptionalCasePropertiesPanel.class, "EditOptionalCasePropertiesPanel.cancelButton.text")); // NOI18N
66 
67  org.openide.awt.Mnemonics.setLocalizedText(saveButton, org.openide.util.NbBundle.getMessage(EditOptionalCasePropertiesPanel.class, "EditOptionalCasePropertiesPanel.saveButton.text")); // NOI18N
68 
69  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
70  this.setLayout(layout);
71  layout.setHorizontalGroup(
72  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
73  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
74  .addContainerGap(254, Short.MAX_VALUE)
75  .addComponent(saveButton)
76  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77  .addComponent(cancelButton)
78  .addContainerGap())
79  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
80  .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
81  );
82 
83  layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, saveButton});
84 
85  layout.setVerticalGroup(
86  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
87  .addGroup(layout.createSequentialGroup()
88  .addContainerGap(266, Short.MAX_VALUE)
89  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
90  .addComponent(cancelButton)
91  .addComponent(saveButton))
92  .addContainerGap())
93  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
94  .addGroup(layout.createSequentialGroup()
95  .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
96  .addGap(38, 38, 38)))
97  );
98  }// </editor-fold>//GEN-END:initComponents
99 
100  void saveProperties() {
101  this.propertiesPanel.saveUpdatedCaseDetails();
102  }
103 
109  void addSaveButtonAction(ActionListener action) {
110  this.saveButton.addActionListener(action);
111  }
112 
118  void addCancelButtonAction(ActionListener action) {
119  this.cancelButton.addActionListener(action);
120  }
121 
122 
123  // Variables declaration - do not modify//GEN-BEGIN:variables
124  private javax.swing.JButton cancelButton;
125  private javax.swing.JPanel optionsPanel;
126  private javax.swing.JButton saveButton;
127  // End of variables declaration//GEN-END:variables
128 }

Copyright © 2012-2022 Basis Technology. Generated on: Thu Sep 29 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.