Пример #1
0
 internal void InitializePluginForTest(IPoderosaWorld poderosa)
 {
     _instance                   = this;
     this._poderosaWorld         = poderosa;
     this._optionSupplier        = new TerminalOptionsSupplier();
     this._keepAlive             = new KeepAlive();
     this._customKeySettings     = new CustomKeySettings();
     this._shellSchemeCollection = new ShellSchemeCollection();
     this._shellSchemeCollection.InitForTest();
 }
Пример #2
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;
            _optionSupplier = new TerminalOptionsSupplier();
            _keepAlive = new KeepAlive();
            _customKeySettings = new CustomKeySettings();
            _shellSchemeCollection = new ShellSchemeCollection();

            GEnv.Init();
            IPluginManager pm = poderosa.PluginManager;
            ICoreServices cs = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            Debug.Assert(cs != null);
            cs.PreferenceExtensionPoint.RegisterExtension(_optionSupplier);
            cs.PreferenceExtensionPoint.RegisterExtension(_shellSchemeCollection);
            _coreServices = cs;

            //Serialize Service
            cs.SerializerExtensionPoint.RegisterExtension(new TerminalSettingsSerializer(pm));

            _commandManager = cs.CommandManager;
            TerminalCommand.Register(_commandManager);
            TerminalSettingMenuGroup.Initialize();

            //PromptChecker
            _promptCheckerWithTimer = new PromptCheckerWithTimer();

            //Edit Menuに追加
            IExtensionPoint editmenu = pm.FindExtensionPoint("org.poderosa.menu.edit");
            editmenu.RegisterExtension(new AdvancedCopyPasteMenuGroup());
            editmenu.RegisterExtension(new TerminalBufferMenuGroup());
            editmenu.RegisterExtension(new SelectionMenuGroup());

            //Console Menu : これは処置に困るところだが!
            IExtensionPoint consolemenu = pm.FindExtensionPoint("org.poderosa.menu.console");
            consolemenu.RegisterExtension(new TerminalSettingMenuGroup());
            consolemenu.RegisterExtension(new IntelliSenseMenuGroup());

            //Context Menu
            _contextMenu = pm.CreateExtensionPoint(TerminalEmulatorConstants.TERMINAL_CONTEXT_MENU_EXTENSIONPOINT, typeof(IPoderosaMenuGroup), this);
            _contextMenu.RegisterExtension(new BasicCopyPasteMenuGroup());
            _contextMenu.RegisterExtension(new TerminalSettingMenuGroup());
            _contextMenu.RegisterExtension(new IntelliSenseMenuGroup());

            //タブのコンテキストメニュー
            _documentContextMenu = pm.CreateExtensionPoint(TerminalEmulatorConstants.DOCUMENT_CONTEXT_MENU_EXTENSIONPOINT, typeof(IPoderosaMenuGroup), this);
            _documentContextMenu.RegisterExtension(new PoderosaMenuGroupImpl(new PoderosaMenuItemImpl(
                cs.CommandManager.Find("org.poderosa.core.session.closedocument"), GEnv.Strings, "Menu.DocumentClose")));

            //ToolBar
            IExtensionPoint toolbar = pm.FindExtensionPoint("org.poderosa.core.window.toolbar");
            TerminalToolBar terminaltoolbar = new TerminalToolBar();
            toolbar.RegisterExtension(terminaltoolbar);
            GetSessionManager().AddActiveDocumentChangeListener(terminaltoolbar);

            //その他 Extension
            _intelliSenseExtension = pm.CreateExtensionPoint(TerminalEmulatorConstants.INTELLISENSE_CANDIDATE_EXTENSIONPOINT, typeof(IIntelliSenseCandidateExtension), this);
            _autoLogFileFormatter = pm.CreateExtensionPoint(TerminalEmulatorConstants.LOG_FILENAME_FORMATTER_EXTENSIONPOINT, typeof(IAutoLogFileFormatter), this);
            _dynamicCaptionFormatter = pm.CreateExtensionPoint(TerminalEmulatorConstants.DYNAMIC_CAPTION_FORMATTER_EXTENSIONPOINT, typeof(IDynamicCaptionFormatter), this);

            //Command Popup
            CommandResultSession.Init(poderosa);
            PopupStyleCommandResultRecognizer.CreateExtensionPointAndDefaultCommands(pm);

            // Preferences for PromptRecognizer
            cs.PreferenceExtensionPoint.RegisterExtension(PromptRecognizerPreferences.Instance);

            // Preferences for XTerm
            cs.PreferenceExtensionPoint.RegisterExtension(XTermPreferences.Instance);
        }
Пример #3
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance              = this;
            _optionSupplier        = new TerminalOptionsSupplier();
            _keepAlive             = new KeepAlive();
            _customKeySettings     = new CustomKeySettings();
            _shellSchemeCollection = new ShellSchemeCollection();

            GEnv.Init();
            IPluginManager pm = poderosa.PluginManager;
            ICoreServices  cs = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));

            Debug.Assert(cs != null);
            cs.PreferenceExtensionPoint.RegisterExtension(_optionSupplier);
            cs.PreferenceExtensionPoint.RegisterExtension(_shellSchemeCollection);
            _coreServices = cs;

            //Serialize Service
            cs.SerializerExtensionPoint.RegisterExtension(new TerminalSettingsSerializer(pm));

            _commandManager = cs.CommandManager;
            TerminalCommand.Register(_commandManager);
            TerminalSettingMenuGroup.Initialize();

            //PromptChecker
            _promptCheckerWithTimer = new PromptCheckerWithTimer();

            //Edit Menuに追加
            IExtensionPoint editmenu = pm.FindExtensionPoint("org.poderosa.menu.edit");

            editmenu.RegisterExtension(new AdvancedCopyPasteMenuGroup());
            editmenu.RegisterExtension(new TerminalBufferMenuGroup());
            editmenu.RegisterExtension(new SelectionMenuGroup());

            //Console Menu : これは処置に困るところだが!
            IExtensionPoint consolemenu = pm.FindExtensionPoint("org.poderosa.menu.console");

            consolemenu.RegisterExtension(new TerminalSettingMenuGroup());
            consolemenu.RegisterExtension(new IntelliSenseMenuGroup());

            //Context Menu
            _contextMenu = pm.CreateExtensionPoint(TerminalEmulatorConstants.TERMINAL_CONTEXT_MENU_EXTENSIONPOINT, typeof(IPoderosaMenuGroup), this);
            _contextMenu.RegisterExtension(new BasicCopyPasteMenuGroup());
            _contextMenu.RegisterExtension(new TerminalSettingMenuGroup());
            _contextMenu.RegisterExtension(new IntelliSenseMenuGroup());

            //タブのコンテキストメニュー
            _documentContextMenu = pm.CreateExtensionPoint(TerminalEmulatorConstants.DOCUMENT_CONTEXT_MENU_EXTENSIONPOINT, typeof(IPoderosaMenuGroup), this);
            _documentContextMenu.RegisterExtension(new PoderosaMenuGroupImpl(new PoderosaMenuItemImpl(
                                                                                 cs.CommandManager.Find("org.poderosa.core.session.closedocument"), GEnv.Strings, "Menu.DocumentClose")));

            //ToolBar
            IExtensionPoint toolbar         = pm.FindExtensionPoint("org.poderosa.core.window.toolbar");
            TerminalToolBar terminaltoolbar = new TerminalToolBar();

            toolbar.RegisterExtension(terminaltoolbar);
            GetSessionManager().AddActiveDocumentChangeListener(terminaltoolbar);

            //その他 Extension
            _intelliSenseExtension   = pm.CreateExtensionPoint(TerminalEmulatorConstants.INTELLISENSE_CANDIDATE_EXTENSIONPOINT, typeof(IIntelliSenseCandidateExtension), this);
            _autoLogFileFormatter    = pm.CreateExtensionPoint(TerminalEmulatorConstants.LOG_FILENAME_FORMATTER_EXTENSIONPOINT, typeof(IAutoLogFileFormatter), this);
            _dynamicCaptionFormatter = pm.CreateExtensionPoint(TerminalEmulatorConstants.DYNAMIC_CAPTION_FORMATTER_EXTENSIONPOINT, typeof(IDynamicCaptionFormatter), this);

            //Command Popup
            CommandResultSession.Init(poderosa);
            PopupStyleCommandResultRecognizer.CreateExtensionPointAndDefaultCommands(pm);

            // Preferences for PromptRecognizer
            cs.PreferenceExtensionPoint.RegisterExtension(PromptRecognizerPreferences.Instance);

            // Preferences for XTerm
            cs.PreferenceExtensionPoint.RegisterExtension(XTermPreferences.Instance);
        }