在基于Xtext的插件中无法打开工作区外部文件

在基于Xtext的插件中无法打开工作区外部文件

本文介绍了在基于Xtext的插件中无法打开工作区外部文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Xtext框架支持我的DSL的Eclipse插件。
当我尝试使用匹配的文件扩展名 .gf 在我的系统上打开一个文件 - 但是不在我的工作区 - 我得到以下内容: p>

 
0 [main] ERROR org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback - 配置了另一个客户端或根本没有配置。
java.lang.IllegalStateException:配置了另一个客户端或根本没有配置。
在org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.removeDirtyStateSupport(DirtyStateEditorSupport.java:318)
在org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback.beforeDispose(AbstractDirtyStateAwareEditorCallback.java:38)
在org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback.beforeDispose(CompoundXtextEditorCallback.java:69)
在org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:469)
在org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:705)
在org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
在org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
在org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
在org.eclipse .ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
在org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(工作benchPage.java:2850)
在org.eclipse.ui.internal.WorkbenchPage.access $ 11(WorkbenchPage.java:2842)
在org.eclipse.ui.internal.WorkbenchPage $ 10.run(WorkbenchPage。 java:2793)
在org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
在org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
在org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
在org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
在org.ecl ipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
在org.eclipse.jface.action.ActionContributionItem.access $ 2(ActionContributionItem.java:501)
在org.eclipse.jface .action.ActionContributionItem $ 5.handleEvent(ActionContributionItem.java:411)
在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
在org.eclipse.swt.widgets。 Widget.sendEvent(Widget.java:1258)
在org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
在org.eclipse.swt.widgets.Display.readAndDispatch( Display.java:3209)
在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
在org.eclipse.ui.internal.Workbench.runUI(Workbench.java: 2660)
在org.eclipse.ui.internal.Workbench.access $ 4(Workbench.java:2494)
在org.eclipse.ui.internal.Workbench $ 7.run(Workbench.java:674)
在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:33 2)
在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
在org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
在org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:在$ org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMet hodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:616)
在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
在org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
在org.eclipse.equinox.launcher.Main.run(Main.java:1410)
在org.eclipse.equinox.launcher.Main.main(Main.java:1386)
!SESSION 2011-11-23 09:51:54.342 --------------- --------------------------------
eclipse.buildId = I20110613-1736
java.version = 1.6.0_23
java.vendor = Sun Microsystems Inc.
BootLoader常量:OS = linux,ARCH = x86,WS = gtk,NL = en_US
框架参数:-product org.eclipse .sdk.ide
命令行参数:-product org.eclipse.sdk.ide -data /home/john/repositories/gf-eclipse-plugin/workspace/../workspace-demo -dev file:/ home / john / repositories / gf-eclipse-plugin / workspace / .metadata / .plugins / org.eclipse.pde.core / Eclipse应用程序/ dev.properties -os linux -ws gtk -arch x86 -consoleLog

!EN TRY org.apache.log4j 4 0 2011-11-23 09:52:18.914
!MESSAGE org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback - 配置了另一个客户端或根本没有配置。

!STACK 0
java.lang.IllegalStateException:配置有其他客户端或根本没有配置。
在org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.removeDirtyStateSupport(DirtyStateEditorSupport.java:318)
在org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback.beforeDispose(AbstractDirtyStateAwareEditorCallback.java:38)
在org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback.beforeDispose(CompoundXtextEditorCallback.java:69)
在org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:469)
在org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:705)
在org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
在org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
在org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
在org.eclipse .ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
在org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(工作benchPage.java:2850)
在org.eclipse.ui.internal.WorkbenchPage.access $ 11(WorkbenchPage.java:2842)
在org.eclipse.ui.internal.WorkbenchPage $ 10.run(WorkbenchPage。 java:2793)
在org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
在org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
在org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
在org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
在org.ecl ipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
在org.eclipse.jface.action.ActionContributionItem.access $ 2(ActionContributionItem.java:501)
在org.eclipse.jface .action.ActionContributionItem $ 5.handleEvent(ActionContributionItem.java:411)
在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
在org.eclipse.swt.widgets。 Widget.sendEvent(Widget.java:1258)
在org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
在org.eclipse.swt.widgets.Display.readAndDispatch( Display.java:3209)
在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
在org.eclipse.ui.internal.Workbench.runUI(Workbench.java: 2660)
在org.eclipse.ui.internal.Workbench.access $ 4(Workbench.java:2494)
在org.eclipse.ui.internal.Workbench $ 7.run(Workbench.java:674)
在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:33 2)
在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
在org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
在org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:在$ org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMet hodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:616)
在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
在org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
在org.eclipse.equinox.launcher.Main.run(Main.java:1410)
在org.eclipse.equinox.launcher.Main.main(Main.java:1386)

!ENTRY org.eclipse.ui 4 0 2011-11-23 09:52:18.921
!MESSAGE无法创建编辑器ID org.grammaticalframework.eclipse.GF:抛出意外的异常。
!STACK 0
java.lang.NullPointerException
在org.eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider.handleProjectionEnabled(DefaultFoldingStructureProvider.java:100)
在org。 eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider $ ProjectionChangeListener.projectionEnabled(DefaultFoldingStructureProvider.java:186)
在org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:489)$在org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java)上的
:1441)
在org.eclipse.xtext.ui.editor.XtextEditor.installFoldingSupport(XtextEditor.java:439)
在org.eclipse.xtext.ui.editor.XtextEditor.createPartControl(XtextEditor.java :421)
在org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at o rg.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
在org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
在org.eclipse。 ui.internal.EditorReference.getEditor(EditorReference.java:289)
在org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
在org.eclipse.ui.internal。 WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
在org.eclipse.ui.internal.WorkbenchPage.access $ 11(WorkbenchPage.java:2842)
在org.eclipse.ui.internal.WorkbenchPage $ 10。运行(WorkbenchPage.java:2793)
在org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage。 java:2789)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
在org.eclipse.ui.ide.IDE.openEdi torOnFileStore(IDE.java:1155)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
在org.eclipse.ui.internal.ide。 actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
在org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
在org.eclipse.ui.internal.WWinPluginAction。 runWithEvent(WWinPluginAction.java:229)
在org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
在org.eclipse.jface.action.ActionContributionItem.access $ 2(ActionContributionItem .java:501)
在org.eclipse.jface.action.ActionContributionItem $ 5.handleEvent(ActionContributionItem.java:411)
在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java: 84)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
在org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
在org.eclipse.swt.widgets。 Display.readAndDispatch(Display.java:3209)
在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
在org.eclipse.ui.internal.Workbench.runUI( Workbench.java:2660)
在org.eclipse.ui.internal.Workbench.access $ 4(Workbench.java:2494)
在org.eclipse.ui.internal.Workbench $ 7.run(Workbench。 java:674)
在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java: 667)
在org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
在org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java: 110)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppL auncher.java:79)
在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
在org.eclipse.core.runtime.adaptor.EclipseStarter.run( EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect。 DelegatingMethodMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:616)
在org.eclipse.equinox.launcher.Main.invokeFramework(Main。 java:622)
在org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
在org.eclipse.equinox.launcher.Main.run(Main.java:1410)
在org.eclipse.equinox.launcher.Main.main(Main.java:1386)

!ENTRY org.eclipse.ui 2 2 2011-11-23 09:52:19.105
!MESSAGE忽略添加已经注册的可保存的尝试
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: unknown可保存:org.eclipse.ui.internal.DefaultSaveable@ccf230从部分org.eclipse.ui.internal.ErrorEditorPart@ccf230
在org.eclipse.ui.internal.SaveablesList.logWarning(SaveablesList.java:187 )
在org.eclipse.ui.internal.SaveablesList.addModel(SaveablesList.java:117)
在org.eclipse.ui.internal.SaveablesList.addModels(SaveablesList.java:289)
在org.eclipse.ui.internal.SaveablesList.postOpen(SaveablesList.java:695)
在org.eclipse.ui.internal.PartList.partOpened(PartList.java:234)
在org。 eclipse.ui.internal.PartList.access $ 0(PartList.java:210)
在org.eclipse.ui.internal.PartList $ 1.propertyChanged(PartList.java:40)
在org.eclipse。 ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:375)
在org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:610)
在org.eclipse.ui.internal。 EditorReference.getEditor(EditorReference.java:289)
在org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
在org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
在org.eclipse .ui.internal.WorkbenchPage.access $ 11(WorkbenchPage.java:2842)
在org.eclipse.ui.internal.WorkbenchPage $ 10.run(WorkbenchPage.java:2793)
在org.eclipse.swt .custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
在org.eclipse.ui.internal.WorkbenchPage .openEditor(WorkbenchPage.java:2773)
在org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
在org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE .java:1155)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
在org.eclipse.ui.internal.ide.actions.OpenLocalFileAction .run(OpenLocalFileAction.java:76)
在org.eclipse.ui.internal。 PluginAction.runWithEvent(PluginAction.java:251)
在org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
在org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection( ActionContributionItem.java:584)
在org.eclipse.jface.action.ActionContributionItem.access $ 2(ActionContributionItem.java:501)
在org.eclipse.jface.action.ActionContributionItem $ 5.handleEvent(ActionContributionItem。 java:411)
在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
在org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
在org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
在org.eclipse .ui.internal.Workbench.access $ 4(Workbench.java:249 4)
在org.eclipse.ui.internal.Workbench $ 7.run(Workbench.java:674)
在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332 )
在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
在org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在$ org.eclipse.equinox.internal.app.EclipseAppHandle.run b在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)中的org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)上的

在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179 )
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke (Method.java:616)
在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
在org.eclipse.equinox.launcher.Main.basicRun(Main.java :577)
在org.eclipse.equinox.launcher.Main.run(Main.java:1410)
在org.eclipse.equinox.launcher.Main.main(Main.java:1386)

我试图以编程方式执行此操作,但是当我使用文件 UI打开时,我会收到完全相同的错误菜单。任何想法?

解决方案

嗯,我设法通过在项目中创建一个链接到外部资源,以编程方式解决问题,如。



我的(摘要)代码如下所示:

  IProject project = ResourcesPlugin.getWorkspace()。getRoot()。getProject(Functors); 
IPath externalPath = new Path(extPath);
String localLink =.external+ java.io.File.separator + externalPath.lastSegment();
IFile link = project.getFile(localLink);
link.createLink(externalPath,IResource.NONE,null);


I'm developing an Eclipse Plugin with support for my DSL using the Xtext framework.When I try to open a file on my system with the matching file extension .gf — but which is not in my workspace — I get the following:

0    [main] ERROR org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback  - Was configured with another client or not configured at all.
java.lang.IllegalStateException: Was configured with another client or not configured at all.
    at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.removeDirtyStateSupport(DirtyStateEditorSupport.java:318)
    at org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback.beforeDispose(AbstractDirtyStateAwareEditorCallback.java:38)
    at org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback.beforeDispose(CompoundXtextEditorCallback.java:69)
    at org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:469)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:705)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
    at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
!SESSION 2011-11-23 09:51:54.342 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data /home/john/repositories/gf-eclipse-plugin/workspace/../workspace-demo -dev file:/home/john/repositories/gf-eclipse-plugin/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os linux -ws gtk -arch x86 -consoleLog

!ENTRY org.apache.log4j 4 0 2011-11-23 09:52:18.914
!MESSAGE org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback  - Was configured with another client or not configured at all.

!STACK 0
java.lang.IllegalStateException: Was configured with another client or not configured at all.
    at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.removeDirtyStateSupport(DirtyStateEditorSupport.java:318)
    at org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback.beforeDispose(AbstractDirtyStateAwareEditorCallback.java:38)
    at org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback.beforeDispose(CompoundXtextEditorCallback.java:69)
    at org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:469)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:705)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
    at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

!ENTRY org.eclipse.ui 4 0 2011-11-23 09:52:18.921
!MESSAGE Unable to create editor ID org.grammaticalframework.eclipse.GF: An unexpected exception was thrown.
!STACK 0
java.lang.NullPointerException
    at org.eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider.handleProjectionEnabled(DefaultFoldingStructureProvider.java:100)
    at org.eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider$ProjectionChangeListener.projectionEnabled(DefaultFoldingStructureProvider.java:186)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:489)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:537)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1441)
    at org.eclipse.xtext.ui.editor.XtextEditor.installFoldingSupport(XtextEditor.java:439)
    at org.eclipse.xtext.ui.editor.XtextEditor.createPartControl(XtextEditor.java:421)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
    at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

!ENTRY org.eclipse.ui 2 2 2011-11-23 09:52:19.105
!MESSAGE Ignored attempt to add saveable that was already registered
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: unknown saveable: org.eclipse.ui.internal.DefaultSaveable@ccf230 from part: org.eclipse.ui.internal.ErrorEditorPart@ccf230
    at org.eclipse.ui.internal.SaveablesList.logWarning(SaveablesList.java:187)
    at org.eclipse.ui.internal.SaveablesList.addModel(SaveablesList.java:117)
    at org.eclipse.ui.internal.SaveablesList.addModels(SaveablesList.java:289)
    at org.eclipse.ui.internal.SaveablesList.postOpen(SaveablesList.java:695)
    at org.eclipse.ui.internal.PartList.partOpened(PartList.java:234)
    at org.eclipse.ui.internal.PartList.access$0(PartList.java:210)
    at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList.java:40)
    at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:375)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:610)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
    at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
    at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

I was trying to do this programmatically, but I get the exact same error when I open using the File UI menu. Any ideas?

解决方案

Well, I managed to get around the issue programmatically by creating a link to the external resource within the project, as described here.

My (summarised) code looks like this:

IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("Functors");
IPath externalPath = new Path(extPath);
String localLink = ".external" + java.io.File.separator + externalPath.lastSegment();
IFile link = project.getFile(localLink);
link.createLink(externalPath, IResource.NONE, null);

这篇关于在基于Xtext的插件中无法打开工作区外部文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 17:11