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

Copyright © 2012-2018 Basis Technology. Generated on: Fri Jun 21 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.