19 package org.sleuthkit.autopsy.centralrepository.persona;
21 import java.awt.Component;
22 import java.util.logging.Level;
23 import javax.swing.JDialog;
24 import javax.swing.JFrame;
25 import org.openide.util.NbBundle;
26 import org.openide.windows.WindowManager;
33 @SuppressWarnings(
"PMD.SingularField")
36 private static final long serialVersionUID = 1L;
43 "PersonaDetailsDialogCreateTitle=Create Persona",
44 "PersonaDetailsDialogEditTitle=Edit Persona",
45 "PersonaDetailsDialogViewTitle=View Persona",})
48 this(parent, mode, persona, callback,
true);
51 super((JFrame) WindowManager.getDefault().getMainWindow(),
54 this.callback = callback;
58 pdp.setMode(parent, mode, persona);
68 return Bundle.PersonaDetailsDialogCreateTitle();
70 return Bundle.PersonaDetailsDialogEditTitle();
72 return Bundle.PersonaDetailsDialogViewTitle();
74 logger.log(Level.WARNING,
"Unsupported mode: {0}", mode);
75 return Bundle.PersonaDetailsDialogViewTitle();
84 @SuppressWarnings(
"unchecked")
86 private
void initComponents() {
88 cancelBtn =
new javax.swing.JButton();
89 okBtn =
new javax.swing.JButton();
92 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
95 org.openide.awt.Mnemonics.setLocalizedText(cancelBtn,
org.openide.util.NbBundle.getMessage(
PersonaDetailsDialog.class,
"PersonaDetailsDialog.cancelBtn.text"));
96 cancelBtn.setMaximumSize(
new java.awt.Dimension(79, 23));
97 cancelBtn.setMinimumSize(
new java.awt.Dimension(79, 23));
98 cancelBtn.setPreferredSize(
new java.awt.Dimension(79, 23));
99 cancelBtn.addActionListener(
new java.awt.event.ActionListener() {
100 public void actionPerformed(java.awt.event.ActionEvent evt) {
101 cancelBtnActionPerformed(evt);
105 org.openide.awt.Mnemonics.setLocalizedText(okBtn,
org.openide.util.NbBundle.getMessage(
PersonaDetailsDialog.class,
"PersonaDetailsDialog.okBtn.text"));
106 okBtn.addActionListener(
new java.awt.event.ActionListener() {
107 public void actionPerformed(java.awt.event.ActionEvent evt) {
108 okBtnActionPerformed(evt);
112 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
113 getContentPane().setLayout(layout);
114 layout.setHorizontalGroup(
115 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
116 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
118 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
119 .addComponent(pdp, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 660, Short.MAX_VALUE)
120 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
121 .addGap(0, 0, Short.MAX_VALUE)
123 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
124 .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
128 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelBtn, okBtn});
130 layout.setVerticalGroup(
131 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132 .addGroup(layout.createSequentialGroup()
133 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
134 .addComponent(pdp, javax.swing.GroupLayout.PREFERRED_SIZE, 564, javax.swing.GroupLayout.PREFERRED_SIZE)
135 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
138 .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
146 this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
PersonaDetailsDialog(Component parent, PersonaDetailsMode mode, Persona persona, PersonaDetailsDialogCallback callback, boolean displayDialog)
final PersonaDetailsDialogCallback callback
void cancelBtnActionPerformed(java.awt.event.ActionEvent evt)
PersonaDetailsPanel getDetailsPanel()
PersonaDetailsDialog(Component parent, PersonaDetailsMode mode, Persona persona, PersonaDetailsDialogCallback callback)
void callback(Persona persona)
void okBtnActionPerformed(java.awt.event.ActionEvent evt)
org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel pdp
javax.swing.JButton cancelBtn
static String getTitle(PersonaDetailsMode mode)
synchronized static Logger getLogger(String name)
javax.swing.JButton okBtn