Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeywordSearchConfigurationAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 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.keywordsearch;
20 
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.awt.event.WindowAdapter;
24 import java.awt.event.WindowEvent;
25 import java.awt.event.WindowListener;
26 import org.openide.util.HelpCtx;
27 import org.openide.util.actions.CallableSystemAction;
29 
33 class KeywordSearchConfigurationAction extends CallableSystemAction {
34 
35  private static final String ACTION_NAME = org.openide.util.NbBundle.getMessage(DropdownToolbar.class, "ListBundleConfig");
36  private KeywordSearchGlobalSettingsPanel panel;
37 
38  @Override
39  public void performAction() {
40  final KeywordSearchGlobalSettingsPanel panel = getPanel();
41  panel.load();
42  final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog();
43  dialog.addApplyButtonListener(new ActionListener() {
44 
45  @Override
46  public void actionPerformed(ActionEvent e) {
47  panel.store();
48  dialog.close();
49  }
50  });
51  WindowListener exitListener = new WindowAdapter() {
52 
53  @Override
54  public void windowClosing(WindowEvent e) {
55  dialog.close();
56  XmlKeywordSearchList.getCurrent().reload();
57  }
58  };
59  dialog.addWindowListener(exitListener);
60  dialog.display(panel);
61  }
62 
63  private KeywordSearchGlobalSettingsPanel getPanel() {
64  if (panel == null) {
65  panel = new KeywordSearchGlobalSettingsPanel();
66  }
67  return panel;
68  }
69 
70  @Override
71  public String getName() {
72  return ACTION_NAME;
73  }
74 
75  @Override
76  public HelpCtx getHelpCtx() {
77  return HelpCtx.DEFAULT_HELP;
78  }
79 
80  @Override
81  protected boolean asynchronous() {
82  return false;
83  }
84 }

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.