1 | class ASpellPlugin extends AbstractExternalToolsPlugin {↵ | | 1 | class GPGPlugin extends AbstractExternalToolsPlugin {↵
|
2 | protected static File defaultLinux = new File("/usr/bin/aspell");↵ | | 2 | protected static File defaultLinux = new File("/usr/bin/gpg");↵
|
3 | protected static File defaultLocalLinux = new File("/usr/local/bin/aspell");↵ | | 3 | protected static File defaultLocalLinux = new File("/usr/local/bin/gpg");↵
|
|
4 | protected static File defaultWin = new File(↵ | | 4 | ↵
|
5 | "C:\\Program Files\\Aspell\\bin\\aspell↵ | | 5 | /* GPG for windows is an executable-only download, fortunately there is↵
|
| | | 6 | * a windows registry file included in the download and has this as the↵
|
| | | 7 | * default installation path in it. While users will probably install GPG↵
|
| | | 8 | * into many other places, this is atleast a best-guess start.↵
|
| | | 9 | */↵
|
6 | .exe");↵ | | 10 | protected static File defaultWin = new File("C:\\GnuPG\\gpg.exe");↵
|
7 | protected static URL websiteURL;↵ | | 11 | protected static URL websiteURL;↵
|
|
8 | static {↵ | | 12 | static {↵
|
9 | try {↵ | | 13 | try {↵
|
10 | websiteURL = new URL("http://aspell.sourceforge.net/");↵ | | 14 | websiteURL = new URL("http://www.gnupg.org/");↵
|
11 | } catch (MalformedURLException mue) {↵ | | 15 | } catch (MalformedURLException mue) {↵
|
12 | }↵ | | 16 | }↵
|
|
13 | //does not happen↵ | | 17 | //does not happen↵
|
14 | }↵ | | 18 | }↵
|
|
15 | /**↵ | | 19 | /**↵
|
16 | * Construct the default ASpell plugin.↵ | | 20 | * Construct the default GPG plugin.↵
|
17 | */↵ | | 21 | */↵
|
18 | public ASpellPlugin() {↵ | | 22 | public GPGPlugin() {↵
|
19 | super();↵ | | 23 | super();↵
|
20 | }↵ | | 24 | }↵
|
|
21 | public String getDescription() {↵ | | 25 | public String getDescription() {↵
|
22 | // TODO (@author fdietz): i18n↵ | | |
|
23 | 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>";↵ | | 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 | }↵ | | 27 | }↵
|
|
25 | public URL getWebsite() {↵ | | 28 | public URL getWebsite() {↵
|
26 | return websiteURL;↵ | | 29 | return websiteURL;↵
|
27 | }↵ | | 30 | }↵
|
|
28 | public File locate() {↵ | | 31 | public File locate() {↵
|
29 | /* If this is a unix-based system, check the 2 best-known areas for the↵ | | 32 | /* If this is a unix-based system, check the 2 best-known areas for the↵
|
30 | * aspell binary.↵ | | 33 | * gpg binary.↵
|
31 | */↵ | | 34 | */↵
|
32 | if (OSInfo.isLinux() || OSInfo.isSolaris()) {↵ | | 35 | if (OSInfo.isLinux() || OSInfo.isSolaris()) {↵
|
33 | if (defaultLinux.exists()) {↵ | | 36 | if (defaultLinux.exists()) {↵
|
34 | return defaultLinux;↵ | | 37 | return defaultLinux;↵
|
35 | } else if (defaultLocalLinux.exists()) {↵ | | 38 | } else if (defaultLocalLinux.exists()) {↵
|
36 | return defaultLocalLinux;↵ | | 39 | return defaultLocalLinux;↵
|
37 | }↵ | | 40 | }↵
|
38 | }↵ | | 41 | }↵
|
|
39 | /* RIYAD: The Prefs API cannot be used to read the Window's registry,↵ | | 42 | /* RIYAD: The Prefs API cannot be used to read the Window's registry,↵
|
40 | * it is coded to use the registry (if available) as a backing store↵ | | 43 | * it is coded to use the registry (if available) as a backing store↵
|
41 | * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER↵ | | 44 | * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER↵
|
42 | * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use↵ | | 45 | * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use↵
|
43 | * the Windows registry and they all required a native lib to do it.↵ | | 46 | * the Windows registry and they all required a native lib to do it.↵
|
44 | */↵ | | 47 | */↵
|
45 | /* If this is windows, check the default installation location for the↵ | | 48 | /* If this is windows, check the default installation location for the↵
|
46 | * aspell.exe binary.↵ | | 49 | * gpg.exe binary.↵
|
47 | */↵ | | 50 | */↵
|
48 | if (OSInfo.isWin32Platform() && defaultWin.exists()) {↵ | | 51 | if (OSInfo.isWin32Platform() && defaultWin.exists()) {↵
|
49 | return defaultWin;↵ | | 52 | return defaultWin;↵
|
50 | }↵ | | 53 | }↵
|
|
51 | /* Couldn't find anything, so return null and let the wizard ask the↵ | | 54 | /* Couldn't find anything, so return null and let the wizard ask the↵
|
52 | * user.↵ | | 55 | * user.↵
|
53 | */↵ | | 56 | */↵
|
54 | return null;↵ | | 57 | return null;↵
|
55 | }↵ | | 58 | }↵
|
56 | } | | 59 | }
|