diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2011-01-26 23:11:28 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2011-01-27 19:47:53 +0300 |
commit | 3a2272c7103a1dcb9386d01b1a5bd625668cfbf1 (patch) | |
tree | 3acd25c65e08a91a68d9b11b9de2bf6825f1e1b6 /extras/MonoDevelop.AddinAuthoring | |
parent | 895ad74e63ef6ed999aeda92f9e579813d4a3b40 (diff) |
Ongoing work.
Diffstat (limited to 'extras/MonoDevelop.AddinAuthoring')
58 files changed, 3664 insertions, 228 deletions
diff --git a/extras/MonoDevelop.AddinAuthoring/AddinTextStylePolicy.xml b/extras/MonoDevelop.AddinAuthoring/AddinTextStylePolicy.xml new file mode 100644 index 0000000000..280289eb7e --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/AddinTextStylePolicy.xml @@ -0,0 +1,8 @@ +<TextStylePolicy scope="application/x-addin+xml"> + <FileWidth>80</FileWidth> + <TabWidth>4</TabWidth> + <TabsToSpaces>False</TabsToSpaces> + <NoTabsAfterNonTabs>False</NoTabsAfterNonTabs> + <RemoveTrailingWhitespace>False</RemoveTrailingWhitespace> + <EolMarker>Native</EolMarker> +</TextStylePolicy> diff --git a/extras/MonoDevelop.AddinAuthoring/AddinXmlPolicy.xml b/extras/MonoDevelop.AddinAuthoring/AddinXmlPolicy.xml new file mode 100644 index 0000000000..debf809562 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/AddinXmlPolicy.xml @@ -0,0 +1,31 @@ +<XmlFormattingPolicy scope="application/x-addin+xml"> + <DefaultFormat + OmitXmlDeclaration="False" + NewLineChars="
" + IndentContent="True" + ContentIndentString=" " + AttributesInNewLine="False" + MaxAttributesPerLine="10" + AttributesIndentString=" " + AlignAttributes="False" + AlignAttributeValues="False" + QuoteChar=""" + SpacesBeforeAssignment="0" + SpacesAfterAssignment="0" + EmptyLinesBeforeStart="0" + EmptyLinesAfterStart="0" + EmptyLinesBeforeEnd="0" + EmptyLinesAfterEnd="0" /> + <Formats> + <XmlFormatingSettings OmitXmlDeclaration="False" NewLineChars="
" IndentContent="True" ContentIndentString=" " AttributesInNewLine="True" MaxAttributesPerLine="10" AttributesIndentString=" " WrapAttributes="False" AlignAttributes="False" AlignAttributeValues="False" QuoteChar=""" SpacesBeforeAssignment="0" SpacesAfterAssignment="0" EmptyLinesBeforeStart="0" EmptyLinesAfterStart="0" EmptyLinesBeforeEnd="0" EmptyLinesAfterEnd="0"> + <ScopeXPath> + <String>/Addin</String> + </ScopeXPath> + </XmlFormatingSettings> + <XmlFormatingSettings OmitXmlDeclaration="False" NewLineChars="
" IndentContent="True" ContentIndentString=" " AttributesInNewLine="False" MaxAttributesPerLine="10" AttributesIndentString=" " WrapAttributes="False" AlignAttributes="False" AlignAttributeValues="False" QuoteChar=""" SpacesBeforeAssignment="0" SpacesAfterAssignment="0" EmptyLinesBeforeStart="1" EmptyLinesAfterStart="0" EmptyLinesBeforeEnd="0" EmptyLinesAfterEnd="1"> + <ScopeXPath> + <String>/*/*</String> + </ScopeXPath> + </XmlFormatingSettings> + </Formats> +</XmlFormattingPolicy> diff --git a/extras/MonoDevelop.AddinAuthoring/AssemblyInfo.cs b/extras/MonoDevelop.AddinAuthoring/AssemblyInfo.cs index 1c679f1121..b2d1935b13 100644 --- a/extras/MonoDevelop.AddinAuthoring/AssemblyInfo.cs +++ b/extras/MonoDevelop.AddinAuthoring/AssemblyInfo.cs @@ -5,5 +5,5 @@ using System.Reflection; [assembly: AssemblyProduct ("MonoDevelop")] [assembly: AssemblyTitle ("Add-in Authoring")] [assembly: AssemblyDescription ("This add-in provides utilities for creating Mono.Addins based libraries and applications")] -[assembly: AssemblyVersion ("2.6")] +[assembly: AssemblyVersion ("2.4")] [assembly: AssemblyCopyright ("MIT X11")] diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/BaseXmlEditorExtension.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/BaseXmlEditorExtension.cs index 62f6bd47f5..aa86ff8a7f 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/BaseXmlEditorExtension.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/BaseXmlEditorExtension.cs @@ -2,7 +2,7 @@ using System; using S = MonoDevelop.Xml.StateEngine; using MonoDevelop.Ide.Gui.Content; -using MonoDevelop.Projects.Gui.Completion; +using MonoDevelop.Ide.CodeCompletion; namespace MonoDevelop.AddinAuthoring.CodeCompletion { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs index 95984415bd..81416b82f9 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs @@ -34,6 +34,7 @@ using Mono.Addins.Description; using MonoDevelop.Core; using MonoDevelop.Core.Collections; using MonoDevelop.Projects; +using MonoDevelop.Ide.CodeCompletion; using MonoDevelop.Ide.Gui.Content; using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.CodeCompletion; diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/AddinView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/AddinView.cs new file mode 100644 index 0000000000..dbb45f6735 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/AddinView.cs @@ -0,0 +1,60 @@ +// +// AddinView.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; + +namespace MonoDevelop.AddinAuthoring.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class AddinView : Gtk.Bin + { + public AddinView () + { + this.Build (); + } + + public void Fill (AddinDescription desc) + { + string name = desc.Name; + if (string.IsNullOrEmpty (name)) + name = desc.LocalId; + labelName.Markup = "<small>Add-in</small>\n<big><b>" + GLib.Markup.EscapeText (name) + "</b></big>"; + + if (!string.IsNullOrEmpty (desc.Description)) + labelDesc.Text = desc.Description; + else + labelDesc.Hide (); + + labelId.Text = desc.LocalId; + labelNamespace.Text = desc.Namespace; + labelVersion.Text = desc.Version; + labelAuthor.Text = desc.Author; + labelCopyright.Text = desc.Copyright; + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionNodeView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionNodeView.cs new file mode 100644 index 0000000000..ad26119774 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionNodeView.cs @@ -0,0 +1,74 @@ +// +// ExtensionNodeView.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; +using Mono.Addins; + +namespace MonoDevelop.AddinAuthoring.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class ExtensionNodeView : Gtk.Bin + { + public ExtensionNodeView () + { + this.Build (); + } + + public void Fill (ExtensionNodeDescription node) + { + ExtensionNodeType ntype = node.GetNodeType (); + labelName.Markup = "<small>Extension Node</small>\n<big><b>" + GLib.Markup.EscapeText (ntype.NodeName) + "</b></big>"; + + if (!string.IsNullOrEmpty (ntype.Description)) + labelDesc.Text = ntype.Description; + else + labelDesc.Text = AddinManager.CurrentLocalizer.GetString ("No additional documentation"); + + uint row = 0; + foreach (var att in node.Attributes) { + Gtk.Label lab = new Gtk.Label (); + lab.Markup = "<b>" + GLib.Markup.EscapeText (att.Name) + ":</b>"; + lab.UseUnderline = false; + lab.Xalign = 0; + tableAtts.Attach (lab, 0, 1, row, row + 1); + Gtk.Table.TableChild ct = (Gtk.Table.TableChild) tableAtts [lab]; + ct.XOptions = Gtk.AttachOptions.Fill; + + lab = new Gtk.Label (att.Value); + lab.UseUnderline = false; + lab.Xalign = 0; + lab.Wrap = true; + tableAtts.Attach (lab, 1, 2, row, row + 1); + ct = (Gtk.Table.TableChild) tableAtts [lab]; + ct.XOptions = Gtk.AttachOptions.Fill; + row++; + } + tableAtts.ShowAll (); + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionPointView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionPointView.cs new file mode 100644 index 0000000000..d5569d2188 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionPointView.cs @@ -0,0 +1,114 @@ +// +// ExtensionPointView.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; +using System.Collections.Generic; +using Mono.Addins; + +namespace MonoDevelop.AddinAuthoring.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class ExtensionPointView : Gtk.Bin + { + AddinRegistry reg; + + public ExtensionPointView () + { + this.Build (); + } + + public void Fill (ExtensionPoint ep, AddinRegistry reg) + { + string name; + if (!string.IsNullOrEmpty (ep.Name)) + name = ep.Name; + else + name = ep.Path; + + labelName.Markup = "<small>Extension Point</small>\n<big><b>" + GLib.Markup.EscapeText (name) + "</b></big>"; + if (!string.IsNullOrEmpty (ep.Description)) + labelDesc.Text = ep.Description; + else + labelDesc.Text = AddinManager.CurrentLocalizer.GetString ("No additional documentation"); + + List<ExtensionNodeType> types = new List<ExtensionNodeType> (); + GetNodeTypes (reg, ep.NodeSet, types); + + uint row = 0; + foreach (ExtensionNodeType nt in types) { + Gtk.Label lab = new Gtk.Label (); + lab.Markup = "<b>" + GLib.Markup.EscapeText (nt.NodeName) + "</b>"; + lab.UseUnderline = false; + lab.Xalign = lab.Yalign = 0; + Gtk.Button but = new Gtk.Button (lab); + but.Relief = Gtk.ReliefStyle.None; + tableNodes.Attach (but, 0, 1, row, row + 1); + Gtk.Table.TableChild ct = (Gtk.Table.TableChild) tableNodes [but]; + ct.XOptions = Gtk.AttachOptions.Fill; + + lab = new Gtk.Label (nt.Description); + lab.UseUnderline = false; + lab.Xalign = lab.Yalign = 0; + lab.Wrap = true; + tableNodes.Attach (lab, 1, 2, row, row + 1); + ct = (Gtk.Table.TableChild) tableNodes [lab]; + ct.XOptions = Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill; + row++; + } + tableNodes.ShowAll (); + } + + void GetNodeTypes (AddinRegistry reg, ExtensionNodeSet nset, List<ExtensionNodeType> list) + { + foreach (ExtensionNodeType nt in nset.NodeTypes) + list.Add (nt); + + foreach (string ns in nset.NodeSets) { + ExtensionNodeSet cset = FindNodeSet (reg, nset.ParentAddinDescription, ns); + if (cset != null) + GetNodeTypes (reg, nset, list); + } + } + + ExtensionNodeSet FindNodeSet (AddinRegistry reg, AddinDescription adesc, string name) + { + ExtensionNodeSet nset = adesc.ExtensionNodeSets [name]; + if (nset != null) + return nset; + foreach (AddinDependency adep in adesc.MainModule.Dependencies) { + Addin addin = reg.GetAddin (adep.FullAddinId); + if (addin != null) { + nset = adesc.ExtensionNodeSets [name]; + if (nset != null) + return nset; + } + } + return null; + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionView.cs new file mode 100644 index 0000000000..688afc8be3 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.Gui/ExtensionView.cs @@ -0,0 +1,80 @@ +// +// ExtensionView.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; +using MonoDevelop.Ide.Gui.Components; +using MonoDevelop.Projects; +using MonoDevelop.Ide; + +namespace MonoDevelop.AddinAuthoring.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class ExtensionView : Gtk.Bin + { + public ExtensionView () + { + this.Build (); + } + + public void Fill (Extension ext, ITreeNavigator nav) + { + labelName.Markup = "<small>Extension</small>\n<big><b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ext)) + "</b></big>"; + object parent = ext.GetExtendedObject (); + + if (parent is ExtensionPoint) { + ExtensionPoint ep = (ExtensionPoint) parent; + string txt = "<small>Extension Point</small>\n<b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ep)) + "</b>"; + if (!string.IsNullOrEmpty (ep.Description)) + txt += "\n" + GLib.Markup.EscapeText (ep.Description); + Gtk.Label lab = new Gtk.Label (); + lab.Xalign = lab.Yalign = 0; + lab.Markup = txt; + lab.WidthRequest = 400; + lab.Wrap = true; + Gtk.Image img = new Gtk.Image (ImageService.GetPixbuf ("md-extension-point", Gtk.IconSize.Menu)); + img.Yalign = 0; + Gtk.HBox box = new Gtk.HBox (false, 6); + box.PackStart (img, false, false, 0); + box.PackStart (lab, true, true, 0); + buttonExt.Add (box); + buttonExt.ShowAll (); + buttonExt.Clicked += delegate { + if (nav.MoveToObject (ext)) { + nav.MoveToParent (typeof(Solution)); + nav.Expanded = true; + if (nav.MoveToObject (ep.ParentAddinDescription)) { + nav.Expanded = true; + if (nav.MoveToObject (ep)) + nav.Selected = true; + } + } + }; + } + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryGroup.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryGroup.cs new file mode 100644 index 0000000000..acfb71e6a5 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryGroup.cs @@ -0,0 +1,44 @@ +// +// AddinCategory.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class AddinCategoryGroup + { + public AddinCategoryGroup (RegistryInfo reg, string name) + { + this.Registry = reg; + this.Name = name; + } + + public RegistryInfo Registry { get; set; } + public string Name { get; set; } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryNodeBuilder.cs new file mode 100644 index 0000000000..76ec30f073 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryNodeBuilder.cs @@ -0,0 +1,92 @@ +// ExtensionPointsNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2007 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +using System; +using MonoDevelop.Projects; +using MonoDevelop.Core; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Gui.Pads; +using MonoDevelop.Ide.Gui.Pads.ProjectPad; +using MonoDevelop.Components.Commands; +using Mono.Addins; +using Mono.Addins.Description; +using MonoDevelop.Ide.Gui.Components; +using Gdk; +using System.Collections.Generic; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class AddinCategoryNodeBuilder: TypeNodeBuilder + { + public override Type NodeDataType { + get { return typeof(AddinCategoryGroup); } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + AddinCategoryGroup ep = (AddinCategoryGroup) dataObject; + return ep.Name; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) + { + AddinCategoryGroup ep = (AddinCategoryGroup) dataObject; + label = ep.Name; + icon = Context.GetIcon ("md-open-folder"); + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + AddinCategoryGroup cat = (AddinCategoryGroup) dataObject; + foreach (var ad in cat.Registry.CachedRegistry.GetAddinRoots ()) { + if (ad.Description.Category == cat.Name) + treeBuilder.AddChild (ad.Description); + } + foreach (var ad in cat.Registry.CachedRegistry.GetAddins ()) { + if (ad.Description.Category == cat.Name) + treeBuilder.AddChild (ad.Description); + } + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + return true; + } + + public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode) + { + object o1 = thisNode.DataItem; + object o2 = otherNode.DataItem; + if ((o1 is AddinCategoryGroup) && !(o2 is AddinCategoryGroup)) + return -1; + if ((o2 is AddinCategoryGroup) && !(o1 is AddinCategoryGroup)) + return 1; + return base.CompareObjects (thisNode, otherNode); + } + + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinFolderNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinFolderNodeBuilder.cs index 4080457f96..9a375de691 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinFolderNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinFolderNodeBuilder.cs @@ -34,13 +34,12 @@ using MonoDevelop.Core; using MonoDevelop.Ide.Gui.Pads; using MonoDevelop.Components.Commands; using MonoDevelop.Ide; -using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Commands; using MonoDevelop.Ide.Gui.Pads.ProjectPad; using Mono.Addins; using MonoDevelop.Ide.Gui.Components; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { public class AddinFolderNodeBuilder: TypeNodeBuilder { @@ -60,10 +59,10 @@ namespace MonoDevelop.AddinAuthoring get { return typeof(AddinFolderCommandHandler); } } - public override string ContextMenuAddinPath { +/* public override string ContextMenuAddinPath { get { return "/MonoDevelop/AddinAuthoring/ContextMenu/ProjectPad/Addin"; } } - + */ public override string GetNodeName (ITreeNavigator thisNode, object dataObject) { return "AddinDescription"; @@ -72,7 +71,7 @@ namespace MonoDevelop.AddinAuthoring public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { label = AddinManager.CurrentLocalizer.GetString ("Extension Model"); - icon = Context.GetIcon (Stock.Addin); + icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Addin); } public override void BuildChildNodes (ITreeBuilder builder, object dataObject) @@ -81,8 +80,6 @@ namespace MonoDevelop.AddinAuthoring ProjectFile file = data.Project.GetProjectFile (data.AddinManifestFileName); if (file != null) builder.AddChild (file); - builder.AddChild (data.CachedAddinManifest.ExtensionPoints); - builder.AddChild (data.CachedAddinManifest.MainModule.Extensions); } public override bool HasChildNodes (ITreeBuilder builder, object dataObject) diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinGroup.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinGroup.cs new file mode 100644 index 0000000000..c722629148 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinGroup.cs @@ -0,0 +1,42 @@ +// +// AddinGroup.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class AddinGroup + { + public AddinGroup (AddinDescription adesc) + { + this.AddinDescription = adesc; + } + + public AddinDescription AddinDescription { get; set; } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinHeaderNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinHeaderNodeBuilder.cs index 885a505933..e50ddf61a4 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinHeaderNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinHeaderNodeBuilder.cs @@ -27,7 +27,7 @@ using System; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinNodeBuilder.cs new file mode 100644 index 0000000000..3230e0b5e6 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinNodeBuilder.cs @@ -0,0 +1,90 @@ +// +// AddinNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using MonoDevelop.Ide.Gui.Components; +using Mono.Addins.Description; +using System.Collections.Generic; +using MonoDevelop.Core; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class AddinNodeBuilder: TypeNodeBuilder + { + public override Type NodeDataType { + get { return typeof(AddinDescription); } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + AddinDescription ad = (AddinDescription) dataObject; + return ad.AddinId; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) + { + AddinDescription ad = (AddinDescription) dataObject; + label = Util.GetDisplayName (ad); + icon = Context.GetIcon ("md-addin"); + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + AddinDescription ad = (AddinDescription) dataObject; + HashSet<string> localPoints = new HashSet<string> (); + foreach (ExtensionPoint ep in ad.ExtensionPoints) { + treeBuilder.AddChild (ep); + localPoints.Add (ep.Path); + } + foreach (Extension ex in ad.MainModule.Extensions) { + if (!localPoints.Contains (ex.Path)) + treeBuilder.AddChild (ex); + } + treeBuilder.AddChild (new TreeViewItem (GettextCatalog.GetString ("Dependencies"), MonoDevelop.Ide.Gui.Stock.ClosedReferenceFolder), true); + foreach (Dependency dep in ad.MainModule.Dependencies) { + AddinDependency adep = dep as AddinDependency; + if (adep != null) + treeBuilder.AddChild (new TreeViewItem (adep.FullAddinId, "md-addin-reference")); + } + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + return true; + } + + public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode) + { + AddinDescription ad1 = thisNode.DataItem as AddinDescription; + AddinDescription ad2 = otherNode.DataItem as AddinDescription; + if (ad1 != null && ad2 != null) + return Util.GetDisplayName (ad1).CompareTo (Util.GetDisplayName (ad2)); + return base.CompareObjects (thisNode, otherNode); + } + + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinReferenceNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinReferenceNodeBuilder.cs index edd8b92aa4..b50943f0cd 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinReferenceNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/AddinReferenceNodeBuilder.cs @@ -29,7 +29,6 @@ using System; using MonoDevelop.Projects; using MonoDevelop.Core; using MonoDevelop.Ide; -using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Gui.Pads; using MonoDevelop.Ide.Gui.Pads.ProjectPad; using MonoDevelop.Components.Commands; @@ -38,7 +37,7 @@ using Mono.Addins.Description; using MonoDevelop.Ide.Gui.Components; using Gdk; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { public class AddinReferenceNodeBuilder: TypeNodeBuilder { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionModelTypeNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionModelTypeNodeBuilder.cs new file mode 100644 index 0000000000..e3e666fdf4 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionModelTypeNodeBuilder.cs @@ -0,0 +1,72 @@ +// +// ExtensionModelTypeNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using MonoDevelop.Ide.Gui.Components; +using MonoDevelop.Projects; +using Mono.Addins; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public abstract class ExtensionModelTypeNodeBuilder: TypeNodeBuilder + { + public AddinRegistry GetRegistry (ITreeNavigator nav) + { + Solution sol = (Solution) nav.GetParentDataItem (typeof(Solution), true); + if (sol != null) + return sol.GetAddinData ().Registry; + RegistryInfo reg = (RegistryInfo) nav.GetParentDataItem (typeof(RegistryInfo), true); + if (reg != null) + return reg.CachedRegistry; + return null; + } + + public AddinData GetAddinData (ITreeNavigator nav) + { + DotNetProject p = (DotNetProject) nav.GetParentDataItem (typeof(DotNetProject), true); + if (p == null) + return null; + return p.GetAddinData (); + } + + public CachedModelData GetCachedModelData (ITreeNavigator nav) + { + Project p = (Project) nav.GetParentDataItem (typeof(Project), true); + if (p == null) + return new CachedModelData (); + CachedModelData data = (CachedModelData) p.ExtendedProperties [typeof(CachedModelData)]; + if (data == null) { + data = new CachedModelData (); + p.ExtendedProperties [typeof(CachedModelData)] = data; + } + return data; + } + } + + public class CachedModelData + { + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs new file mode 100644 index 0000000000..c5c2fa6fdc --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs @@ -0,0 +1,175 @@ +// ExtensionPointsNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2007 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +using System; +using MonoDevelop.Projects; +using MonoDevelop.Core; +using MonoDevelop.Ide; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Gui.Pads; +using MonoDevelop.Ide.Gui.Pads.ProjectPad; +using MonoDevelop.Components.Commands; +using Mono.Addins; +using Mono.Addins.Description; +using MonoDevelop.Ide.Gui.Components; +using Gdk; +using System.Collections.Generic; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class ExtensionNodeBuilder: ExtensionModelTypeNodeBuilder + { + public override Type NodeDataType { + get { return typeof(Extension); } + } + + public override Type CommandHandlerType { + get { return typeof(ExtensionCommandHandler); } + } + + public override string ContextMenuAddinPath { + get { return "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Extension"; } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + Extension ep = (Extension) dataObject; + return ep.Path; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) + { + Extension ext = (Extension) dataObject; + label = Util.GetDisplayName (ext); + icon = Context.GetIcon ("md-extension"); + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + Extension en = (Extension) dataObject; + AddinRegistry reg = GetRegistry (treeBuilder); + if (reg == null) + return; + + if (treeBuilder.Options ["ShowExistingNodes"]) { + + ExtensionNodeTree tree = new ExtensionNodeTree (); + tree.Fill (reg, en); + + foreach (var node in tree.Nodes) + treeBuilder.AddChild (node); + } + else { + int order = 0; + foreach (ExtensionNodeDescription child in en.ExtensionNodes) + treeBuilder.AddChild (new ExtensionNodeInfo (child, true, order++)); + } + } + + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + if (builder.Options ["ShowExistingNodes"]) + return true; + + Extension en = (Extension) dataObject; + return en.ExtensionNodes.Count > 0; + } + + public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode) + { + if (thisNode.DataItem is TreeViewItem) + return -1; + if (otherNode.DataItem is TreeViewItem) + return 1; + return base.CompareObjects (thisNode, otherNode); + } + } + + class ExtensionCommandHandler: NodeCommandHandler + { + protected virtual Extension GetExtension () + { + return (Extension) CurrentNode.DataItem; + } + + [CommandUpdateHandler (Commands.AddNode)] + public void UpdateAddNodeBefore (CommandArrayInfo cinfo) + { + Extension en = GetExtension (); + foreach (ExtensionNodeType ntype in en.GetAllowedNodeTypes ()) + cinfo.Add (GettextCatalog.GetString ("Add extension '{0}'", ntype.NodeName), ntype); + } + + [CommandHandler (Commands.AddNode)] + public void AddNodeBefore (object data) + { + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + + Extension en = GetExtension (); + ExtensionNodeType ntype = (ExtensionNodeType) data; + + ExtensionNodeDescription newNode = new ExtensionNodeDescription (ntype.NodeName); + en.ExtensionNodes.Add (newNode); + CurrentNode.Expanded = true; + + adata.SaveAddinManifest (); + adata.NotifyChanged (false); + + DispatchService.GuiDispatch (delegate { + ITreeNavigator nav = Tree.GetNodeAtObject (new ExtensionNodeInfo (newNode, false)); + if (nav != null) + nav.Selected = true; + }); + } + + public override bool CanDeleteMultipleItems () + { + return true; + } + + public override void DeleteMultipleItems () + { + string msg = GettextCatalog.GetString ("The following extensions and all the nodes they contain will be deleted:") + "\n\n"; + foreach (var nav in CurrentNodes) { + msg += Util.GetDisplayName ((Extension)nav.DataItem) + "\n"; + } + if (MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to delete the selected extensions?"), msg, AlertButton.Delete)) { + foreach (var nav in CurrentNodes) { + Extension ex = (Extension)nav.DataItem; + ModuleDescription module = (ModuleDescription) ex.Parent; + module.Extensions.Remove (ex); + } + } + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + adata.SaveAddinManifest (); + adata.NotifyChanged (false); + } + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeNodeBuilder.cs new file mode 100644 index 0000000000..45af4d115c --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeNodeBuilder.cs @@ -0,0 +1,317 @@ +// ExtensionPointsNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2007 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +using System; +using MonoDevelop.Projects; +using MonoDevelop.Core; +using MonoDevelop.Ide; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Gui.Pads; +using MonoDevelop.Ide.Gui.Pads.ProjectPad; +using MonoDevelop.Components.Commands; +using Mono.Addins; +using Mono.Addins.Description; +using MonoDevelop.Ide.Gui.Components; +using Gdk; + +using System.Text; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class ExtensionNodeNodeBuilder: ExtensionModelTypeNodeBuilder + { + public override Type NodeDataType { + get { return typeof(ExtensionNodeInfo); } + } + + public override Type CommandHandlerType { + get { return typeof(ExtensionNodeCommandHandler); } + } + + public override string ContextMenuAddinPath { + get { return "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionNode"; } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + ExtensionNodeInfo ep = (ExtensionNodeInfo) dataObject; + return ep.Node.Id; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) + { + ExtensionNodeInfo ninfo = (ExtensionNodeInfo) dataObject; + ExtensionNodeDescription node = ninfo.Node; + + label = GLib.Markup.EscapeText (node.NodeName); + StringBuilder desc = new StringBuilder (); + foreach (NodeAttribute at in node.Attributes) { + if (desc.Length > 0) + desc.Append (" "); + desc.Append (at.Name).Append ("=\"").Append (GLib.Markup.EscapeText (at.Value)).Append ('"'); + } + if (desc.Length > 0) + label += "(<i>" + desc + "</i>)"; + + icon = Context.GetIcon ("md-extension-node"); + + if (treeBuilder.Options ["ShowExistingNodes"] && !ninfo.CanModify) { + Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade"); + if (gicon == null) { + gicon = ImageService.MakeTransparent (icon, 0.5); + Context.CacheComposedIcon (icon, "fade", gicon); + } + icon = gicon; + } + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + ExtensionNodeInfo en = (ExtensionNodeInfo) dataObject; + foreach (ExtensionNodeInfo child in en.Expand ()) + treeBuilder.AddChild (child); + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + ExtensionNodeInfo en = (ExtensionNodeInfo) dataObject; + return en.HasChildren; + } + + public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode) + { + ExtensionNodeInfo n1 = thisNode.DataItem as ExtensionNodeInfo; + ExtensionNodeInfo n2 = otherNode.DataItem as ExtensionNodeInfo; + if (n1 != null && n2 != null) + return n1.Order.CompareTo (n2.Order); + else + return base.CompareObjects (thisNode, otherNode); + } + + public override void OnNodeAdded (object dataObject) + { + ExtensionNodeInfo en = (ExtensionNodeInfo) dataObject; + en.Changed += HandleNodeChanged; + } + + public override void OnNodeRemoved (object dataObject) + { + ExtensionNodeInfo en = (ExtensionNodeInfo) dataObject; + en.Changed -= HandleNodeChanged; + } + + void HandleNodeChanged (object sender, EventArgs e) + { + ITreeBuilder builder = Context.GetTreeBuilder (sender); + if (builder != null) + builder.UpdateAll (); + } + + } + + class ExtensionNodeCommandHandler: NodeCommandHandler + { + public override DragOperation CanDragNode () + { + ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem; + if (en.CanModify) + return DragOperation.Copy | DragOperation.Move; + else + return DragOperation.None; + } + + public override bool CanDropNode (object dataObject, DragOperation operation, DropPosition pos) + { + object parent1 = CurrentNode.GetParentDataItem (typeof(Extension), false); + if (parent1 == null) + parent1 = CurrentNode.GetParentDataItem (typeof(ExtensionPoint), false); + + ITreeNavigator nav = CurrentNode.Clone (); + if (!nav.MoveToObject (dataObject)) + return false; + object parent2 = nav.GetParentDataItem (parent1.GetType (), false); + if (parent2 != parent1) + return false; + + return true; + } + + public override void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation, DropPosition pos) + { + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + + ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem; + + foreach (ExtensionNodeInfo newNode in dataObjects) { + if (newNode.Node.Parent is ExtensionNodeDescription) + ((ExtensionNodeDescription)newNode.Node.Parent).ChildNodes.Remove (en.Node); + else + ((Extension)newNode.Node.Parent).ExtensionNodes.Remove (newNode.Node); + InsertNode (adata, en, pos, newNode.Node); + + // Add all other nodes after the first node + en = newNode; + pos = DropPosition.After; + } + + adata.CachedAddinManifest.Save (); + adata.NotifyChanged (false); + } + + [CommandUpdateHandler (Commands.AddNodeAfter)] + public void UpdateAddNodeAfter (CommandArrayInfo cinfo) + { + foreach (ExtensionNodeType ntype in GetAllowedChildTypes ()) { + cinfo.Add (ntype.NodeName, ntype); + } + } + + [CommandHandler (Commands.AddNodeAfter)] + public void AddNodeAfter (object data) + { + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + + ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem; + ExtensionNodeType ntype = (ExtensionNodeType) data; + ExtensionNodeDescription newNode = new ExtensionNodeDescription (ntype.NodeName); + InsertNode (adata, en, DropPosition.After, newNode); + + adata.CachedAddinManifest.Save (); + adata.NotifyChanged (false); + } + + + [CommandUpdateHandler (Commands.AddNodeBefore)] + public void UpdateAddNodeBefore (CommandArrayInfo cinfo) + { + foreach (ExtensionNodeType ntype in GetAllowedChildTypes ()) { + cinfo.Add (ntype.NodeName, ntype); + } + } + + [CommandHandler (Commands.AddNodeBefore)] + public void AddNodeBefore (object data) + { + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + + ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem; + ExtensionNodeType ntype = (ExtensionNodeType) data; + ExtensionNodeDescription newNode = new ExtensionNodeDescription (ntype.NodeName); + InsertNode (adata, en, DropPosition.Before, newNode); + + adata.CachedAddinManifest.Save (); + adata.NotifyChanged (false); + } + + ExtensionNodeDescription InsertNode (AddinData adata, ExtensionNodeInfo refNode, DropPosition pos, ExtensionNodeDescription newNode) + { + ExtensionNodeDescriptionCollection nodes = null; + newNode.InsertBefore = ""; + newNode.InsertAfter = ""; + + if (refNode.CanModify) { + if (pos == DropPosition.Into) + nodes = refNode.Node.ChildNodes; + else if (refNode.Node.Parent is ExtensionNodeDescription) + nodes = ((ExtensionNodeDescription)refNode.Node.Parent).ChildNodes; + } else { + if (pos == DropPosition.After) + newNode.InsertAfter = refNode.Node.Id; + else if (pos == DropPosition.Before) + newNode.InsertBefore = refNode.Node.Id; + } + if (nodes == null) { + string path = refNode.Node.GetParentPath (); + if (pos == DropPosition.Into) + path += "/" + refNode.Node.Id; + Extension ext = adata.CachedAddinManifest.MainModule.GetExtension (path); + nodes = ext.ExtensionNodes; + } + + for (int n = 0; n < nodes.Count; n++) { + ExtensionNodeDescription node = nodes [n]; + if (node == refNode.Node) { + if (pos == DropPosition.After) n++; + nodes.Insert (n, newNode); + return newNode; + } + } + nodes.Add (newNode); + return newNode; + } + + ExtensionNodeTypeCollection GetAllowedChildTypes () + { + ExtensionNodeTypeCollection types = null; + ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem; + object parent = en.Node.Parent; + + Extension ext = parent as Extension; + if (ext != null) + return ext.GetAllowedNodeTypes (); + else { + ExtensionNodeDescription node = (ExtensionNodeDescription) parent; + if (node != null) { + ExtensionNodeType tn = node.GetNodeType (); + if (tn != null) + return tn.GetAllowedNodeTypes (); + } + } + return new ExtensionNodeTypeCollection (); + } + + public override bool CanDeleteMultipleItems () + { + foreach (var nav in CurrentNodes) { + ExtensionNodeInfo en = (ExtensionNodeInfo) nav.DataItem; + if (!en.CanModify) + return false; + } + return true; + } + + public override void DeleteMultipleItems () + { + if (MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to delete the selected nodes?"), AlertButton.Delete)) { + foreach (var nav in CurrentNodes) { + ExtensionNodeInfo en = (ExtensionNodeInfo) nav.DataItem; + if (en.Node.Parent is Extension) + ((Extension)en.Node.Parent).ExtensionNodes.Remove (en.Node); + else if (en.Node.Parent is ExtensionNodeDescription) + ((ExtensionNodeDescription)en.Node.Parent).ChildNodes.Remove (en.Node); + } + } + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + adata.SaveAddinManifest (); + adata.NotifyChanged (false); + } + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs new file mode 100644 index 0000000000..76446829e1 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs @@ -0,0 +1,191 @@ +// ExtensionPointsNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2007 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +using System; +using MonoDevelop.Projects; +using MonoDevelop.Core; +using MonoDevelop.Ide; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Gui.Pads; +using MonoDevelop.Ide.Gui.Pads.ProjectPad; +using MonoDevelop.Components.Commands; +using Mono.Addins; +using Mono.Addins.Description; +using MonoDevelop.Ide.Gui.Components; +using Gdk; +using System.Collections.Generic; + + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class ExtensionPointNodeBuilder: ExtensionModelTypeNodeBuilder + { + public override Type NodeDataType { + get { return typeof(ExtensionPoint); } + } + + public override Type CommandHandlerType { + get { return typeof(ExtensionPointCommandHandler); } + } + + public override string ContextMenuAddinPath { + get { return "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionPoint"; } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + ExtensionPoint ep = (ExtensionPoint) dataObject; + return ep.Path; + } + + public override object GetParentObject (object dataObject) + { + ExtensionPoint ep = (ExtensionPoint) dataObject; + return ep.ParentAddinDescription; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) + { + ExtensionPoint ep = (ExtensionPoint) dataObject; + label = !string.IsNullOrEmpty (ep.Name) ? ep.Name : ep.Path; + icon = Context.GetIcon ("md-extension-point"); + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + ExtensionPoint ep = (ExtensionPoint) dataObject; + + if (treeBuilder.Options ["ShowExistingNodes"]) { + AddinRegistry reg = GetRegistry (treeBuilder); + if (reg == null) + return; + ExtensionNodeTree tree = new ExtensionNodeTree (); + tree.Fill (reg, ep); + foreach (var node in tree.Nodes) + treeBuilder.AddChild (node); + } + else { + int order = 0; + foreach (Extension ext in ep.ParentAddinDescription.MainModule.Extensions) { + if (ext.Path == ep.Path) { + foreach (ExtensionNodeDescription node in ext.ExtensionNodes) + treeBuilder.AddChild (new ExtensionNodeInfo (node, true, order++)); + } + } + } + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + if (builder.Options ["ShowExistingNodes"]) + return true; + else { + ExtensionPoint ep = (ExtensionPoint) dataObject; + foreach (Extension ext in ep.ParentAddinDescription.MainModule.Extensions) { + if (ext.Path == ep.Path) { + if (ext.ExtensionNodes.Count > 0) + return true; + } + } + return false; + } + } + + public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode) + { + if (thisNode.DataItem is TreeViewItem) + return -1; + if (otherNode.DataItem is TreeViewItem) + return 1; + return base.CompareObjects (thisNode, otherNode); + } + + + } + + class ExtensionPointCommandHandler: ExtensionCommandHandler + { + public override void ActivateItem () + { + DotNetProject project = (DotNetProject) CurrentNode.GetParentDataItem (typeof(DotNetProject), true); + if (project == null) + return; + AddinData data = project.GetAddinData (); + if (data == null) + return; + + ExtensionPoint ep = (ExtensionPoint) CurrentNode.DataItem; + ExtensionPoint epc = new ExtensionPoint (); + epc.CopyFrom (ep); + NewExtensionPointDialog epdlg = new NewExtensionPointDialog (project, data.AddinRegistry, data.CachedAddinManifest, epc); + if (epdlg.Run () == (int) Gtk.ResponseType.Ok) { + ep.CopyFrom (epc); + data.CachedAddinManifest.Save (); + } + epdlg.Destroy (); + } + + protected override Extension GetExtension () + { + ExtensionPoint ep = (ExtensionPoint) CurrentNode.DataItem; + return ep.ParentAddinDescription.MainModule.GetExtension (ep.Path); + } + + public override bool CanDeleteMultipleItems () + { + return true; + } + + public override void DeleteMultipleItems () + { + string msg = GettextCatalog.GetString ("The following extension points and all the nodes they contain will be deleted:") + "\n\n"; + foreach (var nav in CurrentNodes) { + msg += Util.GetDisplayName ((ExtensionPoint)nav.DataItem) + "\n"; + } + if (MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to delete the selected extension points?"), msg, AlertButton.Delete)) { + foreach (var nav in CurrentNodes) { + ExtensionPoint ep = (ExtensionPoint)nav.DataItem; + ep.ParentAddinDescription.ExtensionPoints.Remove (ep); + foreach (ModuleDescription module in ep.ParentAddinDescription.AllModules) { + List<Extension> toDelete = new List<Extension> (); + foreach (Extension ext in module.Extensions) { + if (ext.Path == ep.Path || ext.Path.StartsWith (ep.Path + "/")) + toDelete.Add (ext); + } + foreach (Extension ext in toDelete) + module.Extensions.Remove (ext); + } + } + } + DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false); + AddinData adata = p.GetAddinData (); + adata.SaveAddinManifest (); + adata.NotifyChanged (false); + } + + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectFolderNodeBuilderExtension.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectFolderNodeBuilderExtension.cs index 2351812c07..56042df367 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectFolderNodeBuilderExtension.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectFolderNodeBuilderExtension.cs @@ -39,7 +39,7 @@ using Mono.Addins.Description; using MonoDevelop.Ide.Gui.Components; using Gtk; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { class ProjectFolderNodeBuilderExtension: NodeBuilderExtension { @@ -116,17 +116,14 @@ namespace MonoDevelop.AddinAuthoring { public override void ActivateItem () { - if (CurrentNode.DataItem is AddinData) { - AddinData data = (AddinData) CurrentNode.DataItem; - foreach (Document doc in IdeApp.Workbench.Documents) { - AddinDescriptionView view = doc.GetContent<AddinDescriptionView> (); - if (view != null && view.Data == data) { - doc.Select (); - return; - } - } - IdeApp.Workbench.OpenDocument (new AddinDescriptionView (data), true); - } +/* if (CurrentNode.DataItem is AddinData) { + Pad pad = IdeApp.Workbench.GetPad<ExtensionTreePad> (); + ExtensionTreePad etree = (ExtensionTreePad) pad.Content; + pad.BringToFront (); + Project p = (Project) CurrentNode.GetParentDataItem (typeof(Project), false); + if (p != null) + etree.SelectProject (p); + }*/ } [CommandHandler (Commands.AddExtension)] diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectNodeBuilder.cs new file mode 100644 index 0000000000..7a4e44f8d3 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ProjectNodeBuilder.cs @@ -0,0 +1,244 @@ +// +// ProjectNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual +// +// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +using MonoDevelop.Projects; +using MonoDevelop.Projects.Dom; +using MonoDevelop.Projects.Dom.Parser; +using MonoDevelop.Core; +using MonoDevelop.Ide; +using MonoDevelop.Ide.Gui.Components; +using Mono.Addins.Description; +using MonoDevelop.Components.Commands; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class ProjectNodeBuilder: TypeNodeBuilder + { + SolutionItemRenamedEventHandler projectNameChanged; + + public ProjectNodeBuilder () + { + projectNameChanged = (SolutionItemRenamedEventHandler) DispatchService.GuiDispatch (new SolutionItemRenamedEventHandler (OnProjectRenamed)); + } + + protected override void Initialize () + { + } + public override void Dispose () + { + } + + public override Type NodeDataType { + get { return typeof(DotNetProject); } + } + + public override string ContextMenuAddinPath { + get { return "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Project"; } + } + + public override Type CommandHandlerType { + get { return typeof(ProjectCommandHandler); } + } + + public override void OnNodeAdded (object dataObject) + { + DotNetProject project = (DotNetProject) dataObject; + project.NameChanged += projectNameChanged; + + AddinData data = project.GetAddinData (); + if (data != null) { + data.Changed += HandleDataChanged; + } + } + + public override void OnNodeRemoved (object dataObject) + { + DotNetProject project = (DotNetProject) dataObject; + project.NameChanged -= projectNameChanged; + + AddinData data = project.GetAddinData (); + if (data != null) + data.Changed -= HandleDataChanged; + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + return ((Project)dataObject).Name; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) + { + Project p = dataObject as Project; + label = p.Name; + icon = Context.GetIcon (p.StockIcon); + } + + public override void BuildChildNodes (ITreeBuilder builder, object dataObject) + { + DotNetProject project = (DotNetProject) dataObject; + AddinData data = project.GetAddinData (); + if (data != null && data.CachedAddinManifest != null) { + AddinDescription adesc = data.CachedAddinManifest; + HashSet<string> localPoints = new HashSet<string> (); + foreach (ExtensionPoint ep in adesc.ExtensionPoints) { + builder.AddChild (ep); + localPoints.Add (ep.Path); + } + foreach (Extension ext in adesc.MainModule.Extensions) { + if (!localPoints.Contains (ext.Path)) + builder.AddChild (ext); + } + } + } + + public static IEnumerable<object> BuildChildNodes (ITreeBuilder treeBuilder, AddinData data, Func<AddinDescription,bool> includeAddin) + { + AddinDescription adesc = data.CachedAddinManifest; + HashSet<string> localPoints = new HashSet<string> (); + if (includeAddin (adesc)) { + foreach (ExtensionPoint ep in adesc.ExtensionPoints) { + yield return ep; + localPoints.Add (ep.Path); + } + } + foreach (Extension ext in adesc.MainModule.Extensions) { + if (!localPoints.Contains (ext.Path)) { + if (includeAddin != null) { + object ob = ext.GetExtendedObject (); + while (!(ob is ExtensionPoint) && ob != null) { + if (ob is Extension) + ob = ((Extension)ob).GetExtendedObject (); + else if (ob is ExtensionNodeDescription) + ob = ((ExtensionNodeDescription)ob).Parent; + else + ob = null; + } + if (ob != null && includeAddin (((ExtensionPoint)ob).ParentAddinDescription)) + yield return ext; + } else { + yield return ext; + } + } + } + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + return true; + } + + void HandleDataChanged (object sender, EventArgs e) + { + AddinData data = (AddinData) sender; + ITreeBuilder tb = Context.GetTreeBuilder (data.Project); + if (tb != null) tb.UpdateAll (); + } + + void OnProjectRenamed (object sender, SolutionItemRenamedEventArgs e) + { + ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem); + if (tb != null) tb.Update (); + } + + } + + class ProjectCommandHandler: NodeCommandHandler + { + [CommandHandler (Commands.AddExtensionPoint)] + public void OnAddExtensionPoint () + { + DotNetProject project = (DotNetProject) CurrentNode.DataItem; + if (project == null) + return; + AddinData data = project.GetAddinData (); + if (project == null) + return; + + ExtensionPoint ep = new ExtensionPoint (); + NewExtensionPointDialog dlg = new NewExtensionPointDialog (project, data.AddinRegistry, data.CachedAddinManifest, ep); + try { + if (dlg.Run () == (int) Gtk.ResponseType.Ok) { + data.CachedAddinManifest.ExtensionPoints.Add (ep); + data.SaveAddinManifest (); + data.NotifyChanged (false); + } + } finally { + dlg.Destroy (); + } + } + + [CommandHandler (Commands.AddExtension)] + public void OnAddExtension () + { + DotNetProject project = (DotNetProject) CurrentNode.DataItem; + if (project == null) + return; + AddinData data = project.GetAddinData (); + if (project == null) + return; + + AddinDescription adesc = data.CachedAddinManifest; + + ExtensionSelectorDialog dlg = new ExtensionSelectorDialog (data.AddinRegistry, adesc, adesc.IsRoot, false); + if (dlg.Run () == (int) Gtk.ResponseType.Ok) { + foreach (object ob in dlg.GetSelection ()) { + AddinDescription desc = null; + if (ob is ExtensionPoint) { + ExtensionPoint ep = (ExtensionPoint) ob; + Extension ext = new Extension (ep.Path); + adesc.MainModule.Extensions.Add (ext); + desc = (AddinDescription) ep.Parent; + } + else if (ob is ExtensionNodeDescription) { + ExtensionNodeDescription node = (ExtensionNodeDescription) ob; + desc = node.ParentAddinDescription; + string path = ""; + while (node != null && !(node.Parent is Extension)) { + if (!node.IsCondition) + path = "/" + node.Id + path; + node = node.Parent as ExtensionNodeDescription; + } + Extension eext = (Extension) node.Parent; + Extension ext = new Extension (eext.Path + "/" + node.Id + path); + adesc.MainModule.Extensions.Add (ext); + } + if (adesc.AddinId != desc.AddinId && !adesc.MainModule.DependsOnAddin (desc.AddinId)) + adesc.MainModule.Dependencies.Add (new AddinDependency (desc.AddinId)); + } + adesc.Save (); + } + dlg.Destroy (); + } + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferenceNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferenceNodeBuilder.cs index 4681c8e338..cc5db59faa 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferenceNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferenceNodeBuilder.cs @@ -29,7 +29,7 @@ using MonoDevelop.Projects; using MonoDevelop.Ide.Gui.Components; using MonoDevelop.Ide.Gui.Pads.ProjectPad; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { public class ReferenceNodeBuilder: NodeBuilderExtension { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferencesFolderNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferencesFolderNodeBuilder.cs index be983d5c24..de3d1e9eda 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferencesFolderNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ReferencesFolderNodeBuilder.cs @@ -36,7 +36,7 @@ using Mono.Addins; using Mono.Addins.Description; using MonoDevelop.Ide.Gui.Components; -namespace MonoDevelop.AddinAuthoring +namespace MonoDevelop.AddinAuthoring.NodeBuilders { public class ReferencesFolderNodeBuilder: NodeBuilderExtension { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/RegistryNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/RegistryNodeBuilder.cs new file mode 100644 index 0000000000..4fc7f112e2 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/RegistryNodeBuilder.cs @@ -0,0 +1,92 @@ +// +// RegistryNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using MonoDevelop.Ide.Gui.Components; +using Mono.Addins; +using System.Collections.Generic; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class RegistryNodeBuilder: TypeNodeBuilder + { + public RegistryNodeBuilder () + { + } + + public override Type NodeDataType { + get { return typeof(RegistryInfo); } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + RegistryInfo reg = (RegistryInfo) dataObject; + string name = reg.ApplicationName; + if (string.IsNullOrEmpty (name)) + name = reg.ApplicationPath; + return name; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) + { + RegistryInfo reg = (RegistryInfo) dataObject; + label = reg.ApplicationName; + if (string.IsNullOrEmpty (label)) + label = reg.ApplicationPath; + icon = Context.GetIcon ("md-package"); + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + return true; + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + RegistryInfo reg = (RegistryInfo) dataObject; + if (reg.CachedRegistry == null) { + reg.CachedRegistry = new AddinRegistry (reg.RegistryPath, reg.ApplicationPath); + reg.CachedRegistry.Update (null); + } + HashSet<string> cats = new HashSet<string> (); + foreach (var ad in reg.CachedRegistry.GetAddinRoots ()) { + if (string.IsNullOrEmpty (ad.Description.Category)) { + treeBuilder.AddChild (ad.Description); + } else if (cats.Add (ad.Description.Category)) { + treeBuilder.AddChild (new AddinCategoryGroup (reg, ad.Description.Category)); + } + } + foreach (var ad in reg.CachedRegistry.GetAddins ()) { + if (string.IsNullOrEmpty (ad.Description.Category)) { + treeBuilder.AddChild (ad.Description); + } else if (cats.Add (ad.Description.Category)) { + treeBuilder.AddChild (new AddinCategoryGroup (reg, ad.Description.Category)); + } + } + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs new file mode 100644 index 0000000000..0df58e778f --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs @@ -0,0 +1,97 @@ +// +// SolutionNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using MonoDevelop.Ide.Gui.Components; +using MonoDevelop.Projects; + +namespace MonoDevelop.AddinAuthoring.NodeBuilders +{ + public class SolutionNodeBuilder: TypeNodeBuilder + { + bool forBrowser; + + public SolutionNodeBuilder () + { + } + + public SolutionNodeBuilder (bool forBrowser) + { + this.forBrowser = forBrowser; + } + + public override Type NodeDataType { + get { return typeof(Solution); } + } + + public override string GetNodeName (ITreeNavigator thisNode, object dataObject) + { + Solution sol = (Solution) dataObject; + if (forBrowser) { + SolutionAddinData data = sol.GetAddinData (); + if (data != null && data.ApplicationName != null) + return data.ApplicationName; + } + return sol.Name; + } + + public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes) + { + Solution sol = (Solution) dataObject; + foreach (DotNetProject p in sol.GetAllSolutionItems<DotNetProject> ()) { + if (p.GetAddinData () != null) + return; + } + attributes |= NodeAttributes.Hidden; + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) + { + Solution sol = (Solution) dataObject; + label = sol.Name; + icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Solution); + } + + public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject) + { + Solution sol = (Solution) dataObject; + SolutionAddinData data = sol.GetAddinData (); + if (data != null && data.Registry != null) { + foreach (var ad in data.Registry.GetAddinRoots ()) + treeBuilder.AddChild (ad.Description); + foreach (var ad in data.Registry.GetAddins ()) + treeBuilder.AddChild (ad.Description); + } + } + + public override bool HasChildNodes (ITreeBuilder builder, object dataObject) + { + return true; + } + + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.addin.xml b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.addin.xml index 47d8e2bde1..18227fd215 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.addin.xml +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.addin.xml @@ -27,6 +27,22 @@ <ExtensionNode name="Registry" type="MonoDevelop.AddinAuthoring.RegistryInfo" /> </ExtensionPoint> + <ExtensionPoint path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionPoint"> + <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/> + </ExtensionPoint> + + <ExtensionPoint path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Extension"> + <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/> + </ExtensionPoint> + + <ExtensionPoint path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionNode"> + <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/> + </ExtensionPoint> + + <ExtensionPoint path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Project"> + <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/> + </ExtensionPoint> + <!-- Extensions --> <Extension path = "/MonoDevelop/AddinAuthoring/AddinRegistries"> @@ -38,6 +54,22 @@ <Command id = "MonoDevelop.AddinAuthoring.Commands.AddExtension" icon = "md-addin" _label = "Add new extension..." /> + <Command id = "MonoDevelop.AddinAuthoring.Commands.AddNodeBefore" + type="array" + _label = "Add Node Before" /> + <Command id = "MonoDevelop.AddinAuthoring.Commands.AddNodeAfter" + type="array" + _label = "Add Node After" /> + <Command id = "MonoDevelop.AddinAuthoring.Commands.AddNode" + type="array" + _label = "Add Node" /> + <Command id = "MonoDevelop.AddinAuthoring.Commands.AddExtensionPoint" + icon = "md-new-extension-point" + _label = "New Extension Point" /> + <Command id = "MonoDevelop.AddinAuthoring.Commands.ExtensionModelBrowser" + icon = "md-addin" + defaultHandler = "MonoDevelop.AddinAuthoring.ExtensionModelBrowserHandler" + _label = "Extension Model Browser" /> </Extension> <Extension path = "/MonoDevelop/Ide/FileTemplateTypes"> @@ -48,6 +80,14 @@ <CommandItem id="MonoDevelop.AddinAuthoring.Commands.AddAddinDependency" insertafter="Separator5"/> </Extension> + <Extension path="/MonoDevelop/Ide/MainMenu/View"> + <CommandItem id="MonoDevelop.AddinAuthoring.Commands.ExtensionModelBrowser" /> + </Extension> + + <Extension path = "/MonoDevelop/Ide/DisplayBindings"> + <DisplayBinding class = "MonoDevelop.AddinAuthoring.AddinDescriptionDisplayBinding" insertbefore="DefaultDisplayBinding"/> + </Extension> + <Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad"> <Condition id="ItemType" value="ProjectReferenceCollection"> <CommandItem id = "MonoDevelop.AddinAuthoring.Commands.AddAddinDependency" insertafter="MonoDevelop.Ide.Commands.ProjectCommands.AddReference"/> @@ -55,15 +95,11 @@ </Extension> <Extension path = "/MonoDevelop/Ide/Pads/ProjectPad"> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.ReferencesFolderNodeBuilder"/> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.AddinReferenceNodeBuilder"/> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.ReferenceNodeBuilder"/> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.ProjectFolderNodeBuilderExtension"/> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.AddinFolderNodeBuilder"/> -<!-- - <NodeBuilder class = "MonoDevelop.AddinAuthoring.ExtensionsNodeBuilder"/> - <NodeBuilder class = "MonoDevelop.AddinAuthoring.ExtensionPointsNodeBuilder"/> - --> + <NodeBuilder class = "MonoDevelop.AddinAuthoring.NodeBuilders.ReferencesFolderNodeBuilder"/> + <NodeBuilder class = "MonoDevelop.AddinAuthoring.NodeBuilders.AddinReferenceNodeBuilder"/> + <NodeBuilder class = "MonoDevelop.AddinAuthoring.NodeBuilders.ReferenceNodeBuilder"/> +<!-- <NodeBuilder class = "MonoDevelop.AddinAuthoring.NodeBuilders.ProjectFolderNodeBuilderExtension"/>--> + <NodeBuilder class = "MonoDevelop.AddinAuthoring.NodeBuilders.AddinFolderNodeBuilder"/> </Extension> <Extension path = "/MonoDevelop/Ide/ProjectTemplates"> @@ -102,14 +138,10 @@ </Condition> </Extension> -<!-- <Extension path = "/MonoDevelop/Ide/DisplayBindings"> - <DisplayBinding class = "MonoDevelop.AddinAuthoring.AddinDescriptionDisplayBinding" insertbefore="DefaultDisplayBinding"/> - </Extension> ---> - <Extension path = "/MonoDevelop/Core/StockIcons"> <StockIcon stockid = "md-addinauthoring-newclass" icon = "md-class|res:flare.png" size="Menu" /> <StockIcon stockid = "md-addinauthoring-newinterface" icon = "md-interface|res:flare.png" size="Menu" /> + <StockIcon stockid = "md-extension" icon = "res:extension.png" size="Menu" /> <StockIcon stockid = "md-extension-point" icon = "res:extension-point.png" size="Menu" /> <StockIcon stockid = "md-extension-node-type" icon = "res:extension-node-type.png" size="Menu" /> <StockIcon stockid = "md-extension-node" icon = "res:extension-node-type.png" size="Menu" /> @@ -132,4 +164,38 @@ <ItemProperty class = "MonoDevelop.Projects.DotNetProject" name = "ExtensionDomain" type = "System.String" external="false"/> </Extension> + + <Extension path = "/MonoDevelop/Ide/WorkbenchContexts/Edit"> + <ContextPad id = "ExtensionTreePad" /> + </Extension> + + <Extension path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Project"> + <CommandItem id = "MonoDevelop.AddinAuthoring.Commands.AddExtensionPoint" /> + <CommandItem id = "MonoDevelop.AddinAuthoring.Commands.AddExtension" /> + </Extension> + + <Extension path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/Extension"> + <CommandItem id="MonoDevelop.AddinAuthoring.Commands.AddNode" /> + <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete" /> + </Extension> + + <Extension path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionPoint"> + <CommandItem id="MonoDevelop.AddinAuthoring.Commands.AddNode" /> + <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete" /> + </Extension> + + <Extension path = "/MonoDevelop/AddinAuthoring/ContextMenu/ExtensionModelPad/ExtensionNode"> + <ItemSet id="InsertBefore" _label="Insert Before" autohide="true"> + <CommandItem id="MonoDevelop.AddinAuthoring.Commands.AddNodeBefore" /> + </ItemSet> + <ItemSet id="InsertAfter" _label="Insert After" autohide="true"> + <CommandItem id="MonoDevelop.AddinAuthoring.Commands.AddNodeAfter" /> + </ItemSet> + <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete" /> + </Extension> + + <Extension path = "/MonoDevelop/ProjectModel/PolicySets/Mono" > + <Policies resource="AddinXmlPolicy.xml" /> + <Policies resource="AddinTextStylePolicy.xml" /> + </Extension> </Addin> diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.csproj b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.csproj index 116f9c78ba..efc97dac9b 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.csproj +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.csproj @@ -24,6 +24,11 @@ <Execution> <Execution clr-version="Net_2_0" /> </Execution> + <CustomCommands> + <CustomCommands> + <Command type="Execute" command="../../main/build/bin/MonoDevelop.exe" /> + </CustomCommands> + </CustomCommands> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -43,7 +48,6 @@ <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ProjectFolderNodeBuilderExtension.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinFolderNodeBuilder.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\AddinData.cs" /> - <Compile Include="MonoDevelop.AddinAuthoring\AddinDescriptionView.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\AddinDescriptionWidget.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\AddinFileDescriptionTemplate.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\AddinOptionPanelWidget.cs" /> @@ -65,12 +69,9 @@ <Compile Include="MonoDevelop.AddinAuthoring\NodeTypeEditorDialog.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\SelectNodeSetDialog.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinHeaderNodeBuilder.cs" /> - <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionPointsNodeBuilder.cs" /> - <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionsNodeBuilder.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\ExtensionPointsEditorWidget.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ReferencesFolderNodeBuilder.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinReferenceNodeBuilder.cs" /> - <Compile Include="MonoDevelop.AddinAuthoring\AddinDescriptionDisplayBinding.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\AddinProjectReference.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\NewRegistryDialog.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.CodeCompletion\CodeCompletionExtension.cs" /> @@ -93,6 +94,33 @@ <Compile Include="MonoDevelop.AddinAuthoring\ExtensionDomain.cs" /> <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ReferenceNodeBuilder.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\TypeCellEditor.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ProjectNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionPointNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionNodeNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\ExtensionModelTypeNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\Util.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinCategoryGroup.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinGroup.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinCategoryNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\ExtensionNodeTree.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\ExtensionNodeInfo.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\ExtensionModelBrowser.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\ExtensionModelBrowserWidget.cs" /> + <Compile Include="gtk-gui\MonoDevelop.AddinAuthoring.ExtensionModelBrowserWidget.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\AddinNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\SolutionNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.Gui\AddinView.cs" /> + <Compile Include="gtk-gui\MonoDevelop.AddinAuthoring.Gui.AddinView.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.Gui\ExtensionPointView.cs" /> + <Compile Include="gtk-gui\MonoDevelop.AddinAuthoring.Gui.ExtensionPointView.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.Gui\ExtensionView.cs" /> + <Compile Include="gtk-gui\MonoDevelop.AddinAuthoring.Gui.ExtensionView.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.Gui\ExtensionNodeView.cs" /> + <Compile Include="gtk-gui\MonoDevelop.AddinAuthoring.Gui.ExtensionNodeView.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring.NodeBuilders\RegistryNodeBuilder.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\AddinDescriptionDisplayBinding.cs" /> + <Compile Include="MonoDevelop.AddinAuthoring\AddinDescriptionView.cs" /> <Compile Include="MonoDevelop.AddinAuthoring\DomAssemblyReflector.cs" /> </ItemGroup> <ItemGroup> @@ -126,9 +154,17 @@ <EmbeddedResource Include="addin-reference.png"> <LogicalName>addin-reference.png</LogicalName> </EmbeddedResource> + <EmbeddedResource Include="extension.png"> + <LogicalName>extension.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="AddinXmlPolicy.xml"> + <LogicalName>AddinXmlPolicy.xml</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="AddinTextStylePolicy.xml"> + <LogicalName>AddinTextStylePolicy.xml</LogicalName> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <Reference Include="Mono.Posix" /> <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> @@ -206,6 +242,11 @@ <Reference Include="MonoDevelop.Debugger.Soft, Version=2.2.0.0, Culture=neutral"> <Package>monodevelop-core-addins</Package> </Reference> + <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="gtkhtml-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="Mono.Debugger.Soft, Version=0.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"> + <Package>monodevelop-core-addins</Package> + </Reference> <Reference Include="Mono.Addins, Version=0.5.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> <Reference Include="Mono.Addins.Setup, Version=0.5.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> <Reference Include="Mono.Debugging, Version=0.0.0.0, Culture=neutral, PublicKeyToken=5e9ce85b0923c84f"> @@ -214,16 +255,18 @@ <Reference Include="Mono.Debugging.Soft, Version=0.0.0.0, Culture=neutral, PublicKeyToken=5e9ce85b0923c84f"> <Package>monodevelop-core-addins</Package> </Reference> - <Reference Include="Mono.Debugger.Soft, Version=0.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"> - <Package>monodevelop-core-addins</Package> - </Reference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <MonoDevelop> <Properties> + <Policies> + <ChangeLogPolicy UpdateMode="None" inheritsSet="Mono"> + <MessageStyle LineAlign="0" /> + </ChangeLogPolicy> + </Policies> <GtkDesignInfo gettextClass="Mono.Addins.AddinManager.CurrentLocalizer" /> - <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="MonoDevelop.AddinAuthoring.make" SyncReferences="true" RelativeConfigureInPath="../../"> + <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="MonoDevelop.AddinAuthoring.make" BuildTargetName="" SyncReferences="true" RelativeConfigureInPath="../../"> <BuildFilesVar Sync="true" Name="FILES" /> <DeployFilesVar /> <ResourcesVar Sync="true" Name="RESOURCES" /> @@ -235,4 +278,7 @@ </Properties> </MonoDevelop> </ProjectExtensions> + <ItemGroup> + <Folder Include="MonoDevelop.AddinAuthoring.Gui\" /> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.make b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.make index ae61f121a6..b275948011 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.make +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.make @@ -48,8 +48,13 @@ FILES = \ gtk-gui/MonoDevelop.AddinAuthoring.AddinFeatureWidget.cs \ gtk-gui/MonoDevelop.AddinAuthoring.AddinOptionPanelWidget.cs \ gtk-gui/MonoDevelop.AddinAuthoring.ExtensionEditorWidget.cs \ + gtk-gui/MonoDevelop.AddinAuthoring.ExtensionModelBrowserWidget.cs \ gtk-gui/MonoDevelop.AddinAuthoring.ExtensionPointsEditorWidget.cs \ gtk-gui/MonoDevelop.AddinAuthoring.ExtensionSelectorDialog.cs \ + gtk-gui/MonoDevelop.AddinAuthoring.Gui.AddinView.cs \ + gtk-gui/MonoDevelop.AddinAuthoring.Gui.ExtensionNodeView.cs \ + gtk-gui/MonoDevelop.AddinAuthoring.Gui.ExtensionPointView.cs \ + gtk-gui/MonoDevelop.AddinAuthoring.Gui.ExtensionView.cs \ gtk-gui/MonoDevelop.AddinAuthoring.NewExtensionPointDialog.cs \ gtk-gui/MonoDevelop.AddinAuthoring.NewRegistryDialog.cs \ gtk-gui/MonoDevelop.AddinAuthoring.NodeSetEditorDialog.cs \ @@ -60,14 +65,27 @@ FILES = \ gtk-gui/MonoDevelop.AddinAuthoring.SelectRepositoryDialog.cs \ gtk-gui/MonoDevelop.AddinAuthoring.TypeSelector.cs \ MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs \ + MonoDevelop.AddinAuthoring.Gui/AddinView.cs \ + MonoDevelop.AddinAuthoring.Gui/ExtensionNodeView.cs \ + MonoDevelop.AddinAuthoring.Gui/ExtensionPointView.cs \ + MonoDevelop.AddinAuthoring.Gui/ExtensionView.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryGroup.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/AddinCategoryNodeBuilder.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/AddinFolderNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/AddinGroup.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/AddinHeaderNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/AddinNodeBuilder.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/AddinReferenceNodeBuilder.cs \ - MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointsNodeBuilder.cs \ - MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionsNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionModelTypeNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/ProjectFolderNodeBuilderExtension.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/ProjectNodeBuilder.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/ReferenceNodeBuilder.cs \ MonoDevelop.AddinAuthoring.NodeBuilders/ReferencesFolderNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/RegistryNodeBuilder.cs \ + MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs \ MonoDevelop.AddinAuthoring/AddinAuthoringService.cs \ MonoDevelop.AddinAuthoring/AddinData.cs \ MonoDevelop.AddinAuthoring/AddinDescriptionDisplayBinding.cs \ @@ -83,6 +101,10 @@ FILES = \ MonoDevelop.AddinAuthoring/DomAssemblyReflector.cs \ MonoDevelop.AddinAuthoring/ExtensionDomain.cs \ MonoDevelop.AddinAuthoring/ExtensionEditorWidget.cs \ + MonoDevelop.AddinAuthoring/ExtensionModelBrowser.cs \ + MonoDevelop.AddinAuthoring/ExtensionModelBrowserWidget.cs \ + MonoDevelop.AddinAuthoring/ExtensionNodeInfo.cs \ + MonoDevelop.AddinAuthoring/ExtensionNodeTree.cs \ MonoDevelop.AddinAuthoring/ExtensionPointsEditorWidget.cs \ MonoDevelop.AddinAuthoring/ExtensionSelectorDialog.cs \ MonoDevelop.AddinAuthoring/NewExtensionPointDialog.cs \ @@ -97,12 +119,16 @@ FILES = \ MonoDevelop.AddinAuthoring/SelectRepositoryDialog.cs \ MonoDevelop.AddinAuthoring/SolutionAddinData.cs \ MonoDevelop.AddinAuthoring/TypeCellEditor.cs \ - MonoDevelop.AddinAuthoring/TypeSelector.cs + MonoDevelop.AddinAuthoring/TypeSelector.cs \ + MonoDevelop.AddinAuthoring/Util.cs DATA_FILES = RESOURCES = \ addin-reference.png \ + AddinTextStylePolicy.xml \ + AddinXmlPolicy.xml \ + extension.png \ extension-node-set.png \ extension-node-type.png \ extension-point.png \ @@ -117,7 +143,8 @@ EXTRAS = \ monodevelop.addinauthoring.pc.in REFERENCES = \ - Mono.Posix \ + -pkg:glib-sharp-2.0 \ + -pkg:gtkhtml-sharp-3.14 \ -pkg:gtk-sharp-2.0 \ -pkg:mono-addins \ -pkg:mono-addins-setup \ diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.sln b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.sln index 429b1195d7..b669cf8432 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.sln +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.sln @@ -18,7 +18,6 @@ Global Policies = $0
$0.ChangeLogPolicy = $1
$1.UpdateMode = None
- $1.VcsIntegration = None
$1.MessageStyle = $2
$2.LineAlign = 0
$1.inheritsSet = Mono
diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs index 738f93c7d7..e982c8a861 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs @@ -41,6 +41,8 @@ using MonoDevelop.Projects; using MonoDevelop.Core.Serialization; using MonoDevelop.Projects.Formats.MSBuild; using MonoDevelop.Xml.Formatting; +using MonoDevelop.Projects.Policies; +using MonoDevelop.Ide; namespace MonoDevelop.AddinAuthoring { @@ -52,7 +54,7 @@ namespace MonoDevelop.AddinAuthoring static AddinAuthoringService () { if (IdeApp.IsInitialized) { - IdeApp.ProjectOperations.EndBuild += OnEndBuild; + //IdeApp.ProjectOperations.EndBuild += OnEndBuild; } configFile = Path.Combine (PropertyService.ConfigPath, "AddinAuthoring.config"); @@ -71,6 +73,21 @@ namespace MonoDevelop.AddinAuthoring if (config == null) config = new AddinAuthoringServiceConfig (); } + + static Document browserDocument; + + public static void ShowExtensionModelBrowser () + { + if (browserDocument != null) + browserDocument.Select (); + else { + ExtensionModelBrowser browser = new ExtensionModelBrowser (); + browserDocument = IdeApp.Workbench.OpenDocument (browser, true); + browserDocument.Closed += delegate { + browserDocument = null; + }; + } + } static void SaveConfig () { @@ -169,60 +186,24 @@ namespace MonoDevelop.AddinAuthoring internal static void AddReferences (AddinData data, object[] addins) { - AddinDescription desc = data.LoadAddinManifest (); - AddinDescriptionView view = FindLoadedDescription (data); - foreach (Addin ad in addins) { + AddinDescription desc = data.CachedAddinManifest; + foreach (Addin ad in addins) AddReference (desc, ad); - if (view != null) - AddReference (view.AddinDescription, ad); - } - if (view != null) { - view.Update (); - view.BeginInternalUpdate (); - } - try { - desc.Save (); - data.NotifyChanged (true); - } finally { - if (view != null) - view.EndInternalUpdate (); - } + data.SaveAddinManifest (); + data.NotifyChanged (false); } internal static void RemoveReferences (AddinData data, string[] fullIds) { - AddinDescription desc = data.LoadAddinManifest (); - AddinDescriptionView view = FindLoadedDescription (data); - foreach (string ad in fullIds) { + AddinDescription desc = data.CachedAddinManifest; + foreach (string ad in fullIds) RemoveReference (desc, ad); - if (view != null) - RemoveReference (view.AddinDescription, ad); - } - if (view != null) { - view.Update (); - view.BeginInternalUpdate (); - } - try { - desc.Save (); - data.NotifyChanged (true); - } finally { - if (view != null) - view.EndInternalUpdate (); - } + data.SaveAddinManifest (); + data.NotifyChanged (false); } - static AddinDescriptionView FindLoadedDescription (AddinData data) - { - foreach (Document doc in IdeApp.Workbench.Documents) { - AddinDescriptionView view = doc.GetContent <AddinDescriptionView> (); - if (view != null && view.Data == data) - return view; - } - return null; - } - static void AddReference (AddinDescription desc, Addin addin) { foreach (AddinDependency adep in desc.MainModule.Dependencies) { @@ -302,27 +283,14 @@ namespace MonoDevelop.AddinAuthoring return false; } - public static void SaveFormatted (AddinDescription adesc) + public static void SaveFormatted (PolicyContainer policies, AddinDescription adesc) { XmlDocument doc = adesc.SaveToXml (); XmlFormatter formatter = new XmlFormatter (); - TextStylePolicy textPolicy = new TextStylePolicy (80, 4, false, false, true, EolMarker.Unix); - XmlFormattingPolicy xmlPolicy = new XmlFormattingPolicy (); + TextStylePolicy textPolicy = policies.Get<TextStylePolicy> (DesktopService.GetMimeTypeInheritanceChain ("application/x-addin+xml")); + XmlFormattingPolicy xmlPolicy = policies.Get<XmlFormattingPolicy> (DesktopService.GetMimeTypeInheritanceChain ("application/x-addin+xml")); - XmlFormattingSettings f = new XmlFormattingSettings (); - f.ScopeXPath.Add ("*/*"); - f.EmptyLinesBeforeStart = 1; - f.EmptyLinesAfterEnd = 1; - xmlPolicy.Formats.Add (f); - - f = new XmlFormattingSettings (); - f.ScopeXPath.Add ("Addin"); - f.AttributesInNewLine = true; - f.AlignAttributes = true; - f.AttributesInNewLine = false; - xmlPolicy.Formats.Add (f); - string xml = XmlFormatter.FormatXml (textPolicy, xmlPolicy, doc.OuterXml); File.WriteAllText (adesc.FileName, xml); } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs index a13c2aca4f..28d06dd2f8 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs @@ -36,6 +36,8 @@ using MonoDevelop.Projects; using MonoDevelop.Core.Serialization; using Mono.Addins; using Mono.Addins.Description; +using MonoDevelop.Xml.Formatting; + namespace MonoDevelop.AddinAuthoring { @@ -51,6 +53,7 @@ namespace MonoDevelop.AddinAuthoring AddinDescription compiledManifest; FileSystemWatcher watcher; DateTime lastNotifiedTimestamp; + object changeLock = new object (); public event EventHandler Changed; internal static event AddinSupportEventHandler AddinSupportChanged; @@ -113,10 +116,12 @@ namespace MonoDevelop.AddinAuthoring void OnDescFileChanged (object s, EventArgs a) { Gtk.Application.Invoke (delegate { - DateTime tim = File.GetLastWriteTime (AddinManifestFileName); - if (tim != lastNotifiedTimestamp) { - lastNotifiedTimestamp = tim; - NotifyChanged (true); + lock (changeLock) { + DateTime tim = File.GetLastWriteTime (AddinManifestFileName); + if (tim != lastNotifiedTimestamp) { + lastNotifiedTimestamp = tim; + NotifyChanged (true); + } } }); } @@ -132,10 +137,6 @@ namespace MonoDevelop.AddinAuthoring public static AddinData GetAddinData (DotNetProject project) { - // Extensibility options are only available when a project belongs to a solution - if (project.ParentSolution == null) - return null; - AddinData data = project.ExtendedProperties ["MonoDevelop.AddinAuthoring"] as AddinData; if (data != null) return data; @@ -186,6 +187,16 @@ namespace MonoDevelop.AddinAuthoring } } + public void SaveAddinManifest () + { + lock (changeLock) { + if (manifest != null) { + AddinAuthoringService.SaveFormatted (project.Policies, manifest); + lastNotifiedTimestamp = File.GetLastWriteTime (manifest.FileName); + } + } + } + public AddinDescription LoadAddinManifest () { AddinDescription d = AddinRegistry.ReadAddinManifestFile (AddinManifestFileName); @@ -229,11 +240,18 @@ namespace MonoDevelop.AddinAuthoring NotifyChanged (true); } } + + AddinRegistry tempRegistry; public AddinRegistry AddinRegistry { get { if (registry != null) return registry; + if (project.ParentSolution == null) { + if (tempRegistry == null) + tempRegistry = new AddinRegistry ("."); + return tempRegistry; + } return SetRegistry (); } } @@ -276,6 +294,8 @@ namespace MonoDevelop.AddinAuthoring void SyncRoot () { + if (project.ParentSolution == null) + return; if (CachedAddinManifest.IsRoot != isRoot) { isRoot = CachedAddinManifest.IsRoot; registry = null; @@ -290,7 +310,7 @@ namespace MonoDevelop.AddinAuthoring foreach (AddinDependency adep in CachedAddinManifest.MainModule.Dependencies) { bool found = false; foreach (ProjectReference pr in Project.References) { - if ((pr is AddinProjectReference) && pr.Reference == adep.FullAddinId) { + if ((pr is AddinProjectReference) && ((AddinProjectReference)pr).AddinId == adep.FullAddinId) { found = true; break; } else if (pr.ReferenceType == ReferenceType.Project) { @@ -309,7 +329,7 @@ namespace MonoDevelop.AddinAuthoring updating = true; DotNetProject p = FindProjectImplementingAddin (adep.FullAddinId); if (p != null) - Project.References.Add (new ProjectReference (p)); + Project.References.Add (new ProjectReference (p) { LocalCopy = false }); else Project.References.Add (new AddinProjectReference (adep.FullAddinId)); } finally { @@ -322,7 +342,7 @@ namespace MonoDevelop.AddinAuthoring ArrayList toDelete = new ArrayList (); foreach (ProjectReference pr in Project.References) { - if ((pr is AddinProjectReference) && !addinRefs.ContainsKey (pr.Reference)) + if ((pr is AddinProjectReference) && !addinRefs.ContainsKey (((AddinProjectReference)pr).AddinId)) toDelete.Add (pr); } foreach (ProjectReference pr in toDelete) diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionDisplayBinding.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionDisplayBinding.cs index 19fe049bc1..5ae4e7fa4d 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionDisplayBinding.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionDisplayBinding.cs @@ -62,7 +62,7 @@ namespace MonoDevelop.AddinAuthoring { DotNetProject p = IdeApp.Workspace.GetProjectContainingFile (fileName) as DotNetProject; AddinData data = AddinData.GetAddinData (p); - return new AddinDescriptionView (data); + return new AddinDescriptionView (data, fileName); } public IViewContent CreateContentForMimeType (string mimeType, System.IO.Stream content) diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs index 70725522d6..525053aa33 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs @@ -17,12 +17,13 @@ namespace MonoDevelop.AddinAuthoring AddinDescription adesc; DateTime descTimestamp; bool inInternalUpdate; + string manifestFile; - public AddinDescriptionView (AddinData data) + public AddinDescriptionView (AddinData data, string manifestFile) { this.data = data; - ContentName = data.Project.Name + " Extension Model"; - //ContentName = data.AddinManifestFileName; + this.manifestFile = manifestFile; + ContentName = manifestFile; Project = data.Project; descWidget = new AddinDescriptionWidget (); @@ -74,7 +75,7 @@ namespace MonoDevelop.AddinAuthoring public override void Save () { descWidget.Save (); - AddinAuthoringService.SaveFormatted (adesc); + AddinAuthoringService.SaveFormatted (data.Project.Policies, adesc); IsDirty = false; data.NotifyChanged (true); } @@ -87,7 +88,7 @@ namespace MonoDevelop.AddinAuthoring internal void EndInternalUpdate () { inInternalUpdate = false; - descTimestamp = File.GetLastWriteTime (data.AddinManifestFileName); + descTimestamp = File.GetLastWriteTime (manifestFile); } public void Update () @@ -97,15 +98,15 @@ namespace MonoDevelop.AddinAuthoring public void Reload () { - adesc = data.AddinRegistry.ReadAddinManifestFile (data.AddinManifestFileName); + adesc = data.AddinRegistry.ReadAddinManifestFile (manifestFile); descWidget.Fill (adesc, data); IsDirty = false; - descTimestamp = File.GetLastWriteTime (data.AddinManifestFileName); + descTimestamp = File.GetLastWriteTime (manifestFile); } void OnDataChanged (object s, EventArgs a) { - if (inInternalUpdate || descTimestamp == File.GetLastWriteTime (data.AddinManifestFileName)) + if (inInternalUpdate || descTimestamp == File.GetLastWriteTime (manifestFile)) return; if (IsDirty) { string q = AddinManager.CurrentLocalizer.GetString ("The add-in manifest for project '{0}' has been modified. Do you want to reload it? (unsaved changes will be lost)", data.Project.Name); diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinFeatureWidget.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinFeatureWidget.cs index 0ea6180984..6466b5c2c6 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinFeatureWidget.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinFeatureWidget.cs @@ -226,7 +226,7 @@ namespace MonoDevelop.AddinAuthoring if (AddinData.GetAddinData ((DotNetProject)entry) != null) return FeatureSupportLevel.Enabled; else - return FeatureSupportLevel.Supported; + return FeatureSupportLevel.SupportedByDefault; } else return FeatureSupportLevel.NotSupported; diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectExtension.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectExtension.cs index b7d04bc55d..355ad4e78a 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectExtension.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectExtension.cs @@ -7,21 +7,51 @@ using MonoDevelop.Core.Execution; using MonoDevelop.Core.ProgressMonitoring; using Mono.Addins.Description; using Mono.Addins; +using MonoDevelop.Ide; namespace MonoDevelop.AddinAuthoring { public class AddinProjectExtension: ProjectServiceExtension { + static bool buildingSolution; + + public override bool SupportsItem (IBuildTarget item) + { + return IdeApp.IsInitialized && (item is Solution); + } + + protected override BuildResult Build (IProgressMonitor monitor, Solution solution, ConfigurationSelector configuration) + { + try { + buildingSolution = true; + BuildResult res = base.Build (monitor, solution, configuration); + if (res.ErrorCount == 0) { + SolutionAddinData data = solution.GetAddinData (); + if (data != null && data.Registry != null) { + data.Registry.Update (new ProgressStatusMonitor (monitor)); + DispatchService.GuiDispatch (delegate { + data.NotifyChanged (); + }); + } + } + return res; + } finally { + buildingSolution = false; + } + } + protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration) { + DotNetProject project = entry as DotNetProject; + AddinData data = project != null ? AddinData.GetAddinData (project) : null; + if (data != null) + monitor.BeginTask (null, buildingSolution ? 2 : 3); + BuildResult res = base.Build (monitor, entry, configuration); - if (res.ErrorCount > 0 || !(entry is DotNetProject)) + if (res.ErrorCount > 0 || data == null) return res; - DotNetProject project = (DotNetProject) entry; - AddinData data = AddinData.GetAddinData (project); - if (data == null) - return res; + monitor.Step (1); monitor.Log.WriteLine (AddinManager.CurrentLocalizer.GetString ("Verifying add-in description...")); string fileName = data.AddinManifestFileName; @@ -43,6 +73,19 @@ namespace MonoDevelop.AddinAuthoring monitor.Log.WriteLine ("ERROR: " + err); } + if (!buildingSolution && project.ParentSolution != null) { + monitor.Step (1); + SolutionAddinData sdata = project.ParentSolution.GetAddinData (); + if (sdata != null && sdata.Registry != null) { + sdata.Registry.Update (new ProgressStatusMonitor (monitor)); + DispatchService.GuiDispatch (delegate { + sdata.NotifyChanged (); + }); + } + } + + monitor.EndTask (); + return res; } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectReference.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectReference.cs index 0ec1641564..7034496a1b 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectReference.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinProjectReference.cs @@ -45,18 +45,41 @@ namespace MonoDevelop.AddinAuthoring public AddinProjectReference () { + LocalCopy = false; } - public AddinProjectReference (string reference): base (ReferenceType.Custom, reference) + public AddinProjectReference (string addinId): base (ReferenceType.Custom, EncodeId (addinId)) { + LocalCopy = false; + } + + public string AddinId { + get { return DecodeId (Reference); } + } + + static string EncodeId (string addinId) + { + int i = addinId.LastIndexOf (','); + if (i == -1) + throw new ArgumentException ("Invalid add-in id"); + return addinId.Substring (0, i) + ":" + addinId.Substring (i+1); + } + + static string DecodeId (string reference) + { + int i = reference.LastIndexOf (':'); + if (i == -1) + throw new ArgumentException ("Invalid add-in reference"); + return reference.Substring (0, i) + "," + reference.Substring (i+1); } public override string[] GetReferencedFileNames (ConfigurationSelector configuration) { if (OwnerProject != null) { + string aid = AddinId; AddinData data = AddinData.GetAddinData ((DotNetProject)OwnerProject); if (data != null) { - Addin addin = data.AddinRegistry.GetAddin (Reference); + Addin addin = data.AddinRegistry.GetAddin (aid); if (addin != null) { List<string> list = new List<string> (); foreach (string asm in addin.Description.MainModule.Assemblies) { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Commands.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Commands.cs index 9c5ee2e139..3c0287bcc4 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Commands.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Commands.cs @@ -1,11 +1,26 @@ using System; +using MonoDevelop.Components.Commands; +using MonoDevelop.Ide.Gui; namespace MonoDevelop.AddinAuthoring { public enum Commands { AddAddinDependency, - AddExtension + AddExtension, + AddNode, + AddNodeBefore, + AddNodeAfter, + ExtensionModelBrowser, + AddExtensionPoint, + } + + class ExtensionModelBrowserHandler: CommandHandler + { + protected override void Run () + { + AddinAuthoringService.ShowExtensionModelBrowser (); + } } } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowser.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowser.cs new file mode 100644 index 0000000000..2b2d5021da --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowser.cs @@ -0,0 +1,61 @@ +// +// ExtensionModelBrowser.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Projects; + +namespace MonoDevelop.AddinAuthoring +{ + public class ExtensionModelBrowser: AbstractViewContent + { + ExtensionModelBrowserWidget widget; + + public ExtensionModelBrowser () + { + ContentName = "Extension Model Browser"; + } + + public override void Load (string fileName) + { + } + + public override Gtk.Widget Control { + get { + if (widget == null) + widget = new ExtensionModelBrowserWidget (); + return widget; + } + } + + public void Dispose () + { + if (widget != null) + widget.Destroy (); + } + + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowserWidget.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowserWidget.cs new file mode 100644 index 0000000000..9474195f32 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionModelBrowserWidget.cs @@ -0,0 +1,146 @@ +// +// ExtensionModelBrowserWidget.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using MonoDevelop.Ide.Gui.Components; +using MonoDevelop.AddinAuthoring.NodeBuilders; +using MonoDevelop.Ide; +using MonoDevelop.Core; +using Mono.Addins.Description; +using MonoDevelop.AddinAuthoring.Gui; +using MonoDevelop.Projects; +using Mono.Addins; + +namespace MonoDevelop.AddinAuthoring +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class ExtensionModelBrowserWidget : Gtk.Bin + { + ExtensibleTreeView tree; + Gtk.Widget docView; + + 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 (var item in IdeApp.Workspace.Items) { + if (item is Solution) { + Solution sol = (Solution) item; + SolutionAddinData data = sol.GetAddinData (); + if (data != null) { + RegistryInfo reg = new RegistryInfo (); + reg.ApplicationName = data.ApplicationName; + reg.CachedRegistry = data.Registry; + tree.AddChild (reg); + } + } + } + + docView = new Gtk.Label (); + paned.Add2 (docView); + + tree.ShadowType = Gtk.ShadowType.In; + tree.Tree.Selection.Changed += HandleSelectionChanged; + } + + void HandleSelectionChanged (object sender, EventArgs e) + { + ITreeNavigator nav = tree.GetSelectedNode (); + if (nav != null) + ShowDocumentation (nav.DataItem); + } + + void ShowDocumentation (object ob) + { + if (docView != null) { + paned.Remove (docView); + docView.Destroy (); + docView = null; + } + + ITreeNavigator nav = tree.GetSelectedNode (); + RegistryInfo regInfo = (RegistryInfo) nav.GetParentDataItem (typeof(RegistryInfo), true); + AddinRegistry reg = regInfo.CachedRegistry; + + if (ob is AddinDescription) { + AddinView view = new AddinView (); + view.Fill ((AddinDescription) ob); + docView = view; + } + else if (ob is ExtensionPoint) { + ExtensionPointView view = new ExtensionPointView (); + view.Fill ((ExtensionPoint) ob, reg); + docView = view; + } + else if (ob is Extension) { + ExtensionView view = new ExtensionView (); + view.Fill ((Extension) ob, nav); + docView = view; + } + else if (ob is ExtensionNodeInfo) { + ExtensionNodeView view = new ExtensionNodeView (); + view.Fill (((ExtensionNodeInfo) ob).Node); + docView = view; + } + + if (docView == null) + docView = new Gtk.Label (); + + docView.ShowAll (); + paned.Add2 (docView); + } + + protected void OnButtonAddClicked (object sender, System.EventArgs e) + { + SelectRepositoryDialog dlg = new SelectRepositoryDialog (null); + dlg.TransientFor = this.Toplevel as Gtk.Window; + if (dlg.Run () == (int) Gtk.ResponseType.Ok) { + RegistryInfo reg = dlg.SelectedApplication; + tree.AddChild (reg); + } + dlg.Destroy (); + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeInfo.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeInfo.cs new file mode 100644 index 0000000000..46abe24aa0 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeInfo.cs @@ -0,0 +1,137 @@ +// +// ExtensionNodeInfo.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Mono.Addins.Description; +using System.Linq; +using System.Collections.Generic; + +namespace MonoDevelop.AddinAuthoring +{ + public class ExtensionNodeInfo + { + public int Order { get; set; } + public ExtensionNodeDescription Node { get; set; } + public List<ExtensionNodeInfo> Children { get; set; } + + public ExtensionNodeInfo (ExtensionNodeDescription node, bool canModify) + { + this.Node = node; + this.CanModify = canModify; + } + + public ExtensionNodeInfo (ExtensionNodeDescription node, bool canModify, int order) + { + this.Node = node; + this.CanModify = canModify; + this.Order = order; + } + + public bool CanModify { + get; set; + } + + public void Add (ExtensionNodeInfo child) + { + if (Children == null) + Children = new List<ExtensionNodeInfo> (); + Children.Add (child); + } + + public ExtensionNodeInfo GetChild (string name) + { + if (Children == null) + return null; + return Children.FirstOrDefault (n => n.Node.Id == name); + } + + public List<ExtensionNodeInfo> Expand () + { + if (Children != null) + return Children; + Children = new List<ExtensionNodeInfo> (); + int i = 0; + foreach (ExtensionNodeDescription n in Node.ChildNodes) + Children.Add (new ExtensionNodeInfo (n, CanModify) { Order = i++ }); + return Children; + } + + public bool HasChildren { + get { return Node.ChildNodes.Count > 0; } + } + + public void NotifyChanged () + { + if (Changed != null) + Changed (this, EventArgs.Empty); + } + + public override bool Equals (object obj) + { + ExtensionNodeInfo en = obj as ExtensionNodeInfo; + return en != null && Node == en.Node; + } + + public override int GetHashCode () + { + return Node.GetHashCode (); + } + + + + public event EventHandler Changed; + } + + public class ExtensionNodeInfoList: System.Collections.ObjectModel.Collection<ExtensionNodeInfo> + { + protected override void InsertItem (int index, ExtensionNodeInfo item) + { + base.InsertItem (index, item); + UpdateOrder (index); + } + + protected override void SetItem (int index, ExtensionNodeInfo item) + { + base.SetItem (index, item); + item.Order = index; + } + + protected override void RemoveItem (int index) + { + base.RemoveItem (index); + UpdateOrder (index); + } + + void UpdateOrder (int index) + { + for (int n=index; n<Count; n++) + this[n].Order = n; + } + + + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeTree.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeTree.cs new file mode 100644 index 0000000000..8db5b38cc8 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/ExtensionNodeTree.cs @@ -0,0 +1,198 @@ +// +// ExtensionNodeBuilder.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using MonoDevelop.Core; +using MonoDevelop.Projects; +using Mono.Addins; +using Mono.Addins.Description; +using System.Collections.Generic; + +namespace MonoDevelop.AddinAuthoring +{ + public class ExtensionNodeTree + { + List<ExtensionNodeInfo> nodes = new List<ExtensionNodeInfo> (); + + public List<ExtensionNodeInfo> Nodes { + get { return this.nodes; } + } + + public void Fill (AddinRegistry reg, ExtensionPoint ep) + { + List<AddinDescription> deps = new List<AddinDescription> (); + foreach (var addinId in ep.ExtenderAddins) { + Addin ad = reg.GetAddin (addinId); + if (ad != null && ad.LocalId != ep.ParentAddinDescription.LocalId) + deps.Add (ad.Description); + } + Fill (ep.ParentAddinDescription, ep.ParentAddinDescription, ep.Path, deps); + } + + public void Fill (AddinRegistry reg, Extension ex) + { + Fill (reg, ex.ParentAddinDescription, ex.ParentAddinDescription, ex.Path); + } + + public void Fill (AddinData data, AddinDescription pdesc, string path) + { + Fill (data.AddinRegistry, data.CachedAddinManifest, pdesc, path); + } + + public void Fill (AddinRegistry reg, AddinDescription localDesc, AddinDescription pdesc, string path) + { + List<AddinDescription> deps = new List<AddinDescription> (); + + foreach (Dependency dep in pdesc.MainModule.Dependencies) { + AddinDependency adep = dep as AddinDependency; + if (adep == null) continue; + Addin addin = reg.GetAddin (adep.FullAddinId); + if (addin != null) + deps.Add (addin.Description); + } + Fill (localDesc, pdesc, path, deps); + } + + public void Fill (AddinDescription localDesc, AddinDescription pdesc, string path, List<AddinDescription> contributorAddins) + { + var extensions = new List<Extension> (); + var extNodes = new List<ExtensionNodeDescription> (); + + SortReferences (contributorAddins); + + foreach (AddinDescription desc in contributorAddins) + CollectExtensions (desc, path, extensions, extNodes); + + CollectExtensions (pdesc, path, extensions, extNodes); + + foreach (var node in extNodes) + nodes.Add (new ExtensionNodeInfo (node, node.ParentAddinDescription == localDesc)); + + foreach (Extension ext in extensions) { + bool canModify = ext.ParentAddinDescription == localDesc; + string subp = ext.Path.Substring (path.Length); + List<ExtensionNodeInfo> list = nodes; + foreach (string p in subp.Split ('/')) { + if (p.Length == 0) continue; + int i = FindNode (list, p); + if (i == -1) { + list = null; + break; + } + list = list [i].Expand (); + } + if (list != null) { + int insertPos = list.Count; + foreach (ExtensionNodeDescription n in ext.ExtensionNodes) { + if (!string.IsNullOrEmpty (n.InsertAfter)) { + int i = FindNode (list, n.InsertAfter); + if (i != -1) + insertPos = i + 1; + } + else if (!string.IsNullOrEmpty (n.InsertBefore)) { + int i = FindNode (list, n.InsertBefore); + if (i != -1) + insertPos = i; + } + list.Insert (insertPos++, new ExtensionNodeInfo (n, canModify)); + } + } + } + StoreOrder (nodes); + } + + int FindNode (List<ExtensionNodeInfo> list, string name) + { + if (list == null) + return -1; + for (int n = 0; n < list.Count; n++) { + if (list [n].Node.Id == name) + return n; + } + return -1; + } + + void StoreOrder (List<ExtensionNodeInfo> list) + { + for (int n = 0; n < list.Count; n++) { + ExtensionNodeInfo node = list [n]; + node.Order = n; + if (node.Children != null) + StoreOrder (node.Children); + } + } + + void SortReferences (List<AddinDescription> deps) + { + List<AddinDescription> sorted = new List<AddinDescription> (); + foreach (var desc in deps) { + int n; + for (n = 0; n < sorted.Count; n++) { + if (DependsOn (sorted[n], desc)) + break; + } + sorted.Insert (n, desc); + } + } + + bool DependsOn (AddinDescription a1, AddinDescription a2) + { + foreach (ModuleDescription module in a1.AllModules) { + foreach (Dependency dep in module.Dependencies) { + AddinDependency adep = dep as AddinDependency; + if (adep != null && adep.FullAddinId == a2.AddinId) + return true; + else + Console.WriteLine ("pp???:" + dep); + } + } + return false; + } + + void CollectExtensions (AddinDescription desc, string path, List<Extension> extensions, List<ExtensionNodeDescription> nodes) + { + foreach (Extension ext in desc.MainModule.Extensions) { + if (ext.Path == path || ext.Path.StartsWith (path + "/")) + extensions.Add (ext); + else if (path.StartsWith (ext.Path + "/")) { + string subp = path.Substring (ext.Path.Length); + ExtensionNodeDescription foundNode = null; + ExtensionNodeDescriptionCollection list = ext.ExtensionNodes; + foreach (string p in subp.Split ('/')) { + if (p.Length == 0) continue; + foundNode = list [p]; + if (foundNode == null) + break; + } + if (foundNode != null) { + foreach (ExtensionNodeDescription n in foundNode.ChildNodes) + nodes.Add (n); + } + } + } + } + } +} diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/NewRegistryDialog.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/NewRegistryDialog.cs index 1c28988048..d85f07a618 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/NewRegistryDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/NewRegistryDialog.cs @@ -50,5 +50,9 @@ namespace MonoDevelop.AddinAuthoring public string RegistryPath { get { return entryRegPath.Path; } } + + public string ApplicationPath { + get { return entryAppPath.Path; } + } } } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistryExtensionNode.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistryExtensionNode.cs index d95559b3b9..05d2fb596f 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistryExtensionNode.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistryExtensionNode.cs @@ -53,6 +53,8 @@ namespace MonoDevelop.AddinAuthoring [ItemProperty()] [NodeAttribute("testCommand")] string testCommand; + + internal AddinRegistry CachedRegistry { get; set; } public RegistryInfo () { diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistrySelector.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistrySelector.cs index b4782a3a95..efcf8aa6c0 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistrySelector.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/RegistrySelector.cs @@ -57,7 +57,7 @@ namespace MonoDevelop.AddinAuthoring SelectRepositoryDialog dlg = new SelectRepositoryDialog (appName); dlg.TransientFor = this.Toplevel as Gtk.Window; if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - appName = dlg.SelectedApplication; + appName = dlg.SelectedApplication.ApplicationName; UpdateLabel (); if (Changed != null) Changed (this, EventArgs.Empty); diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SelectRepositoryDialog.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SelectRepositoryDialog.cs index bd402c301c..ec22a5fda9 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SelectRepositoryDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SelectRepositoryDialog.cs @@ -3,6 +3,8 @@ using System; using Gtk; using Mono.Addins; using MonoDevelop.Components; +using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide; namespace MonoDevelop.AddinAuthoring { @@ -15,7 +17,7 @@ namespace MonoDevelop.AddinAuthoring { this.Build(); - store = new ListStore (typeof(string), typeof(string)); + store = new ListStore (typeof(string), typeof(string), typeof(RegistryInfo)); tree.AppendColumn (AddinManager.CurrentLocalizer.GetString ("Application"), new CellRendererText (), "text", 0); tree.AppendColumn (AddinManager.CurrentLocalizer.GetString ("Description"), new CellRendererText (), "text", 1); tree.Model = store; @@ -36,7 +38,7 @@ namespace MonoDevelop.AddinAuthoring TreeIter selIter = TreeIter.Zero; foreach (RegistryInfo reg in AddinAuthoringService.GetRegistries ()) { - TreeIter it = store.AppendValues (reg.ApplicationName, reg.Description); + TreeIter it = store.AppendValues (reg.ApplicationName, reg.Description, reg); if (reg.ApplicationName == selection) selIter = it; } @@ -51,11 +53,11 @@ namespace MonoDevelop.AddinAuthoring UpdateButtons (); } - public string SelectedApplication { + public RegistryInfo SelectedApplication { get { TreeIter it; if (tree.Selection.GetSelected (out it)) - return (string) store.GetValue (it, 0); + return (RegistryInfo) store.GetValue (it, 2); else return null; } @@ -68,28 +70,29 @@ namespace MonoDevelop.AddinAuthoring protected virtual void OnButtonAddClicked (object sender, System.EventArgs e) { -/* NewRegistryDialog dlg = new NewRegistryDialog (null); + NewRegistryDialog dlg = new NewRegistryDialog (null); dlg.TransientFor = this; if (dlg.Run () == (int) Gtk.ResponseType.Ok) { RegistryInfo reg = new RegistryInfo (); reg.ApplicationName = dlg.ApplicationName; + reg.ApplicationPath = dlg.ApplicationPath; reg.RegistryPath = dlg.RegistryPath; AddinAuthoringService.AddCustomRegistry (reg); Fill (null); } dlg.Destroy (); -*/ } + } protected virtual void OnButtonRemoveClicked (object sender, System.EventArgs e) { -/* string q = AddinManager.CurrentLocalizer.GetString ("Are you sure you want to remove this registry reference?"); + string q = AddinManager.CurrentLocalizer.GetString ("Are you sure you want to remove this registry reference?"); if (MessageService.Confirm (q, AlertButton.Remove)) { TreeIter it; tree.Selection.GetSelected (out it); - RegistryInfo reg = (RegistryInfo) store.GetValue (it, 3); + RegistryInfo reg = (RegistryInfo) store.GetValue (it, 2); AddinAuthoringService.RemoveCustomRegistry (reg); Fill (null); } -*/ } + } } } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SolutionAddinData.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SolutionAddinData.cs index 03ca3156c5..c35cae6585 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SolutionAddinData.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/SolutionAddinData.cs @@ -32,7 +32,6 @@ using MonoDevelop.Projects; using Mono.Addins; using Mono.Addins.Setup; using MonoDevelop.Ide; -using MonoDevelop.Ide.Gui; namespace MonoDevelop.AddinAuthoring { @@ -48,7 +47,10 @@ namespace MonoDevelop.AddinAuthoring } FilePath TempRegistryPath { - get { return solution.BaseDirectory.Combine (".temp-addin-registry").Combine (IdeApp.Workspace.ActiveConfigurationId); } + get { + + return solution.BaseDirectory.Combine (".temp-addin-registry").Combine (IdeApp.Workspace.ActiveConfigurationId ?? "Default"); + } } public string ApplicationName { @@ -138,5 +140,14 @@ namespace MonoDevelop.AddinAuthoring } Registry.Update (new ConsoleProgressStatus (false)); } + + public void NotifyChanged () + { + foreach (DotNetProject p in solution.GetAllSolutionItems<DotNetProject> ()) { + AddinData data = p.GetAddinData (); + if (data != null) + data.NotifyChanged (false); + } + } } } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Util.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Util.cs new file mode 100644 index 0000000000..0e63d0c95b --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/Util.cs @@ -0,0 +1,85 @@ +// +// Util.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using Mono.Addins.Description; + +namespace MonoDevelop.AddinAuthoring +{ + public static class Util + { + public static string GetDisplayName (AddinDescription ad) + { + if (!string.IsNullOrEmpty (ad.Name)) + return ad.Name; + else + return ad.LocalId; + } + + public static string GetDisplayName (ExtensionPoint ep) + { + if (string.IsNullOrEmpty (ep.Name)) + return ep.Path; + else + return ep.Name; + } + + public static string GetDisplayName (Extension ext) + { + ObjectDescription ob = ext.GetExtendedObject (); + string desc = ""; + string label; + Extension lastExtension = ext; + while (ob is ExtensionNodeDescription) { + ExtensionNodeDescription en = (ExtensionNodeDescription) ob; + if (desc.Length > 0) + desc = " / " + desc; + desc = en.Id + desc; + ob = (ObjectDescription) en.Parent; + if (ob is Extension) { + lastExtension = (Extension) ob; + ob = lastExtension.GetExtendedObject (); + } + } + ExtensionPoint ep = ob as ExtensionPoint; + if (ep != null) { + if (!string.IsNullOrEmpty (ep.Name)) + label = ep.Name; + else + label = ep.Path; + } else if (lastExtension != null) { + label = lastExtension.Path; + } else { + label = "(Unknown Extension Point)"; + } + if (!string.IsNullOrEmpty (desc)) + label += " / " + desc; + return label; + } + } +} + diff --git a/extras/MonoDevelop.AddinAuthoring/extension-point.png b/extras/MonoDevelop.AddinAuthoring/extension-point.png Binary files differindex d9159a3560..38cdb35baa 100644 --- a/extras/MonoDevelop.AddinAuthoring/extension-point.png +++ b/extras/MonoDevelop.AddinAuthoring/extension-point.png diff --git a/extras/MonoDevelop.AddinAuthoring/extension.png b/extras/MonoDevelop.AddinAuthoring/extension.png Binary files differnew file mode 100644 index 0000000000..d9159a3560 --- /dev/null +++ b/extras/MonoDevelop.AddinAuthoring/extension.png diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinDescriptionWidget.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinDescriptionWidget.cs index 88ff92856e..2abfefacad 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinDescriptionWidget.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinDescriptionWidget.cs @@ -346,7 +346,9 @@ namespace MonoDevelop.AddinAuthoring this.notebook.SetTabLabel (this.vbox3, this.label5); this.label5.ShowAll (); // Container child notebook.Gtk.Notebook+NotebookChild - this.extensionPointsEditor = null; + this.extensionPointsEditor = new global::MonoDevelop.AddinAuthoring.ExtensionPointsEditorWidget (); + this.extensionPointsEditor.Events = ((global::Gdk.EventMask)(256)); + this.extensionPointsEditor.Name = "extensionPointsEditor"; this.notebook.Add (this.extensionPointsEditor); global::Gtk.Notebook.NotebookChild w29 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.extensionPointsEditor])); w29.Position = 1; @@ -362,7 +364,9 @@ namespace MonoDevelop.AddinAuthoring this.hbox5.Spacing = 6; this.hbox5.BorderWidth = ((uint)(6)); // Container child hbox5.Gtk.Box+BoxChild - this.extensionEditor = null; + this.extensionEditor = new global::MonoDevelop.AddinAuthoring.ExtensionEditorWidget (); + this.extensionEditor.Events = ((global::Gdk.EventMask)(256)); + this.extensionEditor.Name = "extensionEditor"; this.hbox5.Add (this.extensionEditor); global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.extensionEditor])); w30.Position = 0; diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinFeatureWidget.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinFeatureWidget.cs index 899c83a775..9d877e522a 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinFeatureWidget.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinFeatureWidget.cs @@ -72,7 +72,6 @@ namespace MonoDevelop.AddinAuthoring this.radiobuttonLibrary = new global::Gtk.RadioButton (global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("A library which can be extended by add-ins")); this.radiobuttonLibrary.CanFocus = true; this.radiobuttonLibrary.Name = "radiobuttonLibrary"; - this.radiobuttonLibrary.Active = true; this.radiobuttonLibrary.DrawIndicator = true; this.radiobuttonLibrary.UseUnderline = true; this.radiobuttonLibrary.Group = new global::GLib.SList (global::System.IntPtr.Zero); @@ -119,7 +118,9 @@ namespace MonoDevelop.AddinAuthoring w8.Expand = false; w8.Fill = false; // Container child boxRepo.Gtk.Box+BoxChild - this.regSelector = null; + this.regSelector = new global::MonoDevelop.AddinAuthoring.RegistrySelector (); + this.regSelector.Events = ((global::Gdk.EventMask)(256)); + this.regSelector.Name = "regSelector"; this.boxRepo.Add (this.regSelector); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.boxRepo [this.regSelector])); w9.Position = 1; @@ -235,6 +236,7 @@ namespace MonoDevelop.AddinAuthoring this.labelExtensibleApp.Hide (); this.Show (); this.radiobuttonLibrary.Toggled += new global::System.EventHandler (this.OnRadiobuttonLibraryToggled); + this.regSelector.Changed += new global::System.EventHandler (this.OnRegSelectorChanged); this.entryName.Changed += new global::System.EventHandler (this.OnEntryNameChanged); this.entryId.Changed += new global::System.EventHandler (this.OnEntryIdChanged); this.comboNs.Changed += new global::System.EventHandler (this.OnComboNsChanged); diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinOptionPanelWidget.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinOptionPanelWidget.cs index c4a1b648a3..600a79a6b7 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinOptionPanelWidget.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.AddinOptionPanelWidget.cs @@ -40,7 +40,9 @@ namespace MonoDevelop.AddinAuthoring w2.Expand = false; w2.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.optionsWidget = null; + this.optionsWidget = new global::MonoDevelop.AddinAuthoring.AddinFeatureWidget (); + this.optionsWidget.Events = ((global::Gdk.EventMask)(256)); + this.optionsWidget.Name = "optionsWidget"; this.vbox2.Add (this.optionsWidget); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.optionsWidget])); w3.Position = 2; diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewExtensionPointDialog.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewExtensionPointDialog.cs index 70597a0b3f..7c0e1bd742 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewExtensionPointDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewExtensionPointDialog.cs @@ -197,7 +197,11 @@ namespace MonoDevelop.AddinAuthoring this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.baseTypeSelector = null; + this.baseTypeSelector = new global::MonoDevelop.AddinAuthoring.TypeSelector (); + this.baseTypeSelector.Events = ((global::Gdk.EventMask)(256)); + this.baseTypeSelector.Name = "baseTypeSelector"; + this.baseTypeSelector.AllowCreate = false; + this.baseTypeSelector.AllowCreateInterface = false; this.table1.Add (this.baseTypeSelector); global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.baseTypeSelector])); w15.TopAttach = ((uint)(1)); @@ -268,7 +272,10 @@ namespace MonoDevelop.AddinAuthoring this.notebook.SetTabLabel (this.table1, this.label9); this.label9.ShowAll (); // Container child notebook.Gtk.Notebook+NotebookChild - this.nodeseteditorwidget = null; + this.nodeseteditorwidget = new global::MonoDevelop.AddinAuthoring.NodeSetEditorWidget (); + this.nodeseteditorwidget.Events = ((global::Gdk.EventMask)(256)); + this.nodeseteditorwidget.Name = "nodeseteditorwidget"; + this.nodeseteditorwidget.AllowEditing = true; this.notebook.Add (this.nodeseteditorwidget); global::Gtk.Notebook.NotebookChild w22 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.nodeseteditorwidget])); w22.Position = 1; diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewRegistryDialog.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewRegistryDialog.cs index a1631e19e8..35d7d2fc83 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewRegistryDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NewRegistryDialog.cs @@ -5,10 +5,12 @@ namespace MonoDevelop.AddinAuthoring public partial class NewRegistryDialog { private global::Gtk.Table table1; + private global::MonoDevelop.Components.FolderEntry entryAppPath; private global::Gtk.Entry entryName; private global::MonoDevelop.Components.FolderEntry entryRegPath; private global::Gtk.Label label1; private global::Gtk.Label label2; + private global::Gtk.Label label3; private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; @@ -26,63 +28,86 @@ namespace MonoDevelop.AddinAuthoring w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false); + this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); this.table1.BorderWidth = ((uint)(9)); // Container child table1.Gtk.Table+TableChild + this.entryAppPath = new global::MonoDevelop.Components.FolderEntry (); + this.entryAppPath.Name = "entryAppPath"; + this.table1.Add (this.entryAppPath); + global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryAppPath])); + w2.TopAttach = ((uint)(1)); + w2.BottomAttach = ((uint)(2)); + w2.LeftAttach = ((uint)(1)); + w2.RightAttach = ((uint)(2)); + w2.XOptions = ((global::Gtk.AttachOptions)(4)); + w2.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild this.entryName = new global::Gtk.Entry (); this.entryName.CanFocus = true; this.entryName.Name = "entryName"; this.entryName.IsEditable = true; this.entryName.InvisibleChar = '●'; this.table1.Add (this.entryName); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryName])); - w2.LeftAttach = ((uint)(1)); - w2.RightAttach = ((uint)(2)); - w2.YOptions = ((global::Gtk.AttachOptions)(4)); - // Container child table1.Gtk.Table+TableChild - this.entryRegPath = null; - this.table1.Add (this.entryRegPath); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryRegPath])); - w3.TopAttach = ((uint)(1)); - w3.BottomAttach = ((uint)(2)); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryName])); w3.LeftAttach = ((uint)(1)); w3.RightAttach = ((uint)(2)); - w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild + this.entryRegPath = new global::MonoDevelop.Components.FolderEntry (); + this.entryRegPath.Name = "entryRegPath"; + this.table1.Add (this.entryRegPath); + global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryRegPath])); + w4.TopAttach = ((uint)(2)); + w4.BottomAttach = ((uint)(3)); + w4.LeftAttach = ((uint)(1)); + w4.RightAttach = ((uint)(2)); + w4.XOptions = ((global::Gtk.AttachOptions)(4)); + w4.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 0F; this.label1.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Application Name:"); this.table1.Add (this.label1); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); - w4.XOptions = ((global::Gtk.AttachOptions)(4)); - w4.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); + w5.XOptions = ((global::Gtk.AttachOptions)(4)); + w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 0F; this.label2.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Registry Path:"); this.table1.Add (this.label2); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); - w5.TopAttach = ((uint)(1)); - w5.BottomAttach = ((uint)(2)); - w5.XOptions = ((global::Gtk.AttachOptions)(4)); - w5.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); + w6.TopAttach = ((uint)(2)); + w6.BottomAttach = ((uint)(3)); + w6.XOptions = ((global::Gtk.AttachOptions)(4)); + w6.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.label3 = new global::Gtk.Label (); + this.label3.Name = "label3"; + this.label3.Xalign = 0F; + this.label3.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Application Path:"); + this.table1.Add (this.label3); + global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); + w7.TopAttach = ((uint)(1)); + w7.BottomAttach = ((uint)(2)); + w7.XOptions = ((global::Gtk.AttachOptions)(4)); + w7.YOptions = ((global::Gtk.AttachOptions)(4)); w1.Add (this.table1); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.table1])); - w6.Position = 0; - w6.Expand = false; - w6.Fill = false; + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.table1])); + w8.Position = 0; + w8.Expand = false; + w8.Fill = false; // Internal child MonoDevelop.AddinAuthoring.NewRegistryDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; - w7.Name = "dialog1_ActionArea"; - w7.Spacing = 6; - w7.BorderWidth = ((uint)(5)); - w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w9 = this.ActionArea; + w9.Name = "dialog1_ActionArea"; + w9.Spacing = 6; + w9.BorderWidth = ((uint)(5)); + w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -92,9 +117,9 @@ namespace MonoDevelop.AddinAuthoring this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); - w8.Expand = false; - w8.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel])); + w10.Expand = false; + w10.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -104,10 +129,10 @@ namespace MonoDevelop.AddinAuthoring this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); - w9.Position = 1; - w9.Expand = false; - w9.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk])); + w11.Position = 1; + w11.Expand = false; + w11.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NodeTypeEditorDialog.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NodeTypeEditorDialog.cs index c3e8309757..ad9a7770e7 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NodeTypeEditorDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.NodeTypeEditorDialog.cs @@ -35,7 +35,11 @@ namespace MonoDevelop.AddinAuthoring this.table1.ColumnSpacing = ((uint)(6)); this.table1.BorderWidth = ((uint)(9)); // Container child table1.Gtk.Table+TableChild - this.baseType = null; + this.baseType = new global::MonoDevelop.AddinAuthoring.TypeSelector (); + this.baseType.Events = ((global::Gdk.EventMask)(256)); + this.baseType.Name = "baseType"; + this.baseType.AllowCreate = false; + this.baseType.AllowCreateInterface = false; this.table1.Add (this.baseType); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.baseType])); w2.TopAttach = ((uint)(2)); @@ -112,7 +116,11 @@ namespace MonoDevelop.AddinAuthoring w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.nodeType = null; + this.nodeType = new global::MonoDevelop.AddinAuthoring.TypeSelector (); + this.nodeType.Events = ((global::Gdk.EventMask)(256)); + this.nodeType.Name = "nodeType"; + this.nodeType.AllowCreate = false; + this.nodeType.AllowCreateInterface = false; this.table1.Add (this.nodeType); global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.nodeType])); w9.LeftAttach = ((uint)(1)); @@ -161,6 +169,7 @@ namespace MonoDevelop.AddinAuthoring this.DefaultWidth = 543; this.DefaultHeight = 251; this.Show (); + this.nodeType.Changed += new global::System.EventHandler (this.OnNodeTypeChanged); this.entryName.Changed += new global::System.EventHandler (this.OnEntryNameChanged); this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); } diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.SelectNodeSetDialog.cs b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.SelectNodeSetDialog.cs index a575733b06..bcb8fb3254 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.SelectNodeSetDialog.cs +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/MonoDevelop.AddinAuthoring.SelectNodeSetDialog.cs @@ -55,7 +55,10 @@ namespace MonoDevelop.AddinAuthoring w4.Expand = false; w4.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.nodeseteditor = null; + this.nodeseteditor = new global::MonoDevelop.AddinAuthoring.NodeSetEditorWidget (); + this.nodeseteditor.Events = ((global::Gdk.EventMask)(256)); + this.nodeseteditor.Name = "nodeseteditor"; + this.nodeseteditor.AllowEditing = false; this.vbox3.Add (this.nodeseteditor); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.nodeseteditor])); w5.Position = 1; diff --git a/extras/MonoDevelop.AddinAuthoring/gtk-gui/gui.stetic b/extras/MonoDevelop.AddinAuthoring/gtk-gui/gui.stetic index 6779bc70e1..8044ff37ea 100644 --- a/extras/MonoDevelop.AddinAuthoring/gtk-gui/gui.stetic +++ b/extras/MonoDevelop.AddinAuthoring/gtk-gui/gui.stetic @@ -5,29 +5,26 @@ <target-gtk-version>2.12</target-gtk-version> </configuration> <import> - <widget-library name="MonoDevelop.Core.Gui, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Projects.Gui, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Ide, Version=2.2.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Ide, Version=2.4.0.0, Culture=neutral" /> <widget-library name="Mono.TextEditor, Version=1.0.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.VersionControl, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.NUnit, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.XmlEditor, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Gettext, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Deployment, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Deployment.Linux, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.GtkCore, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.DesignerSupport, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.VBNetBinding, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.CSharpBinding, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.SourceEditor2, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Debugger, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Components, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.AspNet, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.CBinding, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Autotools, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Refactoring, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Moonlight, Version=2.2.0.0, Culture=neutral" /> - <widget-library name="MonoDevelop.Debugger.Soft, Version=2.2.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.VersionControl, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.NUnit, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.XmlEditor, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Gettext, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Deployment, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Deployment.Linux, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.GtkCore, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.DesignerSupport, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.VBNetBinding, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.CSharpBinding, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.SourceEditor2, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Debugger, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.AspNet, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.CBinding, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Autotools, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Refactoring, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Moonlight, Version=2.4.0.0, Culture=neutral" /> + <widget-library name="MonoDevelop.Debugger.Soft, Version=2.4.0.0, Culture=neutral" /> <widget-library name="../build/MonoDevelop.AddinAuthoring.dll" internal="true" /> </import> <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.AddinOptionPanelWidget" design-size="615 437"> @@ -2546,7 +2543,7 @@ </widget> </child> </widget> - <widget class="Gtk.Dialog" id="MonoDevelop.AddinAuthoring.NewRegistryDialog" design-size="575 147"> + <widget class="Gtk.Dialog" id="MonoDevelop.AddinAuthoring.NewRegistryDialog" design-size="586 166"> <property name="MemberName" /> <property name="Title" translatable="yes">New Registry</property> <property name="WindowPosition">CenterOnParent</property> @@ -2561,12 +2558,32 @@ <child> <widget class="Gtk.Table" id="table1"> <property name="MemberName" /> - <property name="NRows">2</property> + <property name="NRows">3</property> <property name="NColumns">2</property> <property name="RowSpacing">6</property> <property name="ColumnSpacing">6</property> <property name="BorderWidth">9</property> <child> + <widget class="MonoDevelop.Components.FolderEntry" id="entryAppPath"> + <property name="MemberName" /> + </widget> + <packing> + <property name="TopAttach">1</property> + <property name="BottomAttach">2</property> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> <widget class="Gtk.Entry" id="entryName"> <property name="MemberName" /> <property name="CanFocus">True</property> @@ -2591,8 +2608,8 @@ <property name="MemberName" /> </widget> <packing> - <property name="TopAttach">1</property> - <property name="BottomAttach">2</property> + <property name="TopAttach">2</property> + <property name="BottomAttach">3</property> <property name="LeftAttach">1</property> <property name="RightAttach">2</property> <property name="AutoSize">True</property> @@ -2631,6 +2648,26 @@ <property name="LabelProp" translatable="yes">Registry Path:</property> </widget> <packing> + <property name="TopAttach">2</property> + <property name="BottomAttach">3</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label3"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes">Application Path:</property> + </widget> + <packing> <property name="TopAttach">1</property> <property name="BottomAttach">2</property> <property name="AutoSize">True</property> @@ -2697,4 +2734,679 @@ </widget> </child> </widget> + <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.ExtensionModelBrowserWidget" design-size="586 402"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox2"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.HBox" id="hbox1"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Button" id="button79"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-go-back Menu</property> + <property name="Label" translatable="yes" /> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="button80"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-go-forward Menu</property> + <property name="Label" translatable="yes" /> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.VSeparator" id="vseparator1"> + <property name="MemberName" /> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonAdd"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-add Menu</property> + <property name="Label" translatable="yes">Add registry</property> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <signal name="Clicked" handler="OnButtonAddClicked" /> + </widget> + <packing> + <property name="Position">3</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.HPaned" id="paned"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Position">253</property> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.Gui.AddinView" design-size="436 253"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox2"> + <property name="MemberName" /> + <property name="Spacing">12</property> + <child> + <widget class="Gtk.Label" id="labelName"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp"><b>Addin Name</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelDesc"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp">Some description</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Table" id="table1"> + <property name="MemberName" /> + <property name="NRows">5</property> + <property name="NColumns">2</property> + <property name="RowSpacing">6</property> + <property name="ColumnSpacing">6</property> + <child> + <widget class="Gtk.Label" id="label3"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b>Id:</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label4"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b>Namespace:</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="TopAttach">1</property> + <property name="BottomAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label5"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b>Version:</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="TopAttach">2</property> + <property name="BottomAttach">3</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label6"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b>Copyright:</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="TopAttach">3</property> + <property name="BottomAttach">4</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label7"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b>Author:</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="TopAttach">4</property> + <property name="BottomAttach">5</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelAuthor"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="TopAttach">4</property> + <property name="BottomAttach">5</property> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelCopyright"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="TopAttach">3</property> + <property name="BottomAttach">4</property> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelId"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">False</property> + <property name="YOptions">Fill</property> + <property name="XExpand">True</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelNamespace"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="TopAttach">1</property> + <property name="BottomAttach">2</property> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelVersion"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="TopAttach">2</property> + <property name="BottomAttach">3</property> + <property name="LeftAttach">1</property> + <property name="RightAttach">2</property> + <property name="AutoSize">True</property> + <property name="XOptions">Fill</property> + <property name="YOptions">Fill</property> + <property name="XExpand">False</property> + <property name="XFill">True</property> + <property name="XShrink">False</property> + <property name="YExpand">False</property> + <property name="YFill">True</property> + <property name="YShrink">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.Gui.ExtensionPointView" design-size="300 300"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox3"> + <property name="MemberName" /> + <property name="Spacing">12</property> + <child> + <widget class="Gtk.Label" id="labelName"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp"><b>Addin Name</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label1"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><i>Remarks:</i></b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelDesc"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp">Some description</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.VBox" id="vbox4"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="label9"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><i>Extension nodes:</i></b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Table" id="tableNodes"> + <property name="MemberName" /> + <property name="NRows">3</property> + <property name="NColumns">2</property> + <property name="RowSpacing">6</property> + <property name="ColumnSpacing">6</property> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">3</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.Gui.ExtensionView" design-size="300 300"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox3"> + <property name="MemberName" /> + <property name="Spacing">12</property> + <child> + <widget class="Gtk.Label" id="labelName"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp"><b>Addin Name</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.VBox" id="vbox5"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="label11"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><i>Extends:</i></b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.HBox" id="hbox1"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Button" id="buttonExt"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">Custom</property> + <property name="Relief">None</property> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="Gtk.Bin" id="MonoDevelop.AddinAuthoring.Gui.ExtensionNodeView" design-size="453 300"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox3"> + <property name="MemberName" /> + <property name="Spacing">12</property> + <child> + <widget class="Gtk.Label" id="labelName"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp"><b>Addin Name</b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label2"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><i>Remarks:</i></b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelDesc"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp">Some description</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="label3"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><i>Attributes:</i></b></property> + <property name="UseMarkup">True</property> + </widget> + <packing> + <property name="Position">3</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.VBox" id="vbox4"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Table" id="tableAtts"> + <property name="MemberName" /> + <property name="NRows">3</property> + <property name="NColumns">3</property> + <property name="RowSpacing">6</property> + <property name="ColumnSpacing">6</property> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">4</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + </child> + </widget> </stetic-interface>
\ No newline at end of file |