summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2020-07-21 14:39:54 (GMT)
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2020-07-21 14:39:54 (GMT)
commita38e14101f3e5bb4f2a758eff6cdcd87c9d99356 (patch)
treec7b3806ab5628c05604ff99581a6942e4fad59f2
parent45baddc2fabeb09688b07099769100e056bcc1d3 (diff)
downloadmocca-a38e14101f3e5bb4f2a758eff6cdcd87c9d99356.zip
mocca-a38e14101f3e5bb4f2a758eff6cdcd87c9d99356.tar.gz
mocca-a38e14101f3e5bb4f2a758eff6cdcd87c9d99356.tar.bz2
Modified Autostart capability on Java Versions > 1.8
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java1
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java19
2 files changed, 11 insertions, 9 deletions
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
index ee951a4..026a947 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
@@ -135,7 +135,6 @@ public class Launcher implements BKUControllerInterface {
}
private Configurator config;
private Container server;
-// private BasicService basicService;
private StatusNotifier status;
private Autostart autostart;
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
index 1b9996f..c12ffde 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
@@ -152,14 +152,17 @@ public class MOCCAIcon implements StatusNotifier, ActionListener, ItemListener {
Menu settingsMenu = new Menu(messages.getString(LABEL_SETTINGS));
menu.add(settingsMenu);
- CheckboxMenuItem autostartItem = new CheckboxMenuItem(
- messages.getString(LABEL_AUTOSTART));
- autostartItem.addItemListener(this);
- autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name());
- autostartItem.setState(controller.isAutostartEnabled());
- autostartItem.setEnabled(controller.isAutostartPossible());
- settingsMenu.add(autostartItem);
-
+ // only add autostart for older java versions
+ String version = System.getProperty("java.version");
+ if (version.startsWith("1.")) {
+ CheckboxMenuItem autostartItem = new CheckboxMenuItem(
+ messages.getString(LABEL_AUTOSTART));
+ autostartItem.addItemListener(this);
+ autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name());
+ autostartItem.setState(controller.isAutostartEnabled());
+ autostartItem.setEnabled(controller.isAutostartPossible());
+ settingsMenu.add(autostartItem);
+ }
menu.addSeparator();
MenuItem shutdownItem = new MenuItem(