[Monodevelop-patches-list] r2475 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . Commands Gui Services
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Mon Apr 25 16:35:47 EDT 2005
Author: lluis
Date: 2005-04-25 16:35:47 -0400 (Mon, 25 Apr 2005)
New Revision: 2475
Added:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/EditorCommands.cs
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs
Log:
2005-04-25 Lluis Sanchez Gual <lluis at novell.com>
* Gui/SourceEditorWidget.cs: Moved here editor-specific commands.
* Gui/SourceEditorDisplayBinding.cs: The methods for managing
bookmarks are now in the editor widget, not the buffer.
* Commands/EditorCommands.cs: New enum with IDs for edit commands.
* Commands/SearchCommands.cs: Moved editor-specific commands to
SourceEditorWidget.cs.
* MonoDevelopEditor.addin.xml: Created the new command structure.
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-04-25 20:35:47 UTC (rev 2475)
@@ -1,3 +1,13 @@
+2005-04-25 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Gui/SourceEditorWidget.cs: Moved here editor-specific commands.
+ * Gui/SourceEditorDisplayBinding.cs: The methods for managing
+ bookmarks are now in the editor widget, not the buffer.
+ * Commands/EditorCommands.cs: New enum with IDs for edit commands.
+ * Commands/SearchCommands.cs: Moved editor-specific commands to
+ SourceEditorWidget.cs.
+ * MonoDevelopEditor.addin.xml: Created the new command structure.
+
2005-04-25 Lluis Sanchez Gual <lluis at novell.com>
* Gui/SourceEditorWidget.cs:
Added: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/EditorCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/EditorCommands.cs 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/EditorCommands.cs 2005-04-25 20:35:47 UTC (rev 2475)
@@ -0,0 +1,44 @@
+//
+// EditorCommands.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;
+
+namespace MonoDevelop.DefaultEditor
+{
+ public enum EditorCommands
+ {
+ HighlightingTypeList,
+ ShowBufferOptions,
+ ToggleBookmark,
+ PrevBookmark,
+ NextBookmark,
+ ClearBookmarks,
+ GotoLineNumber,
+ GotoMatchingBrace
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2005-04-25 20:35:47 UTC (rev 2475)
@@ -24,97 +24,24 @@
using MonoDevelop.Gui;
using MonoDevelop.SourceEditor.Gui;
using SourceEditor_ = MonoDevelop.SourceEditor.Gui.SourceEditor;
+using MonoDevelop.Commands;
-namespace MonoDevelop.DefaultEditor.Commands
+namespace MonoDevelop.Commands
{
-
- public abstract class AbstractEditActionMenuCommand : AbstractMenuCommand
+ public enum SearchCommands
{
- public abstract IEditAction EditAction
- {
- get;
- }
-
- public override void Run()
- {
- Console.WriteLine ("Not implemented in the new editor");
- /*IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
-
- if (window == null || !(window.ViewContent is ITextEditorControlProvider)) {
- return;
- }
- TextEditorControl textEditor = ((ITextEditorControlProvider)window.ViewContent).TextEditorControl;
- EditAction.Execute(textEditor.ActiveTextAreaControl.TextArea);*/
- }
+ Find,
+ FindNext,
+ FindPrevious,
+ Replace,
+ FindInFiles,
+ FindSelection,
+ FindBox,
+ ReplaceInFiles
}
-
- public class Find : AbstractMenuCommand
- {
- public static void SetSearchPattern ()
- {
- IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
- if (window != null && window.ViewContent is SourceEditorDisplayBindingWrapper)
- {
- SourceEditor_ editor = ((SourceEditorDisplayBindingWrapper)window.ViewContent).Editor;
- string selectedText = editor.Buffer.GetSelectedText ();
-
- if (selectedText != null && selectedText.Length > 0)
- SearchReplaceManager.SearchOptions.SearchPattern = selectedText.Split ('\n')[0];
- }
- }
-
- public override void Run()
- {
- SetSearchPattern();
- if (SearchReplaceManager.ReplaceDialog != null) {
- if (SearchReplaceManager.ReplaceDialog.replaceMode == false) {
- SearchReplaceManager.ReplaceDialog.SetSearchPattern(SearchReplaceManager.SearchOptions.SearchPattern);
- SearchReplaceManager.ReplaceDialog.Present ();
- } else {
- SearchReplaceManager.ReplaceDialog.Destroy ();
- ReplaceDialog rd = new ReplaceDialog (false);
- rd.ShowAll ();
- }
- } else {
- ReplaceDialog rd = new ReplaceDialog (false);
- rd.ShowAll();
- }
- }
- }
-
- public class FindNext : AbstractMenuCommand
+ public class FindInFilesHandler : CommandHandler
{
- public override void Run ()
- {
- SearchReplaceManager.FindNext ();
- }
- }
-
- public class Replace : AbstractMenuCommand
- {
- public override void Run ()
- {
- Find.SetSearchPattern ();
-
- if (SearchReplaceManager.ReplaceDialog != null) {
- if (SearchReplaceManager.ReplaceDialog.replaceMode == true) {
- SearchReplaceManager.ReplaceDialog.SetSearchPattern(SearchReplaceManager.SearchOptions.SearchPattern);
- SearchReplaceManager.ReplaceDialog.Present ();
- } else {
- SearchReplaceManager.ReplaceDialog.Destroy ();
- ReplaceDialog rd = new ReplaceDialog (true);
- rd.ShowAll ();
- }
- } else {
- ReplaceDialog rd = new ReplaceDialog(true);
- rd.ShowAll();
- }
- }
- }
-
- public class FindInFiles : AbstractMenuCommand
- {
public static void SetSearchPattern ()
{
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
@@ -127,10 +54,7 @@
}
}
-
-
-
- public override void Run ()
+ protected override void Run ()
{
SetSearchPattern ();
if (SearchReplaceInFilesManager.ReplaceDialog != null) {
@@ -149,11 +73,11 @@
}
}
- public class ReplaceInFiles : AbstractMenuCommand
+ public class ReplaceInFilesHandler : CommandHandler
{
- public override void Run()
+ protected override void Run()
{
- FindInFiles.SetSearchPattern ();
+ FindInFilesHandler.SetSearchPattern ();
if (SearchReplaceInFilesManager.ReplaceDialog != null) {
if (SearchReplaceInFilesManager.ReplaceDialog.replaceMode == true) {
@@ -171,26 +95,4 @@
}
}
- public class GotoLineNumber : AbstractMenuCommand
- {
- public override void Run ()
- {
- if (!GotoLineNumberDialog.IsVisible)
- using (GotoLineNumberDialog gnd = new GotoLineNumberDialog ())
- gnd.Run ();
- }
- }
-
- public class GotoMatchingBrace : AbstractMenuCommand
- {
- public override void Run ()
- {
- IWorkbenchWindow wnd = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
- if (wnd == null) return;
- SourceEditorDisplayBindingWrapper o = wnd.ViewContent as SourceEditorDisplayBindingWrapper;
- if (o == null) return;
-
- o.GotoMatchingBrace ();
- }
- }
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2005-04-25 20:35:47 UTC (rev 2475)
@@ -224,16 +224,6 @@
return false;
}
- public void GotoMatchingBrace ()
- {
- TextIter iter = se.Buffer.GetIterAtMark (se.Buffer.InsertMark);
- if (Source.IterFindMatchingBracket (ref iter)) {
- iter.ForwardChar ();
- se.Buffer.PlaceCursor (iter);
- se.View.ScrollMarkOnscreen (se.Buffer.InsertMark);
- }
- }
-
public override void RedrawContent()
{
}
@@ -484,24 +474,22 @@
#region IBookmarkOperations
void IBookmarkOperations.ToggleBookmark ()
{
- se.Buffer.ToggleBookmark ();
+ se.ToggleBookmark ();
}
void IBookmarkOperations.PrevBookmark ()
{
- se.Buffer.PrevBookmark ();
- se.View.ScrollMarkOnscreen (se.Buffer.InsertMark);
+ se.PrevBookmark ();
}
void IBookmarkOperations.NextBookmark ()
{
- se.Buffer.NextBookmark ();
- se.View.ScrollMarkOnscreen (se.Buffer.InsertMark);
+ se.NextBookmark ();
}
void IBookmarkOperations.ClearBookmarks ()
{
- se.Buffer.ClearBookmarks ();
+ se.ClearBookmarks ();
}
#endregion
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs 2005-04-25 20:35:47 UTC (rev 2475)
@@ -2,7 +2,13 @@
using System;
using System.Runtime.InteropServices;
-
+
+using MonoDevelop.TextEditor.Document;
+using MonoDevelop.Commands;
+using MonoDevelop.Gui.Dialogs;
+using GtkSourceView;
+using MonoDevelop.DefaultEditor;
+
namespace MonoDevelop.SourceEditor.Gui
{
public class SourceEditor : ScrolledWindow
@@ -75,6 +81,112 @@
Buffer.Replace (offset, length, pattern);
}
+
+ public void SetSearchPattern ()
+ {
+ string selectedText = Buffer.GetSelectedText ();
+ if (selectedText != null && selectedText.Length > 0)
+ SearchReplaceManager.SearchOptions.SearchPattern = selectedText.Split ('\n')[0];
+ }
+
+ [CommandHandler (SearchCommands.Find)]
+ public void Find()
+ {
+ SetSearchPattern();
+ if (SearchReplaceManager.ReplaceDialog != null) {
+ if (SearchReplaceManager.ReplaceDialog.replaceMode == false) {
+ SearchReplaceManager.ReplaceDialog.SetSearchPattern(SearchReplaceManager.SearchOptions.SearchPattern);
+ SearchReplaceManager.ReplaceDialog.Present ();
+ } else {
+ SearchReplaceManager.ReplaceDialog.Destroy ();
+ ReplaceDialog rd = new ReplaceDialog (false);
+ rd.ShowAll ();
+ }
+ } else {
+ ReplaceDialog rd = new ReplaceDialog (false);
+ rd.ShowAll();
+ }
+ }
+
+ [CommandHandler (SearchCommands.FindNext)]
+ public void FindNext ()
+ {
+ SearchReplaceManager.FindNext ();
+ }
+
+ [CommandHandler (SearchCommands.FindSelection)]
+ public void FindSelection ()
+ {
+ SetSearchPattern();
+ SearchReplaceManager.FindNext ();
+ }
+
+ [CommandHandler (SearchCommands.Replace)]
+ public void Replace ()
+ {
+ SetSearchPattern ();
+
+ if (SearchReplaceManager.ReplaceDialog != null) {
+ if (SearchReplaceManager.ReplaceDialog.replaceMode == true) {
+ SearchReplaceManager.ReplaceDialog.SetSearchPattern(SearchReplaceManager.SearchOptions.SearchPattern);
+ SearchReplaceManager.ReplaceDialog.Present ();
+ } else {
+ SearchReplaceManager.ReplaceDialog.Destroy ();
+ ReplaceDialog rd = new ReplaceDialog (true);
+ rd.ShowAll ();
+ }
+ } else {
+ ReplaceDialog rd = new ReplaceDialog(true);
+ rd.ShowAll();
+ }
+ }
+
+
+ [CommandHandler (EditorCommands.GotoLineNumber)]
+ public void GotoLineNumber ()
+ {
+ if (!GotoLineNumberDialog.IsVisible)
+ using (GotoLineNumberDialog gnd = new GotoLineNumberDialog ())
+ gnd.Run ();
+ }
+
+ [CommandHandler (EditorCommands.GotoMatchingBrace)]
+ public void GotoMatchingBrace ()
+ {
+ TextIter iter = Buffer.GetIterAtMark (Buffer.InsertMark);
+ if (Source.IterFindMatchingBracket (ref iter)) {
+ iter.ForwardChar ();
+ Buffer.PlaceCursor (iter);
+ View.ScrollMarkOnscreen (Buffer.InsertMark);
+ }
+ }
+
+ [CommandHandler (EditorCommands.ToggleBookmark)]
+ public void ToggleBookmark ()
+ {
+ Buffer.ToggleBookmark ();
+ }
+
+ [CommandHandler (EditorCommands.PrevBookmark)]
+ public void PrevBookmark ()
+ {
+ Buffer.PrevBookmark ();
+ View.ScrollMarkOnscreen (Buffer.InsertMark);
+ }
+
+ [CommandHandler (EditorCommands.NextBookmark)]
+ public void NextBookmark ()
+ {
+ Buffer.NextBookmark ();
+ View.ScrollMarkOnscreen (Buffer.InsertMark);
+ }
+
+ [CommandHandler (EditorCommands.ClearBookmarks)]
+ public void ClearBookmarks ()
+ {
+ Buffer.ClearBookmarks ();
+ }
+
private static readonly string [] drag_icon_xpm = new string [] {
"36 48 9 1",
" c None",
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2005-04-25 20:35:47 UTC (rev 2475)
@@ -32,16 +32,9 @@
InsightWindow/MethodInsightDataProvider.cs \
InsightWindow/InsightWindow.cs \
InsightWindow/IInsightDataProvider.cs \
-Commands/CommentRegionCommand.cs \
-Commands/BookmarkCommands.cs \
-Commands/CodeActions.cs \
-Commands/IEditAction.cs \
-Commands/ToolCommands.cs \
-Commands/FoldingCommands.cs \
+Commands/EditorCommands.cs \
Commands/SearchCommands.cs \
-Commands/ProjectCommands.cs \
-Commands/FormatCommands.cs \
-Commands/TextAreaContextmenuCommands.cs \
+Commands/IEditAction.cs \
Properties/TextEditorProperties.cs \
FormattingStrategy/DefaultFormattingStrategy.cs \
FormattingStrategy/IndentStyle.cs \
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml 2005-04-25 20:35:47 UTC (rev 2475)
@@ -28,7 +28,7 @@
insertafter = "GenerateDocumentation"
insertbefore = "Separator5"
_label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
- class = "MonoDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ExportProjectToHtml"/>
</Conditional> -->
</Extension>
@@ -38,7 +38,7 @@
insertafter = "GenerateDocumentation"
insertbefore = "Separator2"
_label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
- class = "MonoDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ExportProjectToHtml"/>
</Conditional>
</Extension> -->
@@ -49,199 +49,133 @@
insertafter = "GenerateDocumentation"
insertbefore = "SetAsStartupProjectSeparator"
_label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
- class = "MonoDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ExportProjectToHtml"/>
</Conditional> -->
</Extension>
-
+
+ <Extension path = "/SharpDevelop/Commands">
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.HighlightingTypeList"
+ type = "array|radio"
+ _label = "bogus_label" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.ShowBufferOptions"
+ _label = "Buffer Options"
+ icon = "Icons.16x16.PropertiesIcon" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.ToggleBookmark"
+ icon = "Icons.16x16.ToggleBookmark"
+ shortcut = "Control|F2"
+ _label = "Toggle Bookmark" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.PrevBookmark"
+ icon = "Icons.16x16.GotoPrevbookmark"
+ shortcut = "Shift|F2"
+ _label = "Previous Bookmark" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.NextBookmark"
+ icon = "Icons.16x16.GotoNextbookmark"
+ shortcut = "F2"
+ _label = "Next Bookmark" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.ClearBookmarks"
+ icon = "Icons.16x16.ClearAllBookmarks"
+ _label = "Clear Bookmarks" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.GotoLineNumber"
+ _label = "_Goto Line..."
+ description = "${res:XML.MainMenu.SearchMenu.GotoLineNr.Description}"
+ shortcut = "Control|G" />
+ <Command id = "MonoDevelop.DefaultEditor.EditorCommands.GotoMatchingBrace"
+ _label = "Goto Matching _Brace"
+ description = "${res:XML.MainMenu.SearchMenu.GotoBrace.Description}"
+ shortcut = "Control|B" />
+
+ <!-- SearchCommands -->
+
+ <Command id = "MonoDevelop.Commands.SearchCommands.Find"
+ _label = "_Find..."
+ icon = "Icons.16x16.FindIcon"
+ description = "${res:XML.MainMenu.SearchMenu.Find.Description}"
+ shortcut = "Control|F" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.FindNext"
+ _label = "Find _Next"
+ icon = "Icons.16x16.FindNextIcon"
+ description = "${res:XML.MainMenu.SearchMenu.FindNext.Description}"
+ shortcut = "F3" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.FindSelection"
+ _label = "Find Selection"
+ shortcut = "Control|F3" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.FindPrevious"
+ _label = "Find _Previous"
+ icon = "Icons.16x16.FindPrevIcon"
+ description = "${res:XML.MainMenu.SearchMenu.FindPrevious.Description}"
+ shortcut = "Shift|F3" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.Replace"
+ _label = "_Replace..."
+ icon = "Icons.16x16.ReplaceIcon"
+ description = "${res:XML.MainMenu.SearchMenu.Replace.Description}"
+ shortcut = "Control|H" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.FindInFiles"
+ defaultHandler = "MonoDevelop.Commands.FindInFilesHandler"
+ _label = "F_ind In Files..."
+ icon = "Icons.16x16.FindInFiles"
+ description = "${res:XML.MainMenu.SearchMenu.FindInFiles.Description}" />
+ <Command id = "MonoDevelop.Commands.SearchCommands.ReplaceInFiles"
+ defaultHandler = "MonoDevelop.Commands.ReplaceInFilesHandler"
+ _label = "R_eplace In Files..."
+ icon = "Icons.16x16.ReplaceInFiles"
+ description = "${res:XML.MainMenu.SearchMenu.ReplaceInFiles.Description}" />
+ </Extension>
+
<Extension path = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">
- <MenuItem id = "Cut"
- _label = "Cut"
- icon = "Icons.16x16.CutIcon"
- shortcut = "Control|X"
- class = "MonoDevelop.Commands.Cut"/>
- <MenuItem id = "Copy"
- _label = "Copy"
- icon = "Icons.16x16.CopyIcon"
- shortcut = "Control|C"
- class = "MonoDevelop.Commands.Copy"/>
- <MenuItem id = "Paste"
- _label = "Paste"
- icon = "Icons.16x16.PasteIcon"
- shortcut = "Control|V"
- class = "MonoDevelop.Commands.Paste"/>
- <MenuItem id = "Delete"
- _label = "Delete"
- icon = "Icons.16x16.DeleteIcon"
- class = "MonoDevelop.Commands.Delete"/>
- <MenuItem id = "Separator1" _label = "-" />
- <MenuItem id = "Save"
- _label = "Save"
- icon = "Icons.16x16.SaveIcon"
- shortcut = "Control|S"
- class = "MonoDevelop.Commands.SaveFile"/>
- <MenuItem id = "SaveAs"
- _label = "Save As"
- class = "MonoDevelop.Commands.SaveFileAs"/>
- <MenuItem id = "File"
- _label = "Close"
- class ="MonoDevelop.Commands.CloseFile"/>
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.Cut" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.Copy" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.Paste" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.Delete" />
+ <SeparatorItem id = "Separator1" />
+ <CommandItem id = "MonoDevelop.Commands.FileCommands.Save" />
+ <CommandItem id = "MonoDevelop.Commands.FileCommands.SaveAs" />
+ <CommandItem id = "MonoDevelop.Commands.FileCommands.CloseFile" />
<MenuItem id = "Separator2" _label = "-" />
- <MenuItem id = "Comment"
- icon = "Icons.16x16.CommentRegion"
- _label = "Toggle Comments"
- class= "MonoDevelop.DefaultEditor.Commands.CommentRegion"/>
-<!-- <MenuItem id = "Uncomment"
- icon = "Icons.16x16.UnCommentRegion"
- _label = "${res:XML.TextAreaContextMenu.UncommentSelection}"
- class= "MonoDevelop.DefaultEditor.Commands.UncommentRegion"/>-->
- <MenuItem id = "Indent"
- _label = "Indent Selection"
- shortcut = "Control|I"
- class = "MonoDevelop.DefaultEditor.Commands.IndentSelection" />
-
- <MenuItem id = "FileMode" _label = "Highlighting Mode">
- <MenuItem id = "HighlightBuilder" _label = "bogus_label" class = "MonoDevelop.DefaultEditor.Commands.HighlightingTypeBuilder" />
- </MenuItem>
-
- <MenuItem id = "Separator3" _label = "-" />
- <MenuItem id = "Options"
- _label = "Buffer Options"
- icon = "Icons.16x16.PropertiesIcon"
- class ="MonoDevelop.DefaultEditor.Commands.ShowBufferOptions"/>
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.CommentCode" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.UncommentCode" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.IndentSelection" />
+ <CommandItem id = "MonoDevelop.Commands.EditCommands.UnIndentSelection" />
+ <ItemSet id = "FileMode" _label = "Highlighting Mode">
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.HighlightingTypeList" />
+ </ItemSet>
+ <SeparatorItem id = "Separator3" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.ShowBufferOptions" />
</Extension>
<Extension path = "/SharpDevelop/Workbench/ToolBar/Standard">
- <Conditional action="Disable">
- <Or>
- <Condition activewindow="MonoDevelop.SourceEditor.Gui.SourceEditorDisplayBindingWrapper"/>
- <Condition openproject="*"/>
- </Or>
-
- <ToolbarItem id = "Find"
- icon = "Icons.16x16.FindIcon"
- _tooltip = "Find"
- class = "MonoDevelop.DefaultEditor.Commands.Find"/>
- <ToolbarItem id = "FindNext"
- icon = "Icons.16x16.FindNextIcon"
- _tooltip = "Find Next"
- class = "MonoDevelop.DefaultEditor.Commands.FindNext"/>
- <ToolbarItem id = "Replace"
- icon = "Icons.16x16.ReplaceIcon"
- _tooltip = "Replace"
- class = "MonoDevelop.DefaultEditor.Commands.Replace"/>
- </Conditional>
- <ToolbarItem id = "SearchSeparator" _tooltip = "-"/>
- <Conditional activewindow="MonoDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
-<!-- <ToolbarItem id = "Comment"
- icon = "Icons.16x16.CommentRegion"
- tooltip = "${res:XML.TextAreaContextMenu.CommentUncommentSelection}"
- class = "MonoDevelop.DefaultEditor.Commands.CommentRegion"/> -->
-<!-- <ToolbarItem id = "Uncomment"
- icon = "Icons.16x16.UnCommentRegion"
- tooltip = "${res:XML.TextAreaContextMenu.UncommentSelection}"
- class = "MonoDevelop.DefaultEditor.Commands.UncommentRegion"/> -->
-
-<!-- <ToolbarItem id = "SearchSeparator2" tooltip = "-"/> -->
- <ToolbarItem id = "ToggleBookmark"
- icon = "Icons.16x16.ToggleBookmark"
- _tooltip = "Toggle Bookmark"
- class = "MonoDevelop.EditorBindings.Commands.ToggleBookmark"/>
- <ToolbarItem id = "PrevBookmark"
- icon = "Icons.16x16.GotoPrevbookmark"
- _tooltip = "Previous Bookmark"
- class = "MonoDevelop.EditorBindings.Commands.PrevBookmark"/>
- <ToolbarItem id = "NextBookmark"
- icon = "Icons.16x16.GotoNextbookmark"
- _tooltip = "Next Bookmark"
- class = "MonoDevelop.EditorBindings.Commands.NextBookmark"/>
- <ToolbarItem id = "ClearBookmarks"
- icon = "Icons.16x16.ClearAllBookmarks"
- _tooltip = "Clear Bookmarks"
- class = "MonoDevelop.EditorBindings.Commands.ClearBookmarks"/>
- </Conditional>
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.Find" insertafter = "CutSeparator" insertbefore = "CompileSeparator" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.FindNext" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.Replace" />
+ <SeparatorItem id = "SearchSeparator" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.ToggleBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.PrevBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.NextBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.ClearBookmarks" />
</Extension>
<Extension path = "/SharpDevelop/Workbench/MainMenu">
- <MenuItem id = "Search" insertafter ="View" insertbefore ="Tools" _label = "_Search">
- <Conditional action="Disable">
- <Or>
- <Condition openwindow="MonoDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/>
- <Condition openproject="*"/>
- </Or>
-
- <MenuItem id = "Find"
- _label = "_Find..."
- icon = "Icons.16x16.FindIcon"
- description = "${res:XML.MainMenu.SearchMenu.Find.Description}"
- shortcut = "Control|F"
- class = "MonoDevelop.DefaultEditor.Commands.Find"/>
- <MenuItem id = "FindNext"
- _label = "Find _Next"
- icon = "Icons.16x16.FindNextIcon"
- description = "${res:XML.MainMenu.SearchMenu.FindNext.Description}"
- shortcut = "F3"
- class = "MonoDevelop.DefaultEditor.Commands.FindNext"/>
- <MenuItem id = "Replace"
- _label = "_Replace..."
- icon = "Icons.16x16.ReplaceIcon"
- description = "${res:XML.MainMenu.SearchMenu.Replace.Description}"
- shortcut = "Control|R"
- class = "MonoDevelop.DefaultEditor.Commands.Replace"/>
- </Conditional>
-
- <MenuItem id = "SearchSeparator" _label = "-" />
- <MenuItem id = "FindInFiles"
- _label = "F_ind In Files..."
- icon = "Icons.16x16.FindInFiles"
- description = "${res:XML.MainMenu.SearchMenu.FindInFiles.Description}"
- class = "MonoDevelop.DefaultEditor.Commands.FindInFiles"/>
- <MenuItem id = "ReplaceInFiles"
- _label = "R_eplace In Files..."
- icon = "Icons.16x16.ReplaceInFiles"
- description = "${res:XML.MainMenu.SearchMenu.ReplaceInFiles.Description}"
- class = "MonoDevelop.DefaultEditor.Commands.ReplaceInFiles"/>
-
- <MenuItem id = "SearchInFilesSeparator" _label = "-" />
- <Conditional activewindow="MonoDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
-
- <MenuItem id = "ToggleBookmark"
- _label = "_Toggle Bookmark"
- description = "${res:XML.MainMenu.SearchMenu.ToggleBookmark.Description}"
- shortcut = "Control|F2"
- icon = "Icons.16x16.ToggleBookmark"
- class = "MonoDevelop.EditorBindings.Commands.ToggleBookmark"/>
- <MenuItem id = "PrevBookmark"
- _label = "_Previous Bookmark"
- description = "${res:XML.MainMenu.SearchMenu.PrevBookmark.Description}"
- shortcut = "Alt|F2"
- icon = "Icons.16x16.GotoPrevbookmark"
- class = "MonoDevelop.EditorBindings.Commands.PrevBookmark"/>
- <MenuItem id = "NextBookmark"
- _label = "_Next Bookmark"
- description = "${res:XML.MainMenu.SearchMenu.NextBookmark.Description}"
- shortcut = "F2"
- icon = "Icons.16x16.GotoNextbookmark"
- class = "MonoDevelop.EditorBindings.Commands.NextBookmark"/>
- <MenuItem id = "ClearBookmarks"
- _label = "_Clear Bookmarks"
- description = "${res:XML.MainMenu.SearchMenu.ClrBookmark.Description}"
- icon = "Icons.16x16.ClearAllBookmarks"
- class = "MonoDevelop.EditorBindings.Commands.ClearBookmarks"/>
- <MenuItem id = "Separator2" _label = "-" />
- <MenuItem id = "GotoLineNr"
- _label = "_Goto Line..."
- description = "${res:XML.MainMenu.SearchMenu.GotoLineNr.Description}"
- shortcut = "Control|G"
- class = "MonoDevelop.DefaultEditor.Commands.GotoLineNumber"/>
- <MenuItem id = "Separator3" _label = "-" />
- <MenuItem id = "GotoBrace"
- _label = "Goto Matching _Brace"
- description = "${res:XML.MainMenu.SearchMenu.GotoBrace.Description}"
- shortcut = "Control|B"
- class = "MonoDevelop.DefaultEditor.Commands.GotoMatchingBrace"/>
- </Conditional>
- </MenuItem>
+ <ItemSet id = "Search" insertafter ="View" insertbefore ="Tools" _label = "_Search">
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.Find" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.FindNext" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.Replace" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.FindSelection" />
+
+ <SeparatorItem id = "SearchSeparator" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.FindInFiles" />
+ <CommandItem id = "MonoDevelop.Commands.SearchCommands.ReplaceInFiles" />
+
+ <SeparatorItem id = "SearchInFilesSeparator" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.ToggleBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.PrevBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.NextBookmark" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.ClearBookmarks" />
+
+ <SeparatorItem id = "Separator2" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.GotoLineNumber" />
+ <SeparatorItem id = "Separator3" />
+ <CommandItem id = "MonoDevelop.DefaultEditor.EditorCommands.GotoMatchingBrace" />
+ </ItemSet>
</Extension>
<!--
@@ -253,7 +187,7 @@
_label = "${res:XML.MainMenu.WindowMenu.Split}"
icon = "Icons.16x16.SplitWindow"
description = "${res:XML.MainMenu.WindowMenu.Split.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.SplitTextEditor"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.SplitTextEditor"/>
</Conditional>
</Extension>
-->
@@ -266,52 +200,52 @@
<MenuItem id = "RemoveLeadingWs"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.RlWs}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.RlWs.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.RemoveLeadingWS"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.RemoveLeadingWS"/>
<MenuItem id = "RemoveTrailingWs"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.RtWs}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.RtWs.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.RemoveTrailingWS"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.RemoveTrailingWS"/>
<MenuItem id = "Seperator1" _label = "-" />
<MenuItem id = "UpperCase"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.UpperCase}"
icon = "Icons.16x16.LowerToUpperCase"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.UpperCase.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ToUpperCase"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ToUpperCase"/>
<MenuItem id = "LowerCase"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.LowerCase}"
icon = "Icons.16x16.UpperToLowerCase"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.LowerCase.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ToLowerCase"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ToLowerCase"/>
<MenuItem id = "Capitalize"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.Capitalize}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.Capitalize.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.CapitalizeAction"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.CapitalizeAction"/>
<MenuItem id = "InvertCase"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.InvertCase}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.InvertCase.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.InvertCaseAction"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.InvertCaseAction"/>
<MenuItem id = "Separator2" _label = "-" />
<MenuItem id = "SortSelection"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.SortLines}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.SortLines.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.SortSelection"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.SortSelection"/>
<MenuItem id = "Separator3" _label = "-" />
<MenuItem id = "Tabs2Spaces"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.Tab2Space}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.Tab2Space.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ConvertTabsToSpaces"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ConvertTabsToSpaces"/>
<MenuItem id = "Spaces2Tabs"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.Space2Tab}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.Space2Tab.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ConvertSpacesToTabs"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ConvertSpacesToTabs"/>
<MenuItem id = "LeadingTabs2Spaces"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.LdTab2Space}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.LdTab2Space.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ConvertLeadingTabsToSpaces"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ConvertLeadingTabsToSpaces"/>
<MenuItem id = "LeadingSpaces2Tabs"
_label = "${res:XML.MainMenu.EditMenu.FormatMenu.LdSpace2Tab}"
description = "${res:XML.MainMenu.EditMenu.FormatMenu.LdSpace2Tab.Description}"
- class ="MonoDevelop.DefaultEditor.Commands.ConvertLeadingSpacesToTabs"/>
+ class ="MonoDevelop.DefaultEditor.EditorCommands.ConvertLeadingSpacesToTabs"/>
</Conditional>
</MenuItem>
<MenuItem insertafter = "Format" insertbefore = "Separator3" id = "Folding" _label = "${res:XML.MainMenu.EditMenu.FoldingMenu}">
@@ -320,17 +254,17 @@
_label = "${res:XML.MainMenu.EditMenu.FoldingMenu.ToggleFolding}"
description = "Toggles the current selected folding"
shortcut = "Shift|Control|M"
- class = "MonoDevelop.DefaultEditor.Commands.ToggleFolding"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ToggleFolding"/>
<MenuItem id = "ToggleAllFoldings"
_label = "${res:XML.MainMenu.EditMenu.FoldingMenu.ToggleAllFoldings}"
description = "Toggles all foldings"
shortcut = "Shift|Control|L"
- class = "MonoDevelop.DefaultEditor.Commands.ToggleAllFoldings"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ToggleAllFoldings"/>
<MenuItem id = "ShowDefinitionsOnly"
_label = "${res:XML.MainMenu.EditMenu.FoldingMenu.ShowDefinitions}"
description = "Shows only the definitions"
shortcut = "Shift|Control|P"
- class = "MonoDevelop.DefaultEditor.Commands.ShowDefinitionsOnly"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ShowDefinitionsOnly"/>
</Conditional>
</MenuItem>
<MenuItem insertafter = "Separator2" insertbefore = "SelectAll" id = "Separator3" _label = "-" />
@@ -378,19 +312,19 @@
insertafter = "Separator1" insertbefore = "Separator2"
_label = "${res:XML.MainMenu.ToolMenu.InsColor}"
description = "${res:XML.MainMenu.ToolMenu.InsColor.Description}"
- class = "MonoDevelop.DefaultEditor.Commands.ShowColorDialog"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.ShowColorDialog"/>
<MenuItem id = "Separator2" _label = "-" />
<MenuItem id = "GenerateCodeAction"
insertafter = "Separator2"
_label = "${res:XML.MainMenu.ToolMenu.GenerateCode}"
description = "${res:XML.MainMenu.ToolMenu.GenerateCode.Description}"
- class = "MonoDevelop.DefaultEditor.Commands.GenerateCodeAction"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.GenerateCodeAction"/>
<MenuItem id = "ShowQuickHelp"
_label = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc}"
description = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc.Description}"
shortcut = "Control|Q"
- class = "MonoDevelop.DefaultEditor.Commands.QuickDocumentation"/>
+ class = "MonoDevelop.DefaultEditor.EditorCommands.QuickDocumentation"/>
<MenuItem id = "Separator3" _label = "-" />
</Conditional>
</Extension>
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs 2005-04-25 20:35:11 UTC (rev 2474)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs 2005-04-25 20:35:47 UTC (rev 2475)
@@ -7,6 +7,7 @@
using MonoDevelop.Core.Services;
using MonoDevelop.Services;
+using MonoDevelop.DefaultEditor;
namespace MonoDevelop.Services
{
@@ -39,7 +40,7 @@
public override void InitializeService ()
{
base.InitializeService ();
-
+
if (!File.Exists (file))
return;
More information about the Monodevelop-patches-list
mailing list