Autopsy  4.6.0
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-2017 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 final class MultiUserCasesDialog extends JDialog {
32 
33  private static final long serialVersionUID = 1L;
34  private static final String REVIEW_MODE_TITLE = "Open Multi-User Case";
35  private static MultiUserCasesPanel multiUserCasesPanel;
36  private static MultiUserCasesDialog instance;
37 
43  static public MultiUserCasesDialog getInstance() {
44  if(instance == null) {
45  instance = new MultiUserCasesDialog();
46  instance.init();
47  }
48  return instance;
49  }
50 
54  private MultiUserCasesDialog() {
55  super(WindowManager.getDefault().getMainWindow(),
56  REVIEW_MODE_TITLE,
57  Dialog.ModalityType.APPLICATION_MODAL);
58  }
59 
63  private void init() {
64  getRootPane().registerKeyboardAction(
65  e -> {
66  setVisible(false);
67  },
68  KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
69 
70  multiUserCasesPanel = new MultiUserCasesPanel(this);
71  add(multiUserCasesPanel);
72  pack();
73  setResizable(false);
74  }
75 
82  @Override
83  public void setVisible(boolean value) {
84  if(value) {
85  multiUserCasesPanel.refresh();
86  }
87  super.setVisible(value);
88  }
89 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.