IEnumerable<Widget> MonoDevelop.DesignerSupport.IOutlinedDocument.GetToolbarWidgets ()
		{
			if (toolbarWidgets != null)
				return toolbarWidgets;
			
			var groupToggleButton = new ToggleButton () {
				Image = new Image (ImageService.GetPixbuf ("md-design-categorise", IconSize.Menu)),
				TooltipText = GettextCatalog.GetString ("Group entries by type"),
				Active = settings.IsGrouped,
			};	
			groupToggleButton.Toggled += delegate {
				if (groupToggleButton.Active == settings.IsGrouped)
					return;
				settings.IsGrouped = groupToggleButton.Active;
				UpdateSorting ();
			};

			var sortAlphabeticallyToggleButton = new ToggleButton () {
				Image = new Image (Gtk.Stock.SortAscending, IconSize.Menu),
				TooltipText = GettextCatalog.GetString ("Sort entries alphabetically"),
				Active = settings.IsSorted,
			};	
			sortAlphabeticallyToggleButton.Toggled += delegate {
				if (sortAlphabeticallyToggleButton.Active == settings.IsSorted)
					return;
				settings.IsSorted = sortAlphabeticallyToggleButton.Active;
				UpdateSorting ();
			};

			var preferencesButton = new DockToolButton (Gtk.Stock.Preferences) {
				Image = new Image (Gtk.Stock.Preferences, IconSize.Menu),
				TooltipText = GettextCatalog.GetString ("Open preferences dialog"),
			};
			preferencesButton.Clicked += delegate {
				var dialog = new ClassOutlineSortingPreferencesDialog (settings);
				try {
					if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) {
						dialog.SaveSettings ();
						comparer = new ClassOutlineNodeComparer (GetAmbience (), settings, outlineTreeModelSort);
						UpdateSorting ();
					}
				} finally {
					dialog.Destroy ();
				}
			};
			
			return toolbarWidgets = new Widget[] {
				groupToggleButton,
				sortAlphabeticallyToggleButton,
				new VSeparator (),
				preferencesButton,
			};
		}
        IEnumerable <Widget> MonoDevelop.DesignerSupport.IOutlinedDocument.GetToolbarWidgets()
        {
            if (toolbarWidgets != null)
            {
                return(toolbarWidgets);
            }

            var groupToggleButton = new ToggleButton()
            {
                Image       = new Image(Ide.Gui.Stock.GroupByCategory, IconSize.Menu),
                TooltipText = GettextCatalog.GetString("Group entries by type"),
                Active      = settings.IsGrouped,
            };

            groupToggleButton.Toggled += delegate {
                if (groupToggleButton.Active == settings.IsGrouped)
                {
                    return;
                }
                settings.IsGrouped = groupToggleButton.Active;
                UpdateSorting();
            };

            var sortAlphabeticallyToggleButton = new ToggleButton()
            {
                Image       = new Image(Ide.Gui.Stock.SortAlphabetically, IconSize.Menu),
                TooltipText = GettextCatalog.GetString("Sort entries alphabetically"),
                Active      = settings.IsSorted,
            };

            sortAlphabeticallyToggleButton.Toggled += delegate {
                if (sortAlphabeticallyToggleButton.Active == settings.IsSorted)
                {
                    return;
                }
                settings.IsSorted = sortAlphabeticallyToggleButton.Active;
                UpdateSorting();
            };

            var preferencesButton = new DockToolButton(Ide.Gui.Stock.Options)
            {
                TooltipText = GettextCatalog.GetString("Open preferences dialog"),
            };

            preferencesButton.Clicked += delegate {
                using (var dialog = new ClassOutlineSortingPreferencesDialog(settings)) {
                    if (MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog) == (int)Gtk.ResponseType.Ok)
                    {
                        dialog.SaveSettings();
                        comparer = new ClassOutlineNodeComparer(GetAmbience(), settings, outlineTreeModelSort);
                        UpdateSorting();
                    }
                }
            };

            return(toolbarWidgets = new Widget[] {
                groupToggleButton,
                sortAlphabeticallyToggleButton,
                new VSeparator(),
                preferencesButton,
            });
        }