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