Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to open a Papyrus editor programmatically(~)
How to open a Papyrus editor programmatically [message #980908] Mon, 12 November 2012 02:50 Go to next message
Beatus Ding is currently offline Beatus DingFriend
Messages: 18
Registered: November 2012
Junior Member
Hi,everyone.I'm trying to open an papyrus editor programmatically,so I use the following code:'IDE.openEditor(page, file, "org.eclipse.papyrus.core.papyrusEditor", true);' and "file" is the IFile corresponding to the target ".di" file.But I got the following exception:
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:200)
	at unfinishedplugin.actions.SampleAction.run(SampleAction.java:104)
	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)

Who can help me?Any help will be appreciated.
Re: How to open a Papyrus editor programmatically [message #981272 is a reply to message #980908] Mon, 12 November 2012 09:42 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 511
Registered: February 2011
Senior Member
Hello,

In 0.9.X, the Papyrus Editor ID has changed to org.eclipse.papyrus.infra.core.papyrusEditor

Regards,
Camille


Camille Letavernier
Papyrus developer
Re: How to open a Papyrus editor programmatically [message #981494 is a reply to message #981272] Mon, 12 November 2012 13:05 Go to previous message
Beatus Ding is currently offline Beatus DingFriend
Messages: 18
Registered: November 2012
Junior Member
Problem solved,thank you very much.
Previous Topic:How to open a Papyrus editor programmatically
Next Topic:Guards on control flow edge
Goto Forum:
  


Current Time: Sat Dec 20 17:29:46 GMT 2014

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

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