public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); foreach (WorkspaceItem it in IdeApp.Workspace.Items) treeView.AddChild (it); base.TreeView.Tree.Name = "solutionBrowserTree"; }
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; }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath) { base.Initialize (builders, options, menuPath); vbox.PackStart (base.Control, true, true, 0); vbox.ShowAll (); TreeView.LoadTree (ProfilingService.ProfilingSnapshots); }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); Refresh (UnityModeAddin.UnityProjectState); UnityModeAddin.UnityProjectStateChanged += Refresh; TreeView.ShowSelectionPopupButton = true; }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); vbox.PackStart (base.Control, true, true, 0); vbox.ShowAll (); TreeView.Clear (); TreeView.LoadTree (ConnectionContextService.DatabaseConnections); }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); var aliases = new Dictionary<string,string> (); aliases.Add ("SystemFile", "MonoDevelop.Ide.Gui.Pads.ProjectPad.SystemFile"); aliases.Add ("ProjectFolder", "MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFolder"); TreeView.ContextMenuTypeNameAliases = aliases; TreeView.EnableDragUriSource (n => { var pf = n as ProjectFile; if (pf != null) { return new Uri (pf.FilePath).AbsoluteUri; } return null; }); }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); /* IdeApp.Workspace.ItemAddedToSolution += Refresh; IdeApp.Workspace.FileAddedToProject += Refresh; IdeApp.Workspace.FileRemovedFromProject += Refresh; IdeApp.Workspace.FileRenamedInProject += Refresh; IdeApp.Workspace.WorkspaceItemOpened += Refresh; //IdeApp.Workbench.ActiveDocumentChanged += OnWindowChanged;*/ Refresh (UnityModeAddin.UnityProjectState); UnityModeAddin.UnityProjectStateChanged += Refresh; }
internal static bool HasChildNodes (ITreeBuilder tb, NodeBuilder[] chain, object dataObject) { NodePosition pos = tb.CurrentPosition; foreach (NodeBuilder nb in chain) { try { bool res = nb.HasChildNodes (tb, dataObject); if (res) return true; } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); } finally { tb.MoveToPosition (pos); } } return false; }
void BuildNode (Gtk.TreeIter it, NodeBuilder[] chain, NodeAttributes ats, object dataObject) { Gtk.TreeIter oldIter = currentIter; object oldItem = DataItem; InitIter (it, dataObject); // It is *critical* that we set this first. We will // sort after this call, so we must give as much info // to the sort function as possible. store.SetValue (it, ExtensibleTreeView.DataItemColumn, dataObject); store.SetValue (it, ExtensibleTreeView.BuilderChainColumn, chain); UpdateNode (chain, ats, dataObject); bool hasChildren = HasChildNodes (this, chain, dataObject); store.SetValue (currentIter, ExtensibleTreeView.FilledColumn, !hasChildren); if (hasChildren) store.AppendNode (currentIter); // Dummy node InitIter (oldIter, oldItem); }
internal static NodeAttributes GetAttributes (ITreeBuilder tb, NodeBuilder[] chain, object dataObject) { NodePosition pos = tb.CurrentPosition; NodeAttributes ats = NodeAttributes.None; foreach (NodeBuilder nb in chain) { try { nb.GetNodeAttributes (tb, dataObject, ref ats); } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); } tb.MoveToPosition (pos); } return ats; }
void UpdateNode (TreeNode n, NodeBuilder[] chain, NodeAttributes ats, object dataObject) { string text; Gdk.Pixbuf icon; Gdk.Pixbuf closedIcon; TreeBuilder.GetNodeInfo (tree, this, chain, dataObject, out text, out icon, out closedIcon); n.Text = text; n.Icon = icon; n.ClosedIcon = closedIcon; if (chain != null && chain.Length > 0) n.Name = ((TypeNodeBuilder)chain[0]).GetNodeName (this, n.DataItem); else n.Name = n.Text; n.Modified = true; }
public void Initialize (NodeBuilder[] builders, TreePadOption[] options) { Initialize (builders, options, null); }
public TreeViewPad (NodeBuilder[] builders, TreePadOption[] options) { Initialize (builders, options); }
public AssemblyBrowserTreeView (NodeBuilder[] builders, TreePadOption[] options) : base (builders, options) { }
void CreateChildren (NodeBuilder[] chain, object dataObject) { Gtk.TreeIter it = currentIter; foreach (NodeBuilder builder in chain) { try { builder.BuildChildNodes (this, dataObject); } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); } MoveToIter (it); } }
void UpdateNode (NodeBuilder[] chain, NodeAttributes ats, object dataObject) { string text; Gdk.Pixbuf icon; Gdk.Pixbuf closedIcon; GetNodeInfo (pad, this, chain, dataObject, out text, out icon, out closedIcon); SetNodeInfo (currentIter, ats, text, icon, closedIcon); }
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; }
void UpdateNode (NodeBuilder[] chain, NodeAttributes ats, object dataObject) { bool isNew = false; var ni = (NodeInfo)store.GetValue (currentIter, ExtensibleTreeView.NodeInfoColumn); if (ni == null || ni.IsShared) { ni = new NodeInfo (); isNew = true; } else ni.Reset (); GetNodeInfo (ni, pad, this, chain, dataObject); if (isNew) store.SetValue (currentIter, ExtensibleTreeView.NodeInfoColumn, ni); else store.EmitRowChanged (store.GetPath (currentIter), currentIter); }
void UpdateNode (NodeBuilder[] chain, NodeAttributes ats, object dataObject) { var ni = GetNodeInfo (pad, this, chain, dataObject); SetNodeInfo (currentIter, ats, ni); }
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; } }
public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { base.Initialize (builders, options, contextMenuPath); widget.ShowAll(); }
// Helper methods internal static bool HasAttribute (ITreeNavigator treeNavigator, NodeAttributes attr, NodeBuilder[] chain, object dataObject) { NodeAttributes nodeAttr = NodeAttributes.None; NodePosition pos = treeNavigator.CurrentPosition; foreach (NodeBuilder nb in chain) { nb.GetNodeAttributes (treeNavigator, dataObject, ref nodeAttr); treeNavigator.MoveToPosition (pos); } return (nodeAttr & attr) != 0; }
void UpdateNode(TreeNode n, NodeBuilder[] chain, NodeAttributes ats, object dataObject) { var ni = new NodeInfo (); n.NodeInfo = TreeBuilder.GetNodeInfo (ni, tree, this, chain, dataObject); if (chain != null && chain.Length > 0) n.Name = ((TypeNodeBuilder)chain[0]).GetNodeName (this, n.DataItem); else n.Name = n.NodeInfo.Label; n.Modified = true; }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath) { base.Initialize (builders, options, menuPath); testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged)); testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged)); paned = new VPaned (); VBox vbox = new VBox (); DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top); buttonRunAll = new Button (new Gtk.Image (Gtk.Stock.GoUp, IconSize.Menu)); buttonRunAll.Clicked += new EventHandler (OnRunAllClicked); buttonRunAll.Sensitive = true; buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests"); topToolbar.Add (buttonRunAll); buttonRun = new Button (new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu)); buttonRun.Clicked += new EventHandler (OnRunClicked); buttonRun.Sensitive = true; buttonRun.TooltipText = GettextCatalog.GetString ("Run test"); topToolbar.Add (buttonRun); buttonStop = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu)); buttonStop.Clicked += new EventHandler (OnStopClicked); buttonStop.Sensitive = false; buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test"); topToolbar.Add (buttonStop); topToolbar.ShowAll (); vbox.PackEnd (base.Control, true, true, 0); vbox.FocusChain = new Gtk.Widget [] { base.Control }; paned.Pack1 (vbox, true, true); detailsPad = new VBox (); EventBox eb = new EventBox (); HBox header = new HBox (); eb.Add (header); detailLabel = new HeaderLabel (); detailLabel.Padding = 6; Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler (OnCloseDetails); header.PackEnd (hb, false, false, 0); hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler (OnGoBackTest); header.PackEnd (hb, false, false, 0); header.Add (detailLabel); Gdk.Color hcol = eb.Style.Background (StateType.Normal); hcol.Red = (ushort) (((double)hcol.Red) * 0.9); hcol.Green = (ushort) (((double)hcol.Green) * 0.9); hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9); // eb.ModifyBg (StateType.Normal, hcol); detailsPad.PackStart (eb, false, false, 0); VPaned panedDetails = new VPaned (); panedDetails.BorderWidth = 3; VBox boxPaned1 = new VBox (); chart = new TestChart (); chart.ButtonPressEvent += OnChartButtonPress; chart.SelectionChanged += new EventHandler (OnChartDateChanged); chart.HeightRequest = 50; Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.ShowArrow = false; ToolButton but = new ToolButton ("gtk-zoom-in"); but.Clicked += new EventHandler (OnZoomIn); toolbar.Insert (but, -1); but = new ToolButton ("gtk-zoom-out"); but.Clicked += new EventHandler (OnZoomOut); toolbar.Insert (but, -1); but = new ToolButton ("gtk-go-back"); but.Clicked += new EventHandler (OnChartBack); toolbar.Insert (but, -1); but = new ToolButton ("gtk-go-forward"); but.Clicked += new EventHandler (OnChartForward); toolbar.Insert (but, -1); but = new ToolButton ("gtk-goto-last"); but.Clicked += new EventHandler (OnChartLast); toolbar.Insert (but, -1); boxPaned1.PackStart (toolbar, false, false, 0); boxPaned1.PackStart (chart, true, true, 0); panedDetails.Pack1 (boxPaned1, false, false); // Detailed test information -------- infoBook = new ButtonNotebook (); infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired); // Info - Group summary Frame tf = new Frame (); ScrolledWindow sw = new ScrolledWindow (); detailsTree = new TreeView (); detailsTree.HeadersVisible = true; detailsTree.RulesHint = true; detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string)); CellRendererText trtest = new CellRendererText (); CellRendererText tr; TreeViewColumn col3 = new TreeViewColumn (); col3.Expand = false; // col3.Alignment = 0.5f; col3.Widget = new Gtk.Image (CircleImage.Success); col3.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col3.PackStart (tr, false); col3.AddAttribute (tr, "markup", 2); detailsTree.AppendColumn (col3); TreeViewColumn col4 = new TreeViewColumn (); col4.Expand = false; // col4.Alignment = 0.5f; col4.Widget = new Gtk.Image (CircleImage.Failure); col4.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col4.PackStart (tr, false); col4.AddAttribute (tr, "markup", 3); detailsTree.AppendColumn (col4); TreeViewColumn col5 = new TreeViewColumn (); col5.Expand = false; // col5.Alignment = 0.5f; col5.Widget = new Gtk.Image (CircleImage.NotRun); col5.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col5.PackStart (tr, false); col5.AddAttribute (tr, "markup", 4); detailsTree.AppendColumn (col5); TreeViewColumn col1 = new TreeViewColumn (); // col1.Resizable = true; // col1.Expand = true; col1.Title = "Test"; col1.PackStart (trtest, true); col1.AddAttribute (trtest, "markup", 1); detailsTree.AppendColumn (col1); detailsTree.Model = detailsStore; sw.Add (detailsTree); tf.Add (sw); tf.ShowAll (); TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf); // Info - Regressions list tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); regressionTree = new TreeView (); regressionTree.HeadersVisible = false; regressionTree.RulesHint = true; regressionStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf)); CellRendererText trtest2 = new CellRendererText (); var pr = new CellRendererPixbuf (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 2); col.PackStart (trtest2, false); col.AddAttribute (trtest2, "markup", 1); regressionTree.AppendColumn (col); regressionTree.Model = regressionStore; sw.Add (regressionTree); tf.ShowAll (); TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf); // Info - Failed tests list tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); failedTree = new TreeView (); failedTree.HeadersVisible = false; failedTree.RulesHint = true; failedStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf)); trtest2 = new CellRendererText (); pr = new CellRendererPixbuf (); col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 2); col.PackStart (trtest2, false); col.AddAttribute (trtest2, "markup", 1); failedTree.AppendColumn (col); failedTree.Model = failedStore; sw.Add (failedTree); tf.ShowAll (); TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf); // Info - results tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); resultView = new TextView (); resultView.Editable = false; sw.Add (resultView); tf.ShowAll (); TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf); // Info - Output tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); outputView = new TextView (); outputView.Editable = false; sw.Add (outputView); tf.ShowAll (); TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf); panedDetails.Pack2 (infoBook, true, true); detailsPad.PackStart (panedDetails, true, true, 0); paned.Pack2 (detailsPad, true, true); paned.ShowAll (); infoBook.HidePage (TestResultPage); infoBook.HidePage (TestOutputPage); infoBook.HidePage (TestSummaryPage); infoBook.HidePage (TestRegressionsPage); infoBook.HidePage (TestFailuresPage); detailsPad.Sensitive = false; detailsPad.Hide (); detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated); regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated); failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated); foreach (UnitTest t in testService.RootTests) TreeView.AddChild (t); }
public virtual void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) { treeView.Initialize (builders, options, contextMenuPath); }