How to open a Papyrus editor programmatically [message #698676] |
Tue, 19 July 2011 20:10  |
Eclipse User |
|
|
|
For testing purposes, I need to be able to open a Papyrus editor programmatically. But the usual approach doesn't work. For:
UmlGmfDiagramEditor ed = (UmlGmfDiagramEditor) page.openEditor(input, "org.eclipse.papyrus.core.papyrusEditor");
I get:
Caused by: org.eclipse.papyrus.core.extension.NotFoundException: No ContentOutline registered.
at org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.getContentOutlineDescriptor(ContentOutlineRegistry.java:98)
at org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.createContentOutline(ContentOutlineRegistry.java:112)
at org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.getContentOutline(ContentOutlineRegistry.java:72)
at org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor.getAdapter(CoreMultiDiagramEditor.java:363)
... 74 more
How should I accomplish this?
thanks,
Miles
|
|
|
Re: How to open a Papyrus editor programmatically [message #699332 is a reply to message #698676] |
Thu, 21 July 2011 07:27   |
Eclipse User |
|
|
|
Hi,
Sound like a bug. Can you report it in Bugzilla ?
When starting, Papyrus check if there is some registered
contentOutline. If one or more are found, Papyrus takes the one with the
highest priority. If none is found, Papyrus should fails silently. This
seem to be not the case.
As a workaround, you can try to add the simplest contentoutline
(plugins/other/org.eclipse.papyrus.outline) plugins in your test
environement.
Hope this help,
Cedric
Miles Parker a écrit :
> For testing purposes, I need to be able to open a Papyrus editor
> programmatically. But the usual approach doesn't work. For:
>
> UmlGmfDiagramEditor ed = (UmlGmfDiagramEditor) page.openEditor(input,
> "org.eclipse.papyrus.core.papyrusEditor");
>
> I get:
>
>
> Caused by: org.eclipse.papyrus.core.extension.NotFoundException: No
> ContentOutline registered.
> at
> org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.getContentOutlineDescriptor(ContentOutlineRegistry.java:98)
>
> at
> org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.createContentOutline(ContentOutlineRegistry.java:112)
>
> at
> org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry.getContentOutline(ContentOutlineRegistry.java:72)
>
> at
> org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor.getAdapter(CoreMultiDiagramEditor.java:363)
>
> ... 74 more
>
> How should I accomplish this?
>
> thanks,
>
> Miles
|
|
|
|
|
|
|
Re: How to open a Papyrus editor programmatically [message #978658 is a reply to message #977929] |
Sat, 10 November 2012 02:44  |
Eclipse User |
|
|
|
so sorry to mis-paste error information,the real error as follows:
org.eclipse.ui.PartInitException: Unable to open editor, unknown editor ID: org.eclipse.papyrus.core.papyrusEditor
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3025)
at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:3003)
at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2985)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2981)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2940)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2931)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:751)
at unfinishedplugin.actions.SampleAction.openEditor(SampleAction.java:195)
at unfinishedplugin.actions.SampleAction.run(SampleAction.java:100)
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$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
I think it's the same with you~and the bug you posted doesn't exist,so can you tell how you solved the problem,thanks~
|
|
|
Powered by
FUDForum. Page generated in 0.04751 seconds