Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AutopsyOptionsPanel.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.corecomponents;
20 
21 import org.netbeans.spi.options.OptionsPanelController;
23 
27 final class AutopsyOptionsPanel extends javax.swing.JPanel {
28 
29  private static final long serialVersionUID = 1L;
30 
31  AutopsyOptionsPanel() {
32  initComponents();
33  }
34 
35  void load() {
36  boolean keepPreferredViewer = UserPreferences.keepPreferredContentViewer();
37  keepCurrentViewerRB.setSelected(keepPreferredViewer);
38  useBestViewerRB.setSelected(!keepPreferredViewer);
39  dataSourcesHideKnownCB.setSelected(UserPreferences.hideKnownFilesInDataSourcesTree());
40  viewsHideKnownCB.setSelected(UserPreferences.hideKnownFilesInViewsTree());
41  dataSourcesHideSlackCB.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
42  viewsHideSlackCB.setSelected(UserPreferences.hideSlackFilesInViewsTree());
43  boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
44  useLocalTimeRB.setSelected(useLocalTime);
45  useGMTTimeRB.setSelected(!useLocalTime);
46  }
47 
48  void store() {
49  UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRB.isSelected());
50  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCB.isSelected());
51  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCB.isSelected());
52  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCB.isSelected());
53  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCB.isSelected());
54  UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRB.isSelected());
55  }
56 
57  boolean valid() {
58  return true;
59  }
60 
66  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
67  private void initComponents() {
68 
69  buttonGroup1 = new javax.swing.ButtonGroup();
70  buttonGroup3 = new javax.swing.ButtonGroup();
71  jScrollPane1 = new javax.swing.JScrollPane();
72  jPanel1 = new javax.swing.JPanel();
73  useBestViewerRB = new javax.swing.JRadioButton();
74  keepCurrentViewerRB = new javax.swing.JRadioButton();
75  jLabelSelectFile = new javax.swing.JLabel();
76  jLabelTimeDisplay = new javax.swing.JLabel();
77  useLocalTimeRB = new javax.swing.JRadioButton();
78  useGMTTimeRB = new javax.swing.JRadioButton();
79  jLabelHideKnownFiles = new javax.swing.JLabel();
80  dataSourcesHideKnownCB = new javax.swing.JCheckBox();
81  viewsHideKnownCB = new javax.swing.JCheckBox();
82  dataSourcesHideSlackCB = new javax.swing.JCheckBox();
83  viewsHideSlackCB = new javax.swing.JCheckBox();
84  jLabelHideSlackFiles = new javax.swing.JLabel();
85 
86  jScrollPane1.setBorder(null);
87 
88  buttonGroup1.add(useBestViewerRB);
89  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.text")); // NOI18N
90  useBestViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.toolTipText")); // NOI18N
91  useBestViewerRB.addActionListener(new java.awt.event.ActionListener() {
92  public void actionPerformed(java.awt.event.ActionEvent evt) {
93  useBestViewerRBActionPerformed(evt);
94  }
95  });
96 
97  buttonGroup1.add(keepCurrentViewerRB);
98  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.text")); // NOI18N
99  keepCurrentViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText")); // NOI18N
100  keepCurrentViewerRB.addActionListener(new java.awt.event.ActionListener() {
101  public void actionPerformed(java.awt.event.ActionEvent evt) {
102  keepCurrentViewerRBActionPerformed(evt);
103  }
104  });
105 
106  org.openide.awt.Mnemonics.setLocalizedText(jLabelSelectFile, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelSelectFile.text")); // NOI18N
107 
108  org.openide.awt.Mnemonics.setLocalizedText(jLabelTimeDisplay, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelTimeDisplay.text")); // NOI18N
109 
110  buttonGroup3.add(useLocalTimeRB);
111  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useLocalTimeRB.text")); // NOI18N
112  useLocalTimeRB.addActionListener(new java.awt.event.ActionListener() {
113  public void actionPerformed(java.awt.event.ActionEvent evt) {
114  useLocalTimeRBActionPerformed(evt);
115  }
116  });
117 
118  buttonGroup3.add(useGMTTimeRB);
119  org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useGMTTimeRB.text")); // NOI18N
120  useGMTTimeRB.addActionListener(new java.awt.event.ActionListener() {
121  public void actionPerformed(java.awt.event.ActionEvent evt) {
122  useGMTTimeRBActionPerformed(evt);
123  }
124  });
125 
126  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideKnownFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideKnownFiles.text")); // NOI18N
127 
128  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideKnownCB.text")); // NOI18N
129  dataSourcesHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
130  public void actionPerformed(java.awt.event.ActionEvent evt) {
131  dataSourcesHideKnownCBActionPerformed(evt);
132  }
133  });
134 
135  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideKnownCB.text")); // NOI18N
136  viewsHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
137  public void actionPerformed(java.awt.event.ActionEvent evt) {
138  viewsHideKnownCBActionPerformed(evt);
139  }
140  });
141 
142  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideSlackCB.text")); // NOI18N
143  dataSourcesHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
144  public void actionPerformed(java.awt.event.ActionEvent evt) {
145  dataSourcesHideSlackCBActionPerformed(evt);
146  }
147  });
148 
149  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideSlackCB.text")); // NOI18N
150  viewsHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
151  public void actionPerformed(java.awt.event.ActionEvent evt) {
152  viewsHideSlackCBActionPerformed(evt);
153  }
154  });
155 
156  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideSlackFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideSlackFiles.text")); // NOI18N
157 
158  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
159  jPanel1.setLayout(jPanel1Layout);
160  jPanel1Layout.setHorizontalGroup(
161  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
162  .addGroup(jPanel1Layout.createSequentialGroup()
163  .addContainerGap()
164  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
165  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
166  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
167  .addComponent(jLabelTimeDisplay)
168  .addGroup(jPanel1Layout.createSequentialGroup()
169  .addGap(10, 10, 10)
170  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
171  .addComponent(useLocalTimeRB)
172  .addComponent(useGMTTimeRB))))
173  .addContainerGap(512, Short.MAX_VALUE))
174  .addGroup(jPanel1Layout.createSequentialGroup()
175  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
176  .addComponent(jLabelHideKnownFiles)
177  .addComponent(jLabelSelectFile)
178  .addGroup(jPanel1Layout.createSequentialGroup()
179  .addGap(10, 10, 10)
180  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
181  .addComponent(keepCurrentViewerRB)
182  .addComponent(useBestViewerRB)
183  .addComponent(dataSourcesHideKnownCB)
184  .addComponent(viewsHideKnownCB))))
185  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
186  .addGroup(jPanel1Layout.createSequentialGroup()
187  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
188  .addComponent(jLabelHideSlackFiles)
189  .addGroup(jPanel1Layout.createSequentialGroup()
190  .addGap(10, 10, 10)
191  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
192  .addComponent(dataSourcesHideSlackCB)
193  .addComponent(viewsHideSlackCB))))
194  .addGap(0, 0, Short.MAX_VALUE))))
195  );
196  jPanel1Layout.setVerticalGroup(
197  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
198  .addGroup(jPanel1Layout.createSequentialGroup()
199  .addContainerGap()
200  .addComponent(jLabelSelectFile)
201  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202  .addComponent(useBestViewerRB)
203  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
204  .addComponent(keepCurrentViewerRB)
205  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
206  .addComponent(jLabelHideKnownFiles)
207  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
208  .addComponent(dataSourcesHideKnownCB)
209  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
210  .addComponent(viewsHideKnownCB)
211  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
212  .addComponent(jLabelHideSlackFiles)
213  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
214  .addComponent(dataSourcesHideSlackCB)
215  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
216  .addComponent(viewsHideSlackCB)
217  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
218  .addComponent(jLabelTimeDisplay)
219  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
220  .addComponent(useLocalTimeRB)
221  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
222  .addComponent(useGMTTimeRB)
223  .addContainerGap(148, Short.MAX_VALUE))
224  );
225 
226  jScrollPane1.setViewportView(jPanel1);
227 
228  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
229  this.setLayout(layout);
230  layout.setHorizontalGroup(
231  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232  .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
233  );
234  layout.setVerticalGroup(
235  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
236  .addComponent(jScrollPane1)
237  );
238  }// </editor-fold>//GEN-END:initComponents
239 
240  private void useBestViewerRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRBActionPerformed
241  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
242  }//GEN-LAST:event_useBestViewerRBActionPerformed
243 
244  private void keepCurrentViewerRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepCurrentViewerRBActionPerformed
245  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
246  }//GEN-LAST:event_keepCurrentViewerRBActionPerformed
247 
248  private void dataSourcesHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideKnownCBActionPerformed
249  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
250  }//GEN-LAST:event_dataSourcesHideKnownCBActionPerformed
251 
252  private void viewsHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideKnownCBActionPerformed
253  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
254  }//GEN-LAST:event_viewsHideKnownCBActionPerformed
255 
256  private void useLocalTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useLocalTimeRBActionPerformed
257  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
258  }//GEN-LAST:event_useLocalTimeRBActionPerformed
259 
260  private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useGMTTimeRBActionPerformed
261  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
262  }//GEN-LAST:event_useGMTTimeRBActionPerformed
263 
264  private void dataSourcesHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCBActionPerformed
265  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
266  }//GEN-LAST:event_dataSourcesHideSlackCBActionPerformed
267 
268  private void viewsHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideSlackCBActionPerformed
269  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
270  }//GEN-LAST:event_viewsHideSlackCBActionPerformed
271 
272  // Variables declaration - do not modify//GEN-BEGIN:variables
273  private javax.swing.ButtonGroup buttonGroup1;
274  private javax.swing.ButtonGroup buttonGroup3;
275  private javax.swing.JCheckBox dataSourcesHideKnownCB;
276  private javax.swing.JCheckBox dataSourcesHideSlackCB;
277  private javax.swing.JLabel jLabelHideKnownFiles;
278  private javax.swing.JLabel jLabelHideSlackFiles;
279  private javax.swing.JLabel jLabelSelectFile;
280  private javax.swing.JLabel jLabelTimeDisplay;
281  private javax.swing.JPanel jPanel1;
282  private javax.swing.JScrollPane jScrollPane1;
283  private javax.swing.JRadioButton keepCurrentViewerRB;
284  private javax.swing.JRadioButton useBestViewerRB;
285  private javax.swing.JRadioButton useGMTTimeRB;
286  private javax.swing.JRadioButton useLocalTimeRB;
287  private javax.swing.JCheckBox viewsHideKnownCB;
288  private javax.swing.JCheckBox viewsHideSlackCB;
289  // End of variables declaration//GEN-END:variables
290 }

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