Error after adding SetInput() for editorpart [message #86428] |
Tue, 01 July 2003 09:59  |
Eclipse User |
|
|
|
Originally posted by: sinleeh.hotmail.com
Dear All,
I used to set my data model statically in my platform plugin. The platform
did not report any error. As the plugin evolves, I am now at the stage
where I would like to use the extension point org.eclipse.ui.NewWizards to
allow the user to choose the data model it likes.
I sorted out the NewWizards related stuff. Following the logic example, I
get WizardNewFileCreationPage.getInitialContents to set the file as an
InputStream to my PluginEditor. The PluginEditor receives it in
SetInput(). I also implemented the following functions
public boolean isDirty() { return true; }
public boolean isSaveAsAllowed() { return true; }
public boolean isSaveOnCloseNeeded() { return true; }
public void doSave(IProgressMonitor progressMonitor) {}
public void doSaveAs() {}
public boolean performSaveAs{} { return true; }
Currently doSave() and doSaveAs() and performSaveAs() are empty and I will
add the meat in later. The problems are
(1) When double-clicking on the filename in the project view, the
workbench give me an error message: "An error had occured. See error log
for more detail". The error log shows that there is a java null pointer
exception (Listing 2)
(2)On quiting the workbench, after confirming exit, the same error message
appears. I'm asked to save an "unidentified" resources (I assumed it is
the file that I had just created) and click OK. Another error message
appears: Save All failed:null. The next error message is "Could not save
workbench layout. Reason: Problems occurs saving workbench."
I did some tracking and found that the problem in (1) and (2) occurs after
isSaveAsAllowed().
Also interestingly, if I change the first three functions listed to return
false, When I creates the file, the error stack shows an error as in
listing 1.
Also, on quiting the workbench, the last error message in (2) appears.
Can someone point out the error of my way please? Many thanks in advance.
Best regards,
Sinlee
listing 1
----------
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:2332)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:101)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:1815)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1549)
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(Intern alBootLoader.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(DelegatingMe thodAccessorImpl.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)
Listing 2:
----------
java.lang.NullPointerException
at
org.eclipse.ui.internal.NavigationHistory.createEntry(Naviga tionHistory.java:451)
at
org.eclipse.ui.internal.NavigationHistory.addEntry(Navigatio nHistory.java:258)
at
org.eclipse.ui.internal.NavigationHistory.access$9(Navigatio nHistory.java:245)
at
org.eclipse.ui.internal.NavigationHistory$2.run(NavigationHi story.java:128)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:98)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:1815)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1549)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:583 )
at org.eclipse.jface.window.Window.open(Window.java:563)
at
org.eclipse.jface.dialogs.MessageDialog.openError(MessageDia log.java:286)
at
org.eclipse.jface.util.SafeRunnable.handleException(SafeRunn able.java:50)
at
org.eclipse.ui.internal.AbstractSelectionService$3.handleExc eption(AbstractSelectionService.java:146)
at
org.eclipse.core.internal.runtime.InternalPlatform.handleExc eption(InternalPlatform.java:450)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:891)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at
org.eclipse.ui.internal.AbstractSelectionService.fireSelecti on(AbstractSelectionService.java:141)
at
org.eclipse.ui.internal.AbstractSelectionService.partActivat ed(AbstractSelectionService.java:244)
at
org.eclipse.ui.internal.WWinPartService$1.partActivated(WWin PartService.java:29)
at
org.eclipse.ui.internal.PartListenerList2$1.run(PartListener List2.java:45)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:889)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at
org.eclipse.ui.internal.PartListenerList2.firePartActivated( PartListenerList2.java:43)
at
org.eclipse.ui.internal.WorkbenchPage.firePartActivated(Work benchPage.java:1181)
at
org.eclipse.ui.internal.WorkbenchPage.setActivePart(Workbenc hPage.java:2504)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage .java:408)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2071)
at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage .java:2004)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:1991)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:1986)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:1887)
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio n.java:96)
at
org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystem EditorAction.java:96)
at
org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAct ion(OpenActionGroup.java:111)
at
org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAct ion(MainActionGroup.java:250)
at
org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen( ResourceNavigator.java:613)
at
org.eclipse.ui.views.navigator.ResourceNavigator$6.open(Reso urceNavigator.java:384)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:397)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:889)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:395)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:605)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:694)
at
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:209)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:204)
at
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:233)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1838)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1545)
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(Intern alBootLoader.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(DelegatingMe thodAccessorImpl.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)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03158 seconds