Problem with xxxFileStore AND editor [message #327752] |
Wed, 30 April 2008 13:16 |
Carmelo Messages: 224 Registered: July 2009 |
Senior Member |
|
|
Hi all I have got the following scenario . hope someone can help me .
I will try to keep it sample:
XXXFileStore maps objects in a DB
I have an EditorInput that wraps the file store and read the content .
The open action will check the editor id to open
private String getEditorId(IFileStore fileStore)
{
IWorkbench workbench = Activator.getDefault().getWorkbench();
IEditorRegistry editorRegistry = workbench.getEditorRegistry();
IEditorDescriptor descriptor =
editorRegistry.getDefaultEditor(fileStore.getName());
if (descriptor != null)
return descriptor.getId();
return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
And will open it via:
page.openEditor(editorInput, getEditorId(fileStore));
PROBLEM: why I try to open a java file I get the error (see end of the
email)
Editor id used : org.eclipse.jdt.ui.CompilationUnitEditor
This problem will disappear if I set the exist to false (???)
/*
* @see org.eclipse.ui.IEditorInput#exists()
*/
public boolean exists()
{
return false;
}
(clearly the file exists only in the db)
Any idea?
!ENTRY org.eclipse.ui.workbench.texteditor 4 2 2008-04-30 14:37:10.119
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.workbench.texteditor".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.jface.text.source.LineNumberRulerColumn.getWidth (LineNumberRulerColumn.java:413)
at
org.eclipse.jface.text.source.LineNumberChangeRulerColumn.ge tWidth(LineNumberChangeRulerColumn.java:295)
at
org.eclipse.ui.internal.texteditor.LineNumberColumn.getWidth (LineNumberColumn.java:139)
at
org.eclipse.jface.text.source.CompositeRuler.getWidth(Compos iteRuler.java:708)
at
org.eclipse.jface.text.source.SourceViewer$RulerLayout.layou t(SourceViewer.java:125)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.jav a:1025)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:551)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:509)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:472)
at
org.eclipse.jface.text.source.SourceViewer.showAnnotations(S ourceViewer.java:986)
at
org.eclipse.ui.internal.texteditor.LineNumberColumn.installC hangeRulerModel(LineNumberColumn.java:608)
at
org.eclipse.ui.internal.texteditor.LineNumberColumn.updateQu ickDiffVisibility(LineNumberColumn.java:442)
at
org.eclipse.ui.internal.texteditor.LineNumberColumn.initiali ze(LineNumberColumn.java:247)
at
org.eclipse.ui.internal.texteditor.LineNumberColumn.createCo ntrol(LineNumberColumn.java:123)
at
org.eclipse.jface.text.source.CompositeRuler.addDecorator(Co mpositeRuler.java:561)
at
org.eclipse.ui.texteditor.AbstractTextEditor$11.run(Abstract TextEditor.java:1652)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.ui.texteditor.AbstractTextEditor$ColumnSupport.a ddColumn(AbstractTextEditor.java:1655)
at
org.eclipse.ui.texteditor.AbstractTextEditor$ColumnSupport.s etColumnVisible(AbstractTextEditor.java:1639)
at
org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.create PartControl(AbstractDecoratedTextEditor.java:387)
at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.createPart Control(JavaEditor.java:2618)
at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor .createPartControl(CompilationUnitEditor.java:1416)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2557)
at testefs.views.SampleView2$4.run(SampleView2.java:439)
|
|
|
Powered by
FUDForum. Page generated in 0.02801 seconds