|
From: Christopher W. <caw...@us...> - 2006-02-24 20:04:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv451/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyEditorActionContributor.java Log Message: add in go to matching bracket action Index: RubyEditorActionContributor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RubyEditorActionContributor.java 10 Feb 2006 20:14:31 -0000 1.10 --- RubyEditorActionContributor.java 24 Feb 2006 20:04:22 -0000 1.11 *************** *** 1,4 **** --- 1,7 ---- package org.rubypeople.rdt.internal.ui.rubyeditor; + import java.util.ResourceBundle; + + import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.Separator; *************** *** 8,13 **** --- 11,19 ---- import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; import org.eclipse.ui.texteditor.ITextEditor; + import org.eclipse.ui.texteditor.ITextEditorActionConstants; + import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; import org.eclipse.ui.texteditor.RetargetTextEditorAction; import org.rubypeople.rdt.internal.ui.RubyUIMessages; + import org.rubypeople.rdt.ui.actions.IRubyEditorActionDefinitionIds; import org.rubypeople.rdt.ui.actions.RubyActionIds; *************** *** 15,24 **** --- 21,36 ---- protected RetargetTextEditorAction contentAssistProposal; + private RetargetTextEditorAction fGotoMatchingBracket; public RubyEditorActionContributor() { super(); + ResourceBundle b = RubyEditorMessages.getBundleForConstructedKeys(); contentAssistProposal = new RetargetTextEditorAction(RubyUIMessages.getResourceBundle(), "ContentAssistProposal."); + fGotoMatchingBracket = new RetargetTextEditorAction(b, "GotoMatchingBracket."); //$NON-NLS-1$ + fGotoMatchingBracket + .setActionDefinitionId(IRubyEditorActionDefinitionIds.GOTO_MATCHING_BRACKET); + } *************** *** 29,32 **** --- 41,50 ---- editMenu.add(contentAssistProposal); } + + IMenuManager gotoMenu= menuManager.findMenuUsingPath("navigate/goTo"); //$NON-NLS-1$ + if (gotoMenu != null) { + gotoMenu.add(new Separator("additions2")); //$NON-NLS-1$ + gotoMenu.appendToGroup("additions2", fGotoMatchingBracket); //$NON-NLS-1$ + } } *************** *** 34,45 **** super.setActiveEditor(part); ! ITextEditor editor = null; ! if (part instanceof ITextEditor) editor = (ITextEditor) part; ! contentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); ! IActionBars bars = getActionBars(); ! bars.setGlobalActionHandler(RubyActionIds.COMMENT, getAction(editor, "Comment")); ! bars.setGlobalActionHandler(RubyActionIds.UNCOMMENT, getAction(editor, "Uncomment")); } } --- 52,76 ---- super.setActiveEditor(part); ! ITextEditor textEditor = null; ! if (part instanceof ITextEditor) textEditor = (ITextEditor) part; ! contentAssistProposal.setAction(getAction(textEditor, "ContentAssistProposal")); ! fGotoMatchingBracket.setAction(getAction(textEditor, ! GotoMatchingBracketAction.GOTO_MATCHING_BRACKET)); ! IActionBars actionBars = getActionBars(); ! actionBars.setGlobalActionHandler(RubyActionIds.COMMENT, getAction(textEditor, "Comment")); ! actionBars.setGlobalActionHandler(RubyActionIds.UNCOMMENT, getAction(textEditor, ! "Uncomment")); ! ! /** The global actions to be connected with editor actions */ ! IAction action = getAction(textEditor, ITextEditorActionConstants.NEXT); ! actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, ! action); ! actionBars.setGlobalActionHandler(ITextEditorActionConstants.NEXT, action); ! action = getAction(textEditor, ITextEditorActionConstants.PREVIOUS); ! actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, ! action); ! actionBars.setGlobalActionHandler(ITextEditorActionConstants.PREVIOUS, action); } } |