Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » VE doesn't like: new Display() - new Shell(Display)
VE doesn't like: new Display() - new Shell(Display) [message #612186] Mon, 27 February 2006 12:02
Rico is currently offline RicoFriend
Messages: 4
Registered: July 2009
Junior Member
Hello Everyone,

My most important question is: how do I package a bean into a jar to
run as a stand-alone program when the Visual Class generated doesn't
have a main() and adding one manually seems to make it unable to be run
on Eclipse? Is the createSShell() method generated recognized as a main()
entry point equivalent somehow?

I'm no seasoned developer in the GUI world, so please bear with me
here because I couldn't find much about this in the FAQ.

When in Eclipse I clicked my way through from New->Visual Class,
the skeleton class generated with a createSShell() didn't include the
following:

Display display = new Display();
Shell sShell = new Shell(display);
...
...
...
...
sShell.open();
while (!sShell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();


If I add the new Shell(display);
Visual Editor announces NullPointerException on trying to display
the window; and if I use the loop block, upon closing the window VE
has this to say:
============================================================ ================
=========
IWAV0056I Java Bean com.socius.invensys.EmailSenderUI started with the
createSShell method
Exception in thread "main" org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.widgets.Widget.error(Widget.java:395)
at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:505)
at
org.eclipse.ve.internal.java.vce.launcher.remotevm.SWTLaunch er.runEventLoop(
SWTLauncher.java:486)
at
org.eclipse.ve.internal.java.vce.launcher.remotevm.SWTLaunch er.runShell(SWTL
auncher.java:469)
at
org.eclipse.ve.internal.java.vce.launcher.remotevm.SWTLaunch er.launch(SWTLau
ncher.java:181)
at
org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeans Launcher.main(Ja
vaBeansLauncher.java:77)
============================================================ ================
=========

I thought the above construct was a strength of SWT for not hiding the event
loop from me?
Why do such errors occur on VE? What about the skeleton generated using only
"new Shell()"
instead of "new Shell(Display)", in the latter case throwing NPE w/o a stack
trace?

Rico.
Previous Topic:newby QUESTION. Visual Editor for JFace??
Next Topic:Snippet223
Goto Forum:
  


Current Time: Sun Jun 16 16:00:41 GMT 2024

Powered by FUDForum. Page generated in 0.02949 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top