Skip to content

Commit

Permalink
revised: IDE: handling no Jython/JRuby (issue #213)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiMan committed Nov 4, 2019
1 parent 88ef287 commit 947b585
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions API/src/main/java/org/sikuli/script/support/ExtensionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import org.sikuli.script.runners.ProcessRunner;

import javax.swing.*;
import java.awt.Desktop;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
Expand Down Expand Up @@ -112,15 +112,20 @@ public boolean accept(File dir, String name) {
}
}
if (!jythonReady && !jrubyReady) {
// https://github.com/RaiMan/SikuliX1/wiki/How-to-make-Jython-ready-in-the-IDE
String helpURL = "https://7i.fi/IDE-Jython";
String message = "Neither Jython nor JRuby available" +
"\nPlease consult the docs for a solution.\n" +
"\nIDE might not be useable with JavaScript only";
if (RunTime.isIDE()) {
if (!RunTime.isVerbose()) {
JOptionPane.showMessageDialog(null, message, "IDE startup problem",
JOptionPane.showMessageDialog(null,
message + "\n\nClick OK to get more help in a browser window",
"IDE startup problem",
JOptionPane.ERROR_MESSAGE);
} else {
RunTime.startLog(-1, message);
try {
Desktop.getDesktop().browse(new URI(helpURL));
} catch (IOException ex) {
} catch (URISyntaxException ex) {
}
}
}
Expand Down

0 comments on commit 947b585

Please sign in to comment.