facebook

Easy way (hotkey?) to comment out in XML / HTML / JSP?

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #290933 Reply

    mcintosh_i
    Member

    Hi,

    Is there any way in MyEclipse to comment out a tag or element in XML / HTML / JSP? I’m thinking like in the Eclipse Java editor where you can just do a CTRL-/ to comment out the line you’re on. I can see that the IDE is trying to help when I type

    <!--

    …because it completes it with the matching end comment, but then I have to cut and paste this to the end of the section I want commented. What I’d like is to be able to right-click on say, a <table> or a <div> and comment out the whole thing including obviously its nested elements.

    Is there anything currently available or am I looking at a feature request here?

    cheers,
    Ian

    #290944 Reply

    Loyal Water
    Member

    Ian,
    What you have pointed out is a feature request. I’ll make a note of it.

    I hope you know about the “Add Block Comments” feature though. That could prove helpful till this feature is added. You can select some lines of code in your jsp and go to Source > Add Block Comments to comment that bit of code.

    #290989 Reply

    mcintosh_i
    Member

    Thanks Nipun, but the Source > Add Block Comments doesn’t seem to do anything. At least to my .jspx file…do I have to somehow register the jspx extension so that this feature knows to treat it like a jsp?

    #291001 Reply

    Loyal Water
    Member

    You dont have to register the jspx extension. Can you please paste a sample file here for and point out the code that you are trying to comment out using “Add Block Comment”.

    #291049 Reply

    mcintosh_i
    Member

    Hi Nipun,

    As requested, here’s an example:

    <?xml version="1.0" encoding="UTF-8" ?>
    <jsp:root
        version="1.2"
        xmlns:jsp="http://java.sun.com/JSP/Page"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ice="http://www.icesoft.com/icefaces/component">
    
        <jsp:directive.page
            contentType="text/html;charset=UTF-8"
            pageEncoding="UTF-8" />
        <f:view>
            <f:loadBundle
                basename="bundle.form_labels"
                var="labels" />
            <ice:outputDeclaration
                doctypeRoot="html"
                doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
                doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
            <html>
                <head>
                    <meta
                        http-equiv="Content-Type"
                        content="text/html; charset=UTF-8" />
                    <meta
                        http-equiv="Content-language"
                        content="en" />
                    <meta
                        http-equiv="Cache-control"
                        content="no-cache" />
                    <meta
                        http-equiv="Pragma"
                        content="no-cache" />
                    <meta
                        http-equiv="Expires"
                        content="0" />
    
                    <title>demo</title>
                    <ice:outputStyle href="./xmlhttp/css/rime/rime.css" />
                    <ice:outputStyle href="./styles/webapps.css" />
    
                </head>
                <body>
                    <div id="nonFooter">
                        <jsp:directive.include file="header.html" />
    
                        <ice:form id="loginForm">
    
                            <ice:messages globalOnly="true" />
                            <h1>
                                <ice:outputText value="#{labels['common.title']}"></ice:outputText>
                            </h1>
    
                            <br />
                            <ice:outputText
                                value="#{labels['common.mandatory_text']}"
                                styleClass="mandatory_field" />
                            <ice:outputText
                                style="color:red"
                                value="#{labels['common.mandatory_indicator']}" />
                            <br />
                            <br />
                            <h3>
                                <ice:outputText value="#{labels['pages.login.title']}"></ice:outputText>
                            </h3>
                            <br />
                            <ice:panelGrid
                                id="loginTable"
                                columns="2">
    
                                <ice:outputText
                                    value="#{labels['pages.login.label.username']}"
                                    style="float:right;" />
                                <ice:panelGroup>
                                    <ice:inputText
                                        id="username"
                                        required="true"
                                        styleClass="mandatory_field" />
                                    <ice:outputText
                                        style="color:red"
                                        value="#{labels['common.mandatory_indicator']}" />
                                    <ice:message
                                        style="color:red"
                                        for="username" />
                                </ice:panelGroup>
    
                                <ice:outputText
                                    value="#{labels['pages.login.label.password']}"
                                    style="float:right;" />
                                <ice:panelGroup>
                                    <ice:inputText
                                        id="password"
                                        required="true"
                                        styleClass="mandatory_field" />
                                    <ice:outputText
                                        style="color:red"
                                        value="#{labels['common.mandatory_indicator']}" />
                                    <ice:message
                                        style="color:red"
                                        for="password" />
                                </ice:panelGroup>
    
                                <ice:outputText />
    
                                <ice:commandButton
                                    id="loginButton"
                                    value="#{labels['pages.login.button.login']}"
                                    action="login"
                                    type="submit" />
    
                            </ice:panelGrid>
                        </ice:form>
                    </div><jsp:directive.include file="footer.html" />
                </body>
            </html>
        </f:view>
    </jsp:root>
    

    Any attempt within MyEclipse to use the Add Block Comment feature does nothing – the file is unchanged. As I said the file extension is .jspx.

    cheers,
    Ian

    #291092 Reply

    Loyal Water
    Member

    Ian,
    Can you select the complete <head> block and go to Source > Add Block Comment. Does it work? It works for me …

    
    <head>
                <meta
                   http-equiv="Content-Type"
                   content="text/html; charset=UTF-8" />
                <meta
                   http-equiv="Content-language"
                   content="en" />
                <meta
                   http-equiv="Cache-control"
                   content="no-cache" />
                <meta
                   http-equiv="Pragma"
                   content="no-cache" />
                <meta
                   http-equiv="Expires"
                   content="0" />
    
                <title>demo</title>
                <ice:outputStyle href="./xmlhttp/css/rime/rime.css" />
                <ice:outputStyle href="./styles/webapps.css" />
    
             </head>
    
    #291104 Reply

    mcintosh_i
    Member

    Hi Nipun.

    No unfortunately in my IDE that does nothing.

    I’m using MyEclipse 6.0 on top of Eclipse version 6.0.1-GA-200710 inside an Oracle-flavoured Red Hat Linux virtual machine..

    cheers,
    Ian

    #291130 Reply

    Loyal Water
    Member

    Ian,
    I guess you should upgrade to MyEclipse 6.6 ans test this again. This might have been an old issue that was fixed in a later release. I can get the block comment to work with my copy of 6.6.

    #291221 Reply

    rmcvay
    Member

    The 6.6 XML editor will not do comments (ctrl-/, ctrl-shift-/) at all.

    #291240 Reply

    mcintosh_i
    Member

    Thanks, I was beginning to think it was just my environment

    The 6.6 XML editor will not do comments (ctrl-/, ctrl-shift-/) at all.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Easy way (hotkey?) to comment out in XML / HTML / JSP?

You must be logged in to post in the forum log in