Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Palette Viewer Exception
Palette Viewer Exception [message #200206] Fri, 21 October 2005 01:39 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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?
Re: Palette Viewer Exception [message #200337 is a reply to message #200221] Fri, 21 October 2005 17:15 Go to previous message
Eclipse UserFriend
Originally posted by: mcheng.cisco.com

It is the preference I think. How do I set it?

Thanks,
Mike

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dj9n45$msc$1@news.eclipse.org...
> Sounds like a NullPointerException. You should set a breakpoint and find
out
> what is null and why.
> Perhaps your preferences aren't set?
>
>
Previous Topic:refreshing EditParts
Next Topic:initializing a GraphicalEditor with an xml file
Goto Forum:
  


Current Time: Sun Nov 03 23:50:24 GMT 2024

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

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

Back to the top