OmegaT のメニューバーにフォルダーツリー参照用のメニューを追加します。
Force FolderMenu class to be singleton
@@ -31,14 +31,17 @@ | ||
31 | 31 | */ |
32 | 32 | public class FolderMenu implements IApplicationEventListener, IProjectEventListener { |
33 | 33 | |
34 | - private static FolderMenu _this = new FolderMenu(); | |
34 | + private static boolean instantiated = false; | |
35 | 35 | |
36 | 36 | private MenuManager menuManager; |
37 | 37 | |
38 | 38 | public static void loadPlugins() { |
39 | 39 | try { |
40 | - // Not initialize in console mode. | |
41 | - CoreEvents.registerApplicationEventListener(_this); | |
40 | + // Not initialize in console mode | |
41 | + if (!instantiated) { | |
42 | + instantiated = true; | |
43 | + CoreEvents.registerApplicationEventListener(new FolderMenu()); | |
44 | + } | |
42 | 45 | } catch (Throwable ex) { |
43 | 46 | String msg = ex.getMessage(); |
44 | 47 | Log.logErrorRB(msg); |