Please help me debug this [message #61857] |
Tue, 04 February 2003 10:31  |
Eclipse User |
|
|
|
Originally posted by: jim.azeltine.indus.com
I am working on an app based on the Shapes example. I have most of it
working, the plugin loads, the editor with a palette opens, but I get a
null pointer exception when I click on one of the pallette items. I cannot
seem to figure out where to put breakpoints in order to figure out what is
null.
Jim
|
|
|
|
Re: Please help me debug this [message #61931 is a reply to message #61882] |
Tue, 04 February 2003 11:17   |
Eclipse User |
|
|
|
Originally posted by: jim.azeltine.indus.com
Randy Hudson wrote:
> The shapes example is not up-to-date. It is not supported by the GEF team.
> Eclipse let's you set an exception breakpoint. Before you open your editor,
> but after the runtime workbench has started, add an exception breakpoint for
> NullPointerException.
> "Jim Azeltine" <jim.azeltine@indus.com> wrote in message
> news:b1omc9$oqe$1@rogue.oti.com...
> > I am working on an app based on the Shapes example. I have most of it
> > working, the plugin loads, the editor with a palette opens, but I get a
> > null pointer exception when I click on one of the pallette items. I cannot
> > seem to figure out where to put breakpoints in order to figure out what is
> > null.
> >
> > Jim
> >
I understand that the Shapes example is not supported. Eric has made noise
about porting it to the new release, but I don't know if he will have
time. He directed me to an old version of Eclipse where is works (prior to
the renaming of the packages from com.ibm.etools). The Shapes example is
the closest to what I am attempting to develop.
Thanks, the hint about exception breakpoints helps alot! 8)
I have found that the exception is occurring in PaletteViewerImpl:
protected void firePaletteSelectionChanged() {
if (paletteListeners == null)
return;
PaletteEvent event = new PaletteEvent(this, selectedEntry);
for (int listener = 0; listener < paletteListeners.size(); listener++)
((PaletteListener) paletteListeners.get(listener)).entrySelected(
event);
}
In the paletteListeners ArrayList element [0] is null, element [1]=
DefaultEditDomain$1. What should be in element [0]?
|
|
|
Re: Please help me debug this [message #61953 is a reply to message #61931] |
Tue, 04 February 2003 12:03   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"Jim Azeltine" <jim.azeltine@indus.com> wrote in message
news:b1op2k$r39$1@rogue.oti.com...
> Randy Hudson wrote:
>
> > The shapes example is not up-to-date. It is not supported by the GEF
team.
>
> > Eclipse let's you set an exception breakpoint. Before you open your
editor,
> > but after the runtime workbench has started, add an exception breakpoint
for
> > NullPointerException.
>
> > "Jim Azeltine" <jim.azeltine@indus.com> wrote in message
> > news:b1omc9$oqe$1@rogue.oti.com...
> > > I am working on an app based on the Shapes example. I have most of it
> > > working, the plugin loads, the editor with a palette opens, but I get
a
> > > null pointer exception when I click on one of the pallette items. I
cannot
> > > seem to figure out where to put breakpoints in order to figure out
what is
> > > null.
> > >
> > > Jim
> > >
> I understand that the Shapes example is not supported. Eric has made noise
> about porting it to the new release, but I don't know if he will have
> time. He directed me to an old version of Eclipse where is works (prior to
> the renaming of the packages from com.ibm.etools). The Shapes example is
> the closest to what I am attempting to develop.
>
> Thanks, the hint about exception breakpoints helps alot! 8)
> I have found that the exception is occurring in PaletteViewerImpl:
> protected void firePaletteSelectionChanged() {
> if (paletteListeners == null)
> return;
> PaletteEvent event = new PaletteEvent(this, selectedEntry);
> for (int listener = 0; listener < paletteListeners.size(); listener++)
> ((PaletteListener) paletteListeners.get(listener)).entrySelected(
> event);
> }
> In the paletteListeners ArrayList element [0] is null, element [1]=
> DefaultEditDomain$1. What should be in element [0]?
Someone must be calling addPaletteListener(null).
Put a *conditional* breakpoint in addPaletteListener, and set its conditions
to listener == null.
>
>
>
>
>
>
|
|
|
Re: Please help me debug this [message #62091 is a reply to message #61953] |
Wed, 05 February 2003 09:49  |
Eclipse User |
|
|
|
Originally posted by: jim.azeltine.indus.com
Randy Hudson wrote:
> "Jim Azeltine" <jim.azeltine@indus.com> wrote in message
> news:b1op2k$r39$1@rogue.oti.com...
> > Randy Hudson wrote:
> >
> > > The shapes example is not up-to-date. It is not supported by the GEF
> team.
> >
> > > Eclipse let's you set an exception breakpoint. Before you open your
> editor,
> > > but after the runtime workbench has started, add an exception breakpoint
> for
> > > NullPointerException.
> >
> > > "Jim Azeltine" <jim.azeltine@indus.com> wrote in message
> > > news:b1omc9$oqe$1@rogue.oti.com...
> > > > I am working on an app based on the Shapes example. I have most of it
> > > > working, the plugin loads, the editor with a palette opens, but I get
> a
> > > > null pointer exception when I click on one of the pallette items. I
> cannot
> > > > seem to figure out where to put breakpoints in order to figure out
> what is
> > > > null.
> > > >
> > > > Jim
> > > >
> > I understand that the Shapes example is not supported. Eric has made noise
> > about porting it to the new release, but I don't know if he will have
> > time. He directed me to an old version of Eclipse where is works (prior to
> > the renaming of the packages from com.ibm.etools). The Shapes example is
> > the closest to what I am attempting to develop.
> >
> > Thanks, the hint about exception breakpoints helps alot! 8)
> > I have found that the exception is occurring in PaletteViewerImpl:
> > protected void firePaletteSelectionChanged() {
> > if (paletteListeners == null)
> > return;
> > PaletteEvent event = new PaletteEvent(this, selectedEntry);
> > for (int listener = 0; listener < paletteListeners.size(); listener++)
> > ((PaletteListener) paletteListeners.get(listener)).entrySelected(
> > event);
> > }
> > In the paletteListeners ArrayList element [0] is null, element [1]=
> > DefaultEditDomain$1. What should be in element [0]?
> Someone must be calling addPaletteListener(null).
> Put a *conditional* breakpoint in addPaletteListener, and set its conditions
> to listener == null.
> >
> >
> >
> >
> >
> >
I think I found the problem. In class GraphicalEditorWithPalette, there is
a call to viewer.addPaletteListener that did not exist in earlier drops:
private void createPaletteViewer(Composite parent) {
PaletteViewer viewer = new PaletteViewerImpl();
viewer.createControl(parent);
setPaletteViewer(viewer);
viewer.addPaletteListener((CopyTemplateAction)getAction(IWor kbenchActionConstants.COPY));
configurePaletteViewer();
hookPaletteViewer();
initializePaletteViewer();
}
It does not seem to make sense to pass type CopyTemplateAction to
addPaletteListener. I replaced the class in my gef.jar with an earlier
version, and the Shapes example works ok.
|
|
|
Powered by
FUDForum. Page generated in 0.05302 seconds