Author: mkrueger
Date: 2008-02-05 16:26:49 -0500 (Tue, 05 Feb 2008)
New Revision: 94956

Added:
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
Modified:
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp
Log:
* MonoDevelop.Ide.Gui.Content/IFoldable.cs,
  MonoDevelop.Ide.Commands/EditCommands.cs,
  MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
  MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added some folding
  commands.

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-05 
21:26:18 UTC (rev 94955)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-05 
21:26:49 UTC (rev 94956)
@@ -1,5 +1,12 @@
 2008-02-05  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Ide.Gui.Content/IFoldable.cs,
+         MonoDevelop.Ide.Commands/EditCommands.cs, MonoDevelop.Ide.addin.xml,
+         MonoDevelop.Ide.mdp, Makefile.am,
+         MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added some folding 
commands.
+
+2008-02-05  Mike Krüger <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Ide.addin.xml: Fixed a label.
 
 2008-02-04  Michael Hutchinson <[EMAIL PROTECTED]> 

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am 2008-02-05 
21:26:18 UTC (rev 94955)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am 2008-02-05 
21:26:49 UTC (rev 94956)
@@ -147,6 +147,7 @@
        MonoDevelop.Ide.Gui.Content/IEditable.cs \
        MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs \
        MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs \
+       MonoDevelop.Ide.Gui.Content/IFoldable.cs \
        MonoDevelop.Ide.Gui.Content/IndentStyle.cs \
        MonoDevelop.Ide.Gui.Content/IParsableContent.cs \
        MonoDevelop.Ide.Gui.Content/IPositionable.cs \

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
    2008-02-05 21:26:18 UTC (rev 94955)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
    2008-02-05 21:26:49 UTC (rev 94956)
@@ -53,7 +53,11 @@
                LowercaseSelection,
                WordCount,
                MonodevelopPreferences,
-               InsertStandardHeader
+               InsertStandardHeader,
+               
+               ToggleFolding,
+               ToggleAllFoldings,
+               FoldDefinitions
        }
        
        internal class MonodevelopPreferencesHandler: CommandHandler

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
  2008-02-05 21:26:18 UTC (rev 94955)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
  2008-02-05 21:26:49 UTC (rev 94956)
@@ -566,7 +566,42 @@
                        doc.TextEditor.Select(selStart, selEnd);
                        doc.TextEditor.EndAtomicUndo ();
                }
-#region Bookmarks
+               
+               #region Folding
+               [CommandUpdateHandler (EditCommands.ToggleAllFoldings)]
+               [CommandUpdateHandler (EditCommands.FoldDefinitions)]
+               void UpdateFoldCommands (CommandInfo info)
+               {
+                       info.Enabled = GetContent <IFoldable> () != null;
+               }
+               
+               [CommandHandler (EditCommands.ToggleAllFoldings)]
+               void ToggleAllFoldings ()
+               {
+                       GetContent <IFoldable> ().ToggleAllFoldings ();
+               }
+               
+               [CommandHandler (EditCommands.FoldDefinitions)]
+               void FoldDefinitions ()
+               {
+                       GetContent <IFoldable> ().FoldDefinitions ();
+               }
+               
+               [CommandUpdateHandler (EditCommands.ToggleFolding)]
+               void UpdateToggleFolding (CommandInfo info)
+               {
+                       info.Enabled = GetContent <IFoldable> () != null;
+               }
+               
+               [CommandHandler (EditCommands.ToggleFolding)]
+               void ToggleFolding ()
+               {
+                       GetContent <IFoldable> ().ToggleFolding ();
+               }
+               
+               #endregion
+               
+               #region Bookmarks
                [CommandUpdateHandler (SearchCommands.ToggleBookmark)]
                [CommandUpdateHandler (SearchCommands.PrevBookmark)]
                [CommandUpdateHandler (SearchCommands.NextBookmark)]
@@ -608,9 +643,9 @@
                        Debug.Assert (markBuffer != null);
                        markBuffer.ClearBookmarks ();
                }
-#endregion
+               #endregion
                
-#region Splitting
+               #region Splitting
                [CommandUpdateHandler (WindowCommands.SplitWindowHorizontally)]
                protected void UpdateSplitWindowHorizontally (CommandInfo info)
                {
@@ -652,8 +687,9 @@
                        Debug.Assert (split != null);
                        split.Unsplit ();
                }
-#endregion
-#region Printing
+               #endregion
+               
+               #region Printing
                [CommandUpdateHandler (FileCommands.PrintDocument)]
                [CommandUpdateHandler (FileCommands.PrintPreviewDocument)]
                protected void UpdatePrintCommands (CommandInfo info)
@@ -670,7 +706,7 @@
                {
                        GetContent <IPrintable> ().PrintPreviewDocument ();
                }
-#endregion
+               #endregion
                
        }
 }

Added: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
    2008-02-05 21:26:18 UTC (rev 94955)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
    2008-02-05 21:26:49 UTC (rev 94956)
@@ -0,0 +1,39 @@
+//
+// IFoldable.cs
+//
+// Author:
+//   Mike Krüger <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 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;
+
+namespace MonoDevelop.Ide.Gui.Content
+{
+       public interface IFoldable
+       {
+               void ToggleAllFoldings ();
+               void FoldDefinitions ();
+               void ToggleFolding ();
+       }
+}

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml   
2008-02-05 21:26:18 UTC (rev 94955)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml   
2008-02-05 21:26:49 UTC (rev 94956)
@@ -314,7 +314,18 @@
                                _label = "Insert Standard Header" 
                                defaultHandler = 
"MonoDevelop.Ide.Commands.InsertStandardHeaderHandler"
                                description = "Add the user defined header to 
the top of the file"/>
-                               
+               
+               <Command id = 
"MonoDevelop.Ide.Commands.EditCommands.ToggleFolding"
+                               _label = "_Toggle fold" 
+                               shortcut = "Control|Shift|M"
+                               description = "Toggles the folding at caret 
position."/>
+               <Command id = 
"MonoDevelop.Ide.Commands.EditCommands.ToggleAllFoldings"
+                               _label = "Toggle _all folds" 
+                               shortcut = "Control|Shift|A"
+                               description = "Toggles the all foldings in the 
document."/>
+               <Command id = 
"MonoDevelop.Ide.Commands.EditCommands.FoldDefinitions"
+                               _label = "Show _definitions only" 
+                               description = "Folds all method and property 
bodies."/>
                </Category>
 
                <!-- ProjectCommands -->
@@ -1272,6 +1283,12 @@
                                <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.IndentSelection" />
                                <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.UnIndentSelection" />
                        </ItemSet>
+
+                       <ItemSet id = "Folding" _label = "F_olding">
+                               <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.ToggleFolding" />
+                               <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.ToggleAllFoldings" />
+                               <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.FoldDefinitions" />
+                       </ItemSet>
                        
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.TextEditorCommands.ShowCompletionWindow" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.TextEditorCommands.ShowParameterCompletionWindow" />

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp 
2008-02-05 21:26:18 UTC (rev 94955)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp 
2008-02-05 21:26:49 UTC (rev 94956)
@@ -375,6 +375,7 @@
     <File name="MonoDevelop.Ide.Dom/Modifiers.cs" subtype="Code" 
buildaction="Compile" />
     <File name="MonoDevelop.Ide.Dom/ParameterModifiers.cs" subtype="Code" 
buildaction="Compile" />
     <File name="MonoDevelop.Ide.Dom/TypeParameter.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="MonoDevelop.Ide.Gui.Content/IFoldable.cs" subtype="Code" 
buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="False" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to