reformatting
( remove excess newlines ) (no logic changes)
This commit is contained in:
@ -23,7 +23,6 @@ import snoozesoft.systray4j.SysTrayMenuListener;
|
|||||||
* @author hypercubus
|
* @author hypercubus
|
||||||
*/
|
*/
|
||||||
public class SysTray implements SysTrayMenuListener {
|
public class SysTray implements SysTrayMenuListener {
|
||||||
|
|
||||||
private BrowserChooser _browserChooser;
|
private BrowserChooser _browserChooser;
|
||||||
private String _browserString;
|
private String _browserString;
|
||||||
private ConfigFile _configFile = new ConfigFile();
|
private ConfigFile _configFile = new ConfigFile();
|
||||||
@ -36,7 +35,6 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
private UrlLauncher _urlLauncher = new UrlLauncher();
|
private UrlLauncher _urlLauncher = new UrlLauncher();
|
||||||
|
|
||||||
public SysTray() {
|
public SysTray() {
|
||||||
|
|
||||||
if (!_configFile.init("systray.config"))
|
if (!_configFile.init("systray.config"))
|
||||||
_configFile.setProperty("browser", "default");
|
_configFile.setProperty("browser", "default");
|
||||||
|
|
||||||
@ -47,7 +45,6 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
if (System.getProperty("os.name").startsWith("Windows"))
|
if (System.getProperty("os.name").startsWith("Windows"))
|
||||||
new SysTray();
|
new SysTray();
|
||||||
}
|
}
|
||||||
@ -59,7 +56,6 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void menuItemSelected(SysTrayMenuEvent e) {
|
public void menuItemSelected(SysTrayMenuEvent e) {
|
||||||
|
|
||||||
String browser = null;
|
String browser = null;
|
||||||
|
|
||||||
if (e.getActionCommand().equals("shutdown")) {
|
if (e.getActionCommand().equals("shutdown")) {
|
||||||
@ -73,10 +69,8 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
_frame = null;
|
_frame = null;
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
} else if (e.getActionCommand().equals("selectbrowser")) {
|
} else if (e.getActionCommand().equals("selectbrowser")) {
|
||||||
|
|
||||||
if (!(browser = promptForBrowser("Select browser")).equals("nullnull"))
|
if (!(browser = promptForBrowser("Select browser")).equals("nullnull"))
|
||||||
setBrowser(browser);
|
setBrowser(browser);
|
||||||
|
|
||||||
} else if (e.getActionCommand().equals("openconsole")) {
|
} else if (e.getActionCommand().equals("openconsole")) {
|
||||||
openRouterConsole();
|
openRouterConsole();
|
||||||
}
|
}
|
||||||
@ -93,24 +87,19 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openRouterConsole() {
|
private void openRouterConsole() {
|
||||||
|
|
||||||
String browser = null;
|
String browser = null;
|
||||||
|
|
||||||
if (_browserString == null || _browserString.equals("default")) {
|
if (_browserString == null || _browserString.equals("default")) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (_urlLauncher.openUrl("http://localhost:7657/"))
|
if (_urlLauncher.openUrl("http://localhost:7657/"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Fall through.
|
// Fall through.
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (_urlLauncher.openUrl("http://localhost:7657/", _browserString))
|
if (_urlLauncher.openUrl("http://localhost:7657/", _browserString))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Fall through.
|
// Fall through.
|
||||||
}
|
}
|
||||||
@ -121,9 +110,7 @@ public class SysTray implements SysTrayMenuListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String promptForBrowser(String windowTitle) {
|
private String promptForBrowser(String windowTitle) {
|
||||||
|
|
||||||
String browser = null;
|
String browser = null;
|
||||||
|
|
||||||
_frame = new Frame();
|
_frame = new Frame();
|
||||||
_browserChooser = new BrowserChooser(_frame, windowTitle);
|
_browserChooser = new BrowserChooser(_frame, windowTitle);
|
||||||
browser = _browserChooser.getDirectory() + _browserChooser.getFile();
|
browser = _browserChooser.getDirectory() + _browserChooser.getFile();
|
||||||
|
Reference in New Issue
Block a user