@@ -130,6 +130,7 @@ public class MirthRSyntaxTextArea extends RSyntaxTextArea implements MirthTextIn
130130private CustomJCheckBoxMenuItem wrapLinesMenuItem ;
131131private JMenu codeMenu ;
132132private CustomMenuItem formatCodeMenuItem ;
133+ private CustomMenuItem toggleCommentMenuItem ;
133134private JMenu macroMenu ;
134135private CustomMenuItem beginMacroMenuItem ;
135136private CustomMenuItem endMacroMenuItem ;
@@ -233,6 +234,7 @@ public void keyPressed(KeyEvent e) {
233234wrapLinesMenuItem = new CustomJCheckBoxMenuItem (this , new WrapLinesAction (this ), ActionInfo .DISPLAY_WRAP_LINES );
234235codeMenu = new JMenu ("Code" );
235236formatCodeMenuItem = new CustomMenuItem (this , new FormatCodeAction (this ), ActionInfo .FORMAT_CODE );
237+ toggleCommentMenuItem = new CustomMenuItem (this , new ToggleCommentAction (this ), ActionInfo .TOGGLE_COMMENT );
236238macroMenu = new JMenu ("Macro" );
237239beginMacroMenuItem = new CustomMenuItem (this , new BeginMacroAction (), ActionInfo .MACRO_BEGIN );
238240endMacroMenuItem = new CustomMenuItem (this , new EndMacroAction (), ActionInfo .MACRO_END );
@@ -245,7 +247,7 @@ public void keyPressed(KeyEvent e) {
245247getActionMap ().put (ActionInfo .JOIN_LINE .getActionMapKey (), new JoinLineAction ());
246248getActionMap ().put (ActionInfo .GO_TO_MATCHING_BRACKET .getActionMapKey (), new GoToMatchingBracketAction ());
247249getActionMap ().put (ActionInfo .FORMAT_CODE .getActionMapKey (), new FormatCodeAction (this ));
248- getActionMap ().put (ActionInfo .TOGGLE_COMMENT .getActionMapKey (), new ToggleCommentAction ());
250+ getActionMap ().put (ActionInfo .TOGGLE_COMMENT .getActionMapKey (), new ToggleCommentAction (this ));
249251getActionMap ().put (ActionInfo .DOCUMENT_START .getActionMapKey (), new DocumentStartAction (false ));
250252getActionMap ().put (ActionInfo .DOCUMENT_SELECT_START .getActionMapKey (), new DocumentStartAction (true ));
251253getActionMap ().put (ActionInfo .DOCUMENT_END .getActionMapKey (), new DocumentEndAction (false ));
@@ -496,6 +498,7 @@ protected JPopupMenu createPopupMenu() {
496498menu .addSeparator ();
497499
498500codeMenu .add (formatCodeMenuItem );
501+ codeMenu .add (toggleCommentMenuItem );
499502menu .add (codeMenu );
500503menu .addSeparator ();
501504
@@ -525,6 +528,7 @@ protected void configurePopupMenu(JPopupMenu popupMenu) {
525528clearMarkedOccurrencesMenuItem .setEnabled (clearMarkedOccurrencesMenuItem .getAction ().isEnabled () && canType && ((RSyntaxTextAreaHighlighter ) getHighlighter ()).getMarkAllHighlightCount () > 0 );
526529foldingMenu .setEnabled (getFoldManager ().isCodeFoldingSupportedAndEnabled ());
527530formatCodeMenuItem .setEnabled (formatCodeMenuItem .getAction ().isEnabled ());
531+ toggleCommentMenuItem .setEnabled (toggleCommentMenuItem .getAction ().isEnabled ());
528532beginMacroMenuItem .setEnabled (!isRecordingMacro ());
529533endMacroMenuItem .setEnabled (isRecordingMacro ());
530534playbackMacroMenuItem .setEnabled (!isRecordingMacro () && getCurrentMacro () != null );
@@ -545,6 +549,7 @@ protected void configurePopupMenu(JPopupMenu popupMenu) {
545549collapseAllCommentFoldsMenuItem .updateAccelerator ();
546550expandAllFoldsMenuItem .updateAccelerator ();
547551formatCodeMenuItem .updateAccelerator ();
552+ toggleCommentMenuItem .updateAccelerator ();
548553beginMacroMenuItem .updateAccelerator ();
549554endMacroMenuItem .updateAccelerator ();
550555playbackMacroMenuItem .updateAccelerator ();
0 commit comments