Palette Viewer Exception [message #200206] |
Fri, 21 October 2005 01:39 |
Eclipse User |
|
|
|
Originally posted by: mcheng.cisco.com
Hi,
I tried to create a palette viewer in my RCP plug-in and got the following
exception:
java.lang.ExceptionInInitializerError
at
com.micro.designtool.gui.views.MIBPalette.createPartControl( MIBPalette.java:
18)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:30
5)
.....
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.NullPointerException
at
org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences.<init >(DefaultPal
etteViewerPreferences.java:62) <--- don't know what caused this error?
at
org.eclipse.gef.ui.palette.PaletteViewer.<clinit>(PaletteViewer.java:89)
... 44 more
The snippet of the code is:
public class MIBPalette extends ViewPart {
public static final String ID =
"com.micro.mibfix.designtool.gui.views.MIBPalette";
public PaletteViewer viewer;
public void createPartControl(Composite parent) {
PaletteRoot root = new PaletteRoot();
viewer = new PaletteViewer(); <--- Exception here
viewer.createControl(parent);
viewer.setPaletteRoot(root);
createPalette(root);
}
public void createPalette(PaletteRoot root) {
List categories = new ArrayList();
PaletteDrawer drawer = new PaletteDrawer("Scalar
objects");
List entries = new ArrayList();
PaletteEntry enum1 = new PaletteEntry("Enum",
"Enumberation");
PaletteEntry unsigned_32 = new PaletteEntry("Unsign32",
"Unsigned 32-bit integer");
entries.add(enum1);
entries.add(unsigned_32);
PaletteDrawer misc = new PaletteDrawer("Misc");
List list = new ArrayList();
PaletteEntry table = new PaletteEntry("Table", "Table");
PaletteEntry column = new PaletteEntry("Column", "Column
for table object");
list.add(table);
list.add(column);
categories.add(drawer);
categories.add(misc);
root.addAll(categories);
}
}
This was with Eclipse 3.1 and GEF 3.1. I did include org.eclipse.gef
(3.1.0) and org.eclipse.draw2d(3.1.0) in the plug-ins tab when I lauched my
rcp plug-in. Not sure what am I missing?
Thanks, Mike
|
|
|
Re: Palette Viewer Exception [message #200221 is a reply to message #200206] |
Fri, 21 October 2005 03:25 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Sounds like a NullPointerException. You should set a breakpoint and find out
what is null and why.
Perhaps your preferences aren't set?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds