This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 169400

Summary: Need toggle comment and jump-to-next-occurrence actions
Product: javafx Reporter: Torbjorn Norbye <tor>
Component: EditorAssignee: Martin Krauskopf <mkrauskopf>
Status: VERIFIED FIXED    
Severity: blocker CC: trembovetski
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 130138    
Attachments: A patch which implements these two behaviors

Description Torbjorn Norbye 2009-07-29 01:56:00 UTC
The JavaFX editor is missing these two editor features:

(1) Toggle comment. (It has Comment, and it has Uncomment, but not the more useful Toggle Comment editor action).
(2) Go to Previous/Next Mark Occurrence. (When your caret is over a highlighted occurrence, press Ctrl-Up/Down to cycle
through the other occurrences in the same document).

I've filed this as an enhancement request, but I really think this is close to a defect, because all other languages in
the IDE that have comment/uncomment and have mark occurrences support the above two features.

I am attaching a patch which adds these features.  The patch is relative to changeset 62effbd0744d which I think is the
changeset corresponding to NetBeans 6.7.1 JavaFX support FCS?

As you can see the patch is trivial, because in the case of mark occurrences, parts of the feature are already there in
the code - such as keybinding registrations in your DefaultKeybindings.xml file. I simply added a copy of the Java
go-to-marks action, with one tweak that I jump to the middle of a symbol instead of the beginning of a symbol because in
some cases, setting the caret to the beginning of a symbol does not highlight that symbol as an occurrence match, so in
some cases you could cycle your way out of an occurrence.

Toggle comment is even easier; the action is already built in, we simply have to register it with the editor kit and
tell it the comment prefix to use.
Comment 1 Torbjorn Norbye 2009-07-29 01:56:39 UTC
Created attachment 85388 [details]
A patch which implements these two behaviors
Comment 2 dkkopp 2009-08-04 20:26:33 UTC
This would be a huge addition to the JavaFX editor. Please add it.
Comment 3 Torbjorn Norbye 2009-10-27 04:14:25 UTC
Please?

I can check it in myself... the patch still compiles and works with the trunk...
Comment 4 Martin Krauskopf 2009-11-25 02:36:31 UTC
Thanks for the patch, applied: #23d5d4b03852
Comment 5 Alexandr Scherbatiy 2009-12-18 02:36:28 UTC
verified in NetBeans-JavaFX-Soma: #69

Alt-Up/Down works for the Go to Previous/Next Mark Occurrence as it described
in the Keyboard Shortcuts Card