Activator.getURLConverter crashes ImageRegistry [message #325803] |
Wed, 27 February 2008 09:11 |
Eclipse User |
|
|
|
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"
|
|
|
Powered by
FUDForum. Page generated in 0.06115 seconds