Autopsy  4.14.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;
35 
39 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
40 public class ViewPreferencesPanel extends JPanel implements OptionsPanel {
41 
42  private final boolean immediateUpdates;
43 
50  public ViewPreferencesPanel(boolean immediateUpdates) {
51  initComponents();
52  this.immediateUpdates = immediateUpdates;
53  Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
54  //disable when case is closed, enable when case is open
55  currentCaseSettingsPanel.setEnabled(evt.getNewValue() != null);
56  groupByDataSourceCheckbox.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  groupByDataSourceCheckbox.setEnabled(caseIsOpen);
97 
98  if (caseIsOpen) {
99  groupByDataSourceCheckbox.setSelected(Objects.equals(CasePreferences.getGroupItemsInTreeByDataSource(), true));
100  } else {
101  groupByDataSourceCheckbox.setSelected(false);
102  }
103 
104  // Current Session Settings
105  hideRejectedResultsCheckbox.setSelected(DirectoryTreeTopComponent.getDefault().getShowRejectedResults() == false);
106  }
107 
108  @Override
109  public void store() {
110  UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRadioButton.isSelected());
111  UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRadioButton.isSelected());
112  if (useAnotherTimeRadioButton.isSelected()) {
113  UserPreferences.setTimeZoneForDisplays(timeZoneList.getSelectedValue().substring(11).trim());
114  }
115  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCheckbox.isSelected());
116  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCheckbox.isSelected());
117  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCheckbox.isSelected());
118  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCheckbox.isSelected());
119  UserPreferences.setShowOnlyCurrentUserTags(hideOtherUsersTagsCheckbox.isSelected());
120  UserPreferences.setHideSCOColumns(scoColumnsCheckbox.isSelected());
121  UserPreferences.setDisplayTranslatedFileNames(fileNameTranslationColumnCheckbox.isSelected());
122  UserPreferences.setResultsTablePageSize((int)maxResultsSpinner.getValue());
123 
124  storeGroupItemsInTreeByDataSource();
125 
126  DirectoryTreeTopComponent.getDefault().setShowRejectedResults(hideRejectedResultsCheckbox.isSelected() == false);
127  }
128 
138  if (Case.isCaseOpen() && (CasePreferences.getGroupItemsInTreeByDataSource() != null || groupByDataSourceCheckbox.isSelected())) {
139  CasePreferences.setGroupItemsInTreeByDataSource(groupByDataSourceCheckbox.isSelected());
140  }
141  }
142 
148  @SuppressWarnings("unchecked")
149  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
150  private void initComponents() {
151 
152  viewPreferencesScrollPane = new javax.swing.JScrollPane();
153  viewPreferencesPanel = new javax.swing.JPanel();
154  globalSettingsPanel = new javax.swing.JPanel();
155  selectFileLabel = new javax.swing.JLabel();
156  useBestViewerRadioButton = new javax.swing.JRadioButton();
157  keepCurrentViewerRadioButton = new javax.swing.JRadioButton();
158  hideKnownFilesLabel = new javax.swing.JLabel();
159  dataSourcesHideKnownCheckbox = new javax.swing.JCheckBox();
160  viewsHideKnownCheckbox = new javax.swing.JCheckBox();
161  hideSlackFilesLabel = new javax.swing.JLabel();
162  dataSourcesHideSlackCheckbox = new javax.swing.JCheckBox();
163  viewsHideSlackCheckbox = new javax.swing.JCheckBox();
164  displayTimeLabel = new javax.swing.JLabel();
165  useLocalTimeRadioButton = new javax.swing.JRadioButton();
166  useAnotherTimeRadioButton = new javax.swing.JRadioButton();
167  hideOtherUsersTagsCheckbox = new javax.swing.JCheckBox();
168  hideOtherUsersTagsLabel = new javax.swing.JLabel();
169  scoColumnsLabel = new javax.swing.JLabel();
170  scoColumnsCheckbox = new javax.swing.JCheckBox();
171  jScrollPane1 = new javax.swing.JScrollPane();
172  timeZoneList = new javax.swing.JList<>();
173  translateTextLabel = new javax.swing.JLabel();
174  scoColumnsWrapAroundText = new javax.swing.JLabel();
175  fileNameTranslationColumnCheckbox = new javax.swing.JCheckBox();
176  maxResultsLabel = new javax.swing.JLabel();
177  maxResultsSpinner = new javax.swing.JSpinner();
178  currentCaseSettingsPanel = new javax.swing.JPanel();
179  groupByDataSourceCheckbox = new javax.swing.JCheckBox();
180  currentSessionSettingsPanel = new javax.swing.JPanel();
181  hideRejectedResultsCheckbox = new javax.swing.JCheckBox();
182 
183  setPreferredSize(new java.awt.Dimension(625, 465));
184 
185  viewPreferencesScrollPane.setBorder(null);
186  viewPreferencesScrollPane.setPreferredSize(new java.awt.Dimension(625, 465));
187 
188  viewPreferencesPanel.setPreferredSize(new java.awt.Dimension(625, 465));
189 
190  globalSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.globalSettingsPanel.border.title"))); // NOI18N
191 
192  org.openide.awt.Mnemonics.setLocalizedText(selectFileLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.selectFileLabel.text")); // NOI18N
193 
194  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.text")); // NOI18N
195  useBestViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useBestViewerRadioButton.toolTipText")); // NOI18N
196  useBestViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
197  public void actionPerformed(java.awt.event.ActionEvent evt) {
198  useBestViewerRadioButtonActionPerformed(evt);
199  }
200  });
201 
202  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.text")); // NOI18N
203  keepCurrentViewerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.keepCurrentViewerRadioButton.toolTipText")); // NOI18N
204  keepCurrentViewerRadioButton.addActionListener(new java.awt.event.ActionListener() {
205  public void actionPerformed(java.awt.event.ActionEvent evt) {
206  keepCurrentViewerRadioButtonActionPerformed(evt);
207  }
208  });
209 
210  org.openide.awt.Mnemonics.setLocalizedText(hideKnownFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideKnownFilesLabel.text")); // NOI18N
211 
212  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideKnownCheckbox.text")); // NOI18N
213  dataSourcesHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
214  public void actionPerformed(java.awt.event.ActionEvent evt) {
215  dataSourcesHideKnownCheckboxActionPerformed(evt);
216  }
217  });
218 
219  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideKnownCheckbox.text")); // NOI18N
220  viewsHideKnownCheckbox.addActionListener(new java.awt.event.ActionListener() {
221  public void actionPerformed(java.awt.event.ActionEvent evt) {
222  viewsHideKnownCheckboxActionPerformed(evt);
223  }
224  });
225 
226  org.openide.awt.Mnemonics.setLocalizedText(hideSlackFilesLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideSlackFilesLabel.text")); // NOI18N
227 
228  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.dataSourcesHideSlackCheckbox.text")); // NOI18N
229  dataSourcesHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
230  public void actionPerformed(java.awt.event.ActionEvent evt) {
231  dataSourcesHideSlackCheckboxActionPerformed(evt);
232  }
233  });
234 
235  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.viewsHideSlackCheckbox.text")); // NOI18N
236  viewsHideSlackCheckbox.addActionListener(new java.awt.event.ActionListener() {
237  public void actionPerformed(java.awt.event.ActionEvent evt) {
238  viewsHideSlackCheckboxActionPerformed(evt);
239  }
240  });
241 
242  org.openide.awt.Mnemonics.setLocalizedText(displayTimeLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.displayTimeLabel.text")); // NOI18N
243 
244  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useLocalTimeRadioButton.text")); // NOI18N
245  useLocalTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
246  public void actionPerformed(java.awt.event.ActionEvent evt) {
247  useLocalTimeRadioButtonActionPerformed(evt);
248  }
249  });
250 
251  org.openide.awt.Mnemonics.setLocalizedText(useAnotherTimeRadioButton, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.useAnotherTimeRadioButton.text")); // NOI18N
252  useAnotherTimeRadioButton.addActionListener(new java.awt.event.ActionListener() {
253  public void actionPerformed(java.awt.event.ActionEvent evt) {
254  useAnotherTimeRadioButtonActionPerformed(evt);
255  }
256  });
257 
258  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsCheckbox.text")); // NOI18N
259  hideOtherUsersTagsCheckbox.addActionListener(new java.awt.event.ActionListener() {
260  public void actionPerformed(java.awt.event.ActionEvent evt) {
261  hideOtherUsersTagsCheckboxActionPerformed(evt);
262  }
263  });
264 
265  org.openide.awt.Mnemonics.setLocalizedText(hideOtherUsersTagsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideOtherUsersTagsLabel.text")); // NOI18N
266 
267  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsLabel.text")); // NOI18N
268 
269  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsCheckbox.text")); // NOI18N
270  scoColumnsCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
271  scoColumnsCheckbox.addActionListener(new java.awt.event.ActionListener() {
272  public void actionPerformed(java.awt.event.ActionEvent evt) {
273  scoColumnsCheckboxActionPerformed(evt);
274  }
275  });
276 
277  timeZoneList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
278  public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
279  timeZoneListValueChanged(evt);
280  }
281  });
282  jScrollPane1.setViewportView(timeZoneList);
283 
284  org.openide.awt.Mnemonics.setLocalizedText(translateTextLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.translateTextLabel.text")); // NOI18N
285 
286  org.openide.awt.Mnemonics.setLocalizedText(scoColumnsWrapAroundText, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.scoColumnsWrapAroundText.text")); // NOI18N
287 
288  org.openide.awt.Mnemonics.setLocalizedText(fileNameTranslationColumnCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.fileNameTranslationColumnCheckbox.text")); // NOI18N
289  fileNameTranslationColumnCheckbox.addActionListener(new java.awt.event.ActionListener() {
290  public void actionPerformed(java.awt.event.ActionEvent evt) {
291  fileNameTranslationColumnCheckboxActionPerformed(evt);
292  }
293  });
294 
295  org.openide.awt.Mnemonics.setLocalizedText(maxResultsLabel, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.text")); // NOI18N
296  maxResultsLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.maxResultsLabel.toolTipText")); // NOI18N
297 
298  maxResultsSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 50000, 10000));
299  maxResultsSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
300  public void stateChanged(javax.swing.event.ChangeEvent evt) {
301  maxResultsSpinnerStateChanged(evt);
302  }
303  });
304 
305  javax.swing.GroupLayout globalSettingsPanelLayout = new javax.swing.GroupLayout(globalSettingsPanel);
306  globalSettingsPanel.setLayout(globalSettingsPanelLayout);
307  globalSettingsPanelLayout.setHorizontalGroup(
308  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
309  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
310  .addContainerGap()
311  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
312  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
313  .addGap(10, 10, 10)
314  .addComponent(hideOtherUsersTagsCheckbox))
315  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
316  .addComponent(scoColumnsLabel)
317  .addGap(135, 135, 135)
318  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE))
319  .addComponent(hideOtherUsersTagsLabel)
320  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
321  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
322  .addComponent(hideKnownFilesLabel)
323  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
324  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
325  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
326  .addGap(10, 10, 10)
327  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
328  .addComponent(dataSourcesHideSlackCheckbox)
329  .addComponent(viewsHideSlackCheckbox)))
330  .addComponent(hideSlackFilesLabel))
331  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
332  .addGap(10, 10, 10)
333  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
334  .addComponent(dataSourcesHideKnownCheckbox)
335  .addComponent(viewsHideKnownCheckbox))))
336  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
337  .addGap(10, 10, 10)
338  .addComponent(scoColumnsCheckbox))
339  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
340  .addGap(32, 32, 32)
341  .addComponent(scoColumnsWrapAroundText)))
342  .addGap(18, 18, 18)
343  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
344  .addComponent(displayTimeLabel)
345  .addComponent(selectFileLabel)
346  .addComponent(translateTextLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
347  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
348  .addGap(10, 10, 10)
349  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
350  .addComponent(fileNameTranslationColumnCheckbox)
351  .addComponent(keepCurrentViewerRadioButton)
352  .addComponent(useBestViewerRadioButton)
353  .addComponent(useLocalTimeRadioButton)
354  .addComponent(useAnotherTimeRadioButton)))))
355  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
356  .addComponent(maxResultsLabel)
357  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
358  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)))
359  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
360  );
361  globalSettingsPanelLayout.setVerticalGroup(
362  globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
363  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
364  .addContainerGap()
365  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
366  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
367  .addComponent(hideKnownFilesLabel)
368  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
369  .addComponent(dataSourcesHideKnownCheckbox)
370  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
371  .addComponent(viewsHideKnownCheckbox)
372  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
373  .addComponent(hideSlackFilesLabel)
374  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
375  .addComponent(dataSourcesHideSlackCheckbox)
376  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
377  .addComponent(viewsHideSlackCheckbox)
378  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
379  .addComponent(hideOtherUsersTagsLabel)
380  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
381  .addComponent(hideOtherUsersTagsCheckbox)
382  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
383  .addComponent(scoColumnsLabel)
384  .addGap(3, 3, 3)
385  .addComponent(scoColumnsCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
386  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
387  .addComponent(scoColumnsWrapAroundText))
388  .addGroup(globalSettingsPanelLayout.createSequentialGroup()
389  .addComponent(selectFileLabel)
390  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
391  .addComponent(useBestViewerRadioButton)
392  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
393  .addComponent(keepCurrentViewerRadioButton)
394  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
395  .addComponent(displayTimeLabel)
396  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
397  .addComponent(useLocalTimeRadioButton)
398  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
399  .addComponent(useAnotherTimeRadioButton)
400  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
401  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
402  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
403  .addComponent(translateTextLabel)
404  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
405  .addComponent(fileNameTranslationColumnCheckbox)))
406  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
407  .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
408  .addComponent(maxResultsLabel)
409  .addComponent(maxResultsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
410  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
411  );
412 
413  currentCaseSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentCaseSettingsPanel.border.title"))); // NOI18N
414 
415  org.openide.awt.Mnemonics.setLocalizedText(groupByDataSourceCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.groupByDataSourceCheckbox.text")); // NOI18N
416  groupByDataSourceCheckbox.addActionListener(new java.awt.event.ActionListener() {
417  public void actionPerformed(java.awt.event.ActionEvent evt) {
418  groupByDataSourceCheckboxActionPerformed(evt);
419  }
420  });
421 
422  javax.swing.GroupLayout currentCaseSettingsPanelLayout = new javax.swing.GroupLayout(currentCaseSettingsPanel);
423  currentCaseSettingsPanel.setLayout(currentCaseSettingsPanelLayout);
424  currentCaseSettingsPanelLayout.setHorizontalGroup(
425  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
426  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
427  .addContainerGap()
428  .addComponent(groupByDataSourceCheckbox)
429  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
430  );
431  currentCaseSettingsPanelLayout.setVerticalGroup(
432  currentCaseSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
433  .addGroup(currentCaseSettingsPanelLayout.createSequentialGroup()
434  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
435  .addComponent(groupByDataSourceCheckbox))
436  );
437 
438  currentSessionSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.currentSessionSettingsPanel.border.title"))); // NOI18N
439 
440  org.openide.awt.Mnemonics.setLocalizedText(hideRejectedResultsCheckbox, org.openide.util.NbBundle.getMessage(ViewPreferencesPanel.class, "ViewPreferencesPanel.hideRejectedResultsCheckbox.text")); // NOI18N
441  hideRejectedResultsCheckbox.addActionListener(new java.awt.event.ActionListener() {
442  public void actionPerformed(java.awt.event.ActionEvent evt) {
443  hideRejectedResultsCheckboxActionPerformed(evt);
444  }
445  });
446 
447  javax.swing.GroupLayout currentSessionSettingsPanelLayout = new javax.swing.GroupLayout(currentSessionSettingsPanel);
448  currentSessionSettingsPanel.setLayout(currentSessionSettingsPanelLayout);
449  currentSessionSettingsPanelLayout.setHorizontalGroup(
450  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
451  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
452  .addContainerGap()
453  .addComponent(hideRejectedResultsCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
454  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
455  );
456  currentSessionSettingsPanelLayout.setVerticalGroup(
457  currentSessionSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
458  .addGroup(currentSessionSettingsPanelLayout.createSequentialGroup()
459  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
460  .addComponent(hideRejectedResultsCheckbox))
461  );
462 
463  javax.swing.GroupLayout viewPreferencesPanelLayout = new javax.swing.GroupLayout(viewPreferencesPanel);
464  viewPreferencesPanel.setLayout(viewPreferencesPanelLayout);
465  viewPreferencesPanelLayout.setHorizontalGroup(
466  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
467  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPreferencesPanelLayout.createSequentialGroup()
468  .addContainerGap()
469  .addGroup(viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
470  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
471  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
472  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
473  .addContainerGap())
474  );
475  viewPreferencesPanelLayout.setVerticalGroup(
476  viewPreferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
477  .addGroup(viewPreferencesPanelLayout.createSequentialGroup()
478  .addComponent(globalSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
479  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
480  .addComponent(currentCaseSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
481  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
482  .addComponent(currentSessionSettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
483  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
484  );
485 
486  viewPreferencesScrollPane.setViewportView(viewPreferencesPanel);
487 
488  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
489  this.setLayout(layout);
490  layout.setHorizontalGroup(
491  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
492  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
493  );
494  layout.setVerticalGroup(
495  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
496  .addComponent(viewPreferencesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
497  );
498  }// </editor-fold>//GEN-END:initComponents
499 
500  private void groupByDataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_groupByDataSourceCheckboxActionPerformed
501  if (immediateUpdates) {
502  storeGroupItemsInTreeByDataSource();
503  } else {
504  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
505  }
506  }//GEN-LAST:event_groupByDataSourceCheckboxActionPerformed
507 
508  private void hideRejectedResultsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideRejectedResultsCheckboxActionPerformed
509  if (immediateUpdates) {
510  DirectoryTreeTopComponent.getDefault().setShowRejectedResults(hideRejectedResultsCheckbox.isSelected() == false);
511  } else {
512  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
513  }
514  }//GEN-LAST:event_hideRejectedResultsCheckboxActionPerformed
515 
516  private void timeZoneListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_timeZoneListValueChanged
517  if (immediateUpdates && useAnotherTimeRadioButton.isSelected()) {
518  UserPreferences.setTimeZoneForDisplays(timeZoneList.getSelectedValue().substring(11).trim());
519  } else {
520  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
521  }
522  }//GEN-LAST:event_timeZoneListValueChanged
523 
524  private void scoColumnsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scoColumnsCheckboxActionPerformed
525  if (immediateUpdates) {
526  UserPreferences.setHideSCOColumns(scoColumnsCheckbox.isSelected());
527  } else {
528  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
529  }
530  }//GEN-LAST:event_scoColumnsCheckboxActionPerformed
531 
532  private void hideOtherUsersTagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideOtherUsersTagsCheckboxActionPerformed
533  if (immediateUpdates) {
534  UserPreferences.setShowOnlyCurrentUserTags(hideOtherUsersTagsCheckbox.isSelected());
535  } else {
536  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
537  }
538  }//GEN-LAST:event_hideOtherUsersTagsCheckboxActionPerformed
539 
540  private void useAnotherTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useAnotherTimeRadioButtonActionPerformed
541  useLocalTimeRadioButton.setSelected(false);
542  useAnotherTimeRadioButton.setSelected(true);
543  timeZoneList.setEnabled(true);
544  if (immediateUpdates) {
546  } else {
547  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
548  }
549  }//GEN-LAST:event_useAnotherTimeRadioButtonActionPerformed
550 
551  private void useLocalTimeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useLocalTimeRadioButtonActionPerformed
552  useLocalTimeRadioButton.setSelected(true);
553  useAnotherTimeRadioButton.setSelected(false);
554  timeZoneList.setEnabled(false);
555  if (immediateUpdates) {
557  } else {
558  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
559  }
560  }//GEN-LAST:event_useLocalTimeRadioButtonActionPerformed
561 
562  private void viewsHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideSlackCheckboxActionPerformed
563  if (immediateUpdates) {
564  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCheckbox.isSelected());
565  } else {
566  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
567  }
568  }//GEN-LAST:event_viewsHideSlackCheckboxActionPerformed
569 
570  private void dataSourcesHideSlackCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCheckboxActionPerformed
571  if (immediateUpdates) {
572  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCheckbox.isSelected());
573  } else {
574  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
575  }
576  }//GEN-LAST:event_dataSourcesHideSlackCheckboxActionPerformed
577 
578  private void viewsHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideKnownCheckboxActionPerformed
579  if (immediateUpdates) {
580  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCheckbox.isSelected());
581  } else {
582  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
583  }
584  }//GEN-LAST:event_viewsHideKnownCheckboxActionPerformed
585 
586  private void dataSourcesHideKnownCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideKnownCheckboxActionPerformed
587  if (immediateUpdates) {
588  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCheckbox.isSelected());
589  } else {
590  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
591  }
592  }//GEN-LAST:event_dataSourcesHideKnownCheckboxActionPerformed
593 
594  private void keepCurrentViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepCurrentViewerRadioButtonActionPerformed
595  useBestViewerRadioButton.setSelected(false);
596  keepCurrentViewerRadioButton.setSelected(true);
597  if (immediateUpdates) {
599  } else {
600  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
601  }
602  }//GEN-LAST:event_keepCurrentViewerRadioButtonActionPerformed
603 
604  private void useBestViewerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRadioButtonActionPerformed
605  useBestViewerRadioButton.setSelected(true);
606  keepCurrentViewerRadioButton.setSelected(false);
607  if (immediateUpdates) {
609  } else {
610  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
611  }
612  }//GEN-LAST:event_useBestViewerRadioButtonActionPerformed
613 
614  private void fileNameTranslationColumnCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileNameTranslationColumnCheckboxActionPerformed
615  if (immediateUpdates) {
616  UserPreferences.setDisplayTranslatedFileNames(fileNameTranslationColumnCheckbox.isSelected());
617  } else {
618  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
619  }
620  }//GEN-LAST:event_fileNameTranslationColumnCheckboxActionPerformed
621 
622  private void maxResultsSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_maxResultsSpinnerStateChanged
623  if (immediateUpdates) {
624  UserPreferences.setResultsTablePageSize((int)maxResultsSpinner.getValue());
625  } else {
626  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
627  }
628  }//GEN-LAST:event_maxResultsSpinnerStateChanged
629 
630 
631  // Variables declaration - do not modify//GEN-BEGIN:variables
632  private javax.swing.JPanel currentCaseSettingsPanel;
633  private javax.swing.JPanel currentSessionSettingsPanel;
634  private javax.swing.JCheckBox dataSourcesHideKnownCheckbox;
635  private javax.swing.JCheckBox dataSourcesHideSlackCheckbox;
636  private javax.swing.JLabel displayTimeLabel;
637  private javax.swing.JCheckBox fileNameTranslationColumnCheckbox;
638  private javax.swing.JPanel globalSettingsPanel;
639  private javax.swing.JCheckBox groupByDataSourceCheckbox;
640  private javax.swing.JLabel hideKnownFilesLabel;
641  private javax.swing.JCheckBox hideOtherUsersTagsCheckbox;
642  private javax.swing.JLabel hideOtherUsersTagsLabel;
643  private javax.swing.JCheckBox hideRejectedResultsCheckbox;
644  private javax.swing.JLabel hideSlackFilesLabel;
645  private javax.swing.JScrollPane jScrollPane1;
646  private javax.swing.JRadioButton keepCurrentViewerRadioButton;
647  private javax.swing.JLabel maxResultsLabel;
648  private javax.swing.JSpinner maxResultsSpinner;
649  private javax.swing.JCheckBox scoColumnsCheckbox;
650  private javax.swing.JLabel scoColumnsLabel;
651  private javax.swing.JLabel scoColumnsWrapAroundText;
652  private javax.swing.JLabel selectFileLabel;
653  private javax.swing.JList<String> timeZoneList;
654  private javax.swing.JLabel translateTextLabel;
655  private javax.swing.JRadioButton useAnotherTimeRadioButton;
656  private javax.swing.JRadioButton useBestViewerRadioButton;
657  private javax.swing.JRadioButton useLocalTimeRadioButton;
658  private javax.swing.JPanel viewPreferencesPanel;
659  private javax.swing.JScrollPane viewPreferencesScrollPane;
660  private javax.swing.JCheckBox viewsHideKnownCheckbox;
661  private javax.swing.JCheckBox viewsHideSlackCheckbox;
662  // End of variables declaration//GEN-END:variables
663 }
static void setKeepPreferredContentViewer(boolean value)
void keepCurrentViewerRadioButtonActionPerformed(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)
void groupByDataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt)
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 timeZoneListValueChanged(javax.swing.event.ListSelectionEvent evt)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
Definition: Case.java:486
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-2020 Basis Technology. Generated on: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.