Autopsy  4.9.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
MultiUserCasesDialog.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 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.casemodule;
20 
21 import java.awt.Dialog;
22 import java.awt.event.KeyEvent;
23 import javax.swing.JComponent;
24 import javax.swing.JDialog;
25 import javax.swing.KeyStroke;
26 import org.openide.windows.WindowManager;
27 
31 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
32 final class MultiUserCasesDialog extends JDialog {
33 
34  private static final long serialVersionUID = 1L;
35  private static final String REVIEW_MODE_TITLE = "Open Multi-User Case";
36  private static MultiUserCasesPanel multiUserCasesPanel;
37  private static MultiUserCasesDialog instance;
38 
44  static public MultiUserCasesDialog getInstance() {
45  if(instance == null) {
46  instance = new MultiUserCasesDialog();
47  instance.init();
48  }
49  return instance;
50  }
51 
55  private MultiUserCasesDialog() {
56  super(WindowManager.getDefault().getMainWindow(),
57  REVIEW_MODE_TITLE,
58  Dialog.ModalityType.APPLICATION_MODAL);
59  }
60 
64  private void init() {
65  getRootPane().registerKeyboardAction(
66  e -> {
67  setVisible(false);
68  },
69  KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
70 
71  multiUserCasesPanel = new MultiUserCasesPanel(this);
72  add(multiUserCasesPanel);
73  pack();
74  setResizable(false);
75  }
76 
83  @Override
84  public void setVisible(boolean value) {
85  if(value) {
86  multiUserCasesPanel.refresh();
87  }
88  super.setVisible(value);
89  }
90 }

Copyright © 2012-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.