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 - HTML "rename" element (F2)
Summary: HTML "rename" element (F2)
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 17:27 UTC by pekarna
Modified: 2013-08-27 13:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?