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 javax.swing.JOptionPane;
26 import org.openide.util.NbBundle;
27 import org.openide.windows.WindowManager;
34 @SuppressWarnings(
"PMD.SingularField")
37 private static final long serialVersionUID = 1L;
43 private String popupMessageOnStartup =
"";
46 "PersonaDetailsDialogCreateTitle=Create Persona",
47 "PersonaDetailsDialogEditTitle=Edit Persona",
48 "PersonaDetailsDialogViewTitle=View Persona",})
51 this(parent, mode, persona, callback,
true);
54 super((JFrame) WindowManager.getDefault().getMainWindow(),
57 this.callback = callback;
61 pdp.setMode(parent, mode, persona);
71 return Bundle.PersonaDetailsDialogCreateTitle();
73 return Bundle.PersonaDetailsDialogEditTitle();
75 return Bundle.PersonaDetailsDialogViewTitle();
77 logger.log(Level.WARNING,
"Unsupported mode: {0}", mode);
78 return Bundle.PersonaDetailsDialogViewTitle();
87 @SuppressWarnings(
"unchecked")
89 private
void initComponents() {
91 cancelBtn =
new javax.swing.JButton();
92 okBtn =
new javax.swing.JButton();
93 jScrollPane1 =
new javax.swing.JScrollPane();
96 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
97 addWindowListener(
new java.awt.event.WindowAdapter() {
98 public void windowOpened(java.awt.event.WindowEvent evt) {
99 formWindowOpened(evt);
103 org.openide.awt.Mnemonics.setLocalizedText(cancelBtn,
org.openide.util.NbBundle.getMessage(
PersonaDetailsDialog.class,
"PersonaDetailsDialog.cancelBtn.text"));
104 cancelBtn.setMaximumSize(
new java.awt.Dimension(79, 23));
105 cancelBtn.setMinimumSize(
new java.awt.Dimension(79, 23));
106 cancelBtn.setPreferredSize(
new java.awt.Dimension(79, 23));
107 cancelBtn.addActionListener(
new java.awt.event.ActionListener() {
108 public void actionPerformed(java.awt.event.ActionEvent evt) {
109 cancelBtnActionPerformed(evt);
113 org.openide.awt.Mnemonics.setLocalizedText(okBtn,
org.openide.util.NbBundle.getMessage(
PersonaDetailsDialog.class,
"PersonaDetailsDialog.okBtn.text"));
114 okBtn.addActionListener(
new java.awt.event.ActionListener() {
115 public void actionPerformed(java.awt.event.ActionEvent evt) {
116 okBtnActionPerformed(evt);
120 jScrollPane1.setBorder(null);
121 jScrollPane1.setViewportView(pdp);
123 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
124 getContentPane().setLayout(layout);
125 layout.setHorizontalGroup(
126 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127 .addGroup(layout.createSequentialGroup()
128 .addContainerGap(470, Short.MAX_VALUE)
130 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
131 .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
133 .addComponent(jScrollPane1)
136 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelBtn, okBtn});
138 layout.setVerticalGroup(
139 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
140 .addGroup(layout.createSequentialGroup()
142 .addComponent(jScrollPane1)
143 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
144 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
146 .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
154 this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
171 if(!popupMessageOnStartup.isEmpty()) {
172 JOptionPane.showMessageDialog(
this, popupMessageOnStartup,
"Persona Details", JOptionPane.INFORMATION_MESSAGE);
181 popupMessageOnStartup = message;
PersonaDetailsDialog(Component parent, PersonaDetailsMode mode, Persona persona, PersonaDetailsDialogCallback callback, boolean displayDialog)
void setStartupPopupMessage(String message)
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)
javax.swing.JScrollPane jScrollPane1
void okBtnActionPerformed(java.awt.event.ActionEvent evt)
org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel pdp
javax.swing.JButton cancelBtn
static String getTitle(PersonaDetailsMode mode)
void formWindowOpened(java.awt.event.WindowEvent evt)
synchronized static Logger getLogger(String name)
javax.swing.JButton okBtn