Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Activator.getURLConverter crashes ImageRegistry
Activator.getURLConverter crashes ImageRegistry [message #325803] Wed, 27 February 2008 14:11
Karsten Stöckmann is currently offline Karsten StöckmannFriend
Messages: 12
Registered: July 2009
Junior Member
Hi,

recently, I've 'updated' the SWT and JFace components used in a local
project to their latest CVS versions. Since then, an ImageRegistry.get()
reproducibly crashes with a NullPointerException inside
Activator.getURLConverter(). Is this a known issue with latest CVS
versions of SWT, JFace or some Eclipse core components
(org.eclipse.equinox.common)?

The following snippet demonstrates this:



package snippets;


import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;


public class ImageRegistryExample {

public static void main(String[] args) {

final Display display = new Display();
final Shell shell = new Shell();

GridLayout gl = new GridLayout();
gl.numColumns = 1;
shell.setLayout(gl);

ImageRegistry r = new ImageRegistry(display);
r.put("eclipse",
ImageDescriptor.createFromFile(ImageRegistryExample.class, "eclipse.png"));

final Label l = new Label(shell, SWT.NONE);
l.setImage(r.get("eclipse")); // NullPointerException here..

shell.pack();
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}

display.dispose();

}

}



[Note: there has to be an image of the name "eclipse.png" in the
snippet's package directory..]

Best wishes,
Karsten

--
PGP Public Key ID 0x708CD1FE (pgpkeys.pca.dfn.de)
"When the light of day is dead, the spark of night ignites"
Previous Topic:Adding a (text editor) page
Next Topic:Open IFile int the main window
Goto Forum:
  


Current Time: Wed Jul 17 18:24:19 GMT 2024

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

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

Back to the top