Skip to main content



      Home
Home » Modeling » Papyrus » How to open a Papyrus editor programmatically
How to open a Papyrus editor programmatically [message #698676] Tue, 19 July 2011 20:10 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #699528 is a reply to message #699332] Thu, 21 July 2011 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Cedric Dumoulin wrote on Thu, 21 July 2011 07:27
Hi,

Sound like a bug. Can you report it in Bugzilla ?


I think I may have simply screwed something up in my testing setup initialization for Papyrus. It's working now. Smile I'll file a bug if I see it again.
Re: How to open a Papyrus editor programmatically [message #704686 is a reply to message #699528] Thu, 28 July 2011 20:17 Go to previous messageGo to next message
Eclipse UserFriend
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=353375.
Re: How to open a Papyrus editor programmatically [message #977722 is a reply to message #704686] Fri, 09 November 2012 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Excuse me,how did you solve this problem?I met the same problem with you,when I use "org.eclipse.papyrus.core.papyrusEditor" as the EditorID of openEditor,then I get:
org.eclipse.ui.PartInitException: No editor descriptor for id org.eclipse.papyrus.core.papyrusEditor
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:601)
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.PartPane.setVisible(PartPane.java:313)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(PartStack.java:834)
at org.eclipse.ui.internal.PartStack.access$1(PartStack.java:823)
at org.eclipse.ui.internal.PartStack$1.selectPart(PartStack.java:137)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:133)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)
at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$2.handleEvent(DefaultTabFolder.java:88)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

thanks a lot~
Re: How to open a Papyrus editor programmatically [message #977929 is a reply to message #977722] Fri, 09 November 2012 12:49 Go to previous messageGo to next message
Eclipse UserFriend
I think this might be a different issue. See bug re: that content outline issue, and then I'd recommend tracing through with debugger.
Re: How to open a Papyrus editor programmatically [message #978658 is a reply to message #977929] Sat, 10 November 2012 02:44 Go to previous message
Eclipse UserFriend
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~
Previous Topic:How do I create the SysML "allocated from" attribute in a block
Next Topic:How to open a Papyrus editor programmatically
Goto Forum:
  


Current Time: Wed Jul 23 01:31:46 EDT 2025

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

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

Back to the top