|
@@ -14,12 +14,13 @@ public class Installer extends ModuleInstall {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void restored() {
|
|
public void restored() {
|
|
|
|
+ DarkMonkeyLookAndFeel darkMonkeyLaf = new DarkMonkeyLookAndFeel();
|
|
UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo(
|
|
UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo(
|
|
- new DarkMonkeyLookAndFeel().getName(),
|
|
|
|
|
|
+ darkMonkeyLaf.getName(),
|
|
DarkMonkeyLookAndFeel.class.getName()));
|
|
DarkMonkeyLookAndFeel.class.getName()));
|
|
- // TODO
|
|
|
|
-
|
|
|
|
- String[] fontsToLoad = {
|
|
|
|
|
|
+ UIManager.put("Nb.DarkMonkeyLFCustoms", new DarkMonkeyLFCustoms(darkMonkeyLaf));
|
|
|
|
+
|
|
|
|
+ String[] fontsToLoad = {
|
|
"fonts/DejaVuSans.ttf",
|
|
"fonts/DejaVuSans.ttf",
|
|
"fonts/DejaVuSans-Bold.ttf",
|
|
"fonts/DejaVuSans-Bold.ttf",
|
|
"fonts/DejaVuSans-Oblique.ttf",
|
|
"fonts/DejaVuSans-Oblique.ttf",
|
|
@@ -34,32 +35,19 @@ public class Installer extends ModuleInstall {
|
|
"fonts/DejaVuSansMono-BoldOblique.ttf"
|
|
"fonts/DejaVuSansMono-BoldOblique.ttf"
|
|
};
|
|
};
|
|
DMUtils.loadFontsFromJar(this, fontsToLoad);
|
|
DMUtils.loadFontsFromJar(this, fontsToLoad);
|
|
- }
|
|
|
|
-
|
|
|
|
- static {
|
|
|
|
- // Set DarkMonkey as the default LaF (Note: This code could also be placed inside the DarkMonkey LaF, so it'll be executed )
|
|
|
|
- try {
|
|
|
|
- if (NbPreferences.root().nodeExists("laf")) {
|
|
|
|
- String LaF = NbPreferences.root().node("laf").get("laf", null);
|
|
|
|
- if (LaF == null) { /* Did the user already set a LaF? */
|
|
|
|
- NbPreferences.root().node("laf").put("laf", "org.jme3.netbeans.plaf.darkmonkey.DarkMonkeyLookAndFeel"); // Set DarkMonkey as default LaF
|
|
|
|
- // TODO: Make this more generic and code independant. Read some other properties file
|
|
|
|
-
|
|
|
|
- /* The laf file is parsed before this code is executed so we set the LaF once programatically */
|
|
|
|
- UIManager.setLookAndFeel("org.jme3.netbeans.plaf.darkmonkey.DarkMonkeyLookAndFeel");
|
|
|
|
-
|
|
|
|
- /* Calling Netbeans Internal API, unfortunately there is no way around that, apart from manually fiddling with the config/.nbattrs file,
|
|
|
|
- which would need some parsing and a restart to take effect: <fileobject name=""> <attr name="Editors\currentFontColorProfile" stringvalue="Dark Monkey"/></fileobject>
|
|
|
|
- Also see http://www.netbeans.org/dtds/attributes-1_0.dtd
|
|
|
|
- */
|
|
|
|
- EditorSettings setting = org.netbeans.modules.editor.settings.storage.api.EditorSettings.getDefault();
|
|
|
|
- setting.setCurrentFontColorProfile("Dark Monkey");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- UIManager.put("Nb.DarkMonkeyLFCustoms", new DarkMonkeyLFCustoms((DarkMonkeyLookAndFeel)UIManager.getLookAndFeel()));
|
|
|
|
- } catch (Exception e) {}
|
|
|
|
|
|
|
|
|
|
+ EditorSettings setting = org.netbeans.modules.editor.settings.storage.api.EditorSettings.getDefault();
|
|
|
|
+ setting.setCurrentFontColorProfile("Dark Monkey");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void validate() throws IllegalStateException {
|
|
|
|
+
|
|
|
|
+ String LaF = NbPreferences.root().node("laf").get("laf", null);
|
|
|
|
+ if (LaF == null) {
|
|
|
|
+ /* Did the user already set a LaF? */
|
|
|
|
+ NbPreferences.root().node("laf").put("laf", "com.formdev.flatlaf.FlatDarkLaf"); // Set Flatlaf Dark as default LaF
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|