19 package org.sleuthkit.autopsy.casemodule;
21 import java.awt.event.ActionListener;
22 import org.openide.util.NbBundle.Messages;
27 @SuppressWarnings(
"PMD.SingularField")
28 class EditOptionalCasePropertiesPanel extends javax.swing.JPanel {
30 private static final long serialVersionUID = 1L;
32 private final OptionalCasePropertiesPanel propertiesPanel;
37 EditOptionalCasePropertiesPanel() {
39 propertiesPanel =
new OptionalCasePropertiesPanel(
true);
41 optionsPanel.add(propertiesPanel);
42 optionsPanel.setVisible(
true);
43 propertiesPanel.setVisible(
true);
47 "EditOptionalCasePropertiesPanel.saveButton.text=Save",
48 "EditOptionalCasePropertiesPanel.cancelButton.text=Cancel"
55 @SuppressWarnings(
"unchecked")
57 private
void initComponents() {
59 optionsPanel =
new javax.swing.JPanel();
60 cancelButton =
new javax.swing.JButton();
61 saveButton =
new javax.swing.JButton();
63 optionsPanel.setLayout(
new java.awt.BorderLayout());
65 org.openide.awt.Mnemonics.setLocalizedText(cancelButton,
org.openide.util.NbBundle.getMessage(EditOptionalCasePropertiesPanel.class,
"EditOptionalCasePropertiesPanel.cancelButton.text"));
67 org.openide.awt.Mnemonics.setLocalizedText(saveButton,
org.openide.util.NbBundle.getMessage(EditOptionalCasePropertiesPanel.class,
"EditOptionalCasePropertiesPanel.saveButton.text"));
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)
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))
83 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelButton, saveButton});
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))
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)
100 void saveProperties() {
101 this.propertiesPanel.saveUpdatedCaseDetails();
109 void addSaveButtonAction(ActionListener action) {
110 this.saveButton.addActionListener(action);
118 void addCancelButtonAction(ActionListener action) {
119 this.cancelButton.addActionListener(action);
124 private javax.swing.JButton cancelButton;
125 private javax.swing.JPanel optionsPanel;
126 private javax.swing.JButton saveButton;