Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

My Weekly NetBeans Tip (2): Comment/Uncomment XML Tags

DZone's Guide to

My Weekly NetBeans Tip (2): Comment/Uncomment XML Tags

· Java Zone
Free Resource

Learn how to troubleshoot and diagnose some of the most common performance issues in Java today. Brought to you in partnership with AppDynamics.

My tip for this week is similar to my tip from last week. Last week I showed how to surround a selection of Java code with an editor fold. Now I will show how to surround a selection of XML tags with the uncomment tags. When you complete the steps in this tip, then whenever you select XML tags, you will automatically see the small yellow tip with one hint, for surrounding with uncomment:

When you select that hint, you will see this:

     

  1. Go to Tools | Options | Editor | Code templates.

  2. Select XML in the Language
  3. Click New, enter "un" as the abbreviation, then enter the following code as the expanded text:

    <!--
    ${selection line}${cursor}-->

  4. In the Description tab, enter "Uncomment", and click OK.

Now it will work like shown above. The tip is based on my previous tip. Hope you like it!

Understand the needs and benefits around implementing the right monitoring solution for a growing containerized market. Brought to you in partnership with AppDynamics.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}