OmegaT のメニューバーにフォルダーツリー参照用のメニューを追加します。
Java Web Start 実行環境下でエラーが発生する問題について、そもそも Java Web Start 実行環境下では初期化しないように修正
@@ -1,8 +1,8 @@ | ||
1 | 1 | Manifest-Version: 1.0 |
2 | 2 | Main-Class: org.omegat.Main |
3 | 3 | License: GNU Public License version 3 or later |
4 | -Specification-Version: 0.4 | |
5 | -Implementation-Version: 0.4 | |
4 | +Specification-Version: 0.4.20140811 | |
5 | +Implementation-Version: 0.4.20140811 | |
6 | 6 | Permissions: all-permissions |
7 | 7 | Class-Path: lib/lib-mnemonics.jar |
8 | 8 | OmegaT-Plugins: |
@@ -37,14 +37,17 @@ | ||
37 | 37 | public static void loadPlugins() { |
38 | 38 | try { |
39 | 39 | // Not initialize in console mode |
40 | - if (!instantiated) { | |
40 | + if (instantiated) { | |
41 | + throw new RuntimeException("FolderMenu plugin could be instantiated only once."); | |
42 | + } else if (isRunningJavaWebStart()) { | |
43 | + // Just log it, no error. | |
44 | + Log.log("FolderMenu plugin is not working with Java Web Start."); | |
45 | + } else { | |
41 | 46 | CoreEvents.registerApplicationEventListener(new FolderMenu()); |
42 | - } else { | |
43 | - throw new RuntimeException("FolderMenu plugin could be instantiated only once."); | |
44 | 47 | } |
45 | 48 | } catch (Throwable ex) { |
46 | 49 | String msg = ex.getMessage(); |
47 | - Log.logErrorRB(msg); | |
50 | + Log.logErrorRB("LD_ERROR", msg); | |
48 | 51 | Core.pluginLoadingError(msg); |
49 | 52 | } |
50 | 53 | } |
@@ -82,4 +85,15 @@ | ||
82 | 85 | } |
83 | 86 | } |
84 | 87 | |
88 | + private static boolean isRunningJavaWebStart() { | |
89 | + boolean hasJNLP = false; | |
90 | + try { | |
91 | + Class.forName("javax.jnlp.ServiceManager"); | |
92 | + hasJNLP = true; | |
93 | + } catch (ClassNotFoundException ex) { | |
94 | + // ignore | |
95 | + } | |
96 | + return hasJNLP; | |
97 | + } | |
98 | + | |
85 | 99 | } |
\ No newline at end of file |