Summary: | [nls tooling] Properties file editor should have "toggle comment" action | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Alex Miller <alexdmiller> | ||||||
Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | enhancement | ||||||||
Priority: | P3 | CC: | alexdmiller, brockj, daniel_megert, thatnitind | ||||||
Version: | 3.2.2 | Keywords: | contributed | ||||||
Target Milestone: | 3.4 M3 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Alex Miller
2007-06-11 17:14:52 EDT
Created attachment 70941 [details]
patch to org.eclipse.jdt.ui
This basic patch hooks into the prefix/unprefix code in the source viewer. It exposes the operation only though command keybindings (no context actions)
It does this by registering a new key binding context (editing properties files) and hooking up the existing toggle comment command used in the compilation unit editor.
Would it be possible to push down ToggleCommentAction into the text editing layer? The action should work for all languages that have single line comments
>Would it be possible to push down ToggleCommentAction into the text editing
>layer?
Yes, if we find a more generic name as the generic text framework doesn't have the notion of a comment.
(In reply to comment #2) > >Would it be possible to push down ToggleCommentAction into the text editing > >layer? > Yes, if we find a more generic name as the generic text framework doesn't have > the notion of a comment. > how about TogglePrefixAction? Under the hood it basically wraps the prefix and unprefix text editor operations. Yes, sounds good. We should then also move the corresponding tests. While moving down, I would probably only create the action in createActions() but not hook it up in the UI for all editors. Can you prepare such a patch? I will try to create something either tonight or tomorrow. I assume that also means that the command definition and keybindings also get pushed down to text? If the command is pushed down, what should the description be? Most users would not have a clue what a line prefix is. You can work around this by naming the context menu actions as "toggle comment", but you the command will still have the odd name in the keys preference page. >I will try to create something either tonight or tomorrow.
There's no hurry ;-)
Looks like it's better not to create the action createActions() for all editors but instead only provide the generic TogglePrefixAction that can then be created by the individual editor with the desired label and description.
Created attachment 71104 [details]
patch to org.eclipse.jdt.ui
Updated patch.
It does not modify the ToggleCommentAction at all as more thought is needed before pushing it down. Instead, I have cleaned up the previous patch and added the action to the context menu (by overriding createEditorContextMenu). It also re-uses the Java toggle comment command instead of creating a new one.
Also, the action is not available in the PDE property file editors because they do not activate the new keybinding scope and don't seem to use the PropertyFileEditor directly.
Thanks for the patch. I committed the patch with a few small changes: - added your credentials to the copyright notes - remove "(non-javadoc)" - added @since tags Available in builds > N20071026-0010. |