- This topic has 9 replies, 3 voices, and was last updated 16 years, 1 month ago by mcintosh_i.
-
AuthorPosts
-
mcintosh_iMemberHi,
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
Loyal WaterMemberIan,
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.
mcintosh_iMemberThanks 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?
Loyal WaterMemberYou 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”.
mcintosh_iMemberHi 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
Loyal WaterMemberIan,
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>
mcintosh_iMemberHi 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
Loyal WaterMemberIan,
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.
rmcvayMemberThe 6.6 XML editor will not do comments (ctrl-/, ctrl-shift-/) at all.
mcintosh_iMemberThanks, I was beginning to think it was just my environment
The 6.6 XML editor will not do comments (ctrl-/, ctrl-shift-/) at all.
-
AuthorPosts