Page 1 of 1
oXygen Eclipse plugin and IFileStore
Posted: Sat Mar 03, 2007 3:12 am
by Yury
Hi,
I am trying to use oXigen eclipse plugin as an editor for my own eclipse plugin. For this I've implemented standard IFileStore and would like to use it as a source. I've also implemented IEditorInput for my content source.
Unfortunately when invoked, oXygen gives me an exception DocumentProvider is empty. What does it mean? How can I provide a DocumentProvider for oXigen? And generally, how to use it for content sources other than local foles?
Thanks,
Yury
National Center for Biotechnology Information,
NLM-NIH, Bethesda, MD
Posted: Mon Mar 05, 2007 5:35 pm
by sorin_ristache
Hello,
The oXygen plugin provides a document provider but it is possible that Eclipse could not use it because the content type of your file is not associated with oXygen. For example try to open an .xml file or an .xsd file as oXygen is associated with these content types by default.
If you get the same exception about an empty DocumentProvider after associating the content type with oXygen you should try to open the same file with the text editor of Eclipse. Do you get the same exception with the text editor of Eclipse?
It does not matter if it is not a local file. It matters if the content type is associated with oXygen.
Regards,
Sorin
Posted: Mon Mar 05, 2007 9:54 pm
by Yury
The matter is that IFileStore has no method for defining content type. Neither has IEditorInput. And my content is not a file, so I cannot open it in ordinary way.
I have the code like following:
IEditorDescriptor descriptor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor( ".xml" );
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor( input, descriptor.getId() );
where 'input' is an implementation of IEditorInput.
oXygen is registered in Eclipse as default editor for XML. I believe it should be enough to get the default XML editor to assure that content type is set right.
How can I provide a content type for it, otherwise?
Thanks,
Yury
Posted: Tue Mar 06, 2007 8:52 am
by Yury
Sorry for possible misleading. The exception I've got is NullPointerException. Its stack is:
java.lang.NullPointerException
at com.oxygenxml.editor.editors.OxygenBaseEditor.init(Unknown Source)
at com.oxygenxml.editor.editors.X.init(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:179)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:153)
at com.oxygenxml.editor.editors.xml.f.Ɓ(Unknown Source)
at com.oxygenxml.editor.editors.xml.f.createPages(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:276)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1311)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:455)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:102)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:441)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:111)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:820)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:719)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:680)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2593)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2477)
...
Hope it helps.
Thanks,
Yury
National Center for Biotechnology Information,
NLM-NIH, Bethesda, MD
Posted: Wed Mar 07, 2007 10:49 am
by Mircea
Hi Yury,
Thank You for reporting this issue. The problem was identified and resolved in the current development stream. If you need a patch for your case, just write us on
support@oxygenxml.com and we will send you one.
Best regards,
Mircea
Posted: Wed Mar 07, 2007 11:22 pm
by Yury
Mircea,
Thanks a lot! I've sent an email already.
Yury