Failed to create HTML page using GWT plugin for Eclipse - gwt

When i create a new GWT (version 2.3) project using the Eclipse (version 3.5) plugin, without enabling sample code, i failed to create a new HTML page by using the GWT->new HTML page. It opens the dialog window, i enter the name of the file and the module, but when i press 'finish', it does nothing! Bug or my mistake?

It is gwt eclipse plugin bug.. Here is the exception ;
java.lang.NullPointerException
at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:655)
at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:467)
at com.google.gwt.eclipse.core.wizards.NewHostPageWizard.getDocType(NewHostPageWizard.java:216)
at com.google.gwt.eclipse.core.wizards.NewHostPageWizard.getInitialContents(NewHostPageWizard.java:148)
See bug #6338

Try looking in the \war folder of your project, html files are put there.

It's a bug.
Temporary Solution:
Just create GWT Project with sample contents. than you can see html file in war.
Copy that into your project. Modify it. (It's easy to inspect)

Related

PhantomJS Project in Eclipse (with Nodeclipse): NullPointerException when trying to run js file that is present in a folder

I wish to create a PhantomJS Project in Eclipse for which I have installed the Nodeclipse PhantomJS 0.12+ plugin. I am selecting the below project type:
The script runs fine when I arrange the project in the following way (without any folders).
But, when I place the same .js file in a folder and try to run it, I end up getting a NullPointerException (see screenshot below).
The error that I'm getting is below:
An internal error occurred during: "Launching PhantomJSTest-Test1.js".
java.lang.NullPointerException
Screenshot:
What I have tried:
I found a similar question on Stackoverflow with the same error but for Android. I have tried cleaning, building the project. But, the error occurs only when I create a folder structure in my project. If I don't, then the script runs fine. In short, I am not able to organize the project.
Questions:
I'd like to know what type of folder structure is valid / will work for a PhantomJS project?
Why is the NullPointerException occuring?
Are there any other easy alternatives to setting up a PhantomJS project?
Any help / guidance regarding the folder structure is highly appreciated.
First get the latest version, that is 0.17, see news/history at http://www.nodeclipse.org/
If the problem is still on, raise issue on https://github.com/nodeclipse/nodeclipse-1/ (and reference this question)
To the questions:
PhantomJS launcher is rather simple https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.phantomjs, and it should work for any .js file (in any project type). PhantomJS project type is for beauty sake only, as it is just JavaScript project.
NullPointerException should occur never, so it may be bug.
You can create general project as well. But with JSDT and Tern you would get some Content Assist. For new module support with Tern raise issue at https://github.com/angelozerr/tern.java/
I switched to using Enide Studio and that solved the folder structure issue for me.
Here's what is needed to setup PhantomJS Project:
PhantomJS
Enide Studio
Steps:
Download PhantomJS
Download and launch Enide Studio
Goto Window->Preferences->Nodeclipse->PhantomJS and set PhantomJS Path to 'phantomjs.exe' file path
Create a PhantomJS Project (like any normal project)

Eclipse Plugin for reading Java code of current project

I want to make an eclipse plugin which can analyze java code in the current project and display it in the editor.
Scenario:
On right-clicking the java file inside eclipse, I want my plugin option to be seen (which is successfully done) and on clicking it, an editor should open with the contents of that particular java file.
I am stuck at opening the java file and reading its contents.
I think the org.eclipse.jface.text can be of help.
For editor support, I am using org.eclipse.ui.editors.
How to proceed with reading the contents of particular java file that has been right clicked ?
I am new to eclipse plugin development.
Any help is highly appreciated.
I solved the problem even better way than expected.
In the handler class's execute method , I used IWorkspace and IWorkspaceRoot from org.eclipse.core.resources package.
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
From above code, I had access to each and every resource of the current workspace. I fetched the project using IJavaProject and filtered java files from the resources.

JavaScript content assist not working for JSP file in Eclipse Kepler

I am using Eclipse Kepler to develop App Engine application.The autocomplete feature is not working for JSP files and am not sure if I am missing any Property settings.
Would be glad if someone can let me know what needs to be done to enable auto-complete feature?
PS : FYI, I have the WTP tool already installed
You have to be working with a file in a JavaScript Source Folder. To do that, you can create a JavaScript project or enable an existing project from its Configure context menu (right-click->Configure->something JavaScript). Once that's done, if it wasn't opened automatically, bring up the project's JavaScript Include Path property page and create or mark an existing folder as a Source Folder. That should enable it for both JS files and web pages.
Have you tried closing the project and opening it again. That would clear the cache and get things running.
right click project > close project
right click closed project > open project

GWT (eclipse) - only seeing static html in welcome page

Surely very basic, but I am a server-side/pure java developer, just started with GWT...
My new GWT project was working just fine, until it stopped - now the welcome page is served, but I only see the static html on it and nothing else. I see no error anywhere, I can see that the js file is built and referenced from the html, Same happens with the sample web app that's created in a new project in eclipse - it is the Web application starter project - I see "enter you name:" on the browser and nothing else.
Would someone save my sanity?
Try to wait longer if you've really all right and no any exceptions or errors are thrown. The fact that the static HTML is displayed immediately but compiling your Java code takes some time.
I have encountered this a few times (very rarely indeed) when there was an error in the generated files. The typical "Project > Clean..." alone is not enough with GWT projects. Here's the full process I have used to resolve this:
Make a backup of your files.
Delete the following directories (either through the "Navigator" view in Eclipse, or with an external file browser)
gwt-unitCache
war/mymodulename
war/WEB-INF/classes
war/WEB-INF/deploy
Refresh the project (right click it, choose Refresh)
Finally use Project > Clean...

Eclipse Plugin - XML Editor

I've followed this tutorial:
Eclipse Plugin
This tutorial explain why create a HTML Editor.
I need a Text editor,just for auto-highlight some words, anyway I thought this tuto should be a good one to start with.
The thing is that I created the Plugin project and the only thing that I changed it was the extension "pat" instead "html, htm", just that. After that I created a .pat file, but eclipse doesn't open it with my plugin, and my text editor is not in the editor's list.
Any suggestion??
Let me know if you need more information.
My guess is that you have just created the plugin, but aren't running it in your current Eclipse instance. That can be verified by opening the view "Plugin registry". That will show a list of all plugins, see if the plugin you have created is in that list.
If you click on the run button in Eclipse you will open a run configuration dialog. In one of the tabs, you get to choose what plugins should be available. Make sure your plug-in is selected. This will start up a new Eclipse instance that will run your plugin.
To make your plugin be a part of your ordinary Eclipse installation, you will need to export it to a jar and copy that jar to the dropins catalog.