Community
Participate
Working Groups
Build Identifier: Eclipse 3.6 for PHP I used following code to open local PHP file (with .php extention) located outside the workspace: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor( new MyIEditorInputImplementation(), "org.eclipse.php.editor"); and I got dialog box saying that content type was not set (wile it was). It appeared that solution for my case was that MyIEditorInputImplementation should be adaptable to ILocationProvider (the easiest way was to extend FileStoreEditorInput). Nevertheless dialog box was strongly misleading and should be fixed. Here is the stacktrace of the place where the dialog is shown: Thread [main] (Suspended) PHPStructuredEditor(StructuredTextEditor).doSetInput(IEditorInput) line: 1858 PHPStructuredEditor.doSetInput(IEditorInput) line: 2337 AbstractTextEditor$19.run(IProgressMonitor) line: 3037 ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 464 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 372 ApplicationWindow$1.run() line: 759 BusyIndicator.showWhile(Display, Runnable) line: 70 WorkbenchWindow(ApplicationWindow).run(boolean, boolean, IRunnableWithProgress) line: 756 WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 2600 PHPStructuredEditor(AbstractTextEditor).internalInit(IWorkbenchWindow, IEditorSite, IEditorInput) line: 3055 PHPStructuredEditor(AbstractTextEditor).init(IEditorSite, IEditorInput) line: 3082 PHPStructuredEditor(StructuredTextEditor).init(IEditorSite, IEditorInput) line: 2492 PHPStructuredEditor.init(IEditorSite, IEditorInput) line: 1194 EditorManager.createSite(IEditorReference, IEditorPart, EditorDescriptor, IEditorInput) line: 798 EditorReference.createPartHelper() line: 647 EditorReference.createPart() line: 465 EditorReference(WorkbenchPartReference).getPart(boolean) line: 595 EditorReference.getEditor(boolean) line: 289 WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean, int, IMemento) line: 2863 WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int, IMemento) line: 2768 WorkbenchPage.access$11(WorkbenchPage, IEditorInput, String, boolean, int, IMemento) line: 2760 WorkbenchPage$10.run() line: 2711 BusyIndicator.showWhile(Display, Runnable) line: 70 WorkbenchPage.openEditor(IEditorInput, String, boolean, int, IMemento) line: 2707 WorkbenchPage.openEditor(IEditorInput, String, boolean, int) line: 2691 WorkbenchPage.openEditor(IEditorInput, String) line: 2674 OpenVirtualFileJob$FileContentFetchingFromCrucibleOperation$1.run() line: 293 RunnableLock.run() line: 35 UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 134 Display.runAsyncMessages(boolean) line: 4041 Display.readAndDispatch() line: 3660 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2629 Workbench.runUI() line: 2593 Workbench.access$4(Workbench) line: 2427 Workbench$7.run() line: 670 Realm.runWithDefault(Realm, Runnable) line: 332 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 663 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 IDEApplication.start(IApplicationContext) line: 115 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 369 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available Method.invoke(Object, Object...) line: not available Main.invokeFramework(String[], URL[]) line: 619 Main.basicRun(String[]) line: 574 Main.run(String[]) line: 1407 Main.main(String[]) line: 1383 Reproducible: Always Steps to Reproduce: It is quite hard but here you are 1. Install Eclipse 3.6 for PHP 2. Install Atlassian Connector for Eclipse 2.2 3. Create review for any PHP file. 4. Change the file (workspace should contain different file from Crucible repo) 5. Try to open the file from ReviewExplorer in Eclipse (you will get mentioned dialog box)
Feel free to move the ticket if this is not the right place for org.eclipse.wst.sse bug.
The message actually says "Unsupported content type in editor." It should have worked without implementing ILocationProvider. What were you returning for the editor input's name? Was the input implementing IStorageEditorInput?
I returned file name with php extention e.g. file.php but I believe it should not rely on the file extention but editorID which I pass to the openEditor method. Yes, the editor input is implementing IStorageEditorInput.
It's not based solely on the filename. We're calling into the platform's content type manager and IContentTypeMatcher#findContentTypeFor(InputStream, String) with the first 8k of input to determine what the content type is. You might want to step through org.eclipse.wst.sse.ui.internal.StorageModelProvider#loadModel(IStorageEditorInput, boolean) or org.eclipse.core.internal.content.ContentTypeMatcher#findContentTypeFor(InputStream, String) to find out what's going on. I suspect the content type being detected is defaulting to plain text.
(In reply to comment #4) >I suspect the content type being detected is defaulting to plain text. Is it?
pinging to see if this is still an issue.
I know it's been awhile, but if this is still an issue, please reopen. And if you have an answer to Nitin's question in comment 5, please let us know. Thanks.