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 224662

Summary: HTML "rename" element (F2)
Product: web Reporter: pekarna <pekarna>
Component: HTML EditorAssignee: Marek Fukala <mfukala>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description pekarna 2013-01-09 17:27:57 UTC
Most often, if a HTML element's tag name is rewritten, it is done on both sides - start tag and end tag.

It would be very nice if NetBeans allowed navigating to the tag, press F2 and allow to rename both start and end tags.

It would work the same as renaming java variables.

 | == caret
 [...] = selection / frame

    <|h2><span>Foo</span></h2>
    F2.
    <[h2]><span>Foo</span></[h2]>

    <[|]><span>Foo</span><[]/>
    <[h|]><span>Foo</span><[h]/>
    <[h1|]><span>Foo</span><[h1]/>
    Enter.
    <|h2><span>Foo</span></h2>

Done.
Comment 1 pekarna 2013-01-09 17:40:09 UTC
Actually, more refactoring concepts could be used here.
If the DOM would be well-formed, NetBeans could also allow

* deleting, 
* perhaps copy/cut and paste, selecting whole element including inner content,
* move up/down, which would swap the element with it's parent / 1st child,
etc.

Just for inspiration :)
Comment 2 pekarna 2013-01-09 17:43:08 UTC
* deleting the element but leaving inner content,

And all these actions could also nicely bind to actions in Navigator - drag&drop, deleting, shift-del, ctrl-c / ctrl-v...
Comment 3 Marek Fukala 2013-08-27 13:39:31 UTC
1) instant rename allows to edit the element's open/end tag simultaneously as you propose. Use Ctr/Cmd-R when in open/close tag.

2) select/deselect code block actions (Ctrl-Shift-, Ctrl-Shift-.) allows you to select a text/surrounding element/its parent/...

3) surround with tag/remove surrounding tag fixes for selection are available then.

Does this satisfy your needs?