Community
Participate
Working Groups
If the Palette is hidden (i.e. on fast view) and a connection handle is used to create sn Edge, than a null pointer will be thrown because getPaletteViewer() returns null. From this point on, nothing in the diagram is selectable until the diagram is closed and re-opened. Below is the stack trace: java.lang.NullPointerException at org.eclipse.gef.EditDomain.loadDefaultTool(EditDomain.java:188) at org.eclipse.gef.tools.AbstractTool.handleFinished(AbstractTool.java:692) at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleFinished(ConnectionCreationTool.java:199) at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleButtonUp(ConnectionCreationTool.java:187) at org.eclipse.gmf.runtime.diagram.ui.internal.tools.ConnectionHandleTool.handleButtonUp(ConnectionHandleTool.java:132)
Created attachment 100064 [details] proposed patch.
If there is a palette root but no palette viewer, shouldn't the palette root still determine what the default tool is?
... possibly. The current patch fixes my issue but I may be overlooking some other problem? I will create another patch that tries to use the palette root. - James.
Created attachment 100284 [details] takes into account the tool from the palette root.
I've attached a second patch ... perhaps there is a way of "beautifying" it some more but it seems to be logically separated. The first part sets the pallete viewer information and the second part sets the default tool. I'm not sure if the second patch is really necessary. Please feel free to modify the patch any way you see fit.
Are we sure that this entry is correct? We say that the paletteView is null but the paletteRoot is not. setActiveTool(paletteRoot.getDefaultEntry().createTool()); I think James' original patch was correct, there is no visible palette so there is no active tool. setActiveTool(null) is correct in this case.
Randy, Anthony, you guys know way more about GEF than I do so whichever patch seems better is fine with me. They both fix the issue. I was hoping this might be delivered during the RC stage of Ganymede since the NPE is a serious customer issue, basically preventing a user from continuing working with a diagram.
(In reply to comment #6) > Are we sure that this entry is correct? We say that the paletteView is null but > the paletteRoot is not. Maybe someone wants to display a paletteRoot inside a Toolbar or something?? I guess it's safe to say no one is doing this yet though or they'd be seeing the original problem.
I got the same problem since quite a long time now, thought first it could be a bug of the application, and not GEF... And there is no palette in the toolbar or anything else like this. Connections are created via a context menu, so we never use directly the palette to create the connections. All of this worked well before we switch to eclipse 3.3 and gef 3.2.100.v20070620. Bug appeared on both Windows & Linux.
Committed the first patch to HEAD
I don't know if a fix is planned also for version 3.3 ? I don't especially want to change to eclipse 3.4 especially for this fix. Thanks
This will not be pushed back to a 3.3 release. There are only two maintenance releases for 3.3: Sept 2007 and Feb 2008.