19 package org.sleuthkit.autopsy.corecomponents;
21 import java.awt.Insets;
23 import java.util.Collection;
25 import java.util.TreeMap;
26 import java.util.logging.Level;
27 import javax.swing.BorderFactory;
28 import javax.swing.UIManager;
29 import javax.swing.UIManager.LookAndFeelInfo;
30 import javax.swing.UnsupportedLookAndFeelException;
31 import org.netbeans.spi.sendopts.OptionProcessor;
32 import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI;
33 import org.openide.modules.ModuleInstall;
34 import org.openide.util.Lookup;
35 import org.openide.windows.WindowManager;
50 if (instance == null) {
65 UIManager.put(
"ViewTabDisplayerUI",
"org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI");
66 UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder());
67 UIManager.put(
"TabbedPane.contentBorderInsets",
new Insets(0, 0, 0, 0));
70 WindowManager.getDefault().invokeWhenUIReady(
new Runnable() {
73 Collection<? extends OptionProcessor> processors = Lookup.getDefault().lookupAll(OptionProcessor.class);
74 for (OptionProcessor processor : processors) {
76 OpenFromArguments argsProcessor = (OpenFromArguments) processor;
78 if (caseFile != null && !caseFile.equals(
"") && caseFile.endsWith(
".aut") &&
new File(caseFile).exists()) {
82 }
catch (Exception e) {
107 logger.log(Level.WARNING,
"Error closing case. ", ex);
118 if (System.getProperty(
"os.name").toLowerCase().contains(
"mac")) {
131 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
132 }
catch (ClassNotFoundException | InstantiationException
133 | IllegalAccessException | UnsupportedLookAndFeelException ex) {
134 logger.log(Level.WARNING,
"Unable to set theme. ", ex);
137 final String[] UI_MENU_ITEM_KEYS =
new String[]{
"MenuBarUI",
140 Map<Object, Object> uiEntries =
new TreeMap<>();
143 for(String key : UI_MENU_ITEM_KEYS) {
144 uiEntries.put(key, UIManager.get(key));
148 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
149 if (
"Nimbus".equals(info.getName())) {
151 UIManager.setLookAndFeel(info.getClassName());
152 }
catch (ClassNotFoundException | InstantiationException |
153 IllegalAccessException | UnsupportedLookAndFeelException ex) {
154 logger.log(Level.WARNING,
"Unable to set theme. ", ex);
161 for (Map.Entry<Object,Object> entry : uiEntries.entrySet()) {
162 UIManager.put(entry.getKey(), entry.getValue());
static Installer instance
static void open(String configFilePath)
static final Logger logger
static synchronized Installer getDefault()
static void invokeStartupDialog()
static Case getCurrentCase()
static boolean isCaseOpen()
static Logger getLogger(String name)