Problems creating new SWT/JFace project with 4.1

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Problems creating new SWT/JFace project with 4.1

Postby elz_dad » Wed Jul 20, 2005 4:34 am

I sent this mail to wb-support@instantiations.com yesterday but had no response, so just in case that's the wrong email address I'll post this question here, since I can see that there has been activity on the forum since then.

I am using Linux/GTK, and see the problem below when using a fresh install of Eclipse 3.1 with Designer 4.1 unpacked into it.

I was previously using v4.0, and never saw the problem in the earlier version (and I'm pretty sure I tried doing this with Eclipse 3.1, but definitely with 3.0).

When I create a new project and ask for a "Designer|SWT/JFace Java Project", then click "Finish", I get a project that contains entries for:

JRE
ECLIPSE_HOME/plugins/org.eclipse.osgi_3.1.0.jar (followed by filespec)
ECLIPSE_HOME/plugins/org.eclipse.ui.forms_3.1.0.jar (followed by filespec)
ECLIPSE_HOME/plugins/org.eclipse.core.runtime_3.1.0.jar (followed by filespec)

I also get a stack trace on the console like this:

Code: Select all
java.lang.NullPointerException
        at com.swtdesigner.model.util.jdt.ProjectUtilities.getPluginClasspathPathJars(ProjectUtilities.java:92)
        at com.swtdesigner.model.util.jdt.ProjectUtilities.addClassPathLibraries(ProjectUtilities.java:81)
        at com.swtdesigner.model.util.jdt.ProjectUtilities.addPluginLibraries(ProjectUtilities.java:70)
        at com.swtdesigner.model.util.jdt.ProjectUtilities.addSWTLibrary(ProjectUtilities.java:74)
        at com.swtdesigner.wizards.swt.JavaSWTProjectCreationWizard.selectAndReveal(JavaSWTProjectCreationWizard.java:39)
        at org.eclipse.jdt.internal.ui.wizards.JavaProjectWizard.performFinish(JavaProjectWizard.java:69)
        at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:676)
        at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:349)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2867)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2572)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
        at org.eclipse.jface.window.Window.open(Window.java:787)
        at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:114)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2867)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2572)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
        at org.eclipse.core.launcher.Main.run(Main.java:973)
        at org.eclipse.core.launcher.Main.main(Main.java:948)



Then I use "File|New->Other..." and select Designer/SWT/Application Window, give a classname of "MyTest" and click "Finish".

The project shows up with errors, saying that it can't resolve "org.eclipse.swt" (in the imports section) and that it doesn't know what "Shell" is (in the main code).

By using "Project Properties" and adding external JARs to the build path I can get rid of the unresolved warnings, but I never used to have to do this so I would like to know if something else is wrong (I'm quite prepared to accept this may be my fault).


Any ideas would be most appreciated

thanks
nick
elz_dad
 
Posts: 11
Joined: Fri May 06, 2005 2:40 am

Re: Problems creating new SWT/JFace project with 4.1

Postby Eric Clayberg » Wed Jul 20, 2005 7:49 pm

elz_dad wrote:The project shows up with errors, saying that it can't resolve "org.eclipse.swt" (in the imports section) and that it doesn't know what "Shell" is (in the main code).

Give this new build a try. Alternatively, you can manually add the org.eclipse.swt.gtk.linux.x86_3.1.0.jar to your .classpath file.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby elz_dad » Thu Jul 21, 2005 12:18 am

Give this new build a try. Alternatively, you can manually add the org.eclipse.swt.gtk.linux.x86_3.1.0.jar to your .classpath file.


Great stuff, the new build has fixed the problem, thank you very much

nick
elz_dad
 
Posts: 11
Joined: Fri May 06, 2005 2:40 am


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest