139 typeLbl =
new javax.swing.JLabel();
146 okBtn =
new javax.swing.JButton();
148 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
151 settingsPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
153 org.openide.awt.Mnemonics.setLocalizedText(
identiferLbl, org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.identiferLbl.text"));
157 public void actionPerformed(java.awt.event.ActionEvent evt) {
158 identifierTextFieldActionPerformed(evt);
162 org.openide.awt.Mnemonics.setLocalizedText(typeLbl, org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.typeLbl.text"));
164 typeComboBox.setModel(
new javax.swing.DefaultComboBoxModel<>(getAllAccountTypes()));
166 org.openide.awt.Mnemonics.setLocalizedText(confidenceLbl, org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.confidenceLbl.text"));
168 confidenceComboBox.setModel(
new javax.swing.DefaultComboBoxModel<>(org.sleuthkit.autopsy.centralrepository.datamodel.Persona.Confidence.values()));
170 org.openide.awt.Mnemonics.setLocalizedText(justificationLbl, org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.justificationLbl.text"));
172 justificationTextField.setText(org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.justificationTextField.text"));
174 javax.swing.GroupLayout settingsPanelLayout =
new javax.swing.GroupLayout(settingsPanel);
175 settingsPanel.setLayout(settingsPanelLayout);
176 settingsPanelLayout.setHorizontalGroup(
177 settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
178 .addGroup(settingsPanelLayout.createSequentialGroup()
180 .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
181 .addGroup(settingsPanelLayout.createSequentialGroup()
182 .addComponent(typeLbl)
183 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
184 .addComponent(typeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
185 .addGroup(settingsPanelLayout.createSequentialGroup()
186 .addComponent(identiferLbl)
187 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
188 .addComponent(identifierTextField))
189 .addGroup(settingsPanelLayout.createSequentialGroup()
190 .addComponent(confidenceLbl)
191 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
192 .addComponent(confidenceComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
193 .addGroup(settingsPanelLayout.createSequentialGroup()
194 .addComponent(justificationLbl)
195 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
196 .addComponent(justificationTextField)))
199 settingsPanelLayout.setVerticalGroup(
200 settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
201 .addGroup(settingsPanelLayout.createSequentialGroup()
203 .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
204 .addComponent(identiferLbl)
205 .addComponent(identifierTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
206 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
207 .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
208 .addComponent(typeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
209 .addComponent(typeLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE))
210 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
211 .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
212 .addComponent(confidenceLbl)
213 .addComponent(confidenceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
214 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
215 .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
216 .addComponent(justificationLbl)
217 .addComponent(justificationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
218 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
221 org.openide.awt.Mnemonics.setLocalizedText(cancelBtn, org.openide.util.NbBundle.getMessage(
PersonaAccountDialog.class,
"PersonaAccountDialog.cancelBtn.text"));
222 cancelBtn.setMaximumSize(
new java.awt.Dimension(79, 23));
223 cancelBtn.setMinimumSize(
new java.awt.Dimension(79, 23));
224 cancelBtn.setPreferredSize(
new java.awt.Dimension(79, 23));
225 cancelBtn.addActionListener(
new java.awt.event.ActionListener() {
226 public void actionPerformed(java.awt.event.ActionEvent evt) {
227 cancelBtnActionPerformed(evt);
231 org.openide.awt.Mnemonics.setLocalizedText(okBtn, org.openide.util.NbBundle.getMessage(PersonaAccountDialog.class,
"PersonaAccountDialog.okBtn.text"));
232 okBtn.addActionListener(
new java.awt.event.ActionListener() {
233 public void actionPerformed(java.awt.event.ActionEvent evt) {
234 okBtnActionPerformed(evt);
238 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
239 getContentPane().setLayout(layout);
240 layout.setHorizontalGroup(
241 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
242 .addGroup(layout.createSequentialGroup()
243 .addContainerGap(194, Short.MAX_VALUE)
245 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
246 .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
248 .addComponent(settingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
251 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelBtn, okBtn});
253 layout.setVerticalGroup(
254 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
255 .addGroup(layout.createSequentialGroup()
257 .addComponent(settingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
258 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
259 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
260 .addComponent(okBtn, javax.swing.GroupLayout.Alignment.TRAILING)
261 .addComponent(cancelBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
262 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
287 JOptionPane.showMessageDialog(
this,
288 Bundle.PersonaAccountDialog_identifier_empty_msg(),
289 Bundle.PersonaAccountDialog_identifier_empty_Title(),
290 JOptionPane.ERROR_MESSAGE);
294 JOptionPane.showMessageDialog(
this,
295 Bundle.PersonaDetailsPanel_empty_justification_msg(),
296 Bundle.PersonaDetailsPanel_empty_justification_Title(),
297 JOptionPane.ERROR_MESSAGE);
300 Collection<CentralRepoAccount> candidates;
304 logger.log(Level.SEVERE,
"Failed to access central repository", e);
305 JOptionPane.showMessageDialog(
this,
306 Bundle.PersonaAccountDialog_search_failure_msg(),
307 Bundle.PersonaAccountDialog_search_failure_Title(),
308 JOptionPane.ERROR_MESSAGE);
311 catch (InvalidAccountIDException e) {
312 logger.log(Level.SEVERE,
"Invalid account identifier", e);
313 JOptionPane.showMessageDialog(
this,
314 Bundle.PersonaAccountDialog_invalid_account_msg(),
315 Bundle.PersonaAccountDialog_invalid_account_Title(),
316 JOptionPane.ERROR_MESSAGE);
319 if (candidates.isEmpty()) {
320 JOptionPane.showMessageDialog(
this,
321 Bundle.PersonaAccountDialog_search_empty_msg(),
322 Bundle.PersonaAccountDialog_search_empty_Title(),
323 JOptionPane.ERROR_MESSAGE);
328 if (cand.getAccountType().getAcctType().equals(
334 if (result ==
null) {
335 JOptionPane.showMessageDialog(
this,
336 Bundle.PersonaAccountDialog_search_empty_msg(),
337 Bundle.PersonaAccountDialog_search_empty_Title(),
338 JOptionPane.ERROR_MESSAGE);
346 currentAccount.confidence = confidence;
347 currentAccount.justification = justification;
350 if (
pdp.addAccount(result, justification, confidence)) {
353 JOptionPane.showMessageDialog(
this,
354 Bundle.PersonaAccountDialog_dup_msg(),
355 Bundle.PersonaAccountDialog_dup_Title(),
356 JOptionPane.ERROR_MESSAGE);