public TransactedTreeBuilder (ExtensibleTreeView tree, TransactedNodeStore tstore, Gtk.TreeIter it)
			{
				this.tree = tree;
				this.tstore = tstore;
				navigator = new TreeNodeNavigator (tree, it);
				CheckNode ();
			}
Пример #2
0
        internal static void RestoreState(ExtensibleTreeView pad, ITreeNavigator nav, NodeState es)
        {
            if (es == null)
            {
                return;
            }

            pad.ResetState(nav);
            nav.Expanded = es.Expanded;

            if (es.ChildrenState != null)
            {
                foreach (NodeState ces in es.ChildrenState)
                {
                    if (nav.MoveToChild(ces.NodeName, null))
                    {
                        RestoreState(pad, nav, ces);
                        nav.MoveToParent();
                    }
                }
            }

            if (es.Selected)
            {
                nav.Selected = true;
            }
        }
		public ExtensionModelBrowserWidget ()
		{
			this.Build ();
			NodeBuilder[] builders = new NodeBuilder [] {
				new ExtensionNodeBuilder (),
				new ExtensionNodeNodeBuilder (),
				new ExtensionPointNodeBuilder (),
				new AddinNodeBuilder (),
				new SolutionNodeBuilder (true),
				new RegistryNodeBuilder (),
				new AddinCategoryNodeBuilder (),
				new MonoDevelop.Ide.Gui.Pads.ProjectPad.WorkspaceNodeBuilder (),
				new MonoDevelop.Ide.Gui.Pads.ProjectPad.SolutionFolderNodeBuilder ()
			};
			TreePadOption[] options = new TreePadOption [] {
				new TreePadOption ("ShowExistingNodes", GettextCatalog.GetString ("Show existing nodes"), true)
			};
			
			tree = new ExtensibleTreeView (builders, options);
			tree.ShowAll ();
			paned.Add1 (tree);
			
			foreach (Solution sol in IdeApp.Workspace.GetAllSolutions ())
				AddSolution (sol);
			
			docView = new Gtk.Label ();
			paned.Add2 (docView);
			
			tree.ShadowType = Gtk.ShadowType.In;
			tree.Tree.Selection.Changed += HandleSelectionChanged;
			
			AddinAuthoringService.RegistryChanged += OnRegistryChanged;
			IdeApp.Workspace.WorkspaceItemLoaded += OnSolutionLoaded;
			IdeApp.Workspace.WorkspaceItemUnloaded += OnSolutionUnloaded;
		}
Пример #4
0
        static NodeState SaveStateRec(ExtensibleTreeView pad, ITreeNavigator nav)
        {
            List <NodeState> childrenState = null;

            if (nav.Filled && nav.MoveToFirstChild())
            {
                do
                {
                    NodeState cs = SaveStateRec(pad, nav);
                    if (cs != null)
                    {
                        cs.NodeName = nav.NodeName;
                        if (childrenState == null)
                        {
                            childrenState = new List <NodeState> ();
                        }
                        childrenState.Add(cs);
                    }
                } while (nav.MoveNext());
                nav.MoveToParent();
            }

            if (nav.Expanded || childrenState != null || nav.Selected)
            {
                NodeState es = new NodeState();
                es.Expanded      = nav.Expanded;
                es.Selected      = nav.Selected;
                es.ChildrenState = childrenState;
                return(es);
            }
            else
            {
                return(null);
            }
        }
Пример #5
0
 public TransactedTreeBuilder(ExtensibleTreeView tree, TransactedNodeStore tstore, Gtk.TreeIter it)
 {
     this.tree   = tree;
     this.tstore = tstore;
     navigator   = new TreeNodeNavigator(tree, it);
     CheckNode();
 }
 public TreeNodeNavigator(ExtensibleTreeView pad, Gtk.TreeIter iter)
 {
     this.pad = pad;
     tree     = pad.Tree;
     store    = pad.Store;
     MoveToIter(iter);
 }
Пример #7
0
 public TreeNodeNavigator(ExtensibleTreeView pad, Gtk.TreeIter iter)
 {
     this.pad = pad;
     tree = pad.Tree;
     store = pad.Store;
     MoveToIter (iter);
 }
		public ClassBrowserPadWidget (ExtensibleTreeView treeView, IPadWindow window)
		{
			this.treeView = treeView;
			PackStart (treeView, true, true, 0);

			IdeApp.Workspace.WorkspaceItemOpened += OnOpenCombine;
			IdeApp.Workspace.WorkspaceItemClosed += OnCloseCombine;
					
			this.ShowAll ();
		}
        static void SelectFile(ExtensibleTreeView treeView, DnxProject project, string file)
        {
            var projectFile = project.Files.GetFile (file);
            if (projectFile == null)
                return;

            ITreeNavigator navigator = treeView.GetNodeAtObject (projectFile, true);
            if (navigator != null) {
                navigator.ExpandToNode ();
                navigator.Selected = true;
            }
        }
Пример #10
0
        internal static NodeState SaveState(ExtensibleTreeView pad, ITreeNavigator nav)
        {
            NodeState state = SaveStateRec(pad, nav);

            if (state == null)
            {
                return(new NodeState());
            }
            else
            {
                return(state);
            }
        }
Пример #11
0
		public ClassBrowserPadWidget (ExtensibleTreeView treeView, IPadWindow window)
		{
			this.treeView = treeView;
			
			DockItemToolbar searchBox = window.GetToolbar (PositionType.Top);
			
			searchEntry = new Entry ();
			searchBox.Add (searchEntry, true);
			buttonSearch = new Button (new Gtk.Image (Gtk.Stock.Find, IconSize.Menu));
			buttonSearch.Relief = ReliefStyle.None;
			buttonCancelSearch = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu));
			buttonCancelSearch.Relief = ReliefStyle.None;
			searchBox.Add (buttonSearch);
			searchBox.Add (buttonCancelSearch);
			searchBox.ShowAll ();
			
			notebook = new Notebook ();
			notebook.ShowTabs = false;
			notebook.ShowBorder = false;
			this.PackEnd (notebook, true, true, 0);
			
			notebook.AppendPage (treeView, null);
			ScrolledWindow scrolledWindow = new ScrolledWindow ();
			scrolledWindow.Add (searchResultsTreeView);
			notebook.AppendPage (scrolledWindow, null);
			
			list = new ListStore (new Type[] {
				typeof (Pixbuf),
				typeof (string),
				typeof (IType)
			});
			model = new TreeModelSort (list);
			searchResultsTreeView.Model = model;
			searchResultsTreeView.AppendColumn (string.Empty, new Gtk.CellRendererPixbuf (), "pixbuf", 0);
			searchResultsTreeView.AppendColumn (string.Empty, new Gtk.CellRendererText (), "text", 1);
			searchResultsTreeView.HeadersVisible = false;
			searchResultsTreeView.RowActivated += SearchRowActivated;
			IdeApp.Workspace.WorkspaceItemOpened += OnOpenCombine;
			IdeApp.Workspace.WorkspaceItemClosed += OnCloseCombine;
					
			this.searchEntry.Changed += SearchEntryChanged;
			this.buttonCancelSearch.Clicked += CancelSearchClicked;
			this.searchEntry.Activated += SearchClicked;
			this.searchEntry.KeyPressEvent += SearchEntryKeyPressEvent;
			this.buttonSearch.Clicked += SearchClicked;
			
			this.ShowAll ();
		}
Пример #12
0
            internal static void GetNodeInfo(ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject, out string text, out Gdk.Pixbuf icon, out Gdk.Pixbuf closedIcon)
            {
                icon       = null;
                closedIcon = null;
                text       = string.Empty;

                NodePosition pos = tb.CurrentPosition;

                foreach (NodeBuilder builder in chain)
                {
                    try
                    {
                        builder.BuildNode(tb, dataObject, ref text, ref icon, ref closedIcon);
                    }
                    catch (Exception ex)
                    {
                        LoggingService.LogError(ex.ToString());
                    }
                    tb.MoveToPosition(pos);
                }

                if (closedIcon == null)
                {
                    closedIcon = icon;
                }

                if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains(dataObject) && tree.CurrentTransferOperation == DragOperation.Move)
                {
                    Gdk.Pixbuf gicon = tree.BuilderContext.GetComposedIcon(icon, "fade");
                    if (gicon == null)
                    {
                        gicon = ImageService.MakeTransparent(icon, 0.5);
                        tree.BuilderContext.CacheComposedIcon(icon, "fade", gicon);
                    }
                    icon  = gicon;
                    gicon = tree.BuilderContext.GetComposedIcon(closedIcon, "fade");
                    if (gicon == null)
                    {
                        gicon = ImageService.MakeTransparent(closedIcon, 0.5);
                        tree.BuilderContext.CacheComposedIcon(closedIcon, "fade", gicon);
                    }
                    closedIcon = gicon;
                }
            }
Пример #13
0
            internal static NodeInfo GetNodeInfo(ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject)
            {
                NodeInfo nodeInfo = new NodeInfo()
                {
                    Label = string.Empty
                };

                NodePosition pos = tb.CurrentPosition;

                foreach (NodeBuilder builder in chain)
                {
                    try {
                        builder.BuildNode(tb, dataObject, nodeInfo);
                    } catch (Exception ex) {
                        LoggingService.LogError(ex.ToString());
                    }
                    tb.MoveToPosition(pos);
                }

                if (nodeInfo.ClosedIcon == null)
                {
                    nodeInfo.ClosedIcon = nodeInfo.Icon;
                }

                if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains(dataObject) && tree.CurrentTransferOperation == DragOperation.Move)
                {
                    var gicon = tree.BuilderContext.GetComposedIcon(nodeInfo.Icon, "fade");
                    if (gicon == null)
                    {
                        gicon = nodeInfo.Icon.WithAlpha(0.5);
                        tree.BuilderContext.CacheComposedIcon(nodeInfo.Icon, "fade", gicon);
                    }
                    nodeInfo.Icon = gicon;
                    gicon         = tree.BuilderContext.GetComposedIcon(nodeInfo.ClosedIcon, "fade");
                    if (gicon == null)
                    {
                        gicon = nodeInfo.ClosedIcon.WithAlpha(0.5);
                        tree.BuilderContext.CacheComposedIcon(nodeInfo.ClosedIcon, "fade", gicon);
                    }
                    nodeInfo.ClosedIcon = gicon;
                }
                return(nodeInfo);
            }
Пример #14
0
 public TreeOptions(ExtensibleTreeView pad, Gtk.TreeIter iter)
 {
     this.pad  = pad;
     this.iter = iter;
 }
			public TreeBuilder (ExtensibleTreeView pad) : base (pad)
			{
			}
			public TreeBuilder (ExtensibleTreeView pad, Gtk.TreeIter iter): base (pad, iter)
			{
			}
			public TransactedNodeStore (ExtensibleTreeView tree)
			{
				this.tree = tree;
				iterToNode = new Dictionary<Gtk.TreeIter,TreeNode> (new IterComparer (tree.store));
			}
			internal static void GetNodeInfo (ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject, out string text, out Gdk.Pixbuf icon, out Gdk.Pixbuf closedIcon)
			{
				icon = null;
				closedIcon = null;
				text = string.Empty;
				
				NodePosition pos = tb.CurrentPosition;
				
				foreach (NodeBuilder builder in chain) {
					try {
						builder.BuildNode (tb, dataObject, ref text, ref icon, ref closedIcon);
					} catch (Exception ex) {
						LoggingService.LogError (ex.ToString ());
					}
					tb.MoveToPosition (pos);
				}
					
				if (closedIcon == null) closedIcon = icon;
				
				if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains (dataObject) && tree.CurrentTransferOperation == DragOperation.Move) {
					Gdk.Pixbuf gicon = tree.BuilderContext.GetComposedIcon (icon, "fade");
					if (gicon == null) {
						gicon = ImageService.MakeTransparent (icon, 0.5);
						tree.BuilderContext.CacheComposedIcon (icon, "fade", gicon);
					}
					icon = gicon;
					gicon = tree.BuilderContext.GetComposedIcon (closedIcon, "fade");
					if (gicon == null) {
						gicon = ImageService.MakeTransparent (closedIcon, 0.5);
						tree.BuilderContext.CacheComposedIcon (closedIcon, "fade", gicon);
					}
					closedIcon = gicon;
				}
			}
Пример #19
0
 public TreeOptions(ExtensibleTreeView pad)
 {
     this.Pad = pad;
 }
Пример #20
0
 public TreeNodeNavigator(ExtensibleTreeView pad)
     : this(pad, Gtk.TreeIter.Zero)
 {
 }
Пример #21
0
			internal static NodeInfo GetNodeInfo (NodeInfo nodeInfo, ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject)
			{
				NodePosition pos = tb.CurrentPosition;

				foreach (NodeBuilder builder in chain) {
					try {
						builder.BuildNode (tb, dataObject, nodeInfo);
					} catch (Exception ex) {
						LoggingService.LogError (ex.ToString ());
					}
					tb.MoveToPosition (pos);
				}
					
				if (nodeInfo.ClosedIcon == null) nodeInfo.ClosedIcon = nodeInfo.Icon;
				
				if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains (dataObject) && tree.CurrentTransferOperation == DragOperation.Move) {
					var gicon = tree.BuilderContext.GetComposedIcon (nodeInfo.Icon, "fade");
					if (gicon == null) {
						gicon = nodeInfo.Icon.WithAlpha (0.5);
						tree.BuilderContext.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
					}
					nodeInfo.Icon = gicon;
					gicon = tree.BuilderContext.GetComposedIcon (nodeInfo.ClosedIcon, "fade");
					if (gicon == null) {
						gicon = nodeInfo.ClosedIcon.WithAlpha (0.5);
						tree.BuilderContext.CacheComposedIcon (nodeInfo.ClosedIcon, "fade", gicon);
					}
					nodeInfo.ClosedIcon = gicon;
				}
				return nodeInfo;
			}
Пример #22
0
 public TreeBuilder(ExtensibleTreeView pad) : base(pad)
 {
 }
		void WriteTo (XmlWriter writer, ExtensibleTreeView.TreeOptions parentOptions)
		{
			writer.WriteStartElement (Node);
			if (NodeName != null)
				writer.WriteAttributeString (nameAttribute, NodeName);
			if (Expanded)
				writer.WriteAttributeString (expandedAttribute, bool.TrueString);
			if (Selected)
				writer.WriteAttributeString (selectedAttribute, bool.TrueString);

			ExtensibleTreeView.TreeOptions ops = Options;
			if (ops != null) {
				foreach (DictionaryEntry de in ops) {
					object parentVal = parentOptions != null ? parentOptions [de.Key] : null;
					if (parentVal != null && !parentVal.Equals (de.Value) || (parentVal == null && de.Value != null) || parentOptions == null) {
						writer.WriteStartElement ("Option");
						writer.WriteAttributeString ("id", de.Key.ToString());
						writer.WriteAttributeString ("value", de.Value.ToString ());
						writer.WriteEndElement (); // Option
					}
				}
			}
			
			if (ChildrenState != null) { 
				foreach (NodeState ces in ChildrenState) {
					ces.WriteTo (writer, Options != null ? Options : parentOptions);
				}
			}
			
			writer.WriteEndElement (); // NodeState
		}
 public TreeNodeNavigator(ExtensibleTreeView pad) : this(pad, Gtk.TreeIter.Zero)
 {
 }
		ICustomXmlSerializer ReadFrom (XmlReader reader, ExtensibleTreeView.TreeOptions parentOptions)
		{
			NodeState result = new NodeState ();
			result.NodeName = reader.GetAttribute (nameAttribute);
			if (!String.IsNullOrEmpty (reader.GetAttribute (expandedAttribute)))
				result.Expanded = Boolean.Parse (reader.GetAttribute (expandedAttribute));
			if (!String.IsNullOrEmpty (reader.GetAttribute (selectedAttribute)))
				result.Selected = Boolean.Parse (reader.GetAttribute (selectedAttribute));
				
			XmlReadHelper.ReadList (reader, reader.LocalName, delegate () {
				switch (reader.LocalName) {
				case "Option":
					if (result.Options == null) 
						result.Options = parentOptions != null ? parentOptions.CloneOptions (Gtk.TreeIter.Zero) : new ExtensibleTreeView.TreeOptions ();   
					result.Options [reader.GetAttribute ("id")] = bool.Parse (reader.GetAttribute ("value"));
					return true;
				case "Node":
					if (result.ChildrenState == null)
						result.ChildrenState = new List<NodeState> ();
					result.ChildrenState.Add ((NodeState)ReadFrom (reader, result.Options != null ? result.Options : parentOptions));
					return true;
				}
				return false;
			});
			return result;
		}
		internal static NodeState SaveState (ExtensibleTreeView pad, ITreeNavigator nav)
		{
			NodeState state = SaveStateRec (pad, nav);
			if (state == null) 
				return new NodeState ();
			else return state;
		}
		static NodeState SaveStateRec (ExtensibleTreeView pad, ITreeNavigator nav)
		{
			List<NodeState> childrenState = null;

			if (nav.Filled && nav.MoveToFirstChild ()) {
				do {
					NodeState cs = SaveStateRec (pad, nav);
					if (cs != null) {
						cs.NodeName = nav.NodeName;
						if (childrenState == null) 
							childrenState = new List<NodeState> ();
						childrenState.Add (cs);
					}
				} while (nav.MoveNext ());
				nav.MoveToParent ();
			}
			
			ExtensibleTreeView.TreeOptions ops = pad.GetNodeOptions (nav);
			
			if (ops != null || nav.Expanded || childrenState != null || nav.Selected) {
				NodeState es = new NodeState ();
				es.Expanded = nav.Expanded;
				es.Selected = nav.Selected;
				es.Options = ops;
				es.ChildrenState = childrenState;
				return es;
			} else
				return null;
		}
Пример #28
0
 internal void Initialize(ExtensibleTreeView tree)
 {
     this.tree = tree;
 }
Пример #29
0
 public TreeBuilder(ExtensibleTreeView pad, Gtk.TreeIter iter) : base(pad, iter)
 {
 }
Пример #30
0
		internal void Initialize (ExtensibleTreeView tree)
		{
			this.tree = tree;
		}
			public TreeOptions (ExtensibleTreeView pad, Gtk.TreeIter iter)
			{
				this.pad = pad;
				this.iter = iter;
			}
Пример #32
0
		public AssemblyBrowserWidget ()
		{
			this.Build( );
			TreeView = new ExtensibleTreeView (new NodeBuilder[] { 
				new ErrorNodeBuilder (),
				new AssemblyNodeBuilder (this),
				new ModuleReferenceNodeBuilder (),
				new ModuleDefinitionNodeBuilder (this),
				new ReferenceFolderNodeBuilder (this),
				new ResourceFolderNodeBuilder (),
				new ResourceNodeBuilder (),
				new NamespaceBuilder (this),
				new DomTypeNodeBuilder (this),
				new DomMethodNodeBuilder (this),
				new DomFieldNodeBuilder (this),
				new DomEventNodeBuilder (this),
				new DomPropertyNodeBuilder (this),
				new BaseTypeFolderNodeBuilder (this),
				new DomReturnTypeNodeBuilder (this),
				new ReferenceNodeBuilder (this),
				}, new TreePadOption [] {
				new TreePadOption ("PublicApiOnly", GettextCatalog.GetString ("Show public members only"), true)
			});
			TreeView.Tree.Selection.Mode = Gtk.SelectionMode.Single;
			TreeView.Tree.CursorChanged += HandleCursorChanged;
			TreeView.ShadowType = ShadowType.In;
			treeViewPlaceholder.Add (TreeView);
			treeViewPlaceholder.ShowAll ();
			
//			this.descriptionLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 9"));
			this.documentationLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 12"));
			this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
			this.documentationLabel.Wrap = true;
			
			var options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions () {
				ShowFoldMargin = false,
				ShowIconMargin = false,
				ShowInvalidLines = false,
				ShowLineNumberMargin = false,
				ShowSpaces = false,
				ShowTabs = false,
				HighlightCaretLine = true,
			};
			inspectEditor = new Mono.TextEditor.TextEditor (new Mono.TextEditor.Document (), options);
			inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
			
			this.inspectEditor.Document.ReadOnly = true;
//			this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
			this.inspectEditor.TextViewMargin.GetLink = delegate(Mono.TextEditor.MarginMouseEventArgs arg) {
				var loc = inspectEditor.PointToLocation (arg.X, arg.Y);
				int offset = inspectEditor.LocationToOffset (loc);
				var referencedSegment = ReferencedSegments != null ? ReferencedSegments.FirstOrDefault (seg => seg.Contains (offset)) : null;
				if (referencedSegment == null)
					return null;
				if (referencedSegment.Reference is TypeDefinition)
					return new DomCecilType ((TypeDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is MethodDefinition)
					return new DomCecilMethod ((MethodDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is PropertyDefinition)
					return new DomCecilProperty ((PropertyDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is FieldDefinition)
					return new DomCecilField ((FieldDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is EventDefinition)
					return new DomCecilEvent ((EventDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is FieldDefinition)
					return new DomCecilField ((FieldDefinition)referencedSegment.Reference).HelpUrl;
				
				if (referencedSegment.Reference is TypeReference) {
					var returnType = DomCecilMethod.GetReturnType ((TypeReference)referencedSegment.Reference);
					if (returnType.GenericArguments.Count == 0)
						return "T:" + returnType.FullName;
					return "T:" + returnType.FullName + "`" + returnType.GenericArguments.Count;
				}
				return referencedSegment.Reference.ToString ();
			};
			this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;
			this.scrolledwindowEditor.Child = this.inspectEditor;
//			this.inspectLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 250));
			
//			this.vpaned1.ExposeEvent += VPaneExpose;
			this.hpaned1.ExposeEvent += HPaneExpose;
/*			this.notebook1.SwitchPage += delegate {
				// Hack for the switch page select all bug.
//				this.inspectLabel.Selectable = false;
			};*/

			this.languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
			this.languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
			this.languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
			this.languageCombobox.Active = PropertyService.Get ("AssemblyBrowser.InspectLanguage", 2);
			this.languageCombobox.Changed += LanguageComboboxhandleChanged;
			this.searchentry1.Ready = true;
			this.searchentry1.WidthRequest = 200;
			this.searchentry1.Visible = true;
			this.searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types or members");
			this.searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;
			
			CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
			checkMenuItem.Active = true;
			checkMenuItem.Toggled += delegate {
				if (checkMenuItem.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Type;
					CreateColumns ();
					StartSearch ();
				}
			};
			
			CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
			checkMenuItem1.Toggled += delegate {
				if (checkMenuItem1.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Member;
					CreateColumns ();
					StartSearch ();
				}
			};
			comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
			comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
			comboboxVisibilty.Active = 0;
			comboboxVisibilty.Changed += delegate {
				PublicApiOnly = comboboxVisibilty.Active == 0;
				this.TreeView.GetRootNode ().Options[ "PublicApiOnly"] = PublicApiOnly;
				FillInspectLabel ();
			};
			/*
			this.searchInCombobox.Active = 0;
			this.searchInCombobox.Changed += SearchInComboboxhandleChanged;
			*/
			this.notebook1.SetTabLabel (this.documentationScrolledWindow, new Label (GettextCatalog.GetString ("Documentation")));
			this.notebook1.SetTabLabel (this.notebookInspection, new Label (GettextCatalog.GetString ("Inspect")));
			this.notebook1.SetTabLabel (this.searchWidget, new Label (GettextCatalog.GetString ("Search")));
			//this.searchWidget.Visible = false;
				
			typeListStore = new Gtk.ListStore (typeof (Gdk.Pixbuf), // type image
			                                   typeof (string),     // name
			                                   typeof (string),     // namespace
			                                   typeof (string),     // assembly
				                               typeof (IMember)
			                                  );
			
			memberListStore = new Gtk.ListStore (typeof (Gdk.Pixbuf), // member image
			                                   typeof (string),     // name
			                                   typeof (string),     // Declaring type full name
			                                   typeof (string),     // assembly
				                               typeof (IMember)
			                                  );
			CreateColumns ();
			SetInspectWidget ();
//			this.searchEntry.Changed += SearchEntryhandleChanged;
			this.searchTreeview.RowActivated += SearchTreeviewhandleRowActivated;
			this.searchentry1.ShowAll ();
			this.buttonBack.Clicked += this.OnNavigateBackwardActionActivated;
			this.buttonForeward.Clicked += this.OnNavigateForwardActionActivated;
			this.notebook1.ShowTabs = false;
			this.notebookInspection.ShowTabs = false;
			this.ShowAll ();
		}
		internal static void RestoreState (ExtensibleTreeView pad, ITreeNavigator nav, NodeState es)
		{
			if (es == null) 
				return;
			
			if (es.Options != null) 
				pad.SetNodeOptions (nav, es.Options);
			
			pad.ResetState (nav);
			nav.Expanded = es.Expanded;
			
			if (es.ChildrenState != null) {
				foreach (NodeState ces in es.ChildrenState) {
					if (nav.MoveToChild (ces.NodeName, null)) {
						RestoreState (pad, nav, ces);
						nav.MoveToParent ();
					}
				}
			}
			
			if (es.Selected)
				nav.Selected = true;
		}
Пример #34
0
 public TransactedNodeStore(ExtensibleTreeView tree)
 {
     this.tree  = tree;
     iterToNode = new Dictionary <Gtk.TreeIter, TreeNode> (new IterComparer(tree.store));
 }
		public AssemblyBrowserWidget ()
		{
			this.Build();
			TreeView = new ExtensibleTreeView (new NodeBuilder[] { 
				new ErrorNodeBuilder (),
				new AssemblyNodeBuilder (this),
				new ModuleReferenceNodeBuilder (),
				new ModuleDefinitionNodeBuilder (this),
				new ReferenceFolderNodeBuilder (this),
				new ResourceFolderNodeBuilder (),
				new ResourceNodeBuilder (),
				new NamespaceBuilder (this),
				new DomTypeNodeBuilder (this),
				new DomMethodNodeBuilder (this),
				new DomFieldNodeBuilder (this),
				new DomEventNodeBuilder (this),
				new DomPropertyNodeBuilder (this),
				new BaseTypeFolderNodeBuilder (this),
				new DomReturnTypeNodeBuilder (this),
				new ReferenceNodeBuilder (this),
				}, new TreePadOption [] {
				new TreePadOption ("PublicApiOnly", GettextCatalog.GetString ("Show public members only"), true)
			});
			TreeView.Tree.Selection.Mode = Gtk.SelectionMode.Single;
			TreeView.Tree.CursorChanged += HandleCursorChanged;
			inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
			TreeView.ShadowType = ShadowType.In;
			treeViewPlaceholder.Add (TreeView);
			treeViewPlaceholder.ShowAll ();
			
//			this.descriptionLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 9"));
			this.documentationLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 12"));
			this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
			this.documentationLabel.Wrap = true;
			
			Mono.TextEditor.TextEditorOptions options = new Mono.TextEditor.TextEditorOptions ();
			options.FontName = PropertyService.Get<string> ("FontName");
			options.ShowFoldMargin = false;
			options.ShowIconMargin = false;
			options.ShowInvalidLines = false;
			options.ShowLineNumberMargin = false;
			options.ShowSpaces = false;
			options.ShowTabs = false;
			options.HighlightCaretLine = true;
			options.ColorScheme = PropertyService.Get ("ColorScheme", "Default");
			this.inspectEditor.Options = options;
			
			PropertyService.PropertyChanged += HandlePropertyChanged;
			this.inspectEditor.Document.ReadOnly = true;
			this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
			this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;
			
//			this.inspectLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 250));
			
//			this.vpaned1.ExposeEvent += VPaneExpose;
			this.hpaned1.ExposeEvent += HPaneExpose;
/*			this.notebook1.SwitchPage += delegate {
				// Hack for the switch page select all bug.
//				this.inspectLabel.Selectable = false;
			};*/
			this.notebook1.GetNthPage (0).Hide ();
			this.languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
			this.languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
			this.languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
			this.languageCombobox.Active = PropertyService.Get ("AssemblyBrowser.InspectLanguage", 2);
			this.languageCombobox.Changed += LanguageComboboxhandleChanged;
			this.searchentry1.Ready = true;
			this.searchentry1.WidthRequest = 200;
			this.searchentry1.Visible = true;
			this.searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types or members");
			this.searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;
			
			CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
			checkMenuItem.Active = true;
			checkMenuItem.Toggled += delegate {
				if (checkMenuItem.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Type;
					CreateColumns ();
					StartSearch ();
				}
			};
			
			CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
			checkMenuItem1.Toggled += delegate {
				if (checkMenuItem1.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Member;
					CreateColumns ();
					StartSearch ();
				}
			};
			comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
			comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
			comboboxVisibilty.Active = 0;
			comboboxVisibilty.Changed += delegate {
				PublicApiOnly = comboboxVisibilty.Active == 0;
				this.TreeView.GetRootNode ().Options["PublicApiOnly"] = PublicApiOnly;
				FillInspectLabel ();
			};
			/*
			this.searchInCombobox.Active = 0;
			this.searchInCombobox.Changed += SearchInComboboxhandleChanged;
			*/
			this.notebook1.SetTabLabel (this.documentationScrolledWindow, new Label (GettextCatalog.GetString ("Documentation")));
			this.notebook1.SetTabLabel (this.vboxInspect, new Label (GettextCatalog.GetString ("Inspect")));
			this.notebook1.SetTabLabel (this.searchWidget, new Label (GettextCatalog.GetString ("Search")));
			//this.searchWidget.Visible = false;
				
			typeListStore = new Gtk.ListStore (typeof (Gdk.Pixbuf), // type image
			                                   typeof (string),     // name
			                                   typeof (string),     // namespace
			                                   typeof (string),     // assembly
				                               typeof (IMember)
			                                  );
			
			memberListStore = new Gtk.ListStore (typeof (Gdk.Pixbuf), // member image
			                                   typeof (string),     // name
			                                   typeof (string),     // Declaring type full name
			                                   typeof (string),     // assembly
				                               typeof (IMember)
			                                  );
			CreateColumns ();
			SetInpectWidget ();
//			this.searchEntry.Changed += SearchEntryhandleChanged;
			this.searchTreeview.RowActivated += SearchTreeviewhandleRowActivated;
			this.searchentry1.ShowAll ();
			this.buttonBack.Clicked += this.OnNavigateBackwardActionActivated;
			this.buttonForeward.Clicked += this.OnNavigateForwardActionActivated;
			
		}