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 246807 - [801cat] Refactor "Extract include"
Summary: [801cat] Refactor "Extract include"
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF Editor (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-01 19:50 UTC by muellermi
Modified: 2016-07-07 08:54 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
IDE log (84.43 KB, text/plain)
2014-09-01 19:50 UTC, muellermi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muellermi 2014-09-01 19:50:46 UTC
Product Version = NetBeans IDE 8.0.1 (Build 201408142300)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0_11
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.11-b03

Given a JSF page with code like this:

      <footer>
        &copy; Michael Müller
        |
        <h:outputLink value="http://blog.mueller-bruehl.de">
          Michael's Blog
        </h:outputLink>
        |
        <h:link value="About" outcome="/welcome.xhtml"/>
      </footer>

Now, the user marks some text, in this example the text between the footer tags and chooses the function to be implemented: "Extract include"

NetBeans queries the include name (in example: "/common/footer.xhtml") and replace the code by

            <footer>
              <ui:include src="/common/footer.xhtml"/>
            </footer>

NetBeans creates a new file, a ui:composition, with the given name ("/common/footer.xhtml") and places the move content into:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html [<!ENTITY copy "&#169;">]>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

  &copy; Michael Müller
  |
  <h:outputLink value="http://blog.mueller-bruehl.de">
    Michael's Blog
  </h:outputLink>
  |
  <h:link value="About" outcome="/welcome.xhtml"/>
</ui:composition>

Bonus: as in this example, an HTML entity which is used in the snipped to move, is declared in the DOCTYPE.
Comment 1 muellermi 2014-09-01 19:50:50 UTC
Created attachment 148981 [details]
IDE log
Comment 2 Martin Fousek 2014-09-12 06:52:11 UTC
Thanks for good tip for enhancement. Targeting to next for now.
Comment 3 Martin Balin 2016-07-07 08:54:59 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss