Eclipse JSF + facelet - opening and editing page is slow - eclipse

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.

Related

Ecplise "mark occurrences" in HTML editor

I wonder why the option "mark occurrences" isn't available (the button is grayed-inactive) when editing HTML files (*.html, *.htm extension). Is there an option to enable this feature in HTML editor in Ecplise (i'm running Eclipse Mars.2)?
I had your same problem with Aptana's HTML editor, and was finally able to resolve the issue.
First check to make sure this option is selected (by Default in Aptana for HTML, it is not). Go to Windows -> Preferences -> Aptana Studio ->Editors -> HTML. The very first option needs to be checked: "Mark occurrences with background color".
If the above did not work, you could try checking to see if you also have an additional installed software in Aptana that might be causing a conflict (this is actually what corrected my issue). I did have an additional software program added to aptana (called "Colorer"), which unbeknownst to me was disabling this functionality. If you have similar add-ins added to your installation, and they are not crucial to your workflow, I suggest removing them if the first option did not fix your issue. Once I removed my add-in, my Mark Occurrences for HTML (and CSS) came back to life.

Eclipse : Run an external software in editor view

I am using Eclipse to edit almost any file that I code. But for some, I prefer to use gEdit (for instance CoffeeScript files).
I wondered if there was a way to somehow embed the UI of gEdit (or any other software) in the Editor view of Eclipse. I could use my favorite editor in an unified environment and this could also bring the richness of the Eclipse environment to those files (even if I'm well aware that most of it won't work).
But is it ever possible ? Better, is there already a plugin for that ?
Thanks for your help !
I wondered if there was a way to somehow embed the UI of gEdit (or any other software) in the Editor view of Eclipse.
No, there isn't.
However, you can execute an external editor from Eclipse.
From the main Eclipse menu, left click on Window -> Preferences.
On the Preferences dialog, left click General -> Editors -> File Associations.
For any file type, you can associate one or more editors. These editors can be external to Eclipse.
Once you've done this, you can bring up your external editor by double clicking on the module name in the Package Explorer.
After you're finished editing with an external editor, refresh the module so Eclipse knows you've made changes.
SWT allows to integrate apps using OLE. Unluckily this is obviously available only when running on Windows.
For more info, see this article by Lars Vogel.

Eclipse Java EE Indigo 's XML formatting is suddenly screwed up

A few days ago it was just fine. I haven't made any change to the IDE or anything else in the preferences.
Looks like random instability, but I hope I'm wrong, I don't want to go through the IDE setup again.......
Here are two screenshots to tell the story:
Before Ctrl+Shift+F (format):
After (format results):
What can I do about it?
I've tried comparing settings in another Eclipse setup that I have which has XML formatting working properly. (Window -> Preferences -> XML -> XML Files -> Editor). Also (Structured Text Editors).
Solved.
It looks like "Android Common XML Editor" took over, and the above crappy formatting belongs to it.
All I had to do is right click on the XML file and choose Open With -> XML Editor.
You can revert the default editor for XML files to be the original XML Editor at Preferences / General / Editors / File Associations:

GWT Designer lags on xml source autocomplete

Some pretense:
Using MyEclipse 8.6 with GWT 2.2.0. As you know it comes with GWT Designer now.
I've noticed that while editing the xml within GWT Designer, every time I type in a new attribute to a tag it starts to lag. The exact point is when I press '='. This lag freezes eclipse for about 1-2 minutes. As you can imagine, it makes using XML Source for UIBinder almost unbearable. I assume the lag is due to eclipse looking up suggestions to put into an auto complete drop down, but it takes a whopping 1-2 minutes.
My question is:
How do you prevent eclipse from this type of lag while editing the XML source in GWT Designer? What are you developers doing to get around it?
Read here: https://groups.google.com/forum/#!topic/google-web-toolkit/2j0RulDMfgc/discussion.
You need to download the 2 xsd:
http://dl.google.com/gwt/dtd/com.google.gwt.user.client.ui.xsd
uibinder.xsd (replace com.google.gwt.user.client.ui.xsd in the url above. I can't post more than 2 urls yet...)
Then add them to the XmlCatalog (Window -> Preferences -> Xml -> XmlCatalog -> User Specified Entries -> Add.. -> FileSystem)
Worked for me.
Eclipse no longer freezes during auto complete. It still freezes if I try to format text by pressing ctrl+shift+F in the .ui.xml file.
Instead of using the WindowBuilder Editor, you can right-click on *.ui.xml file you're editing and select Open With -> UiBinder Template Editor. I am not using GWT Designer, and WindowBuilder doesn't have autocomplete for me at all, so I use UiBinder Template Editor instead.
I see a similar problem although I am using STS 2.6.0. I eventually worked around it by using the normal eclipse XML editor, right click Open With -> XML Editor but you lose autocomplete and some validation.
My first attempt was to add xhtml.ent, uibinder.xsd and com.google.gwt.user.client.ui.xsd to the XML Catalog as I suspected that it was something around blocking over the network getting these but that didn't help.
I also turned off all validation which also didn't have any effect.
So I wouldn't mind a definitive answer to this myself.

Eclipse: What are these JSP errors?

I've inherited a web application and when setting it up in Eclipse it shows errors in a particular JSP.
The errors have no description associated with them in the Problems view, and clicking them there takes me to the top of the JSP, where the red error underline appears halfway through the string like this:
<%# page erro[rPage="/basicError.j]sp" %>
[<%# page import="javax.s]ervlet.ServletContext" %>
Imagine a red 'error' underline under the parts bracketed by [] (bold, etc won't show in this code segment and I can't show the code at all unless it's in a code segment, hence using [ and ].
Other examples of the errors:
Clicking the red 'X' icon to the left of the lines does nothing.
I've tried re-importing the project, refreshing, validating, moving the lines around, etc, but I always get this error.
Does anyone know what's happening here?
Run it. Does it work? Then it's again the Eclipse's builtin JSP validator which is an epic fail. Just disable it in workspace preferences through Web > JSP Files > Validation > scroll list to very bottom and set all EL validation settings to Ignore. Also in the main Validation preference uncheck all checkboxes related to JSP. This however doesn't seem to remove every warning/error, but it at least minimizes the annoyance.
The solution that worked for me, is given in this answer.
Go to project properties > Targeted runtimes > Select the checkbox for a runtime (Apache Tomcat 7 in my case).
That's all. Just build the project now and everything will be fine
I did try disabling the jsp validation but nothing really worked, so I tried the following and it worked.
Select all the code from your jsp.
copy it in some text editor
delete everything from your jsp.
Save your jsp.[All the red lines should be gone at this step].
Copy and paste your code back in the jsp.
Save your jsp again.
Done.
Right Click your project >> Build Path >> Configure Build Path
Step 1:
In libraries tab you should have proper version of JRE system library(eg:JRE System Library [JRE7]) and server library(eg: Apache tomcat V7.0)
If not then click add library >> JRE System library >> select installed jre version
also add library >> server runtime >> select your installed server
Step 2:
Go in order and export tab
make sure JRE System Library and server library is checked,
click ok