Autopsy  4.19.1
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  setPreferredSize(new java.awt.Dimension(727, 495));
191 
192  viewPreferencesScrollPane.setBorder(null);
193  viewPreferencesScrollPane.setPreferredSize(new java.awt.Dimension(727, 493));
194 
195  viewPreferencesPanel.setPreferredSize(new java.awt.Dimension(727, 492));
196 
197  globalSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.globalSettingsPanel.border.title"))); // NOI18N
198 
199  org.openide.awt.Mnemonics.setLocalizedText(selectFileLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.selectFileLabel.text")); // NOI18N
200 
201  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.text")); // NOI18N
202  useBestViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.toolTipText")); // NOI18N
203  useBestViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
204  public void actionPerformed(java.awt.event.ActionEvent evt) {
205  useBestViewerRadioButtonActionPerformed(evt);
206  }
207  });
208 
209  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.text")); // NOI18N
210  keepCurrentViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.toolTipText")); // NOI18N
211  keepCurrentViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
212  public void actionPerformed(java.awt.event.ActionEvent evt) {
213  keepCurrentViewerRadioButtonActionPerformed(evt);
214  }
215  });
216 
217  org.openide.awt.Mnemonics.setLocalizedText(hideKnownFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideKnownFilesLabel.text")); // NOI18N
218 
219  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideKnownCheckbox.text")); // NOI18N
220  dataSourcesHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
221  public void actionPerformed(java.awt.event.ActionEvent evt) {
222  dataSourcesHideKnownCheckboxActionPerformed(evt);
223  }
224  });
225 
226  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideKnownCheckbox.text")); // NOI18N
227  viewsHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
228  public void actionPerformed(java.awt.event.ActionEvent evt) {
229  viewsHideKnownCheckboxActionPerformed(evt);
230  }
231  });
232 
233  org.openide.awt.Mnemonics.setLocalizedText(hideSlackFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideSlackFilesLabel.text")); // NOI18N
234 
235  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideSlackCheckbox.text")); // NOI18N
236  dataSourcesHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
237  public void actionPerformed(java.awt.event.ActionEvent evt) {
238  dataSourcesHideSlackCheckboxActionPerformed(evt);
239  }
240  });
241 
242  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideSlackCheckbox.text")); // NOI18N
243  viewsHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
244  public void actionPerformed(java.awt.event.ActionEvent evt) {
245  viewsHideSlackCheckboxActionPerformed(evt);
246  }
247  });
248 
249  org.openide.awt.Mnemonics.setLocalizedText(displayTimeLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.displayTimeLabel.text")); // NOI18N
250 
251  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useLocalTimeRadioButton.text")); // NOI18N
252  useLocalTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
253  public void actionPerformed(java.awt.event.ActionEvent evt) {
254  useLocalTimeRadioButtonActionPerformed(evt);
255  }
256  });
257 
258  org.openide.awt.Mnemonics.setLocalizedText(useAnotherTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useAnotherTimeRadioButton.text")); // NOI18N
259  useAnotherTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
260  public void actionPerformed(java.awt.event.ActionEvent evt) {
261  useAnotherTimeRadioButtonActionPerformed(evt);
262  }
263  });
264 
265  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsCheckbox.text")); // NOI18N
266  hideOtherUsersTagsCheckbox.addActionListener(new java.awt.event.ActionListener() {
267  public void actionPerformed(java.awt.event.ActionEvent evt) {
268  hideOtherUsersTagsCheckboxActionPerformed(evt);
269  }
270  });
271 
272  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsLabel.text")); // NOI18N
273 
274  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsLabel.text")); // NOI18N
275 
276  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsCheckbox.text")); // NOI18N
277  scoColumnsCheckbox.addActionListener(new java.awt.event.ActionListener() {
278  public void actionPerformed(java.awt.event.ActionEvent evt) {
279  scoColumnsCheckboxActionPerformed(evt);
280  }
281  });
282 
283  jScrollPane1.setMaximumSize(new java.awt.Dimension(150, 130));
284  jScrollPane1.setPreferredSize(new java.awt.Dimension(150, 130));
285 
286  timeZoneList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
287  public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
288  timeZoneListValueChanged(evt);
289  }
290  });
291  jScrollPane1.setViewportView(timeZoneList);
292 
293  org.openide.awt.Mnemonics.setLocalizedText(translateTextLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.translateTextLabel.text")); // NOI18N
294 
295  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsWrapAroundText, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsWrapAroundText.text")); // NOI18N
296 
297  org.openide.awt.Mnemonics.setLocalizedText(fileNameTranslationColumnCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.fileNameTranslationColumnCheckbox.text")); // NOI18N
298  fileNameTranslationColumnCheckbox.addActionListener(new java.awt.event.ActionListener() {
299  public void actionPerformed(java.awt.event.ActionEvent evt) {
300  fileNameTranslationColumnCheckboxActionPerformed(evt);
301  }
302  });
303 
304  org.openide.awt.Mnemonics.setLocalizedText(maxResultsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.text")); // NOI18N
305  maxResultsLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.toolTipText")); // NOI18N
306 
307  maxResultsSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 50000, 10000));
308  maxResultsSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
309  public void stateChanged(javax.swing.event.ChangeEvent evt) {
310  maxResultsSpinnerStateChanged(evt);
311  }
312  });
313 
314  javax.swing.GroupLayout globalSettingsPanelLayout = new javax.swing.GroupLayout(globalSettingsPanel);
315  globalSettingsPanel.setLayout(globalSettingsPanelLayout);
316  globalSettingsPanelLayout.setHorizontalGroup(
317  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
318  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
319  .addContainerGap()
320  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
321  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
322  .addComponent(maxResultsLabel)
323  .addGap(13, 13, 13)
324  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
325  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
326  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
327  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
328  .addGap(10, 10, 10)
329  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
330  .addComponent(viewsHideKnownCheckbox)
331  .addComponent(dataSourcesHideKnownCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
332  .addComponent(hideOtherUsersTagsCheckbox)
333  .addComponent(viewsHideSlackCheckbox)
334  .addComponent(hideOtherUsersTagsLabel)
335  .addComponent(scoColumnsLabel)
336  .addComponent(scoColumnsCheckbox)
337  .addComponent(dataSourcesHideSlackCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
338  .addComponent(scoColumnsWrapAroundText)))
339  .addComponent(hideSlackFilesLabel)
340  .addComponent(hideKnownFilesLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE))
341  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
342  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
343  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
344  .addGap(10, 10, 10)
345  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
346  .addComponent(useLocalTimeRadioButton)
347  .addComponent(keepCurrentViewerRadioButton)
348  .addComponent(fileNameTranslationColumnCheckbox)
349  .addComponent(useAnotherTimeRadioButton)
350  .addComponent(useBestViewerRadioButton)
351  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))
352  .addComponent(displayTimeLabel)
353  .addComponent(selectFileLabel)
354  .addComponent(translateTextLabel))))
355  .addContainerGap(94, Short.MAX_VALUE))
356  );
357  globalSettingsPanelLayout.setVerticalGroup(
358  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
359  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
360  .addContainerGap()
361  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
362  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
363  .addComponent(hideKnownFilesLabel)
364  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
365  .addComponent(dataSourcesHideKnownCheckbox)
366  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
367  .addComponent(viewsHideKnownCheckbox)
368  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
369  .addComponent(hideSlackFilesLabel)
370  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
371  .addComponent(dataSourcesHideSlackCheckbox)
372  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
373  .addComponent(viewsHideSlackCheckbox)
374  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
375  .addComponent(hideOtherUsersTagsLabel)
376  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
377  .addComponent(hideOtherUsersTagsCheckbox)
378  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
379  .addComponent(scoColumnsLabel)
380  .addGap(3, 3, 3)
381  .addComponent(scoColumnsCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
382  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
383  .addComponent(scoColumnsWrapAroundText))
384  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
385  .addComponent(selectFileLabel)
386  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
387  .addComponent(useBestViewerRadioButton)
388  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
389  .addComponent(keepCurrentViewerRadioButton)
390  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
391  .addComponent(displayTimeLabel)
392  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
393  .addComponent(useLocalTimeRadioButton)
394  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
395  .addComponent(useAnotherTimeRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
396  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
397  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
398  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
399  .addComponent(translateTextLabel)
400  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
401  .addComponent(fileNameTranslationColumnCheckbox)))
402  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
403  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
404  .addComponent(maxResultsLabel)
405  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
406  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
407  );
408 
409  currentCaseSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentCaseSettingsPanel.border.title"))); // NOI18N
410 
411  curCaseRadioGroup.add(radioGroupByPersonHost);
412  org.openide.awt.Mnemonics.setLocalizedText(radioGroupByPersonHost, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.radioGroupByPersonHost.text")); // NOI18N
413  radioGroupByPersonHost.addActionListener(new java.awt.event.ActionListener() {
414  public void actionPerformed(java.awt.event.ActionEvent evt) {
415  radioGroupByPersonHostActionPerformed(evt);
416  }
417  });
418 
419  curCaseRadioGroup.add(radioGroupByDataType);
420  org.openide.awt.Mnemonics.setLocalizedText(radioGroupByDataType, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.radioGroupByDataType.text")); // NOI18N
421  radioGroupByDataType.addActionListener(new java.awt.event.ActionListener() {
422  public void actionPerformed(java.awt.event.ActionEvent evt) {
423  radioGroupByDataTypeActionPerformed(evt);
424  }
425  });
426 
427  javax.swing.GroupLayout currentCaseSettingsPanelLayout = new javax.swing.GroupLayout(currentCaseSettingsPanel);
428  currentCaseSettingsPanel.setLayout(currentCaseSettingsPanelLayout);
429  currentCaseSettingsPanelLayout.setHorizontalGroup(
430  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
431  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
432  .addContainerGap()
433  .addGroup(currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
434  .addComponent(radioGroupByPersonHost)
435  .addComponent(radioGroupByDataType))
436  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
437  );
438  currentCaseSettingsPanelLayout.setVerticalGroup(
439  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
440  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
441  .addComponent(radioGroupByDataType)
442  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
443  .addComponent(radioGroupByPersonHost)
444  .addGap(0, 6, Short.MAX_VALUE))
445  );
446 
447  currentSessionSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentSessionSettingsPanel.border.title"))); // NOI18N
448 
449  org.openide.awt.Mnemonics.setLocalizedText(hideRejectedResultsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideRejectedResultsCheckbox.text")); // NOI18N
450  hideRejectedResultsCheckbox.addActionListener(new java.awt.event.ActionListener() {
451  public void actionPerformed(java.awt.event.ActionEvent evt) {
452  hideRejectedResultsCheckboxActionPerformed(evt);
453  }
454  });
455 
456  javax.swing.GroupLayout currentSessionSettingsPanelLayout = new javax.swing.GroupLayout(currentSessionSettingsPanel);
457  currentSessionSettingsPanel.setLayout(currentSessionSettingsPanelLayout);
458  currentSessionSettingsPanelLayout.setHorizontalGroup(
459  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
460  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
461  .addContainerGap()
462  .addComponent(hideRejectedResultsCheckbox)
463  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
464  );
465  currentSessionSettingsPanelLayout.setVerticalGroup(
466  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
467  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
468  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
469  .addComponent(hideRejectedResultsCheckbox))
470  );
471 
472  javax.swing.GroupLayout viewPreferencesPanelLayout = new javax.swing.GroupLayout(viewPreferencesPanel);
473  viewPreferencesPanel.setLayout(viewPreferencesPanelLayout);
474  viewPreferencesPanelLayout.setHorizontalGroup(
475  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
476  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPreferencesPanelLayout.createSequentialGroup()
477  .addContainerGap()
478  .addGroup(viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
479  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
480  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
481  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
482  .addContainerGap())
483  );
484  viewPreferencesPanelLayout.setVerticalGroup(
485  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
486  .addGroup(viewPreferencesPanelLayout.createSequentialGroup()
487  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
488  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
489  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
490  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
491  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
492  .addGap(0, 0, 0))
493  );
494 
495  viewPreferencesScrollPane.setViewportView(viewPreferencesPanel);
496 
497  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
498  this.setLayout(layout);
499  layout.setHorizontalGroup(
500  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
501  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
502  );
503  layout.setVerticalGroup(
504  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
505  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
506  );
507  }// </editor-fold>//GEN-END:initComponents
508 
509  private void hideRejectedResultsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideRejectedResultsCheckboxActionPerformed
510  if (immediateUpdates) {
511  DirectoryTreeTopComponent.getDefault().setShowRejectedResults(hideRejectedResultsCheckbox.isSelected() == false);
512  } else {
513  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
514  }
515  }//GEN-LAST:event_hideRejectedResultsCheckboxActionPerformed
516 
517  private void maxResultsSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_maxResultsSpinnerStateChanged
518  if (immediateUpdates) {
519  UserPreferences.setResultsTablePageSize((int) maxResultsSpinner.getValue());
520  } else {
521  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
522  }
523  }//GEN-LAST:event_maxResultsSpinnerStateChanged
524 
525  private void fileNameTranslationColumnCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileNameTranslationColumnCheckboxActionPerformed
526  if (immediateUpdates) {
527  UserPreferences.setDisplayTranslatedFileNames(fileNameTranslationColumnCheckbox.isSelected());
528  } else {
529  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
530  }
531  }//GEN-LAST:event_fileNameTranslationColumnCheckboxActionPerformed
532 
533  private void timeZoneListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_timeZoneListValueChanged
534  if (immediateUpdates && useAnotherTimeRadioButton.isSelected()) {
535  UserPreferences.setTimeZoneForDisplays(timeZoneList.getSelectedValue().substring(11).trim());
536  } else {
537  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
538  }
539  }//GEN-LAST:event_timeZoneListValueChanged
540 
541  private void scoColumnsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scoColumnsCheckboxActionPerformed
542  if (immediateUpdates) {
543  UserPreferences.setHideSCOColumns(scoColumnsCheckbox.isSelected());
544  } else {
545  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
546  }
547  }//GEN-LAST:event_scoColumnsCheckboxActionPerformed
548 
549  private void hideOtherUsersTagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideOtherUsersTagsCheckboxActionPerformed
550  if (immediateUpdates) {
551  UserPreferences.setShowOnlyCurrentUserTags(hideOtherUsersTagsCheckbox.isSelected());
552  } else {
553  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
554  }
555  }//GEN-LAST:event_hideOtherUsersTagsCheckboxActionPerformed
556 
557  private void useAnotherTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useAnotherTimeRadioButtonActionPerformed
558  useLocalTimeRadioButton.setSelected(false);
559  useAnotherTimeRadioButton.setSelected(true);
560  timeZoneList.setEnabled(true);
561  if (immediateUpdates) {
563  } else {
564  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
565  }
566  }//GEN-LAST:event_useAnotherTimeRadioButtonActionPerformed
567 
568  private void useLocalTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useLocalTimeRadioButtonActionPerformed
569  useLocalTimeRadioButton.setSelected(true);
570  useAnotherTimeRadioButton.setSelected(false);
571  timeZoneList.setEnabled(false);
572  if (immediateUpdates) {
574  } else {
575  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
576  }
577  }//GEN-LAST:event_useLocalTimeRadioButtonActionPerformed
578 
579  private void viewsHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideSlackCheckboxActionPerformed
580  if (immediateUpdates) {
581  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCheckbox.isSelected());
582  } else {
583  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
584  }
585  }//GEN-LAST:event_viewsHideSlackCheckboxActionPerformed
586 
587  private void dataSourcesHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCheckboxActionPerformed
588  if (immediateUpdates) {
589  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCheckbox.isSelected());
590  } else {
591  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
592  }
593  }//GEN-LAST:event_dataSourcesHideSlackCheckboxActionPerformed
594 
595  private void viewsHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideKnownCheckboxActionPerformed
596  if (immediateUpdates) {
597  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCheckbox.isSelected());
598  } else {
599  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
600  }
601  }//GEN-LAST:event_viewsHideKnownCheckboxActionPerformed
602 
603  private void dataSourcesHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideKnownCheckboxActionPerformed
604  if (immediateUpdates) {
605  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCheckbox.isSelected());
606  } else {
607  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
608  }
609  }//GEN-LAST:event_dataSourcesHideKnownCheckboxActionPerformed
610 
611  private void keepCurrentViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepCurrentViewerRadioButtonActionPerformed
612  useBestViewerRadioButton.setSelected(false);
613  keepCurrentViewerRadioButton.setSelected(true);
614  if (immediateUpdates) {
616  } else {
617  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
618  }
619  }//GEN-LAST:event_keepCurrentViewerRadioButtonActionPerformed
620 
621  private void useBestViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRadioButtonActionPerformed
622  useBestViewerRadioButton.setSelected(true);
623  keepCurrentViewerRadioButton.setSelected(false);
624  if (immediateUpdates) {
626  } else {
627  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
628  }
629  }//GEN-LAST:event_useBestViewerRadioButtonActionPerformed
630 
631  private void radioGroupByDataTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioGroupByDataTypeActionPerformed
632  if (immediateUpdates) {
633  storeGroupItemsInTreeByDataSource();
634  } else {
635  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
636  }
637  }//GEN-LAST:event_radioGroupByDataTypeActionPerformed
638 
639  private void radioGroupByPersonHostActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioGroupByPersonHostActionPerformed
640  if (immediateUpdates) {
641  storeGroupItemsInTreeByDataSource();
642  } else {
643  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
644  }
645  }//GEN-LAST:event_radioGroupByPersonHostActionPerformed
646 
647 
648  // Variables declaration - do not modify//GEN-BEGIN:variables
649  private javax.swing.ButtonGroup curCaseRadioGroup;
650  private javax.swing.JPanel currentCaseSettingsPanel;
651  private javax.swing.JPanel currentSessionSettingsPanel;
652  private javax.swing.JCheckBox dataSourcesHideKnownCheckbox;
653  private javax.swing.JCheckBox dataSourcesHideSlackCheckbox;
654  private javax.swing.JLabel displayTimeLabel;
655  private javax.swing.JCheckBox fileNameTranslationColumnCheckbox;
656  private javax.swing.JPanel globalSettingsPanel;
657  private javax.swing.JLabel hideKnownFilesLabel;
658  private javax.swing.JCheckBox hideOtherUsersTagsCheckbox;
659  private javax.swing.JLabel hideOtherUsersTagsLabel;
660  private javax.swing.JCheckBox hideRejectedResultsCheckbox;
661  private javax.swing.JLabel hideSlackFilesLabel;
662  private javax.swing.JScrollPane jScrollPane1;
663  private javax.swing.JRadioButton keepCurrentViewerRadioButton;
664  private javax.swing.JLabel maxResultsLabel;
665  private javax.swing.JSpinner maxResultsSpinner;
666  private javax.swing.JRadioButton radioGroupByDataType;
667  private javax.swing.JRadioButton radioGroupByPersonHost;
668  private javax.swing.JCheckBox scoColumnsCheckbox;
669  private javax.swing.JLabel scoColumnsLabel;
670  private javax.swing.JLabel scoColumnsWrapAroundText;
671  private javax.swing.JLabel selectFileLabel;
672  private javax.swing.JList<String> timeZoneList;
673  private javax.swing.JLabel translateTextLabel;
674  private javax.swing.JRadioButton useAnotherTimeRadioButton;
675  private javax.swing.JRadioButton useBestViewerRadioButton;
676  private javax.swing.JRadioButton useLocalTimeRadioButton;
677  private javax.swing.JPanel viewPreferencesPanel;
678  private javax.swing.JScrollPane viewPreferencesScrollPane;
679  private javax.swing.JCheckBox viewsHideKnownCheckbox;
680  private javax.swing.JCheckBox viewsHideSlackCheckbox;
681  // End of variables declaration//GEN-END:variables
682 }
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:711
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-2021 Basis Technology. Generated on: Thu Sep 30 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.