Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Default .properties file editor ??
Default .properties file editor ?? [message #449821] Fri, 19 May 2006 14:05 Go to next message
Eclipse UserFriend
Originally posted by: kammerj.bit-sys.com

In trying to incorporate a simple editor into my RCP application I have come across an interesting problem. The editor itself is extremely basic at this point -- I just want to show I can bring it up --

The problem occurs when I try to open a file with the ".properties" extension. In making the attempt I get the following error:

>> Unable to create this part due to an internal error.
>> Reason for the failure: Text editor does not have a
>> document provider

If I rename the file with a different extension it opens up using my BasicEditor class as I would expect.

From the stacktrace I can see that when the application tries to open a ".properties" file it is trying to access the org.eclipse.ui.editors.text.TextEditor instead of my editor. This indicates to me that somehow that text editor has been registered in a plugin somewhere to handle ".properties" files. I can set my own editor to recognize the ".properties" extension and thus override the failing behavior - although that solution does not sit well with me.

This bring up several questions.

1) Is there an easy way to figure out what is the text editor up to handle properties files in place of my editor?

2) Can I make it stop doing that?

3) Is there some way to provide the "broken" editor with a document provider? (Lesser problem, I figure whatever it is, it is screwed up and can probably be deleted once I find it).

-- Thanks,
-- John Kammer

!ENTRY org.eclipse.ui 4 0 2006-05-19 13:51:48.648
!MESSAGE Unable to create editor ID org.eclipse.ui.DefaultTextEditor: Text editor does not have a document provider
!STACK 1
org.eclipse.core.runtime.CoreException: Text editor does not have a document provider
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(Abst ractTextEditor.java:3005)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(Status TextEditor.java:173)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetI nput(AbstractDecoratedTextEditor.java:1303)
at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor .java:262)
at org.eclipse.ui.texteditor.AbstractTextEditor$16.run(Abstract TextEditor.java:2360)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:346)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:291)
at org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:624)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:621)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2134)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:2378)
at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTe xtEditor.java:2405)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:778)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:596)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:384)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:552)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:28 3)
at org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:126)
at org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:269)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:391)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1102)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1051)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:12 56)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:442)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:109 )
at org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:60)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:212)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:202)
at org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:758)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:665)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:628)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2360)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2295)
at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:2287)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:2273)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2268)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2241)
at com.bitsystems.MenuDemo.actions.OpenFileAction.run(OpenFileA ction.java:117)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2867)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2572)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at com.bitsystems.MenuDemo.Application.run(Application.java:21)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
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.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
!SUBENTRY 1 org.eclipse.ui 4 0 2006-05-19 13:51:48.652
!MESSAGE Text editor does not have a document provider
Re: Default .properties file editor ?? [message #449824 is a reply to message #449821] Fri, 19 May 2006 16:42 Go to previous message
Eclipse UserFriend
Originally posted by: kammerj.bit-sys.com

Allow me to rephrase,

Further investigation indicates that the editor registry has somehow been populated such that files with the "properties" extension are associated to the DefaultTextEditor. I still don't know where this is coming from exactly (a rogue plugin?, standard eclipse operating procedures?)

I can override the behavior by specifying that my editor either specifically handle properties files or by eliminating the check for registered defaults. However I do not find either of those solutions palatable.

Thoughts anyone?
-- Kammer


>> IWorkbench workbench= fWindow.getWorkbench();
>> IEditorRegistry editorRegistry= workbench.getEditorRegistry();
>> IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName());
>> if (descriptor != null) return descriptor.getId();
Previous Topic:[RCP+Spring] interface org.eclipse.ui.IViewPart is not visible from class loader
Next Topic:RCP product export for Mac x86/ppc
Goto Forum:
  


Current Time: Fri Aug 29 19:00:30 EDT 2025

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

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

Back to the top