JBoss tools for JSP: Make content assist work for Bootstrap "class" as in HTML Editor - autocomplete

I am working in JBoss Tools editors for HTML and JSP pages in Eclipse Luna.
One interesting thing I found about the different way these two editors work, is that some time they can auto-complete, but sometimes JBoss JSP editors fails. More precisely, when it comes to the "class" attribute which come with Bootstrap 3, the HTML editor works while JSP editor fails. Even though I can open the .jsp file with JBoss HTML editor, the problem persists.
Is there some way to fix this?? They work consistently in some other cases, like this:
When I have a <form>, and I type enctype=" or even enc, in both editors when you press alt + /, you will have enctype="application/x-www-form-urlencoded", which is amazing.
I attach GIF to show this strange behaviour:

Thanks to #Alexey Kazakov I have checked my login.jsp page and I found that bootstrap.css is not introduced in this page, but in other pages, jsp as well as html, this file is introduced in <head> part. So the editor is not working wrongly, it's my fault.
So JBoss Tools stay to be fantastic. ;)

Related

how to see jsp page in eclipse while designing?

I was wondering is there any way to see the jsp page in eclipse while designing like we can in dreamweaver, I did search this on allmight google but did't find anything helpful.. Any Help?
Go to Eclipse Windows>Preferences>General>Editors?File Associations and Select .jsp. Make Web Page Editor as default in the below screen. So when you open any .jsp you see different views below.

Aptana's css autocomplete doesn't update itself

I'm doing an web project and all pages have the .php suffix. I started with a single css (style-default.css) file and the auto-complete worked perfectly. Now I changed that css filename (to custom.css) and added some more css files (Foundation 3 framework).
The strange thing is when typing class="..." the autocomplete only shows me options for the custom.css although it displays the name "style-default.css" and no suggestions at all for the "foundation.min.css". I checked and both files are included in the build despite I can't build a web project. Is there any way to refresh the auto-complete?
I even tried removing the project and importing it again, but it didn't worked.
Ok I found out... Aptana auto-complete apparently can't read *.min.css. I included the *.css instead and the suggestions appeared. Still, the outdated filenames looks like a bug to me.

Eclipse Indigo generating HTML5 warnings in HTML4 snippets

I work for a company who's primary clients still use Internet Explorer 7 (NHS etc).
In our code we generate snippets of HTML in various places and Eclipse is generating lots of warnings relating to markup that is obsolete in HTML5.
I know that setting a valid doctype of HTML4 fixes the problem on flat html files but as we build the code over several PHP files we can't set a doctype in the snippets.
Is there a way to change the 'default' doctype to HTML4 globally or by project as I do not want to turn off the warnings as that may cause me to miss actual issues.
Drove me nuts too until I found the answer...
http://www.eclipse.org/forums/index.php/t/219788/
Steps:
Select an HTML file in the PHP Explorer. If there are no HTML files, create a new one.
Right-click > Properties > Web Content Settings.
Choose preferred doctype in the Document type list.
Click OK and exit Eclipse.
Open {your_workspace}/{your_project}/.settings/org.eclipse.wst.html.core.prefs with a text editor.
Replace document-type/{your_file_name}=... by document-type/<project>=... (do not modify <project>, paste it as-is)
Start Eclipse.

How to make auto-indent work in Eclipse for jsp/jsf/xhtml pages?

I'm using Eclipse Helios with WTP.
I would like eclipse to auto-indent jsf pages. Eclipse fails to do that properly and I didn't find any place that I can configure what I want.
Examples of bad auto-indentation
<li><c:if test="${userSession.loggedUser eq null}">
also
</h:outputLink></li>
The only configuration I found is in Preferences -> XML -> Editor and there are only a handful of options none of which say split new elements on a new line although it has the useless split attributes on a new line.
Currently I'm jsf + richfaces, but this problem exists since jsp was the top of the web stack.
Have you also checked the available preferences under HTML?

Eclipse JSF + facelet - opening and editing page is slow

When opening JSF page (JSF + Apache Trinidad + facelet) in Eclipse (Helios), Eclipse freezes for a few seconds before the page is opened.
Also when editing the page, code complete / syntax verification is slow - for example I type <tr: and again I have to wait a few seconds before I can continue typing or tr tags are display.
It is very annoying that I have to wait each time when typing opening tag and slows me down a lot.
I am also using custom facelet tags.
What to do to avoid Eclipse freezing / slowing down? Do I have to change any configuration to speed it up?
I tried using the XHTML Editor instead of the JSF editor, and the freezing seems to have stopped.
I right clicked on my *.xhtml file and selected Open with->XHTML Designer
Also, you could change the way *.xhtml files are opened by going to Window->Preferences, then General->Editors->File Associations. Select the *.xhtml extension from the File types: pane, and then select XHTML Designer in the Associated editors: pane. To make the XHTML Editor the default editor for *.xhtml files, click the "Default" button next to the Associated editors: pane.
Turn off hyperlinks in your editor by going to the following path
Go to Window -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking preference,
uncheck the option Open Declaration
I had this problems for weeks, and I've found a solution:
Install JBoss Tools > JBoss Web and Java EE Development > Visual Page
Editor (only this subpackage)
After you can edit XHTML files with:
Open with > JBoss Tools HTML Editor
It's faster and gives you a better page preview
Some profiling show that the slowness is due to
org/eclipse/jst/jsf/context/symbol/internal/impl/IJavaTypeDescriptor2Impl.class
Its related to org.eclipse.jst.jsf.common_1.2.2.v201101211220.jar of WebTool 1.2.2
The solution is to update to the last WebTool version
WebTool 3.6.2 update page
using Update Webtool Luna link
Adding metadata-complete=true to WEB-INF/faces-config.xml is a good way to prevent WebTool packages classes scanning, but AnnotationConfigurator.createFacesConfig must be modified !
For eclipse
Windows -> Preferences -> Editor -> File associations
then select XHtml.
After the selection there will be three options in the bottom window select HTML editor and click default. This solved the problem for me.
Please make sure to close all the opened XHtml pages and restart the eclipse.