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