org.eclipse.ui.part.MultiPageEditorSite不能转换为org.eclipse.ui.i



我正在eclipse 4上移植eclipse 3 RCP。我得到运行时异常java.lang.ClassCastException

这是的代码片段

public FamilyEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor) {
Assert.isNotNull (multiPageEditor);
Assert.isNotNull (editor);
this.multiPageEditor = multiPageEditor;
this.editor = editor;
// Point for runtime exception
PartSite site = (PartSite) this.multiPageEditor.getSite();
//IWorkbenchPartSite site = multiPageEditor.getSite ();
IServiceLocatorCreator slc = (IServiceLocatorCreator )site.getService (IServiceLocatorCreator.class);
context = site.getModel().getContext().createChild("FamilyEditorSite");
....
....
}

此代码类似于库类MultiPageEditorSite。

但我仍然得到运行时异常如下

java.lang.ClassCastException:org.eclipse.ui.part.MultiPageEditorSite无法转换为org.eclipse.ui.internal.PartSite网址:org.acmestudio.ui.editer.family.FamilyEditorSite.(FamilyEditorSite.java:136)网址:org.acmestudio.ui.editor.family.FamilyEditor.createSite(FamilyEditor.java:653)网址:org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:236)网址:org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)网址:org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:213)网址:org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:308)网址:org.acmestudio.ui.editer.family.FamilyEditor.addPages(FamilyEditor.java:177)网址:org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)网址:org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)网址:org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.reconfigPages(AcmeStudioMultiPageEditr.java:393)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.doPartInitialization(AcmeStudioMultiPageEditr.java:660)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.access$8(AcmeStudioMultiPageEditr.java:548)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor$6.execute(AcmeStudioMultiPageEditr.java:804)网址:org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)网址:org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)网址:org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)位于org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)在org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)网址:org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindows.java:2157)在org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicater.java:70)网址:org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindows.java:2153)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.createPages(AcmeStudioMultiPageEditr.java:809)网址:org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)网址:org.eclipse.ui.internal.e4.compatibility.Part.createPartControl(CompatibilityPart.java:141)网址:org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)网址:org.eclipse.ui.internal.e4.compatibility.Part.create(CompatibilityPart.java:327)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)位于java.lang.reflect.Method.ioke(Method.java:597)网址:org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)网址:org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)位于org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)网址:org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)网址:org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)网址:org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)网址:org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjection Factory.java:162)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContractionFactory.java:104)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContractionFactory.java:73)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContractionFactory.java:55)网址:org.eclipse.e4.ui.workbench.renderers.swt.ConfributedPartRenderer.createWidget(ContributedPartRender.java:127)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)网址:org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)在org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1246)网址:org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:69)网址:org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)网址:org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)网址:org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)网址:org.eclipse.swt.widgets.Display.syncExec(Display.java:4732)网址:org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)网址:org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)位于org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrappr.java:197)位于org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)位于org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)网址:org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)网址:org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListerQueue.java:148)位于org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)位于org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)位于org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)网址:org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)网址:org.eclipse.e4.ui.internal.workbench。UIEventPublisher.notifyChanged(UIEventPublisher.java:59)网址:org.eclipse.emf.common.notice.impl.BasicNotificationImpl.eNotify(BasicNotificationImpl.java:374)位于org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)在org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:488)网址:org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:454)在org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:705)网址:org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:392)网址:org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1145)网址:org.eclipse.ui.internal.WorkbenchPage.businyOpenEditor(WorkbenchPage.java:3210)网址:org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3125)网址:org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3107)在org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicater.java:70)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3102)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3066)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3056)网址:org.eclipse.ui.ide.ide.openEditor(ide.java:541)位于org.eclipse.ui.ide.ide.openEditor(ide.java:500)网址:org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:99)网址:org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditor Action.java:99)位于org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAction(OpenActionGroup.java:133)位于org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAction(MainActionGroup.java:330)网址:org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen(ResourceNavigator.java:787)网址:org.eclipse.ui.views.navigator.ResourceNavigator$6.open(ResourceNavigator.java:499)位于org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)网址:org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:853)网址:org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)网址:org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)网址:org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)网址:org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:850)位于org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1142)网址:org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1249)网址:org.eclipse.jface.util.OOpenStrategy.fireOpenEvent(OpenStrategy.java:278)网址:org.eclipse.jface.util.OOpenStrategy.access$2(OpenStrategy.java:272)网址:org.eclipse.jface.utilOpenStrategy$1.handleEvent(OpenStrategy.java:313)位于org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)网址:org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)网址:org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)网址:org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)网址:org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)网址:org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4042)网址:org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)网址:org.eclipse.core.databinding.observatory.Realm.runWithDefault(Realm.java:331)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)位于org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)网址:org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)网址:org.eclipse.core.databinding.observatory.Realm.runWithDefault(Realm.java:331)网址:org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)网址:org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)网址:org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)网址:org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)位于org.eclipse.core.runtime.internal.adapter.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)位于org.eclipse.core.runtime.internal.adapter.EclipseAppLauncher.start(EclipseAppLauncher.java:104)位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:380)位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:235)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)位于java.lang.reflect.Method.ioke(Method.java:597)网址:org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)网址:org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)网址:org.eclipse.equinox.launcher.Main.run(Main.java:1465)网址:org.eclipse.equinox.launcher.Main.Main(Main.java:1438)java.lang.IollegalArgumentException:索引越界网址:org.eclipse.swt.swt.error(swt.java:4422)网址:org.eclipse.swt.swt.error(swt.java:4356)位于org.eclipse.swt.swt.error(swt.java:4327)网址:org.eclipse.swt.custom.CTabFolder.getItem(CTabFolder.java:836)网址:org.acmestudio.ui.editor.family.FamilyEditor.pageChange(FamilyEditor.java:504)网址:org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1101)网址:org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:603)网址:org.acmestudio.ui.editor.family.FamilyEditor.setActivePage(FamilyEditor.java:581)网址:org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:366)网址:org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.reconfigPages(AcmeStudioMultiPageEditr.java:393)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.doPartInitialization(AcmeStudioMultiPageEditr.java:660)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.access$8(AcmeStudioMultiPageEditr.java:548)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor$6.execute(AcmeStudioMultiPageEditr.java:804)网址:org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)网址:org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)网址:org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)位于org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)在org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)网址:org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindows.java:2157)在org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicater.java:70)网址:org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindows.java:2153)网址:org.acmestudio.ui.editor.AcmeStudioMultiPageEditor.createPages(AcmeStudioMultiPageEditr.java:809)网址:org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)网址:org.eclipse.ui.internal.e4.compatibility.Part.createPartControl(CompatibilityPart.java:141)网址:org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)网址:org.eclipse.ui.internal.e4.compatibility.Part.create(CompatibilityPart.java:327)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)位于java.lang.reflect.Method.ioke(Method.java:597)网址:org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)网址:org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)位于org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)网址:org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)网址:org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)网址:org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)网址:org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjection Factory.java:162)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContractionFactory.java:104)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContractionFactory.java:73)网址:org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContractionFactory.java:55)网址:org.eclipse.e4.ui.workbench.renderers.swt.ConfributedPartRenderer.createWidget(ContributedPartRender.java:127)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)网址:org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)在org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1246)网址:org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:69)网址:org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)网址:org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)网址:org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)网址:org.eclipse.swt.widgets.Display.syncExec(Display.java:4732)网址:org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)网址:org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)位于org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrappr.java:197)位于org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)位于org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)网址:org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)网址:org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListerQueue.java:148)位于org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)位于org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)位于org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)网址:org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)网址:org.eclipse.e4.ui.internal.workbench。UIEventPublisher.notifyChanged(UIEventPublisher.java:59)网址:org.eclipse.emf.common.notice.impl.BasicNotificationImpl.eNotify(BasicNotificationImpl.java:374)位于org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)在org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:488)网址:org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:454)在org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:705)网址:org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:392)网址:org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1145)网址:org.eclipse.ui.internal.WorkbenchPage.businyOpenEditor(WorkbenchPage.java:3210)网址:org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3125)网址:org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3107)在org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicater.java:70)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3102)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3066)网址:org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3056)网址:org.eclipse.ui.ide.ide.openEditor(ide.java:541)位于org.eclipse.ui.ide.ide.openEditor(ide.java:500)网址:org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:99)网址:org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditor Action.java:99)位于org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAction(OpenActionGroup.java:133)位于org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAction(MainActionGroup.java:330)网址:org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen(ResourceNavigator.java:787)网址:org.eclipse.ui.views.navigator.ResourceNavigator$6.open(ResourceNavigator.java:499)位于org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)网址:org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:853)网址:org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)网址:org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)网址:org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)网址:org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:850)位于org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1142)网址:org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1249)网址:org.eclipse.jface.util.OOpenStrategy.fireOpenEvent(OpenStrategy.java:278)网址:org.eclipse.jface.util.OOpenStrategy.access$2(OpenStrategy.java:272)网址:org.eclipse.jface.utilOpenStrategy$1.handleEvent(OpenStrategy.java:313)位于org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)网址:org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)网址:org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)网址:org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)网址:org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)网址:org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4042)网址:org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)网址:org.eclipse.core.databinding.observatory.Realm.runWithDefault(Realm.java:331)网址:org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)位于org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)网址:org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)网址:org.eclipse.core.databinding.observatory.Realm.runWithDefault(Realm.java:331)网址:org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)网址:org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)网址:org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)网址:org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)位于org.eclipse.core.runtime.internal.adapter.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)位于org.eclipse.core.runtime.internal.adapter.EclipseAppLauncher.start(EclipseAppLauncher.java:104)位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:380)位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:235)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)位于java.lang.reflect.Method.ioke(Method.java:597)网址:org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)网址:org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)网址:org.eclipse.equinox.launcher.Main.run(Main.java:1465)网址:org.eclipse.equinox.launcher.Main.Main(Main.java:1438)java.lang.NullPointerException网址:org.acmestudio.armani.editor.rules.RuleHelper.shouldEvaluate(RuleHelper.java:139)网址:org.acmestudio.armani.editor.rules.IgnoreRuleInterceptor.adjustResult(IgnoreRRuleInterceptor.java:15)网址:org.acmestudio.acme.type.validation.TypeChecker.performTypecheck(TypeChecker.java:206)网址:org.acmestudio.acme.type.validation.TypeChecker.runTypecheckLoop(TypeChecker.java:342)网址:org.acmestudio.acme.type.validation.SimpleModelTypeChecker.runEvaluationLoopOnce(SimpleModelTypeChecker.java:455)网址:org.acmestudio.eclipse.core.environment.TypeCheckingJob.run(TypeCheckingJob.java:34)网址:org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

org.eclipse.ui.internal.PartSite内部包中,您不应该尝试使用它。

MultiPageEditorSite不是基于PartSite的,因此不能从一个强制转换到另一个。

您可以使用获得零件的IEclipseContext

IEclipseContext context = (IEclipseContext)getSite().getService(IEclipseContext.class)

相关内容

最新更新