/// <summary>
        /// We register for events from this action bar
        /// </summary>
        /// <param name="tab"></param>
        public void setActionBar(TerminalActionBar tabIn)
        {
            Unregister();

            tAb = tabIn;

            tAb.ControlEvent += new TerminalActionBar.ControlEventHandler(TerminalControlEvent);
        }
        void setActionBar(object sender, GrammarEventArgs e)
        {
            if (sender is Terminal)
            {
                TerminalActionBar tab = new TerminalActionBar(sender as Terminal);
                actionBarHolder.Content = tab;
                controller.setActionBar(tab);
            }

            if (sender is NonterminalCollapsed)
            {
                NonterminalActionBar tab = new NonterminalActionBar(sender as NonterminalCollapsed);
                actionBarHolder.Content = tab;
                controller.setActionBar(tab);
            }

            if (sender is NonterminalExpanded)
            {
                NonterminalActionBar tab = new NonterminalActionBar(sender as NonterminalExpanded);
                actionBarHolder.Content = tab;
                controller.setActionBar(tab);
            }
        }