1 | class GPGPlugin extends AbstractExternalToolsPlugin {↵ | | 1 | class ASpellPlugin extends AbstractExternalToolsPlugin {↵
|
2 | protected static File defaultLinux = new File("/usr/bin/gpg");↵ | | 2 | protected static File defaultLinux = new File("/usr/bin/aspell");↵
|
3 | protected static File defaultLocalLinux = new File("/usr/local/bin/gpg");↵ | | 3 | protected static File defaultLocalLinux = new File("/usr/local/bin/aspell");↵
|
|
4 | /* GPG for windows is an executable-only download, fortunately there is↵ | | 4 | ↵
|
5 | * a windows registry file included in the download and has this as the↵ | | |
|
6 | * default installation path in it. While users will probably install GPG↵ | | 5 | protected static File defaultWin↵
|
7 | * into many other places, this is atleast a best-guess start.↵ | | |
|
8 | */↵ | | |
|
9 | protected static File defaultWin = new File("C:\\GnuPG\\gpg↵ | | 6 | = new File(↵
|
10 | .exe");↵ | | 7 | "C:\\Program Files\\Aspell\\bin\\aspell.exe");↵
|
11 | protected static URL websiteURL;↵ | | 8 | protected static URL websiteURL;↵
|
|
12 | static {↵ | | 9 | static {↵
|
13 | try {↵ | | 10 | try {↵
|
14 | websiteURL = new URL("http://www.gnupg.org/");↵ | | 11 | websiteURL = new URL("http://aspell.sourceforge.net/");↵
|
15 | } catch (MalformedURLException mue) {↵ | | 12 | } catch (MalformedURLException mue) {↵
|
16 | }↵ | | 13 | }↵
|
|
17 | //does not happen↵ | | 14 | //does not happen↵
|
18 | }↵ | | 15 | }↵
|
|
19 | /**↵ | | 16 | /**↵
|
20 | * Construct the default GPG plugin.↵ | | 17 | * Construct the default ASpell plugin.↵
|
21 | */↵ | | 18 | */↵
|
22 | public GPGPlugin() {↵ | | 19 | public ASpellPlugin() {↵
|
23 | super();↵ | | 20 | super();↵
|
24 | }↵ | | 21 | }↵
|
|
25 | public String getDescription() {↵ | | 22 | public String getDescription() {↵
|
| | | 23 | // TODO (@author fdietz): i18n↵
|
26 | return "<html><body><p>GnuPG is a complete and free replacement for PGP.</p><p>Because it does not use the patented IDEA algorithm, it can be used without any restrictions. GnuPG is a RFC2440 (OpenPGP) compliant application.</p><p>GnuPG itself is a commandline tool without any graphical stuff. It is the real crypto engine which can be used directly from a command prompt, from shell scripts or by other programs. Therefore it can be considered as a backend for other applications.</p></body></html>";↵ | | 24 | return "<html><body><p>GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell.</p><p>It can either be used as a library or as an independent spell checker. Its main feature is that it does a much better job of coming up with possible suggestions than just about any other spell checker out there for the English language, including Ispell and Microsoft Word.</p></p>It also has many other technical enhancements over Ispell such as using shared memory for dictionaries and intelligently handling personal dictionaries when more than one Aspell process is open at once.</p></body></html>";↵
|
27 | }↵ | | 25 | }↵
|
|
28 | public URL getWebsite() {↵ | | 26 | public URL getWebsite() {↵
|
29 | return websiteURL;↵ | | 27 | return websiteURL;↵
|
30 | }↵ | | 28 | }↵
|
|
31 | public File locate() {↵ | | 29 | public File locate() {↵
|
32 | /* If this is a unix-based system, check the 2 best-known areas for the↵ | | 30 | /* If this is a unix-based system, check the 2 best-known areas for the↵
|
33 | * gpg binary.↵ | | 31 | * aspell binary.↵
|
34 | */↵ | | 32 | */↵
|
35 | if (OSInfo.isLinux() || OSInfo.isSolaris()) {↵ | | 33 | if (OSInfo.isLinux() || OSInfo.isSolaris()) {↵
|
36 | if (defaultLinux.exists()) {↵ | | 34 | if (defaultLinux.exists()) {↵
|
37 | return defaultLinux;↵ | | 35 | return defaultLinux;↵
|
38 | } else if (defaultLocalLinux.exists()) {↵ | | 36 | } else if (defaultLocalLinux.exists()) {↵
|
39 | return defaultLocalLinux;↵ | | 37 | return defaultLocalLinux;↵
|
40 | }↵ | | 38 | }↵
|
41 | }↵ | | 39 | }↵
|
|
42 | /* RIYAD: The Prefs API cannot be used to read the Window's registry,↵ | | 40 | /* RIYAD: The Prefs API cannot be used to read the Window's registry,↵
|
43 | * it is coded to use the registry (if available) as a backing store↵ | | 41 | * it is coded to use the registry (if available) as a backing store↵
|
44 | * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER↵ | | 42 | * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER↵
|
45 | * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use↵ | | 43 | * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use↵
|
46 | * the Windows registry and they all required a native lib to do it.↵ | | 44 | * the Windows registry and they all required a native lib to do it.↵
|
47 | */↵ | | 45 | */↵
|
48 | /* If this is windows, check the default installation location for the↵ | | 46 | /* If this is windows, check the default installation location for the↵
|
49 | * gpg.exe binary.↵ | | 47 | * aspell.exe binary.↵
|
50 | */↵ | | 48 | */↵
|
51 | if (OSInfo.isWin32Platform() && defaultWin.exists()) {↵ | | 49 | if (OSInfo.isWin32Platform() && defaultWin.exists()) {↵
|
52 | return defaultWin;↵ | | 50 | return defaultWin;↵
|
53 | }↵ | | 51 | }↵
|
|
54 | /* Couldn't find anything, so return null and let the wizard ask the↵ | | 52 | /* Couldn't find anything, so return null and let the wizard ask the↵
|
55 | * user.↵ | | 53 | * user.↵
|
56 | */↵ | | 54 | */↵
|
57 | return null;↵ | | 55 | return null;↵
|
58 | } | | 56 | }
|