Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ManageHostsDialog.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2021 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.datamodel.hosts;
20 
21 import java.awt.Dialog;
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27 import java.util.Objects;
28 import java.util.Vector;
29 import java.util.logging.Level;
30 import java.util.stream.Collectors;
31 import javax.swing.JFrame;
32 import javax.swing.ListModel;
33 import org.apache.commons.collections4.CollectionUtils;
34 import org.openide.util.NbBundle.Messages;
38 import org.sleuthkit.datamodel.DataSource;
39 import org.sleuthkit.datamodel.Host;
40 import org.sleuthkit.datamodel.SleuthkitCase;
41 import org.sleuthkit.datamodel.TskCoreException;
42 
46 @Messages({
47  "ManageHostsDialog_title_text=Manage Hosts"
48 })
49 public class ManageHostsDialog extends javax.swing.JDialog {
50 
54  private static class HostListItem {
55 
56  private final Host host;
57  private final List<DataSource> dataSources;
58 
65  HostListItem(Host host, List<DataSource> dataSources) {
66  this.host = host;
67  this.dataSources = dataSources;
68  }
69 
73  Host getHost() {
74  return host;
75  }
76 
80  List<DataSource> getDataSources() {
81  return dataSources;
82  }
83 
84  @Override
85  public String toString() {
86  return host == null ? "" : host.getName();
87  }
88 
89  @Override
90  public int hashCode() {
91  int hash = 5;
92  hash = 89 * hash + Objects.hashCode(this.host == null ? 0 : this.host.getHostId());
93  return hash;
94  }
95 
96  @Override
97  public boolean equals(Object obj) {
98  if (this == obj) {
99  return true;
100  }
101  if (obj == null) {
102  return false;
103  }
104  if (getClass() != obj.getClass()) {
105  return false;
106  }
107  final HostListItem other = (HostListItem) obj;
108  if (this.host == null || other.getHost() == null) {
109  return this.host == null && other.getHost() == null;
110  }
111 
112  return this.host.getHostId() == other.getHost().getHostId();
113  }
114 
115  }
116 
117  private static final Logger logger = Logger.getLogger(ManageHostsDialog.class.getName());
118  private static final long serialVersionUID = 1L;
119 
120  private Map<Host, List<DataSource>> hostChildrenMap = Collections.emptyMap();
121 
127  public ManageHostsDialog(java.awt.Frame parent) {
128  super(parent, Bundle.ManageHostsDialog_title_text(), true);
129  init();
130  }
131 
137  public ManageHostsDialog(Dialog parent) {
138  super(parent, Bundle.ManageHostsDialog_title_text(), true);
139  init();
140  }
141 
145  private void init() {
146  initComponents();
147  refresh();
148 
149  // refreshes UI when selection changes including button enabled state and data.
150  this.hostList.addListSelectionListener((evt) -> refreshComponents());
151  }
152 
157  Host getSelectedHost() {
158  return (hostList.getSelectedValue() == null) ? null : hostList.getSelectedValue().getHost();
159  }
160 
164  private void addHost() {
165  String newHostName = getAddEditDialogName(null);
166  if (newHostName != null) {
167  Long selectedId = null;
168  try {
169  Host newHost = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().newHost(newHostName);
170  selectedId = newHost == null ? null : newHost.getHostId();
171  } catch (NoCurrentCaseException | TskCoreException e) {
172  logger.log(Level.WARNING, String.format("Unable to add new host '%s' at this time.", newHostName), e);
173  }
174  refresh();
175  setSelectedHostById(selectedId);
176  }
177  }
178 
184  private void deleteHost(Host selectedHost) {
185  if (selectedHost != null && selectedHost.getName() != null) {
186  try {
187  Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().deleteHost(selectedHost.getName());
188  } catch (NoCurrentCaseException | TskCoreException e) {
189  logger.log(Level.WARNING, String.format("Unable to delete host '%s' at this time.", selectedHost.getName()), e);
190  }
191  refresh();
192  }
193  }
194 
200  private void setSelectedHostById(Long selectedId) {
201  ListModel<HostListItem> model = hostList.getModel();
202 
203  if (selectedId == null) {
204  hostList.clearSelection();
205  }
206 
207  for (int i = 0; i < model.getSize(); i++) {
208  Object o = model.getElementAt(i);
209  if (!(o instanceof HostListItem)) {
210  continue;
211  }
212 
213  Host host = ((HostListItem) o).getHost();
214  if (host == null) {
215  continue;
216  }
217 
218  if (host.getHostId() == selectedId) {
219  hostList.setSelectedIndex(i);
220  return;
221  }
222  }
223 
224  hostList.clearSelection();
225  }
226 
232  private void editHost(Host selectedHost) {
233 
234  if (selectedHost != null) {
235  String newHostName = getAddEditDialogName(selectedHost);
236  if (newHostName != null) {
237  try {
238  Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().updateHostName(selectedHost, newHostName);
239  } catch (NoCurrentCaseException | TskCoreException e) {
240  logger.log(Level.WARNING, String.format("Unable to update host '%s' with id: %d at this time.", selectedHost.getName(), selectedHost.getHostId()), e);
241  }
242 
243  HostListItem selectedItem = hostList.getSelectedValue();
244  Long selectedId = selectedItem == null || selectedItem.getHost() == null ? null : selectedItem.getHost().getHostId();
245 
246  refresh();
247 
248  setSelectedHostById(selectedId);
249  }
250  }
251  }
252 
260  private String getAddEditDialogName(Host origValue) {
261  JFrame parent = (this.getRootPane() != null && this.getRootPane().getParent() instanceof JFrame)
262  ? (JFrame) this.getRootPane().getParent()
263  : null;
264 
265  AddEditHostDialog addEditDialog = new AddEditHostDialog(parent, hostChildrenMap.keySet(), origValue);
266  addEditDialog.setResizable(false);
267  addEditDialog.setLocationRelativeTo(parent);
268  addEditDialog.setVisible(true);
269  addEditDialog.toFront();
270 
271  if (addEditDialog.isChanged()) {
272  String newHostName = addEditDialog.getValue();
273  return newHostName;
274  }
275 
276  return null;
277  }
278 
282  private void refresh() {
283  refreshData();
284  refreshComponents();
285  }
286 
291  private void refreshData() {
292 
293  hostChildrenMap = getHostListData();
294 
295  Vector<HostListItem> jlistData = hostChildrenMap.entrySet().stream()
296  .sorted((a, b) -> getNameOrEmpty(a.getKey()).compareTo(getNameOrEmpty(b.getKey())))
297  .map(entry -> new HostListItem(entry.getKey(), entry.getValue()))
298  .collect(Collectors.toCollection(Vector::new));
299 
300  hostList.setListData(jlistData);
301  }
302 
310  private String getNameOrEmpty(Host h) {
311  return (h == null || h.getName() == null) ? "" : h.getName();
312  }
313 
320  private Map<Host, List<DataSource>> getHostListData() {
321  Map<Host, List<DataSource>> hostMapping = new HashMap<>();
322  try {
323  SleuthkitCase curCase = Case.getCurrentCaseThrows().getSleuthkitCase();
324  List<Host> hosts = curCase.getHostManager().getAllHosts();
325  List<DataSource> dataSources = curCase.getDataSources();
326 
327  if (dataSources != null) {
328  for (DataSource ds : dataSources) {
329  List<DataSource> hostDataSources = hostMapping.computeIfAbsent(ds.getHost(), (d) -> new ArrayList<>());
330  hostDataSources.add(ds);
331  }
332 
333  }
334 
335  if (hosts != null) {
336  for (Host host : hosts) {
337  hostMapping.putIfAbsent(host, Collections.emptyList());
338  }
339  }
340 
341  } catch (TskCoreException | NoCurrentCaseException ex) {
342  logger.log(Level.WARNING, "There was an error while fetching hosts for current case.", ex);
343  }
344 
345  return hostMapping;
346  }
347 
351  private void refreshComponents() {
352  HostListItem selectedItem = hostList.getSelectedValue();
353  Host selectedHost = selectedItem == null ? null : selectedItem.getHost();
354  List<DataSource> dataSources = selectedItem == null ? null : selectedItem.getDataSources();
355  this.editButton.setEnabled(selectedHost != null);
356  this.deleteButton.setEnabled(selectedHost != null && CollectionUtils.isEmpty(dataSources));
357  String nameTextFieldStr = selectedHost != null && selectedHost.getName() != null ? selectedHost.getName() : "";
358  this.hostNameTextField.setText(nameTextFieldStr);
359 
360  }
361 
367  @SuppressWarnings("unchecked")
368  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
369  private void initComponents() {
370 
371  javax.swing.JScrollPane manageHostsScrollPane = new javax.swing.JScrollPane();
372  javax.swing.JPanel manageHostsPanel = new javax.swing.JPanel();
373  javax.swing.JScrollPane hostListScrollPane = new javax.swing.JScrollPane();
374  hostList = new javax.swing.JList<>();
375  javax.swing.JScrollPane hostDescriptionScrollPane = new javax.swing.JScrollPane();
376  hostDescriptionTextArea = new javax.swing.JTextArea();
377  newButton = new javax.swing.JButton();
378  deleteButton = new javax.swing.JButton();
379  closeButton = new javax.swing.JButton();
380  javax.swing.JLabel hostListLabel = new javax.swing.JLabel();
381  javax.swing.JSeparator jSeparator1 = new javax.swing.JSeparator();
382  javax.swing.JLabel hostNameLabel = new javax.swing.JLabel();
383  hostNameTextField = new javax.swing.JTextField();
384  editButton = new javax.swing.JButton();
385  javax.swing.JLabel hostDetailsLabel = new javax.swing.JLabel();
386 
387  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
388  setMinimumSize(new java.awt.Dimension(600, 450));
389 
390  manageHostsScrollPane.setMinimumSize(new java.awt.Dimension(600, 450));
391  manageHostsScrollPane.setPreferredSize(new java.awt.Dimension(600, 450));
392 
393  manageHostsPanel.setPreferredSize(new java.awt.Dimension(527, 407));
394 
395  hostList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
396  hostListScrollPane.setViewportView(hostList);
397 
398  hostDescriptionTextArea.setEditable(false);
399  hostDescriptionTextArea.setBackground(new java.awt.Color(240, 240, 240));
400  hostDescriptionTextArea.setColumns(20);
401  hostDescriptionTextArea.setLineWrap(true);
402  hostDescriptionTextArea.setRows(3);
403  hostDescriptionTextArea.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.hostDescriptionTextArea.text")); // NOI18N
404  hostDescriptionTextArea.setWrapStyleWord(true);
405  hostDescriptionScrollPane.setViewportView(hostDescriptionTextArea);
406 
407  newButton.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.newButton.text")); // NOI18N
408  newButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
409  newButton.setMaximumSize(new java.awt.Dimension(70, 23));
410  newButton.setMinimumSize(new java.awt.Dimension(70, 23));
411  newButton.setPreferredSize(new java.awt.Dimension(70, 23));
412  newButton.addActionListener(new java.awt.event.ActionListener() {
413  public void actionPerformed(java.awt.event.ActionEvent evt) {
414  newButtonActionPerformed(evt);
415  }
416  });
417 
418  deleteButton.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.deleteButton.text")); // NOI18N
419  deleteButton.setMargin(new java.awt.Insets(2, 6, 2, 6));
420  deleteButton.setMaximumSize(new java.awt.Dimension(70, 23));
421  deleteButton.setMinimumSize(new java.awt.Dimension(70, 23));
422  deleteButton.setPreferredSize(new java.awt.Dimension(70, 23));
423  deleteButton.addActionListener(new java.awt.event.ActionListener() {
424  public void actionPerformed(java.awt.event.ActionEvent evt) {
425  deleteButtonActionPerformed(evt);
426  }
427  });
428 
429  closeButton.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.closeButton.text")); // NOI18N
430  closeButton.addActionListener(new java.awt.event.ActionListener() {
431  public void actionPerformed(java.awt.event.ActionEvent evt) {
432  closeButtonActionPerformed(evt);
433  }
434  });
435 
436  hostListLabel.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.hostListLabel.text")); // NOI18N
437 
438  jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
439 
440  hostNameLabel.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.hostNameLabel.text")); // NOI18N
441 
442  hostNameTextField.setEditable(false);
443 
444  editButton.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.editButton.text")); // NOI18N
445  editButton.setMaximumSize(new java.awt.Dimension(70, 23));
446  editButton.setMinimumSize(new java.awt.Dimension(70, 23));
447  editButton.setPreferredSize(new java.awt.Dimension(70, 23));
448  editButton.addActionListener(new java.awt.event.ActionListener() {
449  public void actionPerformed(java.awt.event.ActionEvent evt) {
450  editButtonActionPerformed(evt);
451  }
452  });
453 
454  hostDetailsLabel.setText(org.openide.util.NbBundle.getMessage(ManageHostsDialog.class, "ManageHostsDialog.hostDetailsLabel.text")); // NOI18N
455 
456  javax.swing.GroupLayout manageHostsPanelLayout = new javax.swing.GroupLayout(manageHostsPanel);
457  manageHostsPanel.setLayout(manageHostsPanelLayout);
458  manageHostsPanelLayout.setHorizontalGroup(
459  manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
460  .addGroup(manageHostsPanelLayout.createSequentialGroup()
461  .addContainerGap()
462  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
463  .addComponent(hostDescriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
464  .addComponent(hostListLabel)
465  .addGroup(manageHostsPanelLayout.createSequentialGroup()
466  .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
467  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
468  .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
469  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
470  .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
471  .addComponent(hostListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))
472  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
473  .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
474  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
475  .addGroup(manageHostsPanelLayout.createSequentialGroup()
476  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
477  .addGroup(manageHostsPanelLayout.createSequentialGroup()
478  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
479  .addComponent(closeButton))
480  .addGroup(manageHostsPanelLayout.createSequentialGroup()
481  .addGap(29, 29, 29)
482  .addComponent(hostNameLabel)
483  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
484  .addComponent(hostNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)))
485  .addContainerGap())
486  .addGroup(manageHostsPanelLayout.createSequentialGroup()
487  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
488  .addComponent(hostDetailsLabel)
489  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
490  );
491  manageHostsPanelLayout.setVerticalGroup(
492  manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
493  .addGroup(manageHostsPanelLayout.createSequentialGroup()
494  .addContainerGap()
495  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
496  .addGroup(manageHostsPanelLayout.createSequentialGroup()
497  .addComponent(hostDetailsLabel)
498  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
499  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
500  .addComponent(hostNameLabel)
501  .addComponent(hostNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
502  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
503  .addComponent(closeButton))
504  .addComponent(jSeparator1)
505  .addGroup(manageHostsPanelLayout.createSequentialGroup()
506  .addComponent(hostDescriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
507  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
508  .addComponent(hostListLabel)
509  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
510  .addComponent(hostListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
511  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
512  .addGroup(manageHostsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
513  .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
514  .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
515  .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
516  .addContainerGap())
517  );
518 
519  java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/sleuthkit/autopsy/datamodel/hosts/Bundle"); // NOI18N
520  newButton.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.newButton.text")); // NOI18N
521  deleteButton.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.deleteButton.text")); // NOI18N
522  closeButton.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.closeButton.text")); // NOI18N
523  hostListLabel.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.hostListLabel.text")); // NOI18N
524  hostNameLabel.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.hostNameLabel.text")); // NOI18N
525  editButton.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.editButton.text")); // NOI18N
526  hostDetailsLabel.getAccessibleContext().setAccessibleName(bundle.getString("ManageHostsDialog.hostDetailsLabel.text")); // NOI18N
527 
528  manageHostsScrollPane.setViewportView(manageHostsPanel);
529 
530  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
531  getContentPane().setLayout(layout);
532  layout.setHorizontalGroup(
533  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
534  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
535  .addGap(0, 0, 0)
536  .addComponent(manageHostsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
537  );
538  layout.setVerticalGroup(
539  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
540  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
541  .addGap(0, 0, 0)
542  .addComponent(manageHostsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
543  );
544 
545  pack();
546  }// </editor-fold>//GEN-END:initComponents
547 
548  private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newButtonActionPerformed
549  addHost();
550  }//GEN-LAST:event_newButtonActionPerformed
551 
552  private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
553  HostListItem listItem = this.hostList.getSelectedValue();
554  if (listItem != null && listItem.getHost() != null) {
555  deleteHost(listItem.getHost());
556  }
557  }//GEN-LAST:event_deleteButtonActionPerformed
558 
559  private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
560  dispose();
561  }//GEN-LAST:event_closeButtonActionPerformed
562 
563  private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
564  HostListItem listItem = this.hostList.getSelectedValue();
565  if (listItem != null && listItem.getHost() != null) {
566  editHost(listItem.getHost());
567  }
568  }//GEN-LAST:event_editButtonActionPerformed
569 
570  // Variables declaration - do not modify//GEN-BEGIN:variables
571  private javax.swing.JButton closeButton;
572  private javax.swing.JButton deleteButton;
573  private javax.swing.JButton editButton;
574  private javax.swing.JTextArea hostDescriptionTextArea;
576  private javax.swing.JTextField hostNameTextField;
577  private javax.swing.JButton newButton;
578  // End of variables declaration//GEN-END:variables
579 }
void editButtonActionPerformed(java.awt.event.ActionEvent evt)
void deleteButtonActionPerformed(java.awt.event.ActionEvent evt)
void closeButtonActionPerformed(java.awt.event.ActionEvent evt)
void newButtonActionPerformed(java.awt.event.ActionEvent evt)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
javax.swing.JList< org.sleuthkit.autopsy.datamodel.hosts.ManageHostsDialog.HostListItem > hostList

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