Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
UserPreferences.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014 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.core;
20 
21 import java.util.prefs.PreferenceChangeListener;
22 import java.util.prefs.Preferences;
23 import org.openide.util.NbPreferences;
24 
29 public final class UserPreferences {
30 
31  private static final Preferences preferences = NbPreferences.forModule(UserPreferences.class);
32  public static final String KEEP_PREFERRED_VIEWER = "KeepPreferredViewer"; // NON-NLS
33  public static final String HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE = "HideKnownFilesInDataSourcesTree"; //NON-NLS
34  public static final String HIDE_KNOWN_FILES_IN_VIEWS_TREE = "HideKnownFilesInViewsTree"; //NON-NLS
35  public static final String DISPLAY_TIMES_IN_LOCAL_TIME = "DisplayTimesInLocalTime"; //NON-NLS
36  public static final String NUMBER_OF_FILE_INGEST_THREADS = "NumberOfFileIngestThreads"; //NON-NLS
37 
38  // Prevent instantiation.
39  private UserPreferences() {
40  }
41 
42  public static void addChangeListener(PreferenceChangeListener listener) {
43  preferences.addPreferenceChangeListener(listener);
44  }
45 
46  public static void removeChangeListener(PreferenceChangeListener listener) {
47  preferences.removePreferenceChangeListener(listener);
48  }
49 
50  public static boolean keepPreferredContentViewer() {
51  return preferences.getBoolean(KEEP_PREFERRED_VIEWER, false);
52  }
53 
54  public static void setKeepPreferredContentViewer(boolean value) {
55  preferences.putBoolean(KEEP_PREFERRED_VIEWER, value);
56  }
57 
58  public static boolean hideKnownFilesInDataSourcesTree() {
59  return preferences.getBoolean(HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE, false);
60  }
61 
62  public static void setHideKnownFilesInDataSourcesTree(boolean value) {
63  preferences.putBoolean(HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE, value);
64  }
65 
66  public static boolean hideKnownFilesInViewsTree() {
67  return preferences.getBoolean(HIDE_KNOWN_FILES_IN_VIEWS_TREE, true);
68  }
69 
70  public static void setHideKnownFilesInViewsTree(boolean value) {
71  preferences.putBoolean(HIDE_KNOWN_FILES_IN_VIEWS_TREE, value);
72  }
73 
74  public static boolean displayTimesInLocalTime() {
75  return preferences.getBoolean(DISPLAY_TIMES_IN_LOCAL_TIME, true);
76  }
77 
78  public static void setDisplayTimesInLocalTime(boolean value) {
79  preferences.putBoolean(DISPLAY_TIMES_IN_LOCAL_TIME, value);
80  }
81 
82  public static int numberOfFileIngestThreads() {
83  return preferences.getInt(NUMBER_OF_FILE_INGEST_THREADS, 2);
84  }
85 
86  public static void setNumberOfFileIngestThreads(int value) {
87  preferences.putInt(NUMBER_OF_FILE_INGEST_THREADS, value);
88  }
89 
90 }
static void setKeepPreferredContentViewer(boolean value)
static void setDisplayTimesInLocalTime(boolean value)
static void removeChangeListener(PreferenceChangeListener listener)
static void setHideKnownFilesInViewsTree(boolean value)
static void setHideKnownFilesInDataSourcesTree(boolean value)
static void addChangeListener(PreferenceChangeListener listener)

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.