Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ViewPreferencesPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 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.corecomponents;
20 
21 import java.beans.PropertyChangeEvent;
22 import java.util.EnumSet;
23 import java.util.Objects;
24 import java.util.TimeZone;
25 import javax.swing.JPanel;
26 import javax.swing.JSpinner;
27 import org.netbeans.spi.options.OptionsPanelController;
34 
38 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
39 public class ViewPreferencesPanel extends JPanel implements OptionsPanel {
40 
41  private final boolean immediateUpdates;
42 
49  public ViewPreferencesPanel(boolean immediateUpdates) {
50  initComponents();
51  this.immediateUpdates = immediateUpdates;
52  Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
53  //disable when case is closed, enable when case is open
54  currentCaseSettingsPanel.setEnabled(evt.getNewValue() != null);
55  radioGroupByDataType.setEnabled(evt.getNewValue() != null);
56  radioGroupByPersonHost.setEnabled(evt.getNewValue() != null);
57  });
58  this.timeZoneList.setListData(TimeZoneUtils.createTimeZoneList().stream().toArray(String[]::new));
59 
60  // Disable manual editing of max results spinner
61  ((JSpinner.DefaultEditor) maxResultsSpinner.getEditor()).getTextField().setEditable(false);
62  }
63 
64  @Override
65  public void load() {
66  // Global Settings
67  boolean keepPreferredViewer = UserPreferences.keepPreferredContentViewer();
68  keepCurrentViewerRadioButton.setSelected(keepPreferredViewer);
69  useBestViewerRadioButton.setSelected(!keepPreferredViewer);
70 
71  boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
72  timeZoneList.setEnabled(!useLocalTime);
73  timeZoneList.setSelectedValue(TimeZoneUtils.createTimeZoneString(TimeZone.getTimeZone(UserPreferences.getTimeZoneForDisplays())), true);
74  useLocalTimeRadioButton.setSelected(useLocalTime);
75  useAnotherTimeRadioButton.setSelected(!useLocalTime);
76 
77  dataSourcesHideKnownCheckbox.setSelected(UserPreferences.hideKnownFilesInDataSourcesTree());
78  viewsHideKnownCheckbox.setSelected(UserPreferences.hideKnownFilesInViewsTree());
79 
80  dataSourcesHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
81  viewsHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInViewsTree());
82 
83  scoColumnsCheckbox.setSelected(UserPreferences.getHideSCOColumns());
84 
85  hideOtherUsersTagsCheckbox.setSelected(UserPreferences.showOnlyCurrentUserTags());
86  fileNameTranslationColumnCheckbox.setSelected(UserPreferences.displayTranslatedFileNames());
87 
89  fileNameTranslationColumnCheckbox.setEnabled(tts.hasProvider());
90 
91  maxResultsSpinner.setValue(UserPreferences.getResultsTablePageSize());
92 
93  // Current Case Settings
94  boolean caseIsOpen = Case.isCaseOpen();
95  currentCaseSettingsPanel.setEnabled(caseIsOpen);
96  radioGroupByDataType.setEnabled(caseIsOpen);
97  radioGroupByPersonHost.setEnabled(caseIsOpen);
98 
99  boolean groupByHostPersonTypes = Objects.equals(CasePreferences.getGroupItemsInTreeByDataSource(), true);
100  radioGroupByDataType.setSelected(!groupByHostPersonTypes);
101  radioGroupByPersonHost.setSelected(groupByHostPersonTypes);
102 
103  if (!caseIsOpen) {
104  radioGroupByDataType.setEnabled(false);
105  radioGroupByPersonHost.setEnabled(false);
106  }
107 
108  // Current Session Settings
109  hideRejectedResultsCheckbox.setSelected(DirectoryTreeTopComponent.getDefault().getShowRejectedResults() == false);
110  }
111 
112  @Override
113  public void store() {
114  UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRadioButton.isSelected());
115  UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRadioButton.isSelected());
116  if (useAnotherTimeRadioButton.isSelected()) {
117  UserPreferences.setTimeZoneForDisplays(timeZoneList.getSelectedValue().substring(11).trim());
118  }
119  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCheckbox.isSelected());
120  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCheckbox.isSelected());
121  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCheckbox.isSelected());
122  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCheckbox.isSelected());
123  UserPreferences.setShowOnlyCurrentUserTags(hideOtherUsersTagsCheckbox.isSelected());
124  UserPreferences.setHideSCOColumns(scoColumnsCheckbox.isSelected());
125  UserPreferences.setDisplayTranslatedFileNames(fileNameTranslationColumnCheckbox.isSelected());
126  UserPreferences.setResultsTablePageSize((int) maxResultsSpinner.getValue());
127 
128  storeGroupItemsInTreeByDataSource();
129 
130  DirectoryTreeTopComponent.getDefault().setShowRejectedResults(hideRejectedResultsCheckbox.isSelected() == false);
131  }
132 
142 
143  if (Case.isCaseOpen() && (CasePreferences.getGroupItemsInTreeByDataSource() != null || radioGroupByPersonHost.isSelected())) {
144  CasePreferences.setGroupItemsInTreeByDataSource(radioGroupByPersonHost.isSelected());
145  }
146  }
147 
153  @SuppressWarnings("unchecked")
154  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
155  private void initComponents() {
156 
157  curCaseRadioGroup = new javax.swing.ButtonGroup();
158  viewPreferencesScrollPane = new javax.swing.JScrollPane();
159  viewPreferencesPanel = new javax.swing.JPanel();
160  globalSettingsPanel = new javax.swing.JPanel();
161  selectFileLabel = new javax.swing.JLabel();
162  useBestViewerRadioButton = new javax.swing.JRadioButton();
163  keepCurrentViewerRadioButton = new javax.swing.JRadioButton();
164  hideKnownFilesLabel = new javax.swing.JLabel();
165  dataSourcesHideKnownCheckbox = new javax.swing.JCheckBox();
166  viewsHideKnownCheckbox = new javax.swing.JCheckBox();
167  hideSlackFilesLabel = new javax.swing.JLabel();
168  dataSourcesHideSlackCheckbox = new javax.swing.JCheckBox();
169  viewsHideSlackCheckbox = new javax.swing.JCheckBox();
170  displayTimeLabel = new javax.swing.JLabel();
171  useLocalTimeRadioButton = new javax.swing.JRadioButton();
172  useAnotherTimeRadioButton = new javax.swing.JRadioButton();
173  hideOtherUsersTagsCheckbox = new javax.swing.JCheckBox();
174  hideOtherUsersTagsLabel = new javax.swing.JLabel();
175  scoColumnsLabel = new javax.swing.JLabel();
176  scoColumnsCheckbox = new javax.swing.JCheckBox();
177  jScrollPane1 = new javax.swing.JScrollPane();
178  timeZoneList = new javax.swing.JList<>();
179  translateTextLabel = new javax.swing.JLabel();
180  scoColumnsWrapAroundText = new javax.swing.JLabel();
181  fileNameTranslationColumnCheckbox = new javax.swing.JCheckBox();
182  maxResultsLabel = new javax.swing.JLabel();
183  maxResultsSpinner = new javax.swing.JSpinner();
184  currentCaseSettingsPanel = new javax.swing.JPanel();
185  radioGroupByPersonHost = new javax.swing.JRadioButton();
186  radioGroupByDataType = new javax.swing.JRadioButton();
187  currentSessionSettingsPanel = new javax.swing.JPanel();
188  hideRejectedResultsCheckbox = new javax.swing.JCheckBox();
189 
190  setMinimumSize(new java.awt.Dimension(727, 520));
191  setPreferredSize(new java.awt.Dimension(727, 520));
192 
193  viewPreferencesScrollPane.setBorder(null);
194  viewPreferencesScrollPane.setMinimumSize(new java.awt.Dimension(727, 500));
195  viewPreferencesScrollPane.setPreferredSize(new java.awt.Dimension(727, 500));
196 
197  viewPreferencesPanel.setPreferredSize(new java.awt.Dimension(727, 492));
198 
199  globalSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.globalSettingsPanel.border.title"))); // NOI18N
200 
201  org.openide.awt.Mnemonics.setLocalizedText(selectFileLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.selectFileLabel.text")); // NOI18N
202 
203  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.text")); // NOI18N
204  useBestViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.toolTipText")); // NOI18N
205  useBestViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
206  public void actionPerformed(java.awt.event.ActionEvent evt) {
207  useBestViewerRadioButtonActionPerformed(evt);
208  }
209  });
210 
211  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.text")); // NOI18N
212  keepCurrentViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.toolTipText")); // NOI18N
213  keepCurrentViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
214  public void actionPerformed(java.awt.event.ActionEvent evt) {
215  keepCurrentViewerRadioButtonActionPerformed(evt);
216  }
217  });
218 
219  org.openide.awt.Mnemonics.setLocalizedText(hideKnownFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideKnownFilesLabel.text")); // NOI18N
220 
221  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideKnownCheckbox.text")); // NOI18N
222  dataSourcesHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
223  public void actionPerformed(java.awt.event.ActionEvent evt) {
224  dataSourcesHideKnownCheckboxActionPerformed(evt);
225  }
226  });
227 
228  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideKnownCheckbox.text")); // NOI18N
229  viewsHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
230  public void actionPerformed(java.awt.event.ActionEvent evt) {
231  viewsHideKnownCheckboxActionPerformed(evt);
232  }
233  });
234 
235  org.openide.awt.Mnemonics.setLocalizedText(hideSlackFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideSlackFilesLabel.text")); // NOI18N
236 
237  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideSlackCheckbox.text")); // NOI18N
238  dataSourcesHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
239  public void actionPerformed(java.awt.event.ActionEvent evt) {
240  dataSourcesHideSlackCheckboxActionPerformed(evt);
241  }
242  });
243 
244  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideSlackCheckbox.text")); // NOI18N
245  viewsHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
246  public void actionPerformed(java.awt.event.ActionEvent evt) {
247  viewsHideSlackCheckboxActionPerformed(evt);
248  }
249  });
250 
251  org.openide.awt.Mnemonics.setLocalizedText(displayTimeLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.displayTimeLabel.text")); // NOI18N
252 
253  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useLocalTimeRadioButton.text")); // NOI18N
254  useLocalTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
255  public void actionPerformed(java.awt.event.ActionEvent evt) {
256  useLocalTimeRadioButtonActionPerformed(evt);
257  }
258  });
259 
260  org.openide.awt.Mnemonics.setLocalizedText(useAnotherTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useAnotherTimeRadioButton.text")); // NOI18N
261  useAnotherTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
262  public void actionPerformed(java.awt.event.ActionEvent evt) {
263  useAnotherTimeRadioButtonActionPerformed(evt);
264  }
265  });
266 
267  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsCheckbox.text")); // NOI18N
268  hideOtherUsersTagsCheckbox.addActionListener(new java.awt.event.ActionListener() {
269  public void actionPerformed(java.awt.event.ActionEvent evt) {
270  hideOtherUsersTagsCheckboxActionPerformed(evt);
271  }
272  });
273 
274  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsLabel.text")); // NOI18N
275 
276  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsLabel.text")); // NOI18N
277 
278  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsCheckbox.text")); // NOI18N
279  scoColumnsCheckbox.addActionListener(new java.awt.event.ActionListener() {
280  public void actionPerformed(java.awt.event.ActionEvent evt) {
281  scoColumnsCheckboxActionPerformed(evt);
282  }
283  });
284 
285  jScrollPane1.setMaximumSize(new java.awt.Dimension(150, 130));
286  jScrollPane1.setPreferredSize(new java.awt.Dimension(150, 130));
287 
288  timeZoneList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
289  public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
290  timeZoneListValueChanged(evt);
291  }
292  });
293  jScrollPane1.setViewportView(timeZoneList);
294 
295  org.openide.awt.Mnemonics.setLocalizedText(translateTextLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.translateTextLabel.text")); // NOI18N
296 
297  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsWrapAroundText, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsWrapAroundText.text")); // NOI18N
298 
299  org.openide.awt.Mnemonics.setLocalizedText(fileNameTranslationColumnCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.fileNameTranslationColumnCheckbox.text")); // NOI18N
300  fileNameTranslationColumnCheckbox.addActionListener(new java.awt.event.ActionListener() {
301  public void actionPerformed(java.awt.event.ActionEvent evt) {
302  fileNameTranslationColumnCheckboxActionPerformed(evt);
303  }
304  });
305 
306  org.openide.awt.Mnemonics.setLocalizedText(maxResultsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.text")); // NOI18N
307  maxResultsLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.toolTipText")); // NOI18N
308 
309  maxResultsSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 50000, 10000));
310  maxResultsSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
311  public void stateChanged(javax.swing.event.ChangeEvent evt) {
312  maxResultsSpinnerStateChanged(evt);
313  }
314  });
315 
316  javax.swing.GroupLayout globalSettingsPanelLayout = new javax.swing.GroupLayout(globalSettingsPanel);
317  globalSettingsPanel.setLayout(globalSettingsPanelLayout);
318  globalSettingsPanelLayout.setHorizontalGroup(
319  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
320  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
321  .addContainerGap()
322  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
323  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
324  .addComponent(maxResultsLabel)
325  .addGap(13, 13, 13)
326  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
327  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
328  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
329  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
330  .addGap(10, 10, 10)
331  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
332  .addComponent(viewsHideKnownCheckbox)
333  .addComponent(dataSourcesHideKnownCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
334  .addComponent(hideOtherUsersTagsCheckbox)
335  .addComponent(viewsHideSlackCheckbox)
336  .addComponent(hideOtherUsersTagsLabel)
337  .addComponent(scoColumnsLabel)
338  .addComponent(scoColumnsCheckbox)
339  .addComponent(dataSourcesHideSlackCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
340  .addComponent(scoColumnsWrapAroundText)))
341  .addComponent(hideSlackFilesLabel)
342  .addComponent(hideKnownFilesLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE))
343  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
344  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
345  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
346  .addGap(10, 10, 10)
347  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
348  .addComponent(useLocalTimeRadioButton)
349  .addComponent(keepCurrentViewerRadioButton)
350  .addComponent(fileNameTranslationColumnCheckbox)
351  .addComponent(useAnotherTimeRadioButton)
352  .addComponent(useBestViewerRadioButton)
353  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))
354  .addComponent(displayTimeLabel)
355  .addComponent(selectFileLabel)
356  .addComponent(translateTextLabel))))
357  .addContainerGap(94, Short.MAX_VALUE))
358  );
359  globalSettingsPanelLayout.setVerticalGroup(
360  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
361  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
362  .addContainerGap()
363  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
364  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
365  .addComponent(hideKnownFilesLabel)
366  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
367  .addComponent(dataSourcesHideKnownCheckbox)
368  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
369  .addComponent(viewsHideKnownCheckbox)
370  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
371  .addComponent(hideSlackFilesLabel)
372  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
373  .addComponent(dataSourcesHideSlackCheckbox)
374  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
375  .addComponent(viewsHideSlackCheckbox)
376  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
377  .addComponent(hideOtherUsersTagsLabel)
378  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
379  .addComponent(hideOtherUsersTagsCheckbox)
380  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
381  .addComponent(scoColumnsLabel)
382  .addGap(3, 3, 3)
383  .addComponent(scoColumnsCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
384  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
385  .addComponent(scoColumnsWrapAroundText))
386  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
387  .addComponent(selectFileLabel)
388  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
389  .addComponent(useBestViewerRadioButton)
390  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
391  .addComponent(keepCurrentViewerRadioButton)
392  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
393  .addComponent(displayTimeLabel)
394  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
395  .addComponent(useLocalTimeRadioButton)
396  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
397  .addComponent(useAnotherTimeRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
398  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
399  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
400  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
401  .addComponent(translateTextLabel)
402  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
403  .addComponent(fileNameTranslationColumnCheckbox)))
404  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
405  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
406  .addComponent(maxResultsLabel)
407  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
408  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
409  );
410 
411  currentCaseSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentCaseSettingsPanel.border.title"))); // NOI18N
412 
413  curCaseRadioGroup.add(radioGroupByPersonHost);
414  org.openide.awt.Mnemonics.setLocalizedText(radioGroupByPersonHost, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.radioGroupByPersonHost.text")); // NOI18N
415  radioGroupByPersonHost.addActionListener(new java.awt.event.ActionListener() {
416  public void actionPerformed(java.awt.event.ActionEvent evt) {
417  radioGroupByPersonHostActionPerformed(evt);
418  }
419  });
420 
421  curCaseRadioGroup.add(radioGroupByDataType);
422  org.openide.awt.Mnemonics.setLocalizedText(radioGroupByDataType, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.radioGroupByDataType.text")); // NOI18N
423  radioGroupByDataType.addActionListener(new java.awt.event.ActionListener() {
424  public void actionPerformed(java.awt.event.ActionEvent evt) {
425  radioGroupByDataTypeActionPerformed(evt);
426  }
427  });
428 
429  javax.swing.GroupLayout currentCaseSettingsPanelLayout = new javax.swing.GroupLayout(currentCaseSettingsPanel);
430  currentCaseSettingsPanel.setLayout(currentCaseSettingsPanelLayout);
431  currentCaseSettingsPanelLayout.setHorizontalGroup(
432  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
433  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
434  .addContainerGap()
435  .addGroup(currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
436  .addComponent(radioGroupByPersonHost)
437  .addComponent(radioGroupByDataType))
438  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
439  );
440  currentCaseSettingsPanelLayout.setVerticalGroup(
441  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
442  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
443  .addComponent(radioGroupByDataType)
444  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
445  .addComponent(radioGroupByPersonHost)
446  .addGap(0, 6, Short.MAX_VALUE))
447  );
448 
449  currentSessionSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentSessionSettingsPanel.border.title"))); // NOI18N
450 
451  org.openide.awt.Mnemonics.setLocalizedText(hideRejectedResultsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideRejectedResultsCheckbox.text")); // NOI18N
452  hideRejectedResultsCheckbox.addActionListener(new java.awt.event.ActionListener() {
453  public void actionPerformed(java.awt.event.ActionEvent evt) {
454  hideRejectedResultsCheckboxActionPerformed(evt);
455  }
456  });
457 
458  javax.swing.GroupLayout currentSessionSettingsPanelLayout = new javax.swing.GroupLayout(currentSessionSettingsPanel);
459  currentSessionSettingsPanel.setLayout(currentSessionSettingsPanelLayout);
460  currentSessionSettingsPanelLayout.setHorizontalGroup(
461  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
462  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
463  .addContainerGap()
464  .addComponent(hideRejectedResultsCheckbox)
465  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
466  );
467  currentSessionSettingsPanelLayout.setVerticalGroup(
468  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
469  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
470  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
471  .addComponent(hideRejectedResultsCheckbox))
472  );
473 
474  javax.swing.GroupLayout viewPreferencesPanelLayout = new javax.swing.GroupLayout(viewPreferencesPanel);
475  viewPreferencesPanel.setLayout(viewPreferencesPanelLayout);
476  viewPreferencesPanelLayout.setHorizontalGroup(
477  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
478  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPreferencesPanelLayout.createSequentialGroup()
479  .addContainerGap()
480  .addGroup(viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
481  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
482  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
483  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
484  .addContainerGap())
485  );
486  viewPreferencesPanelLayout.setVerticalGroup(
487  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
488  .addGroup(viewPreferencesPanelLayout.createSequentialGroup()
489  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
490  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
491  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
492  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
493  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
494  .addGap(0, 0, 0))
495  );
496 
497  viewPreferencesScrollPane.setViewportView(viewPreferencesPanel);
498 
499  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
500  this.setLayout(layout);
501  layout.setHorizontalGroup(
502  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
503  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
504  );
505  layout.setVerticalGroup(
506  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
507  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)
508  );
509  }// </editor-fold>//GEN-END:initComponents
510 
511  private void hideRejectedResultsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideRejectedResultsCheckboxActionPerformed
512  if (immediateUpdates) {
513  DirectoryTreeTopComponent.getDefault().setShowRejectedResults(hideRejectedResultsCheckbox.isSelected() == false);
514  } else {
515  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
516  }
517  }//GEN-LAST:event_hideRejectedResultsCheckboxActionPerformed
518 
519  private void maxResultsSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_maxResultsSpinnerStateChanged
520  if (immediateUpdates) {
521  UserPreferences.setResultsTablePageSize((int) maxResultsSpinner.getValue());
522  } else {
523  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
524  }
525  }//GEN-LAST:event_maxResultsSpinnerStateChanged
526 
527  private void fileNameTranslationColumnCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileNameTranslationColumnCheckboxActionPerformed
528  if (immediateUpdates) {
529  UserPreferences.setDisplayTranslatedFileNames(fileNameTranslationColumnCheckbox.isSelected());
530  } else {
531  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
532  }
533  }//GEN-LAST:event_fileNameTranslationColumnCheckboxActionPerformed
534 
535  private void timeZoneListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_timeZoneListValueChanged
536  if (immediateUpdates && useAnotherTimeRadioButton.isSelected()) {
537  UserPreferences.setTimeZoneForDisplays(timeZoneList.getSelectedValue().substring(11).trim());
538  } else {
539  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
540  }
541  }//GEN-LAST:event_timeZoneListValueChanged
542 
543  private void scoColumnsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scoColumnsCheckboxActionPerformed
544  if (immediateUpdates) {
545  UserPreferences.setHideSCOColumns(scoColumnsCheckbox.isSelected());
546  } else {
547  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
548  }
549  }//GEN-LAST:event_scoColumnsCheckboxActionPerformed
550 
551  private void hideOtherUsersTagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideOtherUsersTagsCheckboxActionPerformed
552  if (immediateUpdates) {
553  UserPreferences.setShowOnlyCurrentUserTags(hideOtherUsersTagsCheckbox.isSelected());
554  } else {
555  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
556  }
557  }//GEN-LAST:event_hideOtherUsersTagsCheckboxActionPerformed
558 
559  private void useAnotherTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useAnotherTimeRadioButtonActionPerformed
560  useLocalTimeRadioButton.setSelected(false);
561  useAnotherTimeRadioButton.setSelected(true);
562  timeZoneList.setEnabled(true);
563  if (immediateUpdates) {
565  } else {
566  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
567  }
568  }//GEN-LAST:event_useAnotherTimeRadioButtonActionPerformed
569 
570  private void useLocalTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useLocalTimeRadioButtonActionPerformed
571  useLocalTimeRadioButton.setSelected(true);
572  useAnotherTimeRadioButton.setSelected(false);
573  timeZoneList.setEnabled(false);
574  if (immediateUpdates) {
576  } else {
577  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
578  }
579  }//GEN-LAST:event_useLocalTimeRadioButtonActionPerformed
580 
581  private void viewsHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideSlackCheckboxActionPerformed
582  if (immediateUpdates) {
583  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCheckbox.isSelected());
584  } else {
585  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
586  }
587  }//GEN-LAST:event_viewsHideSlackCheckboxActionPerformed
588 
589  private void dataSourcesHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCheckboxActionPerformed
590  if (immediateUpdates) {
591  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCheckbox.isSelected());
592  } else {
593  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
594  }
595  }//GEN-LAST:event_dataSourcesHideSlackCheckboxActionPerformed
596 
597  private void viewsHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideKnownCheckboxActionPerformed
598  if (immediateUpdates) {
599  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCheckbox.isSelected());
600  } else {
601  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
602  }
603  }//GEN-LAST:event_viewsHideKnownCheckboxActionPerformed
604 
605  private void dataSourcesHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideKnownCheckboxActionPerformed
606  if (immediateUpdates) {
607  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCheckbox.isSelected());
608  } else {
609  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
610  }
611  }//GEN-LAST:event_dataSourcesHideKnownCheckboxActionPerformed
612 
613  private void keepCurrentViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepCurrentViewerRadioButtonActionPerformed
614  useBestViewerRadioButton.setSelected(false);
615  keepCurrentViewerRadioButton.setSelected(true);
616  if (immediateUpdates) {
618  } else {
619  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
620  }
621  }//GEN-LAST:event_keepCurrentViewerRadioButtonActionPerformed
622 
623  private void useBestViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRadioButtonActionPerformed
624  useBestViewerRadioButton.setSelected(true);
625  keepCurrentViewerRadioButton.setSelected(false);
626  if (immediateUpdates) {
628  } else {
629  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
630  }
631  }//GEN-LAST:event_useBestViewerRadioButtonActionPerformed
632 
633  private void radioGroupByDataTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioGroupByDataTypeActionPerformed
634  if (immediateUpdates) {
635  storeGroupItemsInTreeByDataSource();
636  } else {
637  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
638  }
639  }//GEN-LAST:event_radioGroupByDataTypeActionPerformed
640 
641  private void radioGroupByPersonHostActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioGroupByPersonHostActionPerformed
642  if (immediateUpdates) {
643  storeGroupItemsInTreeByDataSource();
644  } else {
645  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
646  }
647  }//GEN-LAST:event_radioGroupByPersonHostActionPerformed
648 
649 
650  // Variables declaration - do not modify//GEN-BEGIN:variables
651  private javax.swing.ButtonGroup curCaseRadioGroup;
652  private javax.swing.JPanel currentCaseSettingsPanel;
653  private javax.swing.JPanel currentSessionSettingsPanel;
654  private javax.swing.JCheckBox dataSourcesHideKnownCheckbox;
655  private javax.swing.JCheckBox dataSourcesHideSlackCheckbox;
656  private javax.swing.JLabel displayTimeLabel;
657  private javax.swing.JCheckBox fileNameTranslationColumnCheckbox;
658  private javax.swing.JPanel globalSettingsPanel;
659  private javax.swing.JLabel hideKnownFilesLabel;
660  private javax.swing.JCheckBox hideOtherUsersTagsCheckbox;
661  private javax.swing.JLabel hideOtherUsersTagsLabel;
662  private javax.swing.JCheckBox hideRejectedResultsCheckbox;
663  private javax.swing.JLabel hideSlackFilesLabel;
664  private javax.swing.JScrollPane jScrollPane1;
665  private javax.swing.JRadioButton keepCurrentViewerRadioButton;
666  private javax.swing.JLabel maxResultsLabel;
667  private javax.swing.JSpinner maxResultsSpinner;
668  private javax.swing.JRadioButton radioGroupByDataType;
669  private javax.swing.JRadioButton radioGroupByPersonHost;
670  private javax.swing.JCheckBox scoColumnsCheckbox;
671  private javax.swing.JLabel scoColumnsLabel;
672  private javax.swing.JLabel scoColumnsWrapAroundText;
673  private javax.swing.JLabel selectFileLabel;
674  private javax.swing.JList<String> timeZoneList;
675  private javax.swing.JLabel translateTextLabel;
676  private javax.swing.JRadioButton useAnotherTimeRadioButton;
677  private javax.swing.JRadioButton useBestViewerRadioButton;
678  private javax.swing.JRadioButton useLocalTimeRadioButton;
679  private javax.swing.JPanel viewPreferencesPanel;
680  private javax.swing.JScrollPane viewPreferencesScrollPane;
681  private javax.swing.JCheckBox viewsHideKnownCheckbox;
682  private javax.swing.JCheckBox viewsHideSlackCheckbox;
683  // End of variables declaration//GEN-END:variables
684 }
static void setKeepPreferredContentViewer(boolean value)
void keepCurrentViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
void radioGroupByPersonHostActionPerformed(java.awt.event.ActionEvent evt)
static void setDisplayTimesInLocalTime(boolean value)
void fileNameTranslationColumnCheckboxActionPerformed(java.awt.event.ActionEvent evt)
static void setHideSlackFilesInViewsTree(boolean value)
static void setHideSCOColumns(boolean value)
static void setResultsTablePageSize(int pageSize)
void useLocalTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
void hideRejectedResultsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void dataSourcesHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt)
static void setHideKnownFilesInViewsTree(boolean value)
void maxResultsSpinnerStateChanged(javax.swing.event.ChangeEvent evt)
static void setGroupItemsInTreeByDataSource(boolean value)
static String createTimeZoneString(TimeZone timeZone)
static void setTimeZoneForDisplays(String timeZone)
static void setDisplayTranslatedFileNames(boolean value)
void hideOtherUsersTagsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
static void setHideSlackFilesInDataSourcesTree(boolean value)
static void setHideKnownFilesInDataSourcesTree(boolean value)
void viewsHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void useBestViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
void useAnotherTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
void radioGroupByDataTypeActionPerformed(java.awt.event.ActionEvent evt)
void timeZoneListValueChanged(javax.swing.event.ListSelectionEvent evt)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
Definition: Case.java:704
static void setShowOnlyCurrentUserTags(boolean value)
void dataSourcesHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void scoColumnsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void viewsHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Aug 1 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.