Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Editor throws exception when closed
Editor throws exception when closed [message #34094] Thu, 15 May 2003 15:51 Go to next message
Eclipse UserFriend
Originally posted by: acme.us.ibm.com

I'm trying to create a custom editor by creating a class that extends
EditorPart and another that implements IEditorInput. I can successfully
display the editor, but when I close it, I get the following exception.
Any ideas on what I'm missing?

Bryan


java.lang.NullPointerException
at org.eclipse.ui.internal.NavigationHistory$1.partClosed(
NavigationHistory.java:70)
at org.eclipse.ui.internal.PartListenerList$3.run(PartListenerL ist.java:
89)
at org.eclipse.core.internal.runtime.InternalPlatform.run(
InternalPlatform.java:889)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.PartListenerList.firePartClosed(
PartListenerList.java:87)
at org.eclipse.ui.internal.WorkbenchPage.firePartClosed(Workben chPage.
java:1210)
at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchP age.java:
824)
at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchP age.java:
789)
at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:89 )
at org.eclipse.ui.internal.EditorWorkbook$1.itemClosed(EditorWo rkbook.
java:161)
at org.eclipse.swt.custom.CTabFolder.closeNotify(CTabFolder.jav a:307)
at org.eclipse.swt.custom.CTabFolder.access$13(CTabFolder.java: 297)
at org.eclipse.swt.custom.CTabFolder$4.handleEvent(CTabFolder.j ava:438)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:913)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1637)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1429)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at org.eclipse.core.internal.boot.InternalBootLoader.run(
InternalBootLoader.java:845)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
Re: Editor throws exception when closed [message #34466 is a reply to message #34094] Thu, 15 May 2003 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

"Bryan Hunt" <acme@us.ibm.com> wrote in message news:20030515145209433-0500@news.eclipse.org...
> I'm trying to create a custom editor by creating a class that extends
> EditorPart and another that implements IEditorInput. I can successfully
> display the editor, but when I close it, I get the following exception.
> Any ideas on what I'm missing?

Try setting a breakpoint in the partClosed handler in org.eclipse.ui.internal.NavigationHistory to see where it crashes or set an
exception breakpoint for the NPE.
Please report back what you find or better yet open a bug against Platform UI. We probably shouldn't throw a NPE if an editor
doesn't return what we expect.
Most likely the editor.getEditorInput returns null or editor.getSite() returns null for your editor.

Knut
Re: Editor throws exception when closed - Fixed [message #34599 is a reply to message #34466] Thu, 15 May 2003 17:31 Go to previous message
Eclipse UserFriend
Originally posted by: acme.us.ibm.com

In <ba0ul2$11j$1@rogue.oti.com> Knut Radloff wrote:
> "Bryan Hunt" <acme@us.ibm.com> wrote in message news:20030515145209433-
> 0500@news.eclipse.org...
>> I'm trying to create a custom editor by creating a class that extends
>> EditorPart and another that implements IEditorInput. I can
>> successfully display the editor, but when I close it, I get the
>> following exception. Any ideas on what I'm missing?
>
> Try setting a breakpoint in the partClosed handler in org.eclipse.ui.
> internal.NavigationHistory to see where it crashes or set an exception
> breakpoint for the NPE. Please report back what you find or better yet
> open a bug against Platform UI. We probably shouldn't throw a NPE if
> an editor doesn't return what we expect. Most likely the editor.
> getEditorInput returns null or editor.getSite() returns null for your
> editor.
>
> Knut
>

Your note got me pointed in the right direction. Inside my init()
funciton I was calling setSite(), but NOT setInput(). Adding a call to
setInput() fixed my problem. I'll open a defect. Thanks for your help
with this.

Bryan
Previous Topic:All marker icons on first line in 2.1
Next Topic:how to show my tree created in separate tree viewer in navigator instead
Goto Forum:
  


Current Time: Sun May 11 20:45:06 EDT 2025

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

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

Back to the top