mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-09 04:48:38 -05:00
Parse -Dnet.filebot.theme case-insensitively
This commit is contained in:
parent
a00d7191d7
commit
2cf7982ed5
@ -1,5 +1,6 @@
|
|||||||
package net.filebot.ui;
|
package net.filebot.ui;
|
||||||
|
|
||||||
|
import static java.util.Arrays.*;
|
||||||
import static javax.swing.BorderFactory.*;
|
import static javax.swing.BorderFactory.*;
|
||||||
import static net.filebot.Logging.*;
|
import static net.filebot.Logging.*;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ import net.filebot.util.ui.notification.SeparatorBorder.Position;
|
|||||||
|
|
||||||
public class ThemeSupport {
|
public class ThemeSupport {
|
||||||
|
|
||||||
private static Theme theme = SystemProperty.of("net.filebot.theme", Theme::valueOf, Theme.System).get();
|
private static Theme theme = SystemProperty.of("net.filebot.theme", Theme::forName, Theme.System).get();
|
||||||
|
|
||||||
public static Theme getTheme() {
|
public static Theme getTheme() {
|
||||||
return theme;
|
return theme;
|
||||||
@ -137,6 +138,15 @@ public class ThemeSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract void setLookAndFeel() throws Exception;
|
public abstract void setLookAndFeel() throws Exception;
|
||||||
|
|
||||||
|
public static Theme forName(String name) {
|
||||||
|
for (Theme t : values()) {
|
||||||
|
if (t.name().equalsIgnoreCase(name)) {
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException(String.format("%s not in %s", name, asList(values())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user