19 package org.sleuthkit.autopsy.corecomponents;
21 import org.netbeans.spi.options.OptionsPanelController;
27 final class AutopsyOptionsPanel
extends javax.swing.JPanel {
29 private static final long serialVersionUID = 1L;
31 AutopsyOptionsPanel() {
36 boolean keepPreferredViewer = UserPreferences.keepPreferredContentViewer();
37 keepCurrentViewerRB.setSelected(keepPreferredViewer);
38 useBestViewerRB.setSelected(!keepPreferredViewer);
39 dataSourcesHideKnownCB.setSelected(UserPreferences.hideKnownFilesInDataSourcesTree());
40 viewsHideKnownCB.setSelected(UserPreferences.hideKnownFilesInViewsTree());
41 dataSourcesHideSlackCB.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
42 viewsHideSlackCB.setSelected(UserPreferences.hideSlackFilesInViewsTree());
43 boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
44 useLocalTimeRB.setSelected(useLocalTime);
45 useGMTTimeRB.setSelected(!useLocalTime);
49 UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRB.isSelected());
50 UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCB.isSelected());
51 UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCB.isSelected());
52 UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCB.isSelected());
53 UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCB.isSelected());
54 UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRB.isSelected());
67 private void initComponents() {
69 buttonGroup1 =
new javax.swing.ButtonGroup();
70 buttonGroup3 =
new javax.swing.ButtonGroup();
71 jScrollPane1 =
new javax.swing.JScrollPane();
72 jPanel1 =
new javax.swing.JPanel();
73 useBestViewerRB =
new javax.swing.JRadioButton();
74 keepCurrentViewerRB =
new javax.swing.JRadioButton();
75 jLabelSelectFile =
new javax.swing.JLabel();
76 jLabelTimeDisplay =
new javax.swing.JLabel();
77 useLocalTimeRB =
new javax.swing.JRadioButton();
78 useGMTTimeRB =
new javax.swing.JRadioButton();
79 jLabelHideKnownFiles =
new javax.swing.JLabel();
80 dataSourcesHideKnownCB =
new javax.swing.JCheckBox();
81 viewsHideKnownCB =
new javax.swing.JCheckBox();
82 dataSourcesHideSlackCB =
new javax.swing.JCheckBox();
83 viewsHideSlackCB =
new javax.swing.JCheckBox();
84 jLabelHideSlackFiles =
new javax.swing.JLabel();
86 jScrollPane1.setBorder(null);
88 buttonGroup1.add(useBestViewerRB);
89 org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useBestViewerRB.text"));
90 useBestViewerRB.setToolTipText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useBestViewerRB.toolTipText"));
91 useBestViewerRB.addActionListener(
new java.awt.event.ActionListener() {
92 public void actionPerformed(java.awt.event.ActionEvent evt) {
93 useBestViewerRBActionPerformed(evt);
97 buttonGroup1.add(keepCurrentViewerRB);
98 org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.keepCurrentViewerRB.text"));
99 keepCurrentViewerRB.setToolTipText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText"));
100 keepCurrentViewerRB.addActionListener(
new java.awt.event.ActionListener() {
101 public void actionPerformed(java.awt.event.ActionEvent evt) {
102 keepCurrentViewerRBActionPerformed(evt);
106 org.openide.awt.Mnemonics.setLocalizedText(jLabelSelectFile,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelSelectFile.text"));
108 org.openide.awt.Mnemonics.setLocalizedText(jLabelTimeDisplay,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelTimeDisplay.text"));
110 buttonGroup3.add(useLocalTimeRB);
111 org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useLocalTimeRB.text"));
112 useLocalTimeRB.addActionListener(
new java.awt.event.ActionListener() {
113 public void actionPerformed(java.awt.event.ActionEvent evt) {
114 useLocalTimeRBActionPerformed(evt);
118 buttonGroup3.add(useGMTTimeRB);
119 org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useGMTTimeRB.text"));
120 useGMTTimeRB.addActionListener(
new java.awt.event.ActionListener() {
121 public void actionPerformed(java.awt.event.ActionEvent evt) {
122 useGMTTimeRBActionPerformed(evt);
126 org.openide.awt.Mnemonics.setLocalizedText(jLabelHideKnownFiles,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelHideKnownFiles.text"));
128 org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.dataSourcesHideKnownCB.text"));
129 dataSourcesHideKnownCB.addActionListener(
new java.awt.event.ActionListener() {
130 public void actionPerformed(java.awt.event.ActionEvent evt) {
131 dataSourcesHideKnownCBActionPerformed(evt);
135 org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.viewsHideKnownCB.text"));
136 viewsHideKnownCB.addActionListener(
new java.awt.event.ActionListener() {
137 public void actionPerformed(java.awt.event.ActionEvent evt) {
138 viewsHideKnownCBActionPerformed(evt);
142 org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.dataSourcesHideSlackCB.text"));
143 dataSourcesHideSlackCB.addActionListener(
new java.awt.event.ActionListener() {
144 public void actionPerformed(java.awt.event.ActionEvent evt) {
145 dataSourcesHideSlackCBActionPerformed(evt);
149 org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.viewsHideSlackCB.text"));
150 viewsHideSlackCB.addActionListener(
new java.awt.event.ActionListener() {
151 public void actionPerformed(java.awt.event.ActionEvent evt) {
152 viewsHideSlackCBActionPerformed(evt);
156 org.openide.awt.Mnemonics.setLocalizedText(jLabelHideSlackFiles,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelHideSlackFiles.text"));
158 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
159 jPanel1.setLayout(jPanel1Layout);
160 jPanel1Layout.setHorizontalGroup(
161 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
162 .addGroup(jPanel1Layout.createSequentialGroup()
164 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
165 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
166 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
167 .addComponent(jLabelTimeDisplay)
168 .addGroup(jPanel1Layout.createSequentialGroup()
170 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
171 .addComponent(useLocalTimeRB)
172 .addComponent(useGMTTimeRB))))
173 .addContainerGap(512, Short.MAX_VALUE))
174 .addGroup(jPanel1Layout.createSequentialGroup()
175 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
176 .addComponent(jLabelHideKnownFiles)
177 .addComponent(jLabelSelectFile)
178 .addGroup(jPanel1Layout.createSequentialGroup()
180 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
181 .addComponent(keepCurrentViewerRB)
182 .addComponent(useBestViewerRB)
183 .addComponent(dataSourcesHideKnownCB)
184 .addComponent(viewsHideKnownCB))))
185 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
186 .addGroup(jPanel1Layout.createSequentialGroup()
187 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
188 .addComponent(jLabelHideSlackFiles)
189 .addGroup(jPanel1Layout.createSequentialGroup()
191 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
192 .addComponent(dataSourcesHideSlackCB)
193 .addComponent(viewsHideSlackCB))))
194 .addGap(0, 0, Short.MAX_VALUE))))
196 jPanel1Layout.setVerticalGroup(
197 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
198 .addGroup(jPanel1Layout.createSequentialGroup()
200 .addComponent(jLabelSelectFile)
201 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202 .addComponent(useBestViewerRB)
203 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
204 .addComponent(keepCurrentViewerRB)
205 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
206 .addComponent(jLabelHideKnownFiles)
207 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
208 .addComponent(dataSourcesHideKnownCB)
209 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
210 .addComponent(viewsHideKnownCB)
211 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
212 .addComponent(jLabelHideSlackFiles)
213 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
214 .addComponent(dataSourcesHideSlackCB)
215 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
216 .addComponent(viewsHideSlackCB)
217 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
218 .addComponent(jLabelTimeDisplay)
219 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
220 .addComponent(useLocalTimeRB)
221 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
222 .addComponent(useGMTTimeRB)
223 .addContainerGap(148, Short.MAX_VALUE))
226 jScrollPane1.setViewportView(jPanel1);
228 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
229 this.setLayout(layout);
230 layout.setHorizontalGroup(
231 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232 .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
234 layout.setVerticalGroup(
235 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
236 .addComponent(jScrollPane1)
240 private void useBestViewerRBActionPerformed(java.awt.event.ActionEvent evt) {
241 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
244 private void keepCurrentViewerRBActionPerformed(java.awt.event.ActionEvent evt) {
245 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
248 private void dataSourcesHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {
249 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
252 private void viewsHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {
253 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
256 private void useLocalTimeRBActionPerformed(java.awt.event.ActionEvent evt) {
257 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
260 private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {
261 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
264 private void dataSourcesHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {
265 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
268 private void viewsHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {
269 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
273 private javax.swing.ButtonGroup buttonGroup1;
274 private javax.swing.ButtonGroup buttonGroup3;
275 private javax.swing.JCheckBox dataSourcesHideKnownCB;
276 private javax.swing.JCheckBox dataSourcesHideSlackCB;
277 private javax.swing.JLabel jLabelHideKnownFiles;
278 private javax.swing.JLabel jLabelHideSlackFiles;
279 private javax.swing.JLabel jLabelSelectFile;
280 private javax.swing.JLabel jLabelTimeDisplay;
281 private javax.swing.JPanel jPanel1;
282 private javax.swing.JScrollPane jScrollPane1;
283 private javax.swing.JRadioButton keepCurrentViewerRB;
284 private javax.swing.JRadioButton useBestViewerRB;
285 private javax.swing.JRadioButton useGMTTimeRB;
286 private javax.swing.JRadioButton useLocalTimeRB;
287 private javax.swing.JCheckBox viewsHideKnownCB;
288 private javax.swing.JCheckBox viewsHideSlackCB;